aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-07-19 14:21:52 -0400
committerFelipe Balbi <balbi@ti.com>2011-08-12 04:52:31 -0400
commit6a22158c596c1531b143c884d479285ef90608d1 (patch)
tree2302cf64ec43b8e189b7223a9ad60eaec1d9a946
parentaba1350fdac7cb52f86e6818addb26d03b3ef9bc (diff)
usb: gadget: composite: fix bMaxPacketSize for SuperSpeed
For bMaxPacketSize0 we usually take what is specified in ep0->maxpacket. This is fine in most cases, however on SuperSpeed bMaxPacketSize0 specifies the exponent instead of the actual size in bytes. The only valid value on SS is 9 which denotes 512 bytes. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/composite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 5ef87794fd32..aef47414f5d5 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1079,10 +1079,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1079 cdev->desc.bMaxPacketSize0 = 1079 cdev->desc.bMaxPacketSize0 =
1080 cdev->gadget->ep0->maxpacket; 1080 cdev->gadget->ep0->maxpacket;
1081 if (gadget_is_superspeed(gadget)) { 1081 if (gadget_is_superspeed(gadget)) {
1082 if (gadget->speed >= USB_SPEED_SUPER) 1082 if (gadget->speed >= USB_SPEED_SUPER) {
1083 cdev->desc.bcdUSB = cpu_to_le16(0x0300); 1083 cdev->desc.bcdUSB = cpu_to_le16(0x0300);
1084 else 1084 cdev->desc.bMaxPacketSize0 = 9;
1085 } else {
1085 cdev->desc.bcdUSB = cpu_to_le16(0x0210); 1086 cdev->desc.bcdUSB = cpu_to_le16(0x0210);
1087 }
1086 } 1088 }
1087 1089
1088 value = min(w_length, (u16) sizeof cdev->desc); 1090 value = min(w_length, (u16) sizeof cdev->desc);