Skip to contentSkip to conversation

r8152 add Microsoft Dock IDs

PATCH In review René Rebe 3 participants 11 messages Jan 13, 2016 – Apr 1, 2017

Subsystems (4)
lore
Share & tools
lore

René Rebe

author
#0 lore raw

PATCH 1/1 r8152 add Microsoft Dock IDs

Hi there,

The Microsoft Surface Docks uses a R8152, too.

drivers/net/usb/r8152.c renamed from drivers/net/usb/r8152.c.orig +0 -0
@@ -462,6 +462,7 @@
 

/* Define these values to match your device */
#define VENDOR_ID_REALTEK 0x0bda
+#define VENDOR_ID_MICROSOFT 0x045e
#define VENDOR_ID_SAMSUNG 0x04e8

#define MCU_TYPE_PLA 0x0100
@@ -3932,6 +3933,8 @@

static struct usb_device_id rtl8152_table[] = {
	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
	{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
	{}
};
Signature · 2 lines
ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de
maintainer
#1 lore raw

From: René Rebe <[email protected]>
Date: Wed, 13 Jan 2016 18:06:36 +0100

Quoted 5 lines

Hi there,

The Microsoft Surface Docks uses a R8152, too.

Your patch was corrupted by your email client.

Please fix this, send a test patch to yourself, and please do not resubmit the patch here until after you can successfully apply the patch you receive in that test email.

Please also do not use attachments to solve this problem.

author
#2 lore raw

Hi David,

Quoted 1 line · David Miller

Your patch was corrupted by your email client.

Ieek, guess that’s what I get from not using Mew on my Ultra5 anymore :-/ Crossing fingers it works this time, ...

The Microsoft Surface Docks uses a R8152, too.

drivers/net/usb/r8152.c renamed from drivers/net/usb/r8152.c.orig +3 -0
@@ -462,6 +462,7 @@
 
 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK		0x0bda
+#define VENDOR_ID_MICROSOFT		0x045e
 #define VENDOR_ID_SAMSUNG		0x04e8
 
 #define MCU_TYPE_PLA			0x0100
@@ -3932,6 +3933,8 @@
 static struct usb_device_id rtl8152_table[] = {
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
 	{}
 };
Signature · 2 lines
 ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
 http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de
maintainer
#3 lore raw

From: René Rebe <[email protected]>
Date: Wed, 13 Jan 2016 21:03:30 +0100

Quoted 4 lines

Hi David,

On Jan 13, 2016, at 20:51, David Miller <[email protected]> wrote:

Quoted 8 lines
Quoted 1 line

Your patch was corrupted by your email client.

Ieek, guess that’s what I get from not using Mew on my Ultra5 anymore :-/ Crossing fingers it works this time, ...

The Microsoft Surface Docks uses a R8152, too.

Sorry, this does not apply to my net tree at all.

author
#4 lore raw

PATCH 1/1 r8152: The Microsoft Surface docks also use R8152.

Without this the generic cdc_ether grabs the device, and does not really work.

drivers/net/usb/r8152.c +3 -0
index c34df33..07f788c 100644
@@ -517,6 +517,7 @@ enum rtl8152_flags {
 
 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK		0x0bda
+#define VENDOR_ID_MICROSOFT		0x045e
 #define VENDOR_ID_SAMSUNG		0x04e8
 #define VENDOR_ID_LENOVO		0x17ef
 #define VENDOR_ID_NVIDIA		0x0955
@@ -4521,6 +4522,8 @@ static void rtl8152_disconnect(struct usb_interface *intf)
 static struct usb_device_id rtl8152_table[] = {
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x304f)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x3062)},
Signature · 2 lines
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de
#5 lore raw

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152.

Quoted 2 lines · Rene Rebe

Without this the generic cdc_ether grabs the device, and does not really work.

Does this need a corresponding blacklist in cdc_ether then? Otherwise you're really depending on driver loading order.

Dan

