Revert "USB: gadget: android: Disable UMS when RNDIS ethernet is active."
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:26:36 +0000 (22:26 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:26:36 +0000 (22:26 +0800)
This reverts commit a8d5021410094d76f4b6003b67ec5ab1d33a6ec6.

drivers/usb/gadget/android.c

index 70e48ac3e2a9d666fcc0ae16d1058996277ce241..e1ea22fe0e612c42d9b835aa220f27e3e39c0e34 100755 (executable)
@@ -325,14 +325,16 @@ void android_enable_function(struct usb_function *f, int enable)
 
        if (!!f->hidden != disable) {
                f->hidden = disable;
+               product_id = get_product_id(dev);
+               device_desc.idProduct = __constant_cpu_to_le16(product_id);
+               if (dev->cdev)
+                       dev->cdev->desc.idProduct = device_desc.idProduct;
 
 #ifdef CONFIG_USB_ANDROID_RNDIS
+               /* We need to specify the COMM class in the device descriptor
+               * if we are using RNDIS.
+               */
                if (!strcmp(f->name, "rndis")) {
-                       struct usb_function             *func;
-
-                       /* We need to specify the COMM class in the device descriptor
-                        * if we are using RNDIS.
-                        */
                        if (enable)
 #ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
                                dev->cdev->desc.bDeviceClass = USB_CLASS_WIRELESS_CONTROLLER;
@@ -341,24 +343,9 @@ void android_enable_function(struct usb_function *f, int enable)
 #endif
                        else
                                dev->cdev->desc.bDeviceClass = USB_CLASS_PER_INTERFACE;
-
-                       /* Windows does not support other interfaces when RNDIS is enabled,
-                        * so we disable UMS when RNDIS is on.
-                        */
-                       list_for_each_entry(func, &android_config_driver.functions, list) {
-                               if (!strcmp(func->name, "usb_mass_storage")) {
-                                       func->hidden = enable;
-                                       break;
-                               }
-                       }
                }
 #endif
 
-               product_id = get_product_id(dev);
-               device_desc.idProduct = __constant_cpu_to_le16(product_id);
-               if (dev->cdev)
-                       dev->cdev->desc.idProduct = device_desc.idProduct;
-
                /* force reenumeration */
                if (dev->cdev && dev->cdev->gadget &&
                                dev->cdev->gadget->speed != USB_SPEED_UNKNOWN) {