Skip to contentSkip to conversation

Additions to the list of devices that can be used for Lenovo Pass-thru feature

PATCH In review David Ober 3 participants 3 messages May 11, 2022

Subsystems (4)
lore
Share & tools
lore

David Ober

author
#0 lore raw

PATCH 1/1 Additions to the list of devices that can be used for Lenovo Pass-thru feature

net: usb: r8152: Add in new Devices that are supported for Mac-Passthru

Lenovo Thunderbolt 4 Dock, and other Lenovo USB Docks are using the original Realtek USB ethernet Vendor and Product IDs
If the Network device is Realtek verify that it is on a Lenovo USB hub before enabling the passthru feature

This also adds in the device IDs for the Lenovo USB Dongle and one other USB-C dock

---
 drivers/net/usb/r8152.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/usb/r8152.c +12 -0
index c2da3438387c..7d43c772b85d 100644
@@ -771,6 +771,9 @@ enum rtl8152_flags {
 };
 
 #define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2	0x3082
+#define DEVICE_ID_THINKPAD_THUNDERBOLT4_DOCK_GEN1	0x8153
+#define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3		0x3062
+#define DEVICE_ID_THINKPAD_USB_C_DONGLE		0x720c
 #define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2		0xa387
 
 struct tally_counter {
@@ -9644,10 +9647,19 @@ static int rtl8152_probe(struct usb_interface *intf,
 
 	if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO) {
 		switch (le16_to_cpu(udev->descriptor.idProduct)) {
+		case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3:
+		case DEVICE_ID_THINKPAD_USB_C_DONGLE:
 		case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2:
 		case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2:
 			tp->lenovo_macpassthru = 1;
 		}
+        }
+	else if ((le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_REALTEK) &&
+                 (le16_to_cpu(udev->parent->descriptor.idVendor) == VENDOR_ID_LENOVO)) {
+		switch (le16_to_cpu(udev->descriptor.idProduct)) {
+		case DEVICE_ID_THINKPAD_THUNDERBOLT4_DOCK_GEN1:
+			tp->lenovo_macpassthru = 1;
+		}
 	}
 
 	if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial &&
Signature · 1 line
2.30.2
#1 lore raw

Hello!

Quoted 1 line · David Ober

net: usb: r8152: Add in new Devices that are supported for Mac-Passthru

This should be in the subject.

Quoted 17 lines

Lenovo Thunderbolt 4 Dock, and other Lenovo USB Docks are using the original Realtek USB ethernet Vendor and Product IDs
If the Network device is Realtek verify that it is on a Lenovo USB hub before enabling the passthru feature

This also adds in the device IDs for the Lenovo USB Dongle and one other USB-C dock

---
 drivers/net/usb/r8152.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/usb/r8152.c +0 -0
index c2da3438387c..7d43c772b85d 100644

[...]

drivers/net/usb/r8152.c static int rtl8152_probe(struct usb_interface *intf, · line 9656

Quoted 11 lines
drivers/net/usb/r8152.c +3 -0
@@ -9644,10 +9647,19 @@ static int rtl8152_probe(struct usb_interface *intf,
 
 	if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO) {
 		switch (le16_to_cpu(udev->descriptor.idProduct)) {
+		case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3:
+		case DEVICE_ID_THINKPAD_USB_C_DONGLE:
 		case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2:
 		case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2:
 			tp->lenovo_macpassthru = 1;
 		}
+        }

Indent with tabs please.

drivers/net/usb/r8152.c static int rtl8152_probe(struct usb_interface *intf, · line 9657

Quoted 1 line
drivers/net/usb/r8152.c +1 -0
+	else if ((le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_REALTEK) &&

The preceding } should be on the same line.

drivers/net/usb/r8152.c static int rtl8152_probe(struct usb_interface *intf, · line 9658

Quoted 1 line
drivers/net/usb/r8152.c +1 -0
+                 (le16_to_cpu(udev->parent->descriptor.idVendor) == VENDOR_ID_LENOVO)) {

Indent with tabs please.

[...]

MBR, Sergey

maintainer
#2 lore raw
In reply to David Ober

drivers/net/usb/r8152.c enum rtl8152_flags { · line 777

Quoted 5 lines · On Wed, 11 May 2022 05:38:26 -0400 David Ober wrote:

#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082

drivers/net/usb/r8152.c +3 -0
+#define DEVICE_ID_THINKPAD_THUNDERBOLT4_DOCK_GEN1	0x8153
+#define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3		0x3062
+#define DEVICE_ID_THINKPAD_USB_C_DONGLE		0x720c
 #define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2		0xa387

Keep these sorted in some logical way please, USB_C_DOCK_GEN3 should probably be after USB_C_DOCK_GEN2?