Quoted 29 lines
drivers/net/usb/r8152.c +0 -0
index c34df33..07f788c 100644
@@ -517,6 +517,7 @@ enum rtl8152_flags {


 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK              0x0bda
+#define VENDOR_ID_MICROSOFT            0x045e
 #define VENDOR_ID_SAMSUNG              0x04e8
 #define VENDOR_ID_LENOVO               0x17ef
 #define VENDOR_ID_NVIDIA               0x0955

drivers/net/usb/r8152.c +2 -0
@@ -4521,6 +4522,8 @@ static void rtl8152_disconnect(struct
 usb_interface *intf)
  static struct usb_device_id rtl8152_table[] = {
         {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
         {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
         {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
         {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x304f)},

        {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x3062)},

--
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de

author
#6 lore raw

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152.

Hi,

Quoted 6 lines · Dan Williams
Quoted 2 lines · Rene Rebe

Without this the generic cdc_ether grabs the device, and does not really work.

Does this need a corresponding blacklist in cdc_ether then? Otherwise you're really depending on driver loading order.

right, I already test build, and will send after reboot.

Any other nitpick in the meantime?

Quoted 31 lines

Dan

Quoted 29 lines
drivers/net/usb/r8152.c +3 -0
index c34df33..07f788c 100644
@@ -517,6 +517,7 @@ enum rtl8152_flags {
 
 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK              0x0bda
+#define VENDOR_ID_MICROSOFT            0x045e
 #define VENDOR_ID_SAMSUNG              0x04e8
 #define VENDOR_ID_LENOVO               0x17ef
 #define VENDOR_ID_NVIDIA               0x0955
@@ -4521,6 +4522,8 @@ static void rtl8152_disconnect(struct
 usb_interface *intf)
 static struct usb_device_id rtl8152_table[] = {
        {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
        {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
        {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
        {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x304f)},
        {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x3062)},
Signature · 2 lines
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de
Signature · 2 lines
 ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
 http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de
#7 lore raw

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152.

Quoted 8 lines · René Rebe

Hi,

Quoted 4 lines · Dan Williams
Quoted 2 lines · Rene Rebe

Without this the generic cdc_ether grabs the device, and does not really work.

Quoted 7 lines
Quoted 3 lines

Does this need a corresponding blacklist in cdc_ether then?  Otherwise
you're really depending on driver loading order.

right, I already test build, and will send after reboot.

Any other nitpick in the meantime?

Nope, other than it's pretty odd that the device would expose standard cdc-ether compatible USB descriptors, but apparently not be compatible with cdc-ether? Are we sure we don't just need a tweak or something to cdc-ether?

Dan

Quoted 35 lines
Quoted 33 lines

Dan

Quoted 31 lines
drivers/net/usb/r8152.c +0 -0
index c34df33..07f788c 100644
@@ -517,6 +517,7 @@ enum rtl8152_flags {


 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK              0x0bda
+#define VENDOR_ID_MICROSOFT            0x045e
 #define VENDOR_ID_SAMSUNG              0x04e8
 #define VENDOR_ID_LENOVO               0x17ef
 #define VENDOR_ID_NVIDIA               0x0955

drivers/net/usb/r8152.c +2 -0
@@ -4521,6 +4522,8 @@ static void rtl8152_disconnect(struct
 usb_interface *intf)
  static struct usb_device_id rtl8152_table[] = {
         {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
         {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+       {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
         {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
         {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x304f)},

        {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x3062)},

--
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org |
http://rene.rebe.de

author
#8 lore raw

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152.

Quoted 13 lines · René Rebe
Quoted 12 lines

Hi,

Quoted 7 lines · Dan Williams
Quoted 2 lines · Rene Rebe

Without this the generic cdc_ether grabs the device, and does not really work.

Does this need a corresponding blacklist in cdc_ether then?  Otherwise
you're really depending on driver loading order.

Quoted 8 lines
Quoted 3 lines

right, I already test build, and will send after reboot.

Any other nitpick in the meantime?

Nope, other than it's pretty odd that the device would expose standard cdc-ether compatible USB descriptors, but apparently not be compatible with cdc-ether? Are we sure we don't just need a tweak or something to cdc-ether?

Based on the existing glue and blacklist code I would assume most if not all R8152 devices have this "issue".

However, sometimes the standard macOS driver works with it. IIRC if the dock is connected after booting or so, so maybe the BIOS network boot glue alters the behavior or whatever. It never was able to TX any packet with the generic Linux cdc-ether, though.

Anyways, given the existing specific Linux driver I would assume it is better to use it in any case.

René

Signature · 2 lines
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de
author
#9 lore raw

PATCH 1/1 r8152: The Microsoft Surface docks also use R8152 v2

In reply to Dan Williams

Without this the generic cdc_ether grabs the device, and does not really work.

drivers/net/usb/cdc_ether.c +15 -0
index f5552aa..f3ae88f 100644
@@ -532,6 +532,7 @@ static const struct driver_info wwan_info = {
 #define LENOVO_VENDOR_ID	0x17ef
 #define NVIDIA_VENDOR_ID	0x0955
 #define HP_VENDOR_ID		0x03f0
+#define MICROSOFT_VENDOR_ID	0x045e
 
 static const struct usb_device_id	products[] = {
 /* BLACKLIST !!
@@ -761,6 +762,20 @@ static const struct usb_device_id	products[] = {
 	.driver_info = 0,
 },
 
+/* Microsoft Surface 2 dock (based on Realtek RTL8152) */
+{
+	USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM,
+			USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+	.driver_info = 0,
+},
+
+/* Microsoft Surface 3 dock (based on Realtek RTL8153) */
+{
+	USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM,
+			USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+	.driver_info = 0,
+},
+
 /* WHITELIST!!!
  *
  * CDC Ether uses two interfaces, not necessarily consecutive.
drivers/net/usb/r8152.c +3 -0
index c34df33..07f788c 100644
@@ -517,6 +517,7 @@ enum rtl8152_flags {
 
 /* Define these values to match your device */
 #define VENDOR_ID_REALTEK		0x0bda
+#define VENDOR_ID_MICROSOFT		0x045e
 #define VENDOR_ID_SAMSUNG		0x04e8
 #define VENDOR_ID_LENOVO		0x17ef
 #define VENDOR_ID_NVIDIA		0x0955
@@ -4521,6 +4522,8 @@ static void rtl8152_disconnect(struct usb_interface *intf)
 static struct usb_device_id rtl8152_table[] = {
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x304f)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x3062)},
Signature · 2 lines
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de
maintainer Applied
#10 lore raw

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152 v2

From: Rene Rebe <[email protected]>
Date: Tue, 28 Mar 2017 07:56:51 +0200 (CEST)

Quoted 4 lines

Without this the generic cdc_ether grabs the device, and does not really work.

Applied, thank you.