diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-04-27 22:57:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:49 -0400 |
commit | 3ffbba9511b4148cbe1f6b6238686adaeaca8feb (patch) | |
tree | f69e42d07d596039e049fe2b14b720ddc6be2694 /drivers/usb/host/xhci-dbg.c | |
parent | c6515272b858742962c1de0f3bf497a048b9abd7 (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.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index 570cd4820458..16ef42a0fe85 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) | |||
410 | val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[1]); | 410 | val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[1]); |
411 | xhci_dbg(xhci, "// xHC command ring deq ptr high bits = 0x%x\n", val); | 411 | xhci_dbg(xhci, "// xHC command ring deq ptr high bits = 0x%x\n", val); |
412 | } | 412 | } |
413 | |||
414 | void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep) | ||
415 | { | ||
416 | int i, j; | ||
417 | int last_ep_ctx = 31; | ||
418 | /* Fields are 32 bits wide, DMA addresses are in bytes */ | ||
419 | int field_size = 32 / 8; | ||
420 | |||
421 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - drop flags\n", | ||
422 | (unsigned int) &ctx->drop_flags, | ||
423 | dma, ctx->drop_flags); | ||
424 | dma += field_size; | ||
425 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - add flags\n", | ||
426 | (unsigned int) &ctx->add_flags, | ||
427 | dma, ctx->add_flags); | ||
428 | dma += field_size; | ||
429 | for (i = 0; i > 6; ++i) { | ||
430 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n", | ||
431 | (unsigned int) &ctx->rsvd[i], | ||
432 | dma, ctx->rsvd[i], i); | ||
433 | dma += field_size; | ||
434 | } | ||
435 | |||
436 | xhci_dbg(xhci, "Slot Context:\n"); | ||
437 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_info\n", | ||
438 | (unsigned int) &ctx->slot.dev_info, | ||
439 | dma, ctx->slot.dev_info); | ||
440 | dma += field_size; | ||
441 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_info2\n", | ||
442 | (unsigned int) &ctx->slot.dev_info2, | ||
443 | dma, ctx->slot.dev_info2); | ||
444 | dma += field_size; | ||
445 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - tt_info\n", | ||
446 | (unsigned int) &ctx->slot.tt_info, | ||
447 | dma, ctx->slot.tt_info); | ||
448 | dma += field_size; | ||
449 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - dev_state\n", | ||
450 | (unsigned int) &ctx->slot.dev_state, | ||
451 | dma, ctx->slot.dev_state); | ||
452 | dma += field_size; | ||
453 | for (i = 0; i > 4; ++i) { | ||
454 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n", | ||
455 | (unsigned int) &ctx->slot.reserved[i], | ||
456 | dma, ctx->slot.reserved[i], i); | ||
457 | dma += field_size; | ||
458 | } | ||
459 | |||
460 | if (last_ep < 31) | ||
461 | last_ep_ctx = last_ep + 1; | ||
462 | for (i = 0; i < last_ep_ctx; ++i) { | ||
463 | xhci_dbg(xhci, "Endpoint %02d Context:\n", i); | ||
464 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - ep_info\n", | ||
465 | (unsigned int) &ctx->ep[i].ep_info, | ||
466 | dma, ctx->ep[i].ep_info); | ||
467 | dma += field_size; | ||
468 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - ep_info2\n", | ||
469 | (unsigned int) &ctx->ep[i].ep_info2, | ||
470 | dma, ctx->ep[i].ep_info2); | ||
471 | dma += field_size; | ||
472 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - deq[0]\n", | ||
473 | (unsigned int) &ctx->ep[i].deq[0], | ||
474 | dma, ctx->ep[i].deq[0]); | ||
475 | dma += field_size; | ||
476 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - deq[1]\n", | ||
477 | (unsigned int) &ctx->ep[i].deq[1], | ||
478 | dma, ctx->ep[i].deq[1]); | ||
479 | dma += field_size; | ||
480 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - tx_info\n", | ||
481 | (unsigned int) &ctx->ep[i].tx_info, | ||
482 | dma, ctx->ep[i].tx_info); | ||
483 | dma += field_size; | ||
484 | for (j = 0; j < 3; ++j) { | ||
485 | xhci_dbg(xhci, "@%08x (virt) @%08x (dma) %#08x - rsvd[%d]\n", | ||
486 | (unsigned int) &ctx->ep[i].reserved[j], | ||
487 | dma, ctx->ep[i].reserved[j], j); | ||
488 | dma += field_size; | ||
489 | } | ||
490 | } | ||
491 | } | ||