usbtest: make module param pattern writeable
[deliverable/linux.git] / drivers / usb / host / xhci.h
index 4b254b6fa2456468731925199a69de85afd84602..c92f84154fb59193215cfe14ec2a400004f75c50 100644 (file)
@@ -652,13 +652,17 @@ struct xhci_virt_ep {
        struct xhci_ring                *new_ring;
        unsigned int                    ep_state;
 #define SET_DEQ_PENDING                (1 << 0)
-#define EP_HALTED              (1 << 1)
+#define EP_HALTED              (1 << 1)        /* For stall handling */
+#define EP_HALT_PENDING                (1 << 2)        /* For URB cancellation */
        /* ----  Related to URB cancellation ---- */
        struct list_head        cancelled_td_list;
-       unsigned int            cancels_pending;
        /* The TRB that was last reported in a stopped endpoint ring */
        union xhci_trb          *stopped_trb;
        struct xhci_td          *stopped_td;
+       /* Watchdog timer for stop endpoint command to cancel URBs */
+       struct timer_list       stop_cmd_timer;
+       int                     stop_cmds_pending;
+       struct xhci_hcd         *xhci;
 };
 
 struct xhci_virt_device {
@@ -1022,6 +1026,8 @@ struct xhci_scratchpad {
 #define        ERST_ENTRIES    1
 /* Poll every 60 seconds */
 #define        POLL_TIMEOUT    60
+/* Stop endpoint command timeout (secs) for URB cancellation watchdog timer */
+#define XHCI_STOP_EP_CMD_TIMEOUT       5
 /* XXX: Make these module parameters */
 
 
@@ -1083,6 +1089,21 @@ struct xhci_hcd {
        struct timer_list       event_ring_timer;
        int                     zombie;
 #endif
+       /* Host controller watchdog timer structures */
+       unsigned int            xhc_state;
+/* Host controller is dying - not responding to commands. "I'm not dead yet!"
+ *
+ * xHC interrupts have been disabled and a watchdog timer will (or has already)
+ * halt the xHCI host, and complete all URBs with an -ESHUTDOWN code.  Any code
+ * that sees this status (other than the timer that set it) should stop touching
+ * hardware immediately.  Interrupt handlers should return immediately when
+ * they see this status (any time they drop and re-acquire xhci->lock).
+ * xhci_urb_dequeue() should call usb_hcd_check_unlink_urb() and return without
+ * putting the TD on the canceled list, etc.
+ *
+ * There are no reports of xHCI host controllers that display this issue.
+ */
+#define XHCI_STATE_DYING       (1 << 0)
        /* Statistics */
        int                     noops_submitted;
        int                     noops_handled;
@@ -1223,6 +1244,7 @@ void xhci_unregister_pci(void);
 #endif
 
 /* xHCI host controller glue */
+void xhci_quiesce(struct xhci_hcd *xhci);
 int xhci_halt(struct xhci_hcd *xhci);
 int xhci_reset(struct xhci_hcd *xhci);
 int xhci_init(struct usb_hcd *hcd);
@@ -1278,6 +1300,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
 void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci,
                unsigned int slot_id, unsigned int ep_index,
                struct xhci_dequeue_state *deq_state);
+void xhci_stop_endpoint_command_watchdog(unsigned long arg);
 
 /* xHCI roothub code */
 int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
This page took 0.025661 seconds and 5 git commands to generate.