Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,10 +1549,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)
Expand All @@ -1566,10 +1567,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 ||
Expand Down Expand Up @@ -1630,8 +1635,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);

Expand Down