mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
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>
This commit is contained in:
@@ -127,9 +127,9 @@ static struct usb_interface_descriptor rndis_control_intf = {
|
||||
/* .bInterfaceNumber = DYNAMIC */
|
||||
/* status endpoint is optional; this could be patched later */
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = USB_CLASS_COMM,
|
||||
.bInterfaceSubClass = USB_CDC_SUBCLASS_ACM,
|
||||
.bInterfaceProtocol = USB_CDC_ACM_PROTO_VENDOR,
|
||||
.bInterfaceClass = USB_CLASS_WIRELESS_CONTROLLER,
|
||||
.bInterfaceSubClass = 1,
|
||||
.bInterfaceProtocol = 3,
|
||||
/* .iInterface = DYNAMIC */
|
||||
};
|
||||
|
||||
@@ -188,9 +188,9 @@ rndis_iad_descriptor = {
|
||||
|
||||
.bFirstInterface = 0, /* XXX, hardcoded */
|
||||
.bInterfaceCount = 2, // control + data
|
||||
.bFunctionClass = USB_CLASS_COMM,
|
||||
.bFunctionSubClass = USB_CDC_SUBCLASS_ETHERNET,
|
||||
.bFunctionProtocol = USB_CDC_PROTO_NONE,
|
||||
.bFunctionClass = USB_CLASS_WIRELESS_CONTROLLER,
|
||||
.bFunctionSubClass = 1,
|
||||
.bFunctionProtocol = 3,
|
||||
/* .iFunction = DYNAMIC */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user