summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorErik Gilling <konkers@android.com>2010-12-13 21:12:12 -0800
committerErik Gilling <konkers@android.com>2010-12-13 21:12:33 -0800
commit98bf149e45c7a6e93d2c09ff789f1e7c970ec9a7 (patch)
treeea9e6630f1cea9d490356ec5c23c2d0d3bba1fcd /drivers
parent7b1d94e54b49c415f4456de23ae1492838a2d042 (diff)
parent1cfb26afa1528c3c148f59aa0f6764d77c02659a (diff)
Merge remote branch android-2.6.36 into android-tegra-2.6.36
Change-Id: Ifd4c8ddc62f0c6e213d203498891d151d9b06442
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/power/main.c3
-rw-r--r--drivers/net/wireless/bcm4329/include/epivers.h10
-rw-r--r--drivers/usb/gadget/android.c56
-rw-r--r--drivers/usb/gadget/composite.c15
-rw-r--r--drivers/usb/gadget/f_acm.c2
-rw-r--r--drivers/usb/gadget/f_rndis.c13
6 files changed, 76 insertions, 23 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 17aff79bd329..4a57ecc4ead9 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -528,7 +528,8 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
TRACE_DEVICE(dev);
TRACE_RESUME(0);
- if (dev->parent && dev->parent->power.status >= DPM_OFF)
+ if (dev->parent && (dev->parent->power.status >= DPM_OFF ||
+ dev->parent->power.status == DPM_RESUMING))
dpm_wait(dev->parent, async);
device_lock(dev);
diff --git a/drivers/net/wireless/bcm4329/include/epivers.h b/drivers/net/wireless/bcm4329/include/epivers.h
index 062df0480357..6d5adf258ef8 100644
--- a/drivers/net/wireless/bcm4329/include/epivers.h
+++ b/drivers/net/wireless/bcm4329/include/epivers.h
@@ -33,16 +33,16 @@
#define EPI_RC_NUMBER 248
-#define EPI_INCREMENTAL_NUMBER 15
+#define EPI_INCREMENTAL_NUMBER 17
#define EPI_BUILD_NUMBER 0
-#define EPI_VERSION 4, 218, 248, 15
+#define EPI_VERSION 4, 218, 248, 17
-#define EPI_VERSION_NUM 0x04daf80f
+#define EPI_VERSION_NUM 0x04daf811
-#define EPI_VERSION_STR "4.218.248.15"
-#define EPI_ROUTER_VERSION_STR "4.219.248.15"
+#define EPI_VERSION_STR "4.218.248.17"
+#define EPI_ROUTER_VERSION_STR "4.219.248.17"
#endif
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index d9d4d2fd5998..213e8a2d7825 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -351,6 +351,47 @@ void android_register_function(struct android_usb_function *f)
bind_functions(dev);
}
+void update_dev_desc(struct android_dev *dev)
+{
+ struct usb_function *f;
+ struct usb_function *last_enabled_f = NULL;
+ int num_enabled = 0;
+ int has_iad = 0;
+
+ dev->cdev->desc.bDeviceClass = USB_CLASS_PER_INTERFACE;
+ dev->cdev->desc.bDeviceSubClass = 0x00;
+ dev->cdev->desc.bDeviceProtocol = 0x00;
+
+ list_for_each_entry(f, &android_config_driver.functions, list) {
+ if (!f->disabled) {
+ num_enabled++;
+ last_enabled_f = f;
+ if (f->descriptors[0]->bDescriptorType ==
+ USB_DT_INTERFACE_ASSOCIATION)
+ has_iad = 1;
+ }
+ if (num_enabled > 1 && has_iad) {
+ dev->cdev->desc.bDeviceClass = USB_CLASS_MISC;
+ dev->cdev->desc.bDeviceSubClass = 0x02;
+ dev->cdev->desc.bDeviceProtocol = 0x01;
+ break;
+ }
+ }
+
+ if (num_enabled == 1) {
+#ifdef CONFIG_USB_ANDROID_RNDIS
+ if (!strcmp(last_enabled_f->name, "rndis")) {
+#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
+ dev->cdev->desc.bDeviceClass =
+ USB_CLASS_WIRELESS_CONTROLLER;
+#else
+ dev->cdev->desc.bDeviceClass = USB_CLASS_COMM;
+#endif
+ }
+#endif
+ }
+}
+
void android_enable_function(struct usb_function *f, int enable)
{
struct android_dev *dev = _android_dev;
@@ -363,19 +404,6 @@ void android_enable_function(struct usb_function *f, int enable)
#ifdef CONFIG_USB_ANDROID_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;
-#else
- dev->cdev->desc.bDeviceClass = USB_CLASS_COMM;
-#endif
- else
- dev->cdev->desc.bDeviceClass = USB_CLASS_PER_INTERFACE;
-
/* Windows does not support other interfaces when RNDIS is enabled,
* so we disable UMS and MTP when RNDIS is on.
*/
@@ -388,6 +416,8 @@ void android_enable_function(struct usb_function *f, int enable)
}
#endif
+ update_dev_desc(dev);
+
product_id = get_product_id(dev);
device_desc.idProduct = __constant_cpu_to_le16(product_id);
if (dev->cdev)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 840c41e2f33e..a664e2994620 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -301,6 +301,7 @@ static int config_buf(struct usb_configuration *config,
{
struct usb_config_descriptor *c = buf;
struct usb_interface_descriptor *intf;
+ struct usb_interface_assoc_descriptor *iad = NULL;
void *next = buf + USB_DT_CONFIG_SIZE;
int len = USB_BUFSIZ - USB_DT_CONFIG_SIZE;
struct usb_function *f;
@@ -354,6 +355,20 @@ static int config_buf(struct usb_configuration *config,
intf->bInterfaceNumber = interfaceCount++;
else
intf->bInterfaceNumber = interfaceCount - 1;
+ if (iad) {
+ iad->bFirstInterface =
+ intf->bInterfaceNumber;
+ iad = NULL;
+ }
+ } else if (intf->bDescriptorType ==
+ USB_DT_INTERFACE_ASSOCIATION) {
+ /* This will be first if it exists. Save
+ * a pointer to it so we can properly set
+ * bFirstInterface when we process the first
+ * interface.
+ */
+ iad = (struct usb_interface_assoc_descriptor *)
+ dest;
}
dest += intf->bLength;
}
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
index 2d7fdcce310d..cf2e7fc7659f 100644
--- a/drivers/usb/gadget/f_acm.c
+++ b/drivers/usb/gadget/f_acm.c
@@ -112,7 +112,7 @@ acm_iad_descriptor = {
.bInterfaceCount = 2, // control + data
.bFunctionClass = USB_CLASS_COMM,
.bFunctionSubClass = USB_CDC_SUBCLASS_ACM,
- .bFunctionProtocol = USB_CDC_PROTO_NONE,
+ .bFunctionProtocol = USB_CDC_ACM_PROTO_AT_V25TER,
/* .iFunction = DYNAMIC */
};
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 2d9d97ecce2b..af60922d6713 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -133,8 +133,8 @@ static struct usb_interface_descriptor rndis_control_intf = {
#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
/* "Wireless" RNDIS; auto-detected by Windows */
.bInterfaceClass = USB_CLASS_WIRELESS_CONTROLLER,
- .bInterfaceSubClass = 1,
- .bInterfaceProtocol = 3,
+ .bInterfaceSubClass = 0x01,
+ .bInterfaceProtocol = 0x03,
#else
.bInterfaceClass = USB_CLASS_COMM,
.bInterfaceSubClass = USB_CDC_SUBCLASS_ACM,
@@ -198,9 +198,16 @@ rndis_iad_descriptor = {
.bFirstInterface = 0, /* XXX, hardcoded */
.bInterfaceCount = 2, // control + data
+#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS
+ /* "Wireless" RNDIS; auto-detected by Windows */
+ .bFunctionClass = USB_CLASS_WIRELESS_CONTROLLER,
+ .bFunctionSubClass = 0x01,
+ .bFunctionProtocol = 0x03,
+#else
.bFunctionClass = USB_CLASS_COMM,
.bFunctionSubClass = USB_CDC_SUBCLASS_ETHERNET,
- .bFunctionProtocol = USB_CDC_PROTO_NONE,
+ .bFunctionProtocol = USB_CDC_ACM_PROTO_VENDOR,
+#endif
/* .iFunction = DYNAMIC */
};