aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-04-16 11:07:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-12 18:02:37 -0400
commit3a198595ae2227d73d9cd211629d66d417c0427f (patch)
tree8b2ceffd491c6365bfcc3dbf7d1734250d2904f1 /drivers/usb/host/xhci-mem.c
parent2effcfb90e7e66c668bae37b47a9f804cba6781b (diff)
USB: xhci: properly set the "Mult" field of the endpoint context.
commit 1cf62246c0e394021e494e0a8f1013e80db1a1a9 upstream. A SuperSpeed interrupt or isochronous endpoint can define the number of "burst transactions" it can handle in a service interval. This is indicated by the "Mult" bits in the bmAttributes of the SuperSpeed Endpoint Companion Descriptor. For example, if it has a max packet size of 1024, a max burst of 11, and a mult of 3, the host may send 33 1024-byte packets in one service interval. We must tell the xHCI host controller the number of multiple service opportunities (mults) the device can handle when the endpoint is installed. We do that by setting the Mult field of the Endpoint Context before a configure endpoint command is sent down. The Mult field is invalid for control or bulk SuperSpeed endpoints. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> 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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index bffcef7a5545..b62be3925492 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -549,6 +549,19 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
549 return EP_INTERVAL(interval); 549 return EP_INTERVAL(interval);
550} 550}
551 551
552/* The "Mult" field in the endpoint context is only set for SuperSpeed devices.
553 * High speed endpoint descriptors can define "the number of additional
554 * transaction opportunities per microframe", but that goes in the Max Burst
555 * endpoint context field.
556 */
557static inline u32 xhci_get_endpoint_mult(struct usb_device *udev,
558 struct usb_host_endpoint *ep)
559{
560 if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp)
561 return 0;
562 return ep->ss_ep_comp->desc.bmAttributes;
563}
564
552static inline u32 xhci_get_endpoint_type(struct usb_device *udev, 565static inline u32 xhci_get_endpoint_type(struct usb_device *udev,
553 struct usb_host_endpoint *ep) 566 struct usb_host_endpoint *ep)
554{ 567{
@@ -611,6 +624,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
611 ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; 624 ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state;
612 625
613 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); 626 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep);
627 ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep));
614 628
615 /* FIXME dig Mult and streams info out of ep companion desc */ 629 /* FIXME dig Mult and streams info out of ep companion desc */
616 630