Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Currently, USB CDC devices that do not use MDIO to get link status have
their duplex mode set to half-duplex by default. However, since the CDC
specification does not define a duplex status, this can be misleading.

This patch changes the default to DUPLEX_UNKNOWN in the absence of MII,
which more accurately reflects the state of the link and avoids implying
an incorrect or error state.

Link: https://lore.kernel.org/all/20250723152151.70a8034b@kernel.org/
Signed-off-by: Yi Cong <yicong@kylinos.cn>
Acked-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20250724013133.1645142-1-yicongsrfy@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yi Cong and committed by
Jakub Kicinski
a75afcd1 f6c650c8

+7
+7
drivers/net/usb/usbnet.c
··· 1013 1013 else 1014 1014 cmd->base.speed = SPEED_UNKNOWN; 1015 1015 1016 + /* The standard "Universal Serial Bus Class Definitions 1017 + * for Communications Devices v1.2" does not specify 1018 + * anything about duplex status. 1019 + * So set it DUPLEX_UNKNOWN instead of default DUPLEX_HALF. 1020 + */ 1021 + cmd->base.duplex = DUPLEX_UNKNOWN; 1022 + 1016 1023 return 0; 1017 1024 } 1018 1025 EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings_internal);