bnx2x: ethtool now returns unknown speed/duplex
Previously, unless both interface and link were up, ethtool returned the requested speed/duplex when asked for the interface's settings. This change will now enable the driver to answer correctly (i.e., return unknown as its answer). Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9ce392d4fa
commit
382984618e
1 changed files with 19 additions and 12 deletions
|
@ -222,19 +222,22 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||||
(SUPPORTED_TP | SUPPORTED_FIBRE));
|
(SUPPORTED_TP | SUPPORTED_FIBRE));
|
||||||
cmd->advertising = bp->port.advertising[cfg_idx];
|
cmd->advertising = bp->port.advertising[cfg_idx];
|
||||||
|
|
||||||
if ((bp->state == BNX2X_STATE_OPEN) &&
|
if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) {
|
||||||
!(bp->flags & MF_FUNC_DIS) &&
|
if (!(bp->flags & MF_FUNC_DIS)) {
|
||||||
(bp->link_vars.link_up)) {
|
ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
|
||||||
ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
|
cmd->duplex = bp->link_vars.duplex;
|
||||||
cmd->duplex = bp->link_vars.duplex;
|
} else {
|
||||||
} else {
|
ethtool_cmd_speed_set(
|
||||||
ethtool_cmd_speed_set(
|
cmd, bp->link_params.req_line_speed[cfg_idx]);
|
||||||
cmd, bp->link_params.req_line_speed[cfg_idx]);
|
cmd->duplex = bp->link_params.req_duplex[cfg_idx];
|
||||||
cmd->duplex = bp->link_params.req_duplex[cfg_idx];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_MF(bp))
|
if (IS_MF(bp) && !BP_NOMCP(bp))
|
||||||
ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
|
ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
|
||||||
|
} else {
|
||||||
|
cmd->duplex = DUPLEX_UNKNOWN;
|
||||||
|
ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
cmd->port = bnx2x_get_port_type(bp);
|
cmd->port = bnx2x_get_port_type(bp);
|
||||||
|
|
||||||
|
@ -309,6 +312,10 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||||
|
|
||||||
speed = ethtool_cmd_speed(cmd);
|
speed = ethtool_cmd_speed(cmd);
|
||||||
|
|
||||||
|
/* If recieved a request for an unknown duplex, assume full*/
|
||||||
|
if (cmd->duplex == DUPLEX_UNKNOWN)
|
||||||
|
cmd->duplex = DUPLEX_FULL;
|
||||||
|
|
||||||
if (IS_MF_SI(bp)) {
|
if (IS_MF_SI(bp)) {
|
||||||
u32 part;
|
u32 part;
|
||||||
u32 line_speed = bp->link_vars.line_speed;
|
u32 line_speed = bp->link_vars.line_speed;
|
||||||
|
|
Loading…
Add table
Reference in a new issue