Message ID | 20250110092302.2717512-1-zhangxiangqian@kylinos.cn (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [RESEND] net: mii: Fix the Speed display when the network cable is not connected | expand |
On Fri, Jan 10, 2025 at 05:23:02PM +0800, Xiangqian Zhang wrote:
> Speed should be SPEED_UNKNOWN when the network cable is not connected
What driver is actually using this? Have you really experienced this
problem? The mii_ code is really old, i doubt there are too many
drivers in use today which use it. So a bit more explanation would be
good.
Andrew
---
pw-bot: cr
diff --git a/drivers/net/mii.c b/drivers/net/mii.c index 22680f47385d..297a0cc3682f 100644 --- a/drivers/net/mii.c +++ b/drivers/net/mii.c @@ -213,6 +213,9 @@ void mii_ethtool_get_link_ksettings(struct mii_if_info *mii, lp_advertising = 0; } + if (!mii_link_ok(mii)) + cmd->base.speed = SPEED_UNKNOWN; + mii->full_duplex = cmd->base.duplex; ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
Speed should be SPEED_UNKNOWN when the network cable is not connected Signed-off-by: Xiangqian Zhang <zhangxiangqian@kylinos.cn> --- drivers/net/mii.c | 3 +++ 1 file changed, 3 insertions(+)