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.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index e72265c06f52..f8336408ef07 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -535,7 +535,7 @@ static void xhci_free_container_ctx(struct xhci_hcd *xhci,
535 kfree(ctx); 535 kfree(ctx);
536} 536}
537 537
538struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, 538struct xhci_input_control_ctx *xhci_get_input_control_ctx(
539 struct xhci_container_ctx *ctx) 539 struct xhci_container_ctx *ctx)
540{ 540{
541 if (ctx->type != XHCI_CTX_TYPE_INPUT) 541 if (ctx->type != XHCI_CTX_TYPE_INPUT)
@@ -784,8 +784,7 @@ void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
784 * Reinstalls the "normal" endpoint ring (at its previous dequeue mark, 784 * Reinstalls the "normal" endpoint ring (at its previous dequeue mark,
785 * not at the beginning of the ring). 785 * not at the beginning of the ring).
786 */ 786 */
787void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci, 787void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx,
788 struct xhci_ep_ctx *ep_ctx,
789 struct xhci_virt_ep *ep) 788 struct xhci_virt_ep *ep)
790{ 789{
791 dma_addr_t addr; 790 dma_addr_t addr;
@@ -1341,8 +1340,7 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev,
1341 return ep->ss_ep_comp.bmAttributes; 1340 return ep->ss_ep_comp.bmAttributes;
1342} 1341}
1343 1342
1344static u32 xhci_get_endpoint_type(struct usb_device *udev, 1343static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep)
1345 struct usb_host_endpoint *ep)
1346{ 1344{
1347 int in; 1345 int in;
1348 u32 type; 1346 u32 type;
@@ -1375,8 +1373,7 @@ static u32 xhci_get_endpoint_type(struct usb_device *udev,
1375 * Basically, this is the maxpacket size, multiplied by the burst size 1373 * Basically, this is the maxpacket size, multiplied by the burst size
1376 * and mult size. 1374 * and mult size.
1377 */ 1375 */
1378static u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, 1376static u32 xhci_get_max_esit_payload(struct usb_device *udev,
1379 struct usb_device *udev,
1380 struct usb_host_endpoint *ep) 1377 struct usb_host_endpoint *ep)
1381{ 1378{
1382 int max_burst; 1379 int max_burst;
@@ -1417,7 +1414,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
1417 ep_index = xhci_get_endpoint_index(&ep->desc); 1414 ep_index = xhci_get_endpoint_index(&ep->desc);
1418 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); 1415 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
1419 1416
1420 endpoint_type = xhci_get_endpoint_type(udev, ep); 1417 endpoint_type = xhci_get_endpoint_type(ep);
1421 if (!endpoint_type) 1418 if (!endpoint_type)
1422 return -EINVAL; 1419 return -EINVAL;
1423 ep_ctx->ep_info2 = cpu_to_le32(endpoint_type); 1420 ep_ctx->ep_info2 = cpu_to_le32(endpoint_type);
@@ -1483,7 +1480,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
1483 } 1480 }
1484 ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) | 1481 ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) |
1485 MAX_BURST(max_burst)); 1482 MAX_BURST(max_burst));
1486 max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); 1483 max_esit_payload = xhci_get_max_esit_payload(udev, ep);
1487 ep_ctx->tx_info = cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload)); 1484 ep_ctx->tx_info = cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload));
1488 1485
1489 /* 1486 /*
@@ -1772,7 +1769,7 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
1772 return command; 1769 return command;
1773} 1770}
1774 1771
1775void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv) 1772void xhci_urb_free_priv(struct urb_priv *urb_priv)
1776{ 1773{
1777 if (urb_priv) { 1774 if (urb_priv) {
1778 kfree(urb_priv->td[0]); 1775 kfree(urb_priv->td[0]);
@@ -1925,7 +1922,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
1925} 1922}
1926 1923
1927/* TRB math checks for xhci_trb_in_td(), using the command and event rings. */ 1924/* TRB math checks for xhci_trb_in_td(), using the command and event rings. */
1928static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags) 1925static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci)
1929{ 1926{
1930 struct { 1927 struct {
1931 dma_addr_t input_dma; 1928 dma_addr_t input_dma;
@@ -2451,7 +2448,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2451 flags); 2448 flags);
2452 if (!xhci->event_ring) 2449 if (!xhci->event_ring)
2453 goto fail; 2450 goto fail;
2454 if (xhci_check_trb_in_td_math(xhci, flags) < 0) 2451 if (xhci_check_trb_in_td_math(xhci) < 0)
2455 goto fail; 2452 goto fail;
2456 2453
2457 xhci->erst.entries = dma_alloc_coherent(dev, 2454 xhci->erst.entries = dma_alloc_coherent(dev,