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

r8152: add PID for the Lenovo OneLink+ Dock

The Lenovo OneLink+ Dock contains an RTL8153 controller that behaves as
a broken CDC device by default. Add the custom Lenovo PID to the r8152
driver to support it properly.

Also, systems compatible with this dock provide a BIOS option to enable
MAC address passthrough (as per Lenovo document "ThinkPad Docking
Solutions 2017"). Add the custom PID to the MAC passthrough list too.

Tested on a ThinkPad 13 1st gen with the expected results:

passthrough disabled: Invalid header when reading pass-thru MAC addr
passthrough enabled: Using pass-thru MAC addr XX:XX:XX:XX:XX:XX

Signed-off-by: Jean-Francois Le Fillatre <jflf_kernel@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jean-Francois Le Fillatre and committed by
David S. Miller
76d7df94 77baa37a

+10
+7
drivers/net/usb/cdc_ether.c
··· 777 777 }, 778 778 #endif 779 779 780 + /* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ 781 + { 782 + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM, 783 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 784 + .driver_info = 0, 785 + }, 786 + 780 787 /* ThinkPad USB-C Dock (based on Realtek RTL8153) */ 781 788 { 782 789 USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM,
+3
drivers/net/usb/r8152.c
··· 770 770 RX_EPROTO, 771 771 }; 772 772 773 + #define DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK 0x3054 773 774 #define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082 774 775 #define DEVICE_ID_THINKPAD_USB_C_DONGLE 0x720c 775 776 #define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 0xa387 ··· 9582 9581 9583 9582 if (vendor_id == VENDOR_ID_LENOVO) { 9584 9583 switch (product_id) { 9584 + case DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK: 9585 9585 case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2: 9586 9586 case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2: 9587 9587 case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3: ··· 9830 9828 REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), 9831 9829 REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), 9832 9830 REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), 9831 + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), 9833 9832 REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), 9834 9833 REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), 9835 9834 REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082),