Add USB_ANDROID_RNDIS_WCEIS option.
authorSteve Kondik <shade@discord.hmsinc.com>
Wed, 17 Feb 2010 17:59:29 +0000 (12:59 -0500)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:28 +0000 (17:49 -0700)
Change-Id: I85973ebfcbfae6b401fb8b402842309c72655149
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/Kconfig
drivers/usb/gadget/android.c
drivers/usb/gadget/f_rndis.c

index 977fe76de6e7359cd5b4f7a40dbb424c68663168..7fe4a56906333e8d2084924177fe8255ffe3b3da 100644 (file)
@@ -869,6 +869,16 @@ config USB_ANDROID_RNDIS
        help
          Provides RNDIS ethernet function for android gadget driver.
 
+config USB_ANDROID_RNDIS_WCEIS
+        boolean "Use Windows Internet Sharing Class/SubClass/Protocol"
+        depends on USB_ANDROID_RNDIS
+        help
+         Causes the driver to look like a Windows-compatible Internet
+         Sharing device, so Windows auto-detects it.
+
+         If you enable this option, the device is no longer CDC ethernet
+         compatible.
+
 config USB_CDC_COMPOSITE
        tristate "CDC Composite Device (Ethernet and ACM)"
        depends on NET
index 77ff19eebbfa67b1574acc9cd20d6d93c762c3bc..e1ea22fe0e612c42d9b835aa220f27e3e39c0e34 100644 (file)
@@ -336,7 +336,11 @@ void android_enable_function(struct usb_function *f, int enable)
                */
                if (!strcmp(f->name, "rndis")) {
                        if (enable)
+#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
+                               dev->cdev->desc.bDeviceClass = USB_CLASS_WIRELESS_CONTROLLER;
+#else
                                dev->cdev->desc.bDeviceClass = USB_CLASS_COMM;
+#endif
                        else
                                dev->cdev->desc.bDeviceClass = USB_CLASS_PER_INTERFACE;
                }
index 89e2b7fb4f3155397a0a2094f20ba332055cd1eb..20a25ff1f2ae13ac7a9623ae10758c5a942e3609 100644 (file)
@@ -130,9 +130,16 @@ static struct usb_interface_descriptor rndis_control_intf = {
        /* .bInterfaceNumber = DYNAMIC */
        /* status endpoint is optional; this could be patched later */
        .bNumEndpoints =        1,
+#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
+       /* "Wireless" RNDIS; auto-detected by Windows */
+       .bInterfaceClass =      USB_CLASS_WIRELESS_CONTROLLER,
+       .bInterfaceSubClass = 1,
+       .bInterfaceProtocol =   3,
+#else
        .bInterfaceClass =      USB_CLASS_COMM,
        .bInterfaceSubClass =   USB_CDC_SUBCLASS_ACM,
        .bInterfaceProtocol =   USB_CDC_ACM_PROTO_VENDOR,
+#endif
        /* .iInterface = DYNAMIC */
 };