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.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index cb2033879ae..c5313c83f42 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -601,6 +601,44 @@ void xhci_endpoint_zero(struct xhci_hcd *xhci,
601 */ 601 */
602} 602}
603 603
604/* Copy output xhci_ep_ctx to the input xhci_ep_ctx copy.
605 * Useful when you want to change one particular aspect of the endpoint and then
606 * issue a configure endpoint command.
607 */
608void xhci_endpoint_copy(struct xhci_hcd *xhci,
609 struct xhci_virt_device *vdev, unsigned int ep_index)
610{
611 struct xhci_ep_ctx *out_ep_ctx;
612 struct xhci_ep_ctx *in_ep_ctx;
613
614 out_ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index);
615 in_ep_ctx = xhci_get_ep_ctx(xhci, vdev->in_ctx, ep_index);
616
617 in_ep_ctx->ep_info = out_ep_ctx->ep_info;
618 in_ep_ctx->ep_info2 = out_ep_ctx->ep_info2;
619 in_ep_ctx->deq = out_ep_ctx->deq;
620 in_ep_ctx->tx_info = out_ep_ctx->tx_info;
621}
622
623/* Copy output xhci_slot_ctx to the input xhci_slot_ctx.
624 * Useful when you want to change one particular aspect of the endpoint and then
625 * issue a configure endpoint command. Only the context entries field matters,
626 * but we'll copy the whole thing anyway.
627 */
628void xhci_slot_copy(struct xhci_hcd *xhci, struct xhci_virt_device *vdev)
629{
630 struct xhci_slot_ctx *in_slot_ctx;
631 struct xhci_slot_ctx *out_slot_ctx;
632
633 in_slot_ctx = xhci_get_slot_ctx(xhci, vdev->in_ctx);
634 out_slot_ctx = xhci_get_slot_ctx(xhci, vdev->out_ctx);
635
636 in_slot_ctx->dev_info = out_slot_ctx->dev_info;
637 in_slot_ctx->dev_info2 = out_slot_ctx->dev_info2;
638 in_slot_ctx->tt_info = out_slot_ctx->tt_info;
639 in_slot_ctx->dev_state = out_slot_ctx->dev_state;
640}
641
604/* Set up the scratchpad buffer array and scratchpad buffers, if needed. */ 642/* Set up the scratchpad buffer array and scratchpad buffers, if needed. */
605static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) 643static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
606{ 644{