aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/usb/xhci.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2015-02-18 11:10:55 +0000
committerMichael Brown <mcb30@ipxe.org>2015-02-18 11:10:55 +0000
commit645458e5a05a76b15cbef743fe1d3ff4ffa82569 (patch)
tree32349281082200015e520be9e7baf4852bd2fee7 /src/drivers/usb/xhci.h
parent88448de720f1b0261a33355295248766e51303fe (diff)
downloadipxe-645458e5a05a76b15cbef743fe1d3ff4ffa82569.tar.gz
[xhci] Abort commands on timeout
When a command times out, abort it (via the Command Abort bit in the Command Ring Control Register) so that subsequent commands may execute as expected. This improves robustness when a device fails to respond to the Set Address command, since the subsequent Disable Slot command will now succeed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/usb/xhci.h')
-rw-r--r--src/drivers/usb/xhci.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/drivers/usb/xhci.h b/src/drivers/usb/xhci.h
index ec951bd6..30c6d1f4 100644
--- a/src/drivers/usb/xhci.h
+++ b/src/drivers/usb/xhci.h
@@ -178,6 +178,9 @@ enum xhci_default_psi_value {
/** Command ring cycle state */
#define XHCI_CRCR_RCS 0x00000001UL
+/** Command abort */
+#define XHCI_CRCR_CA 0x00000004UL
+
/** Command ring running */
#define XHCI_CRCR_CRR 0x00000008UL
@@ -629,6 +632,8 @@ enum xhci_completion_code {
XHCI_CMPLT_SUCCESS = 1,
/** Short packet */
XHCI_CMPLT_SHORT = 13,
+ /** Command ring stopped */
+ XHCI_CMPLT_CMD_STOPPED = 24,
};
/** A port status change transfer request block */
@@ -987,6 +992,12 @@ xhci_ring_consumed ( struct xhci_trb_ring *ring ) {
*/
#define XHCI_COMMAND_MAX_WAIT_MS 500
+/** Time to delay after aborting a command
+ *
+ * This is a policy decision
+ */
+#define XHCI_COMMAND_ABORT_DELAY_MS 500
+
/** Maximum time to wait for a port reset to complete
*
* This is a policy decision.
@@ -1042,8 +1053,8 @@ struct xhci_device {
struct xhci_trb_ring command;
/** Event ring */
struct xhci_event_ring event;
- /** Current command completion buffer (if any) */
- union xhci_trb *completion;
+ /** Current command (if any) */
+ union xhci_trb *pending;
/** Device slots, indexed by slot ID */
struct xhci_slot **slot;