aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 18:22:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 18:22:55 -0500
commit748e566b7e24541e05e3e70be311887a1262f2a1 (patch)
tree41cc3a9aa04918cc17efa575baf6dbf87f40ddba /drivers/usb/host/xhci.h
parent5f1141eb352ea79d849920039503e40dd623fffa (diff)
parentacf509ae28301d78b022c534c26b1e4765c18f2b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (122 commits) USB: mos7840: add device IDs for B&B electronics devices USB: ftdi_sio: add USB device ID's for B&B Electronics line USB: musb: musb_host: fix sparse warning USB: musb: musb_gadget: fix sparse warning USB: musb: omap2430: fix sparse warning USB: core: message: fix sparse warning USB: core: hub: fix sparse warning USB: core: fix sparse warning for static function USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDIS USB: Check bandwidth when switching alt settings. USB: Refactor code to find alternate interface settings. USB: xhci: Fix command completion after a drop endpoint. USB: xhci: Make reverting an alt setting "unfailable". USB: usbtmc: Use usb_clear_halt() instead of custom code. USB: xhci: Add correct email and files to MAINTAINERS entry. USB: ehci-omap.c: introduce missing kfree USB: xhci-mem.c: introduce missing kfree USB: add remove_id sysfs attr for usb drivers USB: g_multi kconfig: fix depends and help text USB: option: add pid for ZTE ...
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 4b254b6fa245..877813505ef2 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -652,13 +652,17 @@ struct xhci_virt_ep {
652 struct xhci_ring *new_ring; 652 struct xhci_ring *new_ring;
653 unsigned int ep_state; 653 unsigned int ep_state;
654#define SET_DEQ_PENDING (1 << 0) 654#define SET_DEQ_PENDING (1 << 0)
655#define EP_HALTED (1 << 1) 655#define EP_HALTED (1 << 1) /* For stall handling */
656#define EP_HALT_PENDING (1 << 2) /* For URB cancellation */
656 /* ---- Related to URB cancellation ---- */ 657 /* ---- Related to URB cancellation ---- */
657 struct list_head cancelled_td_list; 658 struct list_head cancelled_td_list;
658 unsigned int cancels_pending;
659 /* The TRB that was last reported in a stopped endpoint ring */ 659 /* The TRB that was last reported in a stopped endpoint ring */
660 union xhci_trb *stopped_trb; 660 union xhci_trb *stopped_trb;
661 struct xhci_td *stopped_td; 661 struct xhci_td *stopped_td;
662 /* Watchdog timer for stop endpoint command to cancel URBs */
663 struct timer_list stop_cmd_timer;
664 int stop_cmds_pending;
665 struct xhci_hcd *xhci;
662}; 666};
663 667
664struct xhci_virt_device { 668struct xhci_virt_device {
@@ -673,6 +677,10 @@ struct xhci_virt_device {
673 struct xhci_container_ctx *out_ctx; 677 struct xhci_container_ctx *out_ctx;
674 /* Used for addressing devices and configuration changes */ 678 /* Used for addressing devices and configuration changes */
675 struct xhci_container_ctx *in_ctx; 679 struct xhci_container_ctx *in_ctx;
680 /* Rings saved to ensure old alt settings can be re-instated */
681 struct xhci_ring **ring_cache;
682 int num_rings_cached;
683#define XHCI_MAX_RINGS_CACHED 31
676 struct xhci_virt_ep eps[31]; 684 struct xhci_virt_ep eps[31];
677 struct completion cmd_completion; 685 struct completion cmd_completion;
678 /* Status of the last command issued for this device */ 686 /* Status of the last command issued for this device */
@@ -824,9 +832,6 @@ struct xhci_event_cmd {
824/* Normal TRB fields */ 832/* Normal TRB fields */
825/* transfer_len bitmasks - bits 0:16 */ 833/* transfer_len bitmasks - bits 0:16 */
826#define TRB_LEN(p) ((p) & 0x1ffff) 834#define TRB_LEN(p) ((p) & 0x1ffff)
827/* TD size - number of bytes remaining in the TD (including this TRB):
828 * bits 17 - 21. Shift the number of bytes by 10. */
829#define TD_REMAINDER(p) ((((p) >> 10) & 0x1f) << 17)
830/* Interrupter Target - which MSI-X vector to target the completion event at */ 835/* Interrupter Target - which MSI-X vector to target the completion event at */
831#define TRB_INTR_TARGET(p) (((p) & 0x3ff) << 22) 836#define TRB_INTR_TARGET(p) (((p) & 0x3ff) << 22)
832#define GET_INTR_TARGET(p) (((p) >> 22) & 0x3ff) 837#define GET_INTR_TARGET(p) (((p) >> 22) & 0x3ff)
@@ -1022,6 +1027,8 @@ struct xhci_scratchpad {
1022#define ERST_ENTRIES 1 1027#define ERST_ENTRIES 1
1023/* Poll every 60 seconds */ 1028/* Poll every 60 seconds */
1024#define POLL_TIMEOUT 60 1029#define POLL_TIMEOUT 60
1030/* Stop endpoint command timeout (secs) for URB cancellation watchdog timer */
1031#define XHCI_STOP_EP_CMD_TIMEOUT 5
1025/* XXX: Make these module parameters */ 1032/* XXX: Make these module parameters */
1026 1033
1027 1034
@@ -1083,6 +1090,21 @@ struct xhci_hcd {
1083 struct timer_list event_ring_timer; 1090 struct timer_list event_ring_timer;
1084 int zombie; 1091 int zombie;
1085#endif 1092#endif
1093 /* Host controller watchdog timer structures */
1094 unsigned int xhc_state;
1095/* Host controller is dying - not responding to commands. "I'm not dead yet!"
1096 *
1097 * xHC interrupts have been disabled and a watchdog timer will (or has already)
1098 * halt the xHCI host, and complete all URBs with an -ESHUTDOWN code. Any code
1099 * that sees this status (other than the timer that set it) should stop touching
1100 * hardware immediately. Interrupt handlers should return immediately when
1101 * they see this status (any time they drop and re-acquire xhci->lock).
1102 * xhci_urb_dequeue() should call usb_hcd_check_unlink_urb() and return without
1103 * putting the TD on the canceled list, etc.
1104 *
1105 * There are no reports of xHCI host controllers that display this issue.
1106 */
1107#define XHCI_STATE_DYING (1 << 0)
1086 /* Statistics */ 1108 /* Statistics */
1087 int noops_submitted; 1109 int noops_submitted;
1088 int noops_handled; 1110 int noops_handled;
@@ -1223,6 +1245,7 @@ void xhci_unregister_pci(void);
1223#endif 1245#endif
1224 1246
1225/* xHCI host controller glue */ 1247/* xHCI host controller glue */
1248void xhci_quiesce(struct xhci_hcd *xhci);
1226int xhci_halt(struct xhci_hcd *xhci); 1249int xhci_halt(struct xhci_hcd *xhci);
1227int xhci_reset(struct xhci_hcd *xhci); 1250int xhci_reset(struct xhci_hcd *xhci);
1228int xhci_init(struct usb_hcd *hcd); 1251int xhci_init(struct usb_hcd *hcd);
@@ -1246,6 +1269,9 @@ void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1246 1269
1247/* xHCI ring, segment, TRB, and TD functions */ 1270/* xHCI ring, segment, TRB, and TD functions */
1248dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, union xhci_trb *trb); 1271dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, union xhci_trb *trb);
1272struct xhci_segment *trb_in_td(struct xhci_segment *start_seg,
1273 union xhci_trb *start_trb, union xhci_trb *end_trb,
1274 dma_addr_t suspect_dma);
1249void xhci_ring_cmd_db(struct xhci_hcd *xhci); 1275void xhci_ring_cmd_db(struct xhci_hcd *xhci);
1250void *xhci_setup_one_noop(struct xhci_hcd *xhci); 1276void *xhci_setup_one_noop(struct xhci_hcd *xhci);
1251void xhci_handle_event(struct xhci_hcd *xhci); 1277void xhci_handle_event(struct xhci_hcd *xhci);
@@ -1278,6 +1304,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
1278void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci, 1304void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci,
1279 unsigned int slot_id, unsigned int ep_index, 1305 unsigned int slot_id, unsigned int ep_index,
1280 struct xhci_dequeue_state *deq_state); 1306 struct xhci_dequeue_state *deq_state);
1307void xhci_stop_endpoint_command_watchdog(unsigned long arg);
1281 1308
1282/* xHCI roothub code */ 1309/* xHCI roothub code */
1283int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1310int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,