Skip to content

Commit e379ba9

Browse files
wuliangfengtzuwen_chang
authored andcommitted
usb: gadget: rndis: fix class definitions for windows
The RNDIS gadget function has USB class of 2 and subclass of 2, which matches "USB\Class_02&SubClass_02" in the usbser.inf file in the Windows system, so the device is initially detected as a COM port instead of RNDIS. This is why we need to install RNDIS manually. Refer to Defined Class Codes [1] and rndis_host of Linux [2], this patch sets the RNDIS gadget with base class of 0xE0h (Wireless Controller) and subclass of 0x01h and protocol of 0x03h. [1] https://www.usb.org/defined-class-codes [2] http://www.embedded-os.de/en/proto-rndis_host.shtml Change-Id: Ida366749f378a0ce770d707b4ba56b87f9e188cf Signed-off-by: William Wu <william.wu@rock-chips.com>
1 parent 9535e00 commit e379ba9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/usb/gadget/function/f_rndis.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ static struct usb_interface_descriptor rndis_control_intf = {
127127
/* .bInterfaceNumber = DYNAMIC */
128128
/* status endpoint is optional; this could be patched later */
129129
.bNumEndpoints = 1,
130-
.bInterfaceClass = USB_CLASS_COMM,
131-
.bInterfaceSubClass = USB_CDC_SUBCLASS_ACM,
132-
.bInterfaceProtocol = USB_CDC_ACM_PROTO_VENDOR,
130+
.bInterfaceClass = USB_CLASS_WIRELESS_CONTROLLER,
131+
.bInterfaceSubClass = 1,
132+
.bInterfaceProtocol = 3,
133133
/* .iInterface = DYNAMIC */
134134
};
135135

@@ -188,9 +188,9 @@ rndis_iad_descriptor = {
188188

189189
.bFirstInterface = 0, /* XXX, hardcoded */
190190
.bInterfaceCount = 2, // control + data
191-
.bFunctionClass = USB_CLASS_COMM,
192-
.bFunctionSubClass = USB_CDC_SUBCLASS_ETHERNET,
193-
.bFunctionProtocol = USB_CDC_PROTO_NONE,
191+
.bFunctionClass = USB_CLASS_WIRELESS_CONTROLLER,
192+
.bFunctionSubClass = 1,
193+
.bFunctionProtocol = 3,
194194
/* .iFunction = DYNAMIC */
195195
};
196196

0 commit comments

Comments
 (0)