nvethernet: update speed and mode in fixed link

Issue: in caseof interface down and up the speed
and mode values are incorrect incase of fixed link

Fix: In case of fixed link restore speed and mode
values based on the iface mode

Bug 3359851
Bug 200765222

Change-Id: Iacd1cb2212c0783bb5e361205cbf62f64b197325
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2584629
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Narayan Reddy
2021-08-27 17:36:44 +00:00
committed by Revanth Kumar Uppala
parent f415855538
commit 36d784d40e
2 changed files with 13 additions and 0 deletions

View File

@@ -867,6 +867,16 @@ static void ether_adjust_link(struct net_device *dev)
}
}
if (pdata->fixed_link == OSI_ENABLE) {
if (pdata->osi_core->mac == OSI_MAC_HW_MGBE) {
if (iface_mode == OSI_XFI_MODE_10G) {
phydev->speed = OSI_SPEED_10000;
} else if (iface_mode == OSI_XFI_MODE_5G) {
phydev->speed = OSI_SPEED_5000;
}
phydev->duplex = OSI_FULL_DUPLEX;
}
}
if (phydev->duplex != pdata->oldduplex) {
new_state = 1;
ioctl_data.cmd = OSI_CMD_SET_MODE;
@@ -5144,6 +5154,7 @@ static int ether_parse_phy_dt(struct ether_priv_data *pdata,
if ((pdata->phy_node == NULL) && of_phy_is_fixed_link(node)) {
if ((of_phy_register_fixed_link(node) < 0))
return -ENODEV;
pdata->fixed_link = OSI_ENABLE;
pdata->phy_node = of_node_get(node);
}

View File

@@ -571,6 +571,8 @@ struct ether_priv_data {
unsigned int mdio_addr;
/** Skip MAC reset */
unsigned int skip_mac_reset;
/** Fixed link enable/disable */
unsigned int fixed_link;
};
/**