Skip to content

Commit b1f5037

Browse files
Rajesh Borundiadavem330
Rajesh Borundia
authored andcommitted
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 <[email protected]> Signed-off-by: Shahed Shaikh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent beb3d3a commit b1f5037

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,18 +2075,25 @@ void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *adapter)
20752075
static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter,
20762076
u32 data[])
20772077
{
2078+
struct qlcnic_hardware_context *ahw = adapter->ahw;
20782079
u8 link_status, duplex;
20792080
/* link speed */
20802081
link_status = LSB(data[3]) & 1;
2081-
adapter->ahw->link_speed = MSW(data[2]);
2082-
adapter->ahw->link_autoneg = MSB(MSW(data[3]));
2083-
adapter->ahw->module_type = MSB(LSW(data[3]));
2084-
duplex = LSB(MSW(data[3]));
2085-
if (duplex)
2086-
adapter->ahw->link_duplex = DUPLEX_FULL;
2087-
else
2088-
adapter->ahw->link_duplex = DUPLEX_HALF;
2089-
adapter->ahw->has_link_events = 1;
2082+
if (link_status) {
2083+
ahw->link_speed = MSW(data[2]);
2084+
duplex = LSB(MSW(data[3]));
2085+
if (duplex)
2086+
ahw->link_duplex = DUPLEX_FULL;
2087+
else
2088+
ahw->link_duplex = DUPLEX_HALF;
2089+
} else {
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;
20902097
qlcnic_advert_link_change(adapter, link_status);
20912098
}
20922099

0 commit comments

Comments
 (0)