[PATCH] r8152 add Microsoft Dock IDs

STALE3446d

11 messages, 3 authors, 2017-04-01 · open the first message on its own page

[PATCH] r8152 add Microsoft Dock IDs

From: René Rebe <hidden>
Date: 2016-01-13 17:06:35

Hi there,

The Microsoft Surface Docks uses a R8152, too.

Signed-off-by: René Rebe <redacted>
--- linux-3.19/drivers/net/usb/r8152.c.orig	2015-02-09 02:54:22.000000000 +0000
+++ linux-3.19/drivers/net/usb/r8152.c	2015-02-15 15:52:52.924000000 +0000
@@ -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)},
	{}
};

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

Re: [PATCH] r8152 add Microsoft Dock IDs

From: David Miller <davem@davemloft.net>
Date: 2016-01-13 19:51:48

From: René Rebe <redacted>
Date: Wed, 13 Jan 2016 18:06:36 +0100
Hi there,

The Microsoft Surface Docks uses a R8152, too.

Signed-off-by: René Rebe <redacted>
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.

Re: [PATCH] r8152 add Microsoft Dock IDs

From: René Rebe <hidden>
Date: 2016-01-13 20:03:44

Hi David,

On Jan 13, 2016, at 20:51, David Miller [off-list ref] wrote:
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.

Signed-off-by: René Rebe <redacted>
--- linux-3.19/drivers/net/usb/r8152.c.orig	2015-02-09 02:54:22.000000000 +0000
+++ linux-3.19/drivers/net/usb/r8152.c	2015-02-15 15:52:52.924000000 +0000
@@ -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)},
 	{}
 };
-- 
 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

Re: [PATCH] r8152 add Microsoft Dock IDs

From: David Miller <davem@davemloft.net>
Date: 2016-01-13 20:49:42

From: René Rebe <redacted>
Date: Wed, 13 Jan 2016 21:03:30 +0100
Hi David,

On Jan 13, 2016, at 20:51, David Miller [off-list ref] wrote:
quoted
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.

Signed-off-by: René Rebe <redacted>
Sorry, this does not apply to my net tree at all.

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

From: Rene Rebe <hidden>
Date: 2017-03-30 16:53:38

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

Signed-off-by: René Rebe <redacted>
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c34df33..07f788c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)},

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

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

From: Dan Williams <hidden>
Date: 2017-03-30 17:06:08

On Tue, 2017-03-28 at 06:42 +0200, Rene Rebe wrote:
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 hunk
Signed-off-by: René Rebe <redacted>
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c34df33..07f788c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)},


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

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

From: René Rebe <hidden>
Date: 2017-03-30 17:47:24

Hi,

On Mar 30, 2017, at 19:06, Dan Williams [off-list ref] wrote:
On Tue, 2017-03-28 at 06:42 +0200, Rene Rebe wrote:
quoted
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?
Dan
quoted
Signed-off-by: René Rebe <redacted>
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c34df33..07f788c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)},


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

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

From: Dan Williams <hidden>
Date: 2017-03-30 18:12:45

On Thu, 2017-03-30 at 19:47 +0200, René Rebe wrote:
Hi,

On Mar 30, 2017, at 19:06, Dan Williams [off-list ref] wrote:
quoted
On Tue, 2017-03-28 at 06:42 +0200, Rene Rebe wrote:
quoted
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?
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
Dan
quoted
Signed-off-by: René Rebe <redacted>
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c34df33..07f788c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)},


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

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

From: Rene Rebe <hidden>
Date: 2017-03-30 20:57:19

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

Signed-off-by: René Rebe <redacted>
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index f5552aa..f3ae88f 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -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.
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c34df33..07f788c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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)},
-- 
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.de

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

From: Rene Rebe <hidden>
Date: 2017-03-30 21:00:54

On Thu, 2017-03-30 at 19:47 +0200, René Rebe wrote:
quoted
Hi,

On Mar 30, 2017, at 19:06, Dan Williams [off-list ref] wrote:
quoted
On Tue, 2017-03-28 at 06:42 +0200, Rene Rebe wrote:
quoted
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?
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é

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

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

From: David Miller <davem@davemloft.net>
Date: 2017-04-01 19:20:09

From: Rene Rebe <redacted>
Date: Tue, 28 Mar 2017 07:56:51 +0200 (CEST)
Without this the generic cdc_ether grabs the device,
and does not really work.

Signed-off-by: René Rebe <redacted>
Applied, thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help