aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-12-09 18:59:13 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:53:12 -0500
commit2a8f82c4ceaffcfd64531dbdee1d1bc227387882 (patch)
treeb70b68e35d8a9e7264263848ce48a9863b387c55 /drivers/usb/host/xhci.h
parent6219c047d3fe18dee4916d6898fc94f5a7ffd156 (diff)
USB: xhci: Notify the xHC when a device is reset.
When a USB device is reset, the xHCI hardware must know, in order to match the device state and disable all endpoints except control endpoint 0. Issue a Reset Device command after a USB device is successfully reset. Wait on the command to finish, and then cache or free the disabled endpoint rings. There are four different USB device states that the xHCI hardware tracks: - disabled/enabled - device connection has just been detected, - default - the device has been reset and has an address of 0, - addressed - the device has a non-zero address but no configuration has been set, - configured - a set configuration succeeded. The USB core may issue a port reset when a device is in any state, but the Reset Device command will fail for a 0.96 xHC if the device is not in the addressed or configured state. Don't consider this failure as an error, but don't free any endpoint rings if this command fails. A storage driver may request that the USB device be reset during error handling, so use GPF_NOIO instead of GPF_KERNEL while allocating memory for the Reset Device 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.h')
-rw-r--r--drivers/usb/host/xhci.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 20122ec75d94..feb0101f91eb 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1210,6 +1210,8 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
1210void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci); 1210void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
1211void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring); 1211void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring);
1212void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep); 1212void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
1213inline char *xhci_get_slot_state(struct xhci_hcd *xhci,
1214 struct xhci_container_ctx *ctx);
1213 1215
1214/* xHCI memory management */ 1216/* xHCI memory management */
1215void xhci_mem_cleanup(struct xhci_hcd *xhci); 1217void xhci_mem_cleanup(struct xhci_hcd *xhci);
@@ -1298,6 +1300,7 @@ int xhci_queue_evaluate_context(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1298 u32 slot_id); 1300 u32 slot_id);
1299int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id, 1301int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1300 unsigned int ep_index); 1302 unsigned int ep_index);
1303int xhci_queue_reset_device(struct xhci_hcd *xhci, u32 slot_id);
1301void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, 1304void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
1302 unsigned int slot_id, unsigned int ep_index, 1305 unsigned int slot_id, unsigned int ep_index,
1303 struct xhci_td *cur_td, struct xhci_dequeue_state *state); 1306 struct xhci_td *cur_td, struct xhci_dequeue_state *state);