usb:rndis:Fix the no auto installation problem
authora17671 <a17671@motorola.com>
Sat, 29 Sep 2018 05:51:40 +0000 (13:51 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:17 +0000 (17:30 +0800)
The samsung rndis driver has to be manually installed on Windows
Switch the function class to wireless controller to trigger auto
Installation on Windows

Change-Id: I7fdd0f439cbae41a6a4142785db360fe57873c5f
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1248692
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/usb/gadget/function/f_rndis.c

index 4723ba2ece9b7e6fa35df98cce223a6c4829c953..97202f0a7cbe8f42eac7496419197df1043dc556 100644 (file)
@@ -742,6 +742,15 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
        rndis_data_intf.bInterfaceNumber = status;
        rndis_union_desc.bSlaveInterface0 = status;
 
+       /* "Wireless" RNDIS; auto-detected by Windows */
+       rndis_iad_descriptor.bFunctionClass =
+                                       USB_CLASS_WIRELESS_CONTROLLER;
+       rndis_iad_descriptor.bFunctionSubClass = 0x01;
+       rndis_iad_descriptor.bFunctionProtocol = 0x03;
+       rndis_control_intf.bInterfaceClass =
+                                       USB_CLASS_WIRELESS_CONTROLLER;
+       rndis_control_intf.bInterfaceSubClass =  0x01;
+       rndis_control_intf.bInterfaceProtocol =  0x03;
        status = -ENODEV;
 
        /* allocate instance-specific endpoints */