netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] r8152: Add MAC passthrough support to new device
@ 2020-02-04  5:33 Kai-Heng Feng
  2020-02-04 10:58 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kai-Heng Feng @ 2020-02-04  5:33 UTC (permalink / raw)
  To: davem, hayeswang
  Cc: Kai-Heng Feng, Jakub Kicinski, Prashant Malani,
	open list:USB NETWORKING DRIVERS, open list:NETWORKING DRIVERS,
	open list

Device 0xa387 also supports MAC passthrough, therefore add it to the
whitelst.

BugLink: https://bugs.launchpad.net/bugs/1827961/comments/30
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v2:
 - Use switch case to match device id.
 - Use macro instead of hex for device id.

 drivers/net/usb/r8152.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index e8cd8c05b156..78ddbaf6401b 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -698,6 +698,9 @@ enum rtl8152_flags {
 #define VENDOR_ID_NVIDIA		0x0955
 #define VENDOR_ID_TPLINK		0x2357
 
+#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2	0x3082
+#define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2		0xa387
+
 #define MCU_TYPE_PLA			0x0100
 #define MCU_TYPE_USB			0x0000
 
@@ -6759,9 +6762,13 @@ static int rtl8152_probe(struct usb_interface *intf,
 		netdev->hw_features &= ~NETIF_F_RXCSUM;
 	}
 
-	if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO &&
-	    le16_to_cpu(udev->descriptor.idProduct) == 0x3082)
-		set_bit(LENOVO_MACPASSTHRU, &tp->flags);
+	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:
+			set_bit(LENOVO_MACPASSTHRU, &tp->flags);
+		}
+	}
 
 	if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial &&
 	    (!strcmp(udev->serial, "000001000000") ||
-- 
2.17.1


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

* Re: [PATCH v2] r8152: Add MAC passthrough support to new device
  2020-02-04  5:33 [PATCH v2] r8152: Add MAC passthrough support to new device Kai-Heng Feng
@ 2020-02-04 10:58 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-02-04 10:58 UTC (permalink / raw)
  To: kai.heng.feng; +Cc: hayeswang, kuba, pmalani, linux-usb, netdev, linux-kernel

From: Kai-Heng Feng <kai.heng.feng@canonical.com>
Date: Tue,  4 Feb 2020 13:33:13 +0800

> Device 0xa387 also supports MAC passthrough, therefore add it to the
> whitelst.
> 
> BugLink: https://bugs.launchpad.net/bugs/1827961/comments/30
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v2:
>  - Use switch case to match device id.
>  - Use macro instead of hex for device id.

Applied, thank you.

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

end of thread, other threads:[~2020-02-04 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04  5:33 [PATCH v2] r8152: Add MAC passthrough support to new device Kai-Heng Feng
2020-02-04 10:58 ` David Miller

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).