qlcnic: report valid speed and duplex status when link is down
Report valid link statistics when link is down. Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
646779f1b4
commit
476a4b6d25
2 changed files with 9 additions and 6 deletions
|
@ -155,7 +155,6 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
|
||||||
{
|
{
|
||||||
struct qlcnic_adapter *adapter = netdev_priv(dev);
|
struct qlcnic_adapter *adapter = netdev_priv(dev);
|
||||||
int check_sfp_module = 0;
|
int check_sfp_module = 0;
|
||||||
u16 pcifn = adapter->ahw->pci_func;
|
|
||||||
|
|
||||||
/* read which mode */
|
/* read which mode */
|
||||||
if (adapter->ahw->port_type == QLCNIC_GBE) {
|
if (adapter->ahw->port_type == QLCNIC_GBE) {
|
||||||
|
@ -194,10 +193,8 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
val = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn));
|
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||||
ethtool_cmd_speed_set(ecmd, P3P_LINK_SPEED_MHZ *
|
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||||
P3P_LINK_SPEED_VAL(pcifn, val));
|
|
||||||
ecmd->duplex = DUPLEX_FULL;
|
|
||||||
ecmd->autoneg = AUTONEG_DISABLE;
|
ecmd->autoneg = AUTONEG_DISABLE;
|
||||||
} else
|
} else
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
@ -1369,7 +1369,13 @@ qlcnic_handle_linkevent(struct qlcnic_adapter *adapter,
|
||||||
|
|
||||||
adapter->module_type = module;
|
adapter->module_type = module;
|
||||||
adapter->link_autoneg = autoneg;
|
adapter->link_autoneg = autoneg;
|
||||||
adapter->link_speed = link_speed;
|
|
||||||
|
if (link_status) {
|
||||||
|
adapter->link_speed = link_speed;
|
||||||
|
} else {
|
||||||
|
adapter->link_speed = SPEED_UNKNOWN;
|
||||||
|
adapter->link_duplex = DUPLEX_UNKNOWN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Reference in a new issue