提交 64c22182 编写于 作者: M Matt Carlson 提交者: David S. Miller

tg3: Report invalid link from tg3_get_settings()

Currently the tg3 driver leaves the speed and duplex fields
uninitialized in tg3_get_settings() if the device is not up.  This can
lead to some strange deductions in certain versions of ethtool.  When
the device is up and the link is down, the driver reports SPEED_INVALID
and DUPLEX_INVALID for these fields.  This patch makes the presentation
consistent by returning SPEED_INVALID and DUPLEX_INVALID when the device
has not been brought up as well.
Signed-off-by: NMatt Carlson <mcarlson@broadcom.com>
Reviewed-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 48035728
...@@ -9807,6 +9807,9 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -9807,6 +9807,9 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
if (netif_running(dev)) { if (netif_running(dev)) {
cmd->speed = tp->link_config.active_speed; cmd->speed = tp->link_config.active_speed;
cmd->duplex = tp->link_config.active_duplex; cmd->duplex = tp->link_config.active_duplex;
} else {
cmd->speed = SPEED_INVALID;
cmd->duplex = DUPLEX_INVALID;
} }
cmd->phy_address = tp->phy_addr; cmd->phy_address = tp->phy_addr;
cmd->transceiver = XCVR_INTERNAL; cmd->transceiver = XCVR_INTERNAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册