aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-07-27 15:03:15 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-28 17:31:11 -0400
commita1587d97ce3e53816c88b513a2038f6c5e5babd7 (patch)
tree3deb2b83974a9cfa61def8f8ab248cafbbb9809f /drivers/usb/host/xhci.h
parentf9dc68fe7ad390428c6bc5d7ff582cdb5d92fcb8 (diff)
USB: xhci: Deal with stalled endpoints.
When an endpoint on a device under an xHCI host controller stalls, the host controller driver must let the hardware know that the USB core has successfully cleared the halt condition. The HCD submits a Reset Endpoint Command, which will clear the toggle bit for USB 2.0 devices, and set the sequence number to zero for USB 3.0 devices. The xHCI urb_enqueue will accept new URBs while the endpoint is halted, and will queue them to the hardware rings. However, the endpoint doorbell will not be rung until the Reset Endpoint Command completes. Don't queue a reset endpoint command for root hubs. khubd clears halt conditions on the roothub during the initialization process, but the roothub isn't a real device, so the xHCI host controller doesn't need to know about the cleared halt. 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.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8936eeb5588b..cde648a524f5 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -848,8 +848,8 @@ union xhci_trb {
848#define TRB_CONFIG_EP 12 848#define TRB_CONFIG_EP 12
849/* Evaluate Context Command */ 849/* Evaluate Context Command */
850#define TRB_EVAL_CONTEXT 13 850#define TRB_EVAL_CONTEXT 13
851/* Reset Transfer Ring Command */ 851/* Reset Endpoint Command */
852#define TRB_RESET_RING 14 852#define TRB_RESET_EP 14
853/* Stop Transfer Ring Command */ 853/* Stop Transfer Ring Command */
854#define TRB_STOP_RING 15 854#define TRB_STOP_RING 15
855/* Set Transfer Ring Dequeue Pointer Command */ 855/* Set Transfer Ring Dequeue Pointer Command */
@@ -929,6 +929,7 @@ struct xhci_ring {
929 unsigned int cancels_pending; 929 unsigned int cancels_pending;
930 unsigned int state; 930 unsigned int state;
931#define SET_DEQ_PENDING (1 << 0) 931#define SET_DEQ_PENDING (1 << 0)
932#define EP_HALTED (1 << 1)
932 /* The TRB that was last reported in a stopped endpoint ring */ 933 /* The TRB that was last reported in a stopped endpoint ring */
933 union xhci_trb *stopped_trb; 934 union xhci_trb *stopped_trb;
934 struct xhci_td *stopped_td; 935 struct xhci_td *stopped_td;
@@ -1128,6 +1129,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
1128int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status); 1129int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
1129int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1130int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1130int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1131int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1132void xhci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
1131int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1133int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1132void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1134void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1133 1135
@@ -1148,6 +1150,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1148 int slot_id, unsigned int ep_index); 1150 int slot_id, unsigned int ep_index);
1149int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1151int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1150 u32 slot_id); 1152 u32 slot_id);
1153int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1154 unsigned int ep_index);
1151 1155
1152/* xHCI roothub code */ 1156/* xHCI roothub code */
1153int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1157int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,