aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic
diff options
context:
space:
mode:
authorSony Chacko <sony.chacko@qlogic.com>2012-02-03 08:45:42 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-04 15:59:30 -0500
commit476a4b6d2543f0d9fa5205e0c25ebcd7973337bd (patch)
tree0a7eee6a6449bb0f42e5d0f64dbeec06f8daddb3 /drivers/net/ethernet/qlogic
parent646779f1b4ade4acac6b49dbfa8be84a98ab85b4 (diff)
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>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c7
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c8
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index cc228cf3d84b..6b2cf8bd16c3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -155,7 +155,6 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
155{ 155{
156 struct qlcnic_adapter *adapter = netdev_priv(dev); 156 struct qlcnic_adapter *adapter = netdev_priv(dev);
157 int check_sfp_module = 0; 157 int check_sfp_module = 0;
158 u16 pcifn = adapter->ahw->pci_func;
159 158
160 /* read which mode */ 159 /* read which mode */
161 if (adapter->ahw->port_type == QLCNIC_GBE) { 160 if (adapter->ahw->port_type == QLCNIC_GBE) {
@@ -194,10 +193,8 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
194 goto skip; 193 goto skip;
195 } 194 }
196 195
197 val = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn)); 196 ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
198 ethtool_cmd_speed_set(ecmd, P3P_LINK_SPEED_MHZ * 197 ecmd->duplex = DUPLEX_UNKNOWN;
199 P3P_LINK_SPEED_VAL(pcifn, val));
200 ecmd->duplex = DUPLEX_FULL;
201 ecmd->autoneg = AUTONEG_DISABLE; 198 ecmd->autoneg = AUTONEG_DISABLE;
202 } else 199 } else
203 return -EIO; 200 return -EIO;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index 38669583840c..41d85efee422 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1369,7 +1369,13 @@ qlcnic_handle_linkevent(struct qlcnic_adapter *adapter,
1369 1369
1370 adapter->module_type = module; 1370 adapter->module_type = module;
1371 adapter->link_autoneg = autoneg; 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
1375static void 1381static void