aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index fd9e03afd91c..2eb658d26394 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -835,6 +835,27 @@ fail:
835 return 0; 835 return 0;
836} 836}
837 837
838void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
839 struct usb_device *udev)
840{
841 struct xhci_virt_device *virt_dev;
842 struct xhci_ep_ctx *ep0_ctx;
843 struct xhci_ring *ep_ring;
844
845 virt_dev = xhci->devs[udev->slot_id];
846 ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0);
847 ep_ring = virt_dev->eps[0].ring;
848 /*
849 * FIXME we don't keep track of the dequeue pointer very well after a
850 * Set TR dequeue pointer, so we're setting the dequeue pointer of the
851 * host to our enqueue pointer. This should only be called after a
852 * configured device has reset, so all control transfers should have
853 * been completed or cancelled before the reset.
854 */
855 ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue);
856 ep0_ctx->deq |= ep_ring->cycle_state;
857}
858
838/* Setup an xHCI virtual device for a Set Address command */ 859/* Setup an xHCI virtual device for a Set Address command */
839int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) 860int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev)
840{ 861{
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
1002 return EP_INTERVAL(interval); 1023 return EP_INTERVAL(interval);
1003} 1024}
1004 1025
1005/* The "Mult" field in the endpoint context is only set for SuperSpeed devices. 1026/* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps.
1006 * High speed endpoint descriptors can define "the number of additional 1027 * High speed endpoint descriptors can define "the number of additional
1007 * transaction opportunities per microframe", but that goes in the Max Burst 1028 * transaction opportunities per microframe", but that goes in the Max Burst
1008 * endpoint context field. 1029 * endpoint context field.
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
1010static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, 1031static inline u32 xhci_get_endpoint_mult(struct usb_device *udev,
1011 struct usb_host_endpoint *ep) 1032 struct usb_host_endpoint *ep)
1012{ 1033{
1013 if (udev->speed != USB_SPEED_SUPER) 1034 if (udev->speed != USB_SPEED_SUPER ||
1035 !usb_endpoint_xfer_isoc(&ep->desc))
1014 return 0; 1036 return 0;
1015 return ep->ss_ep_comp.bmAttributes; 1037 return ep->ss_ep_comp.bmAttributes;
1016} 1038}