netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbnet: Set duplex status to unknown in the absence of MII
@ 2025-07-21  7:10 yicongsrfy
  2025-07-21 13:51 ` Andrew Lunn
  0 siblings, 1 reply; 14+ messages in thread
From: yicongsrfy @ 2025-07-21  7:10 UTC (permalink / raw)
  To: oneukum, andrew+netdev, davem; +Cc: netdev, linux-usb, Yi Cong

From: Yi Cong <yicong@kylinos.cn>

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 <yicong@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-25 18:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21  7:10 [PATCH] usbnet: Set duplex status to unknown in the absence of MII yicongsrfy
2025-07-21 13:51 ` Andrew Lunn
2025-07-22  2:09   ` yicongsrfy
2025-07-22 13:06     ` Andrew Lunn
2025-07-23  1:29       ` yicongsrfy
2025-07-23  7:17         ` Oliver Neukum
2025-07-23  8:44           ` yicongsrfy
2025-07-23 10:03             ` Oliver Neukum
2025-07-23 13:04             ` Andrew Lunn
2025-07-23 13:05         ` Andrew Lunn
2025-07-23 22:21           ` Jakub Kicinski
2025-07-24  1:31             ` [PATCH v2] " yicongsrfy
2025-07-24  9:03               ` Oliver Neukum
2025-07-25 18:10               ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).