public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks
@ 2021-11-16 14:19 Aaron Ma
  2021-11-17 14:50 ` patchwork-bot+netdevbpf
  2022-01-04 11:38 ` Henning Schild
  0 siblings, 2 replies; 10+ messages in thread
From: Aaron Ma @ 2021-11-16 14:19 UTC (permalink / raw)
  To: davem, kuba, hayeswang, tiwai, linux-usb, netdev, linux-kernel,
	aaron.ma

Like ThinkaPad Thunderbolt 4 Dock, more Lenovo docks start to use the original
Realtek USB ethernet chip ID 0bda:8153.

Lenovo Docks always use their own IDs for usb hub, even for older Docks.
If parent hub is from Lenovo, then r8152 should try MAC passthrough.
Verified on Lenovo TBT3 dock too.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/net/usb/r8152.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 4a02f33f0643..f9877a3e83ac 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -9603,12 +9603,9 @@ static int rtl8152_probe(struct usb_interface *intf,
 		netdev->hw_features &= ~NETIF_F_RXCSUM;
 	}
 
-	if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO) {
-		switch (le16_to_cpu(udev->descriptor.idProduct)) {
-		case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2:
-		case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2:
-			tp->lenovo_macpassthru = 1;
-		}
+	if (udev->parent &&
+			le16_to_cpu(udev->parent->descriptor.idVendor) == VENDOR_ID_LENOVO) {
+		tp->lenovo_macpassthru = 1;
 	}
 
 	if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial &&
-- 
2.25.1


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

end of thread, other threads:[~2022-01-04 20:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16 14:19 [PATCH] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks Aaron Ma
2021-11-17 14:50 ` patchwork-bot+netdevbpf
2022-01-04 11:38 ` Henning Schild
2022-01-04 14:53   ` Jakub Kicinski
2022-01-04 17:07     ` Henning Schild
2022-01-04 17:40       ` Aaron Ma
2022-01-04 18:34         ` Henning Schild
2022-01-04 20:00           ` Jakub Kicinski
2022-01-04 20:23             ` Henning Schild
2022-01-04 18:47         ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox