aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index a7181b491e67..73e5db3e89c9 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -269,6 +269,10 @@ struct xhci_op_regs {
269 * A read gives the current link PM state of the port, 269 * A read gives the current link PM state of the port,
270 * a write with Link State Write Strobe set sets the link state. 270 * a write with Link State Write Strobe set sets the link state.
271 */ 271 */
272#define PORT_PLS_MASK (0xf << 5)
273#define XDEV_U0 (0x0 << 5)
274#define XDEV_U3 (0x3 << 5)
275#define XDEV_RESUME (0xf << 5)
272/* true: port has power (see HCC_PPC) */ 276/* true: port has power (see HCC_PPC) */
273#define PORT_POWER (1 << 9) 277#define PORT_POWER (1 << 9)
274/* bits 10:13 indicate device speed: 278/* bits 10:13 indicate device speed:
@@ -510,6 +514,7 @@ struct xhci_slot_ctx {
510#define MAX_EXIT (0xffff) 514#define MAX_EXIT (0xffff)
511/* Root hub port number that is needed to access the USB device */ 515/* Root hub port number that is needed to access the USB device */
512#define ROOT_HUB_PORT(p) (((p) & 0xff) << 16) 516#define ROOT_HUB_PORT(p) (((p) & 0xff) << 16)
517#define DEVINFO_TO_ROOT_HUB_PORT(p) (((p) >> 16) & 0xff)
513/* Maximum number of ports under a hub device */ 518/* Maximum number of ports under a hub device */
514#define XHCI_MAX_PORTS(p) (((p) & 0xff) << 24) 519#define XHCI_MAX_PORTS(p) (((p) & 0xff) << 24)
515 520
@@ -754,6 +759,7 @@ struct xhci_virt_device {
754 /* Status of the last command issued for this device */ 759 /* Status of the last command issued for this device */
755 u32 cmd_status; 760 u32 cmd_status;
756 struct list_head cmd_list; 761 struct list_head cmd_list;
762 u8 port;
757}; 763};
758 764
759 765
@@ -884,6 +890,10 @@ struct xhci_event_cmd {
884#define TRB_TO_EP_INDEX(p) ((((p) & (0x1f << 16)) >> 16) - 1) 890#define TRB_TO_EP_INDEX(p) ((((p) & (0x1f << 16)) >> 16) - 1)
885#define EP_ID_FOR_TRB(p) ((((p) + 1) & 0x1f) << 16) 891#define EP_ID_FOR_TRB(p) ((((p) + 1) & 0x1f) << 16)
886 892
893#define SUSPEND_PORT_FOR_TRB(p) (((p) & 1) << 23)
894#define TRB_TO_SUSPEND_PORT(p) (((p) & (1 << 23)) >> 23)
895#define LAST_EP_INDEX 30
896
887/* Set TR Dequeue Pointer command TRB fields */ 897/* Set TR Dequeue Pointer command TRB fields */
888#define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16)) 898#define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16))
889#define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16) 899#define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16)
@@ -1202,6 +1212,9 @@ struct xhci_hcd {
1202#define XHCI_LINK_TRB_QUIRK (1 << 0) 1212#define XHCI_LINK_TRB_QUIRK (1 << 0)
1203#define XHCI_RESET_EP_QUIRK (1 << 1) 1213#define XHCI_RESET_EP_QUIRK (1 << 1)
1204#define XHCI_NEC_HOST (1 << 2) 1214#define XHCI_NEC_HOST (1 << 2)
1215 u32 port_c_suspend[8]; /* port suspend change*/
1216 u32 suspended_ports[8]; /* which ports are
1217 suspended */
1205}; 1218};
1206 1219
1207/* For testing purposes */ 1220/* For testing purposes */
@@ -1409,7 +1422,7 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1409int xhci_queue_vendor_command(struct xhci_hcd *xhci, 1422int xhci_queue_vendor_command(struct xhci_hcd *xhci,
1410 u32 field1, u32 field2, u32 field3, u32 field4); 1423 u32 field1, u32 field2, u32 field3, u32 field4);
1411int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id, 1424int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
1412 unsigned int ep_index); 1425 unsigned int ep_index, int suspend);
1413int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, 1426int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1414 int slot_id, unsigned int ep_index); 1427 int slot_id, unsigned int ep_index);
1415int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, 1428int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
@@ -1439,6 +1452,8 @@ void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci,
1439 unsigned int slot_id, unsigned int ep_index, 1452 unsigned int slot_id, unsigned int ep_index,
1440 struct xhci_dequeue_state *deq_state); 1453 struct xhci_dequeue_state *deq_state);
1441void xhci_stop_endpoint_command_watchdog(unsigned long arg); 1454void xhci_stop_endpoint_command_watchdog(unsigned long arg);
1455void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
1456 unsigned int ep_index, unsigned int stream_id);
1442 1457
1443/* xHCI roothub code */ 1458/* xHCI roothub code */
1444int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1459int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,