Thread (14 messages) 14 messages, 5 authors, 2025-07-25
STALE344d

[PATCH] usbnet: Set duplex status to unknown in the absence of MII

From: <hidden>
Date: 2025-07-21 07:10:47
Also in: linux-usb
Subsystem: networking drivers, the rest, usb "usbnet" driver framework, usb networking drivers · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Oliver Neukum

From: Yi Cong <redacted>

CDC device don't use mdio to get link status, duplex is set
half as default.

Now cdc_ncm can't get duplex, set it UNKNOWN instead of half
which might actually be in an error state.

Signed-off-by: Yi Cong <redacted>
---
 drivers/net/usb/usbnet.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 6a3cca104af9..c612f8f606e5 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1013,6 +1013,11 @@ int usbnet_get_link_ksettings_internal(struct net_device *net,
 	else
 		cmd->base.speed = SPEED_UNKNOWN;
 
+	/* Now we can't get link duplex without MII,
+	 * set it DUPLEX_UNKNOWN instead of default DUPLEX_HALF
+	 */
+	cmd->base.duplex = DUPLEX_UNKNOWN;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings_internal);
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help