Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sony Chacko and committed by
David S. Miller
476a4b6d 646779f1

+9 -6
+2 -5
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
··· 155 155 { 156 156 struct qlcnic_adapter *adapter = netdev_priv(dev); 157 157 int check_sfp_module = 0; 158 - u16 pcifn = adapter->ahw->pci_func; 159 158 160 159 /* read which mode */ 161 160 if (adapter->ahw->port_type == QLCNIC_GBE) { ··· 193 194 goto skip; 194 195 } 195 196 196 - val = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn)); 197 - ethtool_cmd_speed_set(ecmd, P3P_LINK_SPEED_MHZ * 198 - P3P_LINK_SPEED_VAL(pcifn, val)); 199 - ecmd->duplex = DUPLEX_FULL; 197 + ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN); 198 + ecmd->duplex = DUPLEX_UNKNOWN; 200 199 ecmd->autoneg = AUTONEG_DISABLE; 201 200 } else 202 201 return -EIO;
+7 -1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
··· 1369 1369 1370 1370 adapter->module_type = module; 1371 1371 adapter->link_autoneg = autoneg; 1372 - adapter->link_speed = link_speed; 1372 + 1373 + if (link_status) { 1374 + adapter->link_speed = link_speed; 1375 + } else { 1376 + adapter->link_speed = SPEED_UNKNOWN; 1377 + adapter->link_duplex = DUPLEX_UNKNOWN; 1378 + } 1373 1379 } 1374 1380 1375 1381 static void