summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-dbg.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-04-27 19:57:38 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-15 21:44:49 -0700
commit3ffbba9511b4148cbe1f6b6238686adaeaca8feb (patch)
treef69e42d07d596039e049fe2b14b720ddc6be2694 /drivers/usb/host/xhci-dbg.c
parentc6515272b858742962c1de0f3bf497a048b9abd7 (diff)
USB: xhci: Allocate and address USB devices
xHCI needs to get a "Slot ID" from the host controller and allocate other data structures for every USB device. Make usb_alloc_dev() and usb_release_dev() allocate and free these device structures. After setting up the xHC device structures, usb_alloc_dev() must wait for the hardware to respond to an Enable Slot command. usb_alloc_dev() fires off a Disable Slot command and does not wait for it to complete. When the USB core wants to choose an address for the device, the xHCI driver must issue a Set Address command and wait for an event for that command. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-dbg.c')
-rw-r--r--drivers/usb/host/xhci-dbg.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index 570cd482045..16ef42a0fe8 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -410,3 +410,82 @@ void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[1]);
xhci_dbg(xhci, "// xHC command ring deq ptr high bits = 0x%x\n", val);
}
+
+void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep)
+{
+ int i, j;
+ int last_ep_ctx = 31;
+ /* Fields are 32 bits wide, DMA addresses are in bytes */
+ int field_size = 32 / 8;
+
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - drop flags\n",
+ (unsigned int) &ctx->drop_flags,
+ dma, ctx->drop_flags);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - add flags\n",
+ (unsigned int) &ctx->add_flags,
+ dma, ctx->add_flags);
+ dma += field_size;
+ for (i = 0; i > 6; ++i) {
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n",
+ (unsigned int) &ctx->rsvd[i],
+ dma, ctx->rsvd[i], i);
+ dma += field_size;
+ }
+
+ xhci_dbg(xhci, "Slot Context:\n");
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_info\n",
+ (unsigned int) &ctx->slot.dev_info,
+ dma, ctx->slot.dev_info);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_info2\n",
+ (unsigned int) &ctx->slot.dev_info2,
+ dma, ctx->slot.dev_info2);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - tt_info\n",
+ (unsigned int) &ctx->slot.tt_info,
+ dma, ctx->slot.tt_info);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_state\n",
+ (unsigned int) &ctx->slot.dev_state,
+ dma, ctx->slot.dev_state);
+ dma += field_size;
+ for (i = 0; i > 4; ++i) {
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n",
+ (unsigned int) &ctx->slot.reserved[i],
+ dma, ctx->slot.reserved[i], i);
+ dma += field_size;
+ }
+
+ if (last_ep < 31)
+ last_ep_ctx = last_ep + 1;
+ for (i = 0; i < last_ep_ctx; ++i) {
+ xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - ep_info\n",
+ (unsigned int) &ctx->ep[i].ep_info,
+ dma, ctx->ep[i].ep_info);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - ep_info2\n",
+ (unsigned int) &ctx->ep[i].ep_info2,
+ dma, ctx->ep[i].ep_info2);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - deq[0]\n",
+ (unsigned int) &ctx->ep[i].deq[0],
+ dma, ctx->ep[i].deq[0]);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - deq[1]\n",
+ (unsigned int) &ctx->ep[i].deq[1],
+ dma, ctx->ep[i].deq[1]);
+ dma += field_size;
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - tx_info\n",
+ (unsigned int) &ctx->ep[i].tx_info,
+ dma, ctx->ep[i].tx_info);
+ dma += field_size;
+ for (j = 0; j < 3; ++j) {
+ xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n",
+ (unsigned int) &ctx->ep[i].reserved[j],
+ dma, ctx->ep[i].reserved[j], j);
+ dma += field_size;
+ }
+ }
+}