diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2013-08-02 23:16:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-03 15:03:04 -0400 |
commit | b1f5037f1b33a15fa2ad5c9c41837477465af063 (patch) | |
tree | abaec072817fbb7e34d460ea34dc874f2b1a03f7 | |
parent | beb3d3a4d4830b1e090eedef0d0d7870639f09e0 (diff) |
qlcnic: Fix link speed and duplex display for 83xx adapter
o Set link speed and duplex to unknown when link is not up.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index bc483e1881a3..94ff7a43b679 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -2075,18 +2075,25 @@ void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *adapter) | |||
2075 | static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter, | 2075 | static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter, |
2076 | u32 data[]) | 2076 | u32 data[]) |
2077 | { | 2077 | { |
2078 | struct qlcnic_hardware_context *ahw = adapter->ahw; | ||
2078 | u8 link_status, duplex; | 2079 | u8 link_status, duplex; |
2079 | /* link speed */ | 2080 | /* link speed */ |
2080 | link_status = LSB(data[3]) & 1; | 2081 | link_status = LSB(data[3]) & 1; |
2081 | adapter->ahw->link_speed = MSW(data[2]); | 2082 | if (link_status) { |
2082 | adapter->ahw->link_autoneg = MSB(MSW(data[3])); | 2083 | ahw->link_speed = MSW(data[2]); |
2083 | adapter->ahw->module_type = MSB(LSW(data[3])); | 2084 | duplex = LSB(MSW(data[3])); |
2084 | duplex = LSB(MSW(data[3])); | 2085 | if (duplex) |
2085 | if (duplex) | 2086 | ahw->link_duplex = DUPLEX_FULL; |
2086 | adapter->ahw->link_duplex = DUPLEX_FULL; | 2087 | else |
2087 | else | 2088 | ahw->link_duplex = DUPLEX_HALF; |
2088 | adapter->ahw->link_duplex = DUPLEX_HALF; | 2089 | } else { |
2089 | adapter->ahw->has_link_events = 1; | 2090 | ahw->link_speed = SPEED_UNKNOWN; |
2091 | ahw->link_duplex = DUPLEX_UNKNOWN; | ||
2092 | } | ||
2093 | |||
2094 | ahw->link_autoneg = MSB(MSW(data[3])); | ||
2095 | ahw->module_type = MSB(LSW(data[3])); | ||
2096 | ahw->has_link_events = 1; | ||
2090 | qlcnic_advert_link_change(adapter, link_status); | 2097 | qlcnic_advert_link_change(adapter, link_status); |
2091 | } | 2098 | } |
2092 | 2099 | ||