public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 23/39] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks
       [not found] <20211126023156.441292-1-sashal@kernel.org>
@ 2021-11-26  2:31 ` Sasha Levin
  2021-11-28  9:49   ` Sergey Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2021-11-26  2:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Aaron Ma, David S . Miller, Sasha Levin, kuba, hayeswang, tiwai,
	linux-usb, netdev

From: Aaron Ma <aaron.ma@canonical.com>

[ Upstream commit f77b83b5bbab53d2be339184838b19ed2c62c0a5 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 f329e39100a7d..d3da350777a4d 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.33.0


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

* Re: [PATCH AUTOSEL 5.15 23/39] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks
  2021-11-26  2:31 ` [PATCH AUTOSEL 5.15 23/39] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks Sasha Levin
@ 2021-11-28  9:49   ` Sergey Shtylyov
  2021-11-28  9:50     ` Sergey Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Shtylyov @ 2021-11-28  9:49 UTC (permalink / raw)
  To: Sasha Levin, linux-kernel, stable
  Cc: Aaron Ma, David S . Miller, kuba, hayeswang, tiwai, linux-usb,
	netdev

Hello!

On 26.11.2021 5:31, Sasha Levin wrote:

> From: Aaron Ma <aaron.ma@canonical.com>
> 
> [ Upstream commit f77b83b5bbab53d2be339184838b19ed2c62c0a5 ]
> 
> 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>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>   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 f329e39100a7d..d3da350777a4d 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;
>   	}

    {} not needed anymore, please remove 'em.

[...]

MBR, Sergey

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

* Re: [PATCH AUTOSEL 5.15 23/39] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks
  2021-11-28  9:49   ` Sergey Shtylyov
@ 2021-11-28  9:50     ` Sergey Shtylyov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Shtylyov @ 2021-11-28  9:50 UTC (permalink / raw)
  To: Sasha Levin, linux-kernel, stable
  Cc: Aaron Ma, David S . Miller, kuba, hayeswang, tiwai, linux-usb,
	netdev

On 28.11.2021 12:49, Sergey Shtylyov wrote:

>> From: Aaron Ma <aaron.ma@canonical.com>
>>
>> [ Upstream commit f77b83b5bbab53d2be339184838b19ed2c62c0a5 ]
>>
>> 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>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>>   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 f329e39100a7d..d3da350777a4d 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;
>>       }
> 
>     {} not needed anymore, please remove 'em.

    Oops, sorry didn't notice that this is a stable patch. :-)

> [...]

MBR, Sergey

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

end of thread, other threads:[~2021-11-28  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211126023156.441292-1-sashal@kernel.org>
2021-11-26  2:31 ` [PATCH AUTOSEL 5.15 23/39] net: usb: r8152: Add MAC passthrough support for more Lenovo Docks Sasha Levin
2021-11-28  9:49   ` Sergey Shtylyov
2021-11-28  9:50     ` Sergey Shtylyov

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