aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-08-07 17:04:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 09:46:17 -0400
commit47aded8ade9fee6779b121b2b156235f261239d7 (patch)
tree601dc3cd6abf84b84f224bf6fd48a38d341c2083 /drivers/usb/host/xhci-mem.c
parentf2217e8edd95b0428d8123d426e0097a5e955f9f (diff)
USB: xhci: Set correct max packet size for HS/FS control endpoints.
Set the max packet size for the default control endpoint on high speed devices to be 64 bytes. High speed devices always have a max packet size of 64 bytes. There's no use setting it to eight for the initial 8 byte descriptor fetch and then issuing (and waiting for) an evaluate context command to update it to 64 bytes for the subsequent control transfers. The USB core guesses that the max packet size on a full speed control endpoint is 64 bytes, and then updates it after the first 8-byte descriptor fetch. Change the initial setup for the xHCI internal representation of the full speed device to have a 64 byte max packet size. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index c5313c83f42e..55920b39d106 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -401,15 +401,28 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
401 /* Step 5 */ 401 /* Step 5 */
402 ep0_ctx->ep_info2 = EP_TYPE(CTRL_EP); 402 ep0_ctx->ep_info2 = EP_TYPE(CTRL_EP);
403 /* 403 /*
404 * See section 4.3 bullet 6:
405 * The default Max Packet size for ep0 is "8 bytes for a USB2
406 * LS/FS/HS device or 512 bytes for a USB3 SS device"
407 * XXX: Not sure about wireless USB devices. 404 * XXX: Not sure about wireless USB devices.
408 */ 405 */
409 if (udev->speed == USB_SPEED_SUPER) 406 switch (udev->speed) {
407 case USB_SPEED_SUPER:
410 ep0_ctx->ep_info2 |= MAX_PACKET(512); 408 ep0_ctx->ep_info2 |= MAX_PACKET(512);
411 else 409 break;
410 case USB_SPEED_HIGH:
411 /* USB core guesses at a 64-byte max packet first for FS devices */
412 case USB_SPEED_FULL:
413 ep0_ctx->ep_info2 |= MAX_PACKET(64);
414 break;
415 case USB_SPEED_LOW:
412 ep0_ctx->ep_info2 |= MAX_PACKET(8); 416 ep0_ctx->ep_info2 |= MAX_PACKET(8);
417 break;
418 case USB_SPEED_VARIABLE:
419 xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n");
420 return -EINVAL;
421 break;
422 default:
423 /* New speed? */
424 BUG();
425 }
413 /* EP 0 can handle "burst" sizes of 1, so Max Burst Size field is 0 */ 426 /* EP 0 can handle "burst" sizes of 1, so Max Burst Size field is 0 */
414 ep0_ctx->ep_info2 |= MAX_BURST(0); 427 ep0_ctx->ep_info2 |= MAX_BURST(0);
415 ep0_ctx->ep_info2 |= ERROR_COUNT(3); 428 ep0_ctx->ep_info2 |= ERROR_COUNT(3);