Commit 430d172a authored by Yaniv Rosner's avatar Yaniv Rosner Committed by David S. Miller

bnx2x: display the correct duplex value

Prior to this fix, the driver reported the chip's active duplex state
is always 'full', even if using half-duplex mode.
Signed-off-by: default avatarYaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 375944cb
...@@ -5434,7 +5434,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, ...@@ -5434,7 +5434,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
switch (speed_mask) { switch (speed_mask) {
case GP_STATUS_10M: case GP_STATUS_10M:
vars->line_speed = SPEED_10; vars->line_speed = SPEED_10;
if (vars->duplex == DUPLEX_FULL) if (is_duplex == DUPLEX_FULL)
vars->link_status |= LINK_10TFD; vars->link_status |= LINK_10TFD;
else else
vars->link_status |= LINK_10THD; vars->link_status |= LINK_10THD;
...@@ -5442,7 +5442,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, ...@@ -5442,7 +5442,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
case GP_STATUS_100M: case GP_STATUS_100M:
vars->line_speed = SPEED_100; vars->line_speed = SPEED_100;
if (vars->duplex == DUPLEX_FULL) if (is_duplex == DUPLEX_FULL)
vars->link_status |= LINK_100TXFD; vars->link_status |= LINK_100TXFD;
else else
vars->link_status |= LINK_100TXHD; vars->link_status |= LINK_100TXHD;
...@@ -5451,7 +5451,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, ...@@ -5451,7 +5451,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
case GP_STATUS_1G: case GP_STATUS_1G:
case GP_STATUS_1G_KX: case GP_STATUS_1G_KX:
vars->line_speed = SPEED_1000; vars->line_speed = SPEED_1000;
if (vars->duplex == DUPLEX_FULL) if (is_duplex == DUPLEX_FULL)
vars->link_status |= LINK_1000TFD; vars->link_status |= LINK_1000TFD;
else else
vars->link_status |= LINK_1000THD; vars->link_status |= LINK_1000THD;
...@@ -5459,7 +5459,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, ...@@ -5459,7 +5459,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
case GP_STATUS_2_5G: case GP_STATUS_2_5G:
vars->line_speed = SPEED_2500; vars->line_speed = SPEED_2500;
if (vars->duplex == DUPLEX_FULL) if (is_duplex == DUPLEX_FULL)
vars->link_status |= LINK_2500TFD; vars->link_status |= LINK_2500TFD;
else else
vars->link_status |= LINK_2500THD; vars->link_status |= LINK_2500THD;
...@@ -5533,6 +5533,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy, ...@@ -5533,6 +5533,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy,
if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) { if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) {
if (SINGLE_MEDIA_DIRECT(params)) { if (SINGLE_MEDIA_DIRECT(params)) {
vars->duplex = duplex;
bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status); bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status);
if (phy->req_line_speed == SPEED_AUTO_NEG) if (phy->req_line_speed == SPEED_AUTO_NEG)
bnx2x_xgxs_an_resolve(phy, params, vars, bnx2x_xgxs_an_resolve(phy, params, vars,
...@@ -5627,6 +5628,7 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, ...@@ -5627,6 +5628,7 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy,
LINK_STATUS_PARALLEL_DETECTION_USED; LINK_STATUS_PARALLEL_DETECTION_USED;
} }
bnx2x_ext_phy_resolve_fc(phy, params, vars); bnx2x_ext_phy_resolve_fc(phy, params, vars);
vars->duplex = duplex;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment