diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 5cb3d7a10017..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 | ||
538 | struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, | 538 | struct 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 | */ |
787 | void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci, | 787 | void 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; |
@@ -833,9 +832,8 @@ void xhci_free_stream_info(struct xhci_hcd *xhci, | |||
833 | static void xhci_init_endpoint_timer(struct xhci_hcd *xhci, | 832 | static void xhci_init_endpoint_timer(struct xhci_hcd *xhci, |
834 | struct xhci_virt_ep *ep) | 833 | struct xhci_virt_ep *ep) |
835 | { | 834 | { |
836 | init_timer(&ep->stop_cmd_timer); | 835 | setup_timer(&ep->stop_cmd_timer, xhci_stop_endpoint_command_watchdog, |
837 | ep->stop_cmd_timer.data = (unsigned long) ep; | 836 | (unsigned long)ep); |
838 | ep->stop_cmd_timer.function = xhci_stop_endpoint_command_watchdog; | ||
839 | ep->xhci = xhci; | 837 | ep->xhci = xhci; |
840 | } | 838 | } |
841 | 839 | ||
@@ -1342,8 +1340,7 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev, | |||
1342 | return ep->ss_ep_comp.bmAttributes; | 1340 | return ep->ss_ep_comp.bmAttributes; |
1343 | } | 1341 | } |
1344 | 1342 | ||
1345 | static u32 xhci_get_endpoint_type(struct usb_device *udev, | 1343 | static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep) |
1346 | struct usb_host_endpoint *ep) | ||
1347 | { | 1344 | { |
1348 | int in; | 1345 | int in; |
1349 | u32 type; | 1346 | u32 type; |
@@ -1376,8 +1373,7 @@ static u32 xhci_get_endpoint_type(struct usb_device *udev, | |||
1376 | * Basically, this is the maxpacket size, multiplied by the burst size | 1373 | * Basically, this is the maxpacket size, multiplied by the burst size |
1377 | * and mult size. | 1374 | * and mult size. |
1378 | */ | 1375 | */ |
1379 | static u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, | 1376 | static u32 xhci_get_max_esit_payload(struct usb_device *udev, |
1380 | struct usb_device *udev, | ||
1381 | struct usb_host_endpoint *ep) | 1377 | struct usb_host_endpoint *ep) |
1382 | { | 1378 | { |
1383 | int max_burst; | 1379 | int max_burst; |
@@ -1418,7 +1414,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
1418 | ep_index = xhci_get_endpoint_index(&ep->desc); | 1414 | ep_index = xhci_get_endpoint_index(&ep->desc); |
1419 | 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); |
1420 | 1416 | ||
1421 | endpoint_type = xhci_get_endpoint_type(udev, ep); | 1417 | endpoint_type = xhci_get_endpoint_type(ep); |
1422 | if (!endpoint_type) | 1418 | if (!endpoint_type) |
1423 | return -EINVAL; | 1419 | return -EINVAL; |
1424 | ep_ctx->ep_info2 = cpu_to_le32(endpoint_type); | 1420 | ep_ctx->ep_info2 = cpu_to_le32(endpoint_type); |
@@ -1484,7 +1480,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
1484 | } | 1480 | } |
1485 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) | | 1481 | ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) | |
1486 | MAX_BURST(max_burst)); | 1482 | MAX_BURST(max_burst)); |
1487 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); | 1483 | max_esit_payload = xhci_get_max_esit_payload(udev, ep); |
1488 | 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)); |
1489 | 1485 | ||
1490 | /* | 1486 | /* |
@@ -1773,7 +1769,7 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, | |||
1773 | return command; | 1769 | return command; |
1774 | } | 1770 | } |
1775 | 1771 | ||
1776 | void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv) | 1772 | void xhci_urb_free_priv(struct urb_priv *urb_priv) |
1777 | { | 1773 | { |
1778 | if (urb_priv) { | 1774 | if (urb_priv) { |
1779 | kfree(urb_priv->td[0]); | 1775 | kfree(urb_priv->td[0]); |
@@ -1926,7 +1922,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci, | |||
1926 | } | 1922 | } |
1927 | 1923 | ||
1928 | /* 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. */ |
1929 | static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags) | 1925 | static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci) |
1930 | { | 1926 | { |
1931 | struct { | 1927 | struct { |
1932 | dma_addr_t input_dma; | 1928 | dma_addr_t input_dma; |
@@ -2452,7 +2448,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2452 | flags); | 2448 | flags); |
2453 | if (!xhci->event_ring) | 2449 | if (!xhci->event_ring) |
2454 | goto fail; | 2450 | goto fail; |
2455 | if (xhci_check_trb_in_td_math(xhci, flags) < 0) | 2451 | if (xhci_check_trb_in_td_math(xhci) < 0) |
2456 | goto fail; | 2452 | goto fail; |
2457 | 2453 | ||
2458 | xhci->erst.entries = dma_alloc_coherent(dev, | 2454 | xhci->erst.entries = dma_alloc_coherent(dev, |
@@ -2509,9 +2505,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2509 | xhci_print_ir_set(xhci, 0); | 2505 | xhci_print_ir_set(xhci, 0); |
2510 | 2506 | ||
2511 | /* init command timeout timer */ | 2507 | /* init command timeout timer */ |
2512 | init_timer(&xhci->cmd_timer); | 2508 | setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout, |
2513 | xhci->cmd_timer.data = (unsigned long) xhci; | 2509 | (unsigned long)xhci); |
2514 | xhci->cmd_timer.function = xhci_handle_command_timeout; | ||
2515 | 2510 | ||
2516 | /* | 2511 | /* |
2517 | * XXX: Might need to set the Interrupter Moderation Register to | 2512 | * XXX: Might need to set the Interrupter Moderation Register to |