usb:rndis:Fix the no auto installation problem
authora17671 <a17671@motorola.com>
Sat, 29 Sep 2018 05:51:40 +0000 (13:51 +0800)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:50 +0000 (20:23 +0300)
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 5799fb6e929c7fa8011aad83f0e88197e33bdfdd..d0deef3ac7d9a40f2b52594c758af0f26647cc6c 100644 (file)
@@ -745,6 +745,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 */