diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 66c0ae71e039..4edcaede64bc 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1620,10 +1620,11 @@ static int xhci_check_ep0_maxpacket(struct xhci_hcd *xhci, struct xhci_virt_devi * XXX: bandwidth is not recalculated. We should probably do that. */ -static unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index) -{ - return 1 << (ep_index + 1); -} +static void xhci_setup_input_ctx_for_config_ep(struct xhci_hcd *xhci, + struct xhci_container_ctx *in_ctx, + struct xhci_container_ctx *out_ctx, + struct xhci_input_control_ctx *ctrl_ctx, + u32 add_flags, u32 drop_flags); static void xhci_fixup_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep, int interval) @@ -1637,10 +1638,14 @@ static void xhci_fixup_endpoint(struct usb_hcd *hcd, struct usb_device *udev, int ret; int ep_index; unsigned long flags; - u32 ep_info_tmp; + u32 ep_flag, ep_info_tmp; xhci = hcd_to_xhci(hcd); ep_index = xhci_get_endpoint_index(&ep->desc); + ep_flag = xhci_get_endpoint_flag(&ep->desc); + + if (ep_flag == SLOT_FLAG || ep_flag == EP0_FLAG) + return; /* FS/LS interval translations */ if ((udev->speed == USB_SPEED_FULL || @@ -1701,8 +1706,8 @@ static void xhci_fixup_endpoint(struct usb_hcd *hcd, struct usb_device *udev, mutex_unlock(&xhci->mutex); return; } - ctrl_ctx->add_flags = xhci_get_endpoint_flag_from_index(ep_index); - ctrl_ctx->drop_flags = ctrl_ctx->add_flags; + xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx, vdev->out_ctx, + ctrl_ctx, ep_flag, ep_flag); spin_unlock_irqrestore(&xhci->lock, flags);