diff options
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 7f127df6dd55..711de253bc0f 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -644,6 +644,9 @@ struct xhci_ep_ctx { | |||
644 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) | 644 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) |
645 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) | 645 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) |
646 | 646 | ||
647 | /* deq bitmasks */ | ||
648 | #define EP_CTX_CYCLE_MASK (1 << 0) | ||
649 | |||
647 | 650 | ||
648 | /** | 651 | /** |
649 | * struct xhci_input_control_context | 652 | * struct xhci_input_control_context |
@@ -746,6 +749,12 @@ struct xhci_virt_ep { | |||
746 | struct timer_list stop_cmd_timer; | 749 | struct timer_list stop_cmd_timer; |
747 | int stop_cmds_pending; | 750 | int stop_cmds_pending; |
748 | struct xhci_hcd *xhci; | 751 | struct xhci_hcd *xhci; |
752 | /* Dequeue pointer and dequeue segment for a submitted Set TR Dequeue | ||
753 | * command. We'll need to update the ring's dequeue segment and dequeue | ||
754 | * pointer after the command completes. | ||
755 | */ | ||
756 | struct xhci_segment *queued_deq_seg; | ||
757 | union xhci_trb *queued_deq_ptr; | ||
749 | /* | 758 | /* |
750 | * Sometimes the xHC can not process isochronous endpoint ring quickly | 759 | * Sometimes the xHC can not process isochronous endpoint ring quickly |
751 | * enough, and it will miss some isoc tds on the ring and generate | 760 | * enough, and it will miss some isoc tds on the ring and generate |
@@ -1161,8 +1170,29 @@ struct s3_save { | |||
1161 | u64 erst_dequeue; | 1170 | u64 erst_dequeue; |
1162 | }; | 1171 | }; |
1163 | 1172 | ||
1173 | struct xhci_bus_state { | ||
1174 | unsigned long bus_suspended; | ||
1175 | unsigned long next_statechange; | ||
1176 | |||
1177 | /* Port suspend arrays are indexed by the portnum of the fake roothub */ | ||
1178 | /* ports suspend status arrays - max 31 ports for USB2, 15 for USB3 */ | ||
1179 | u32 port_c_suspend; | ||
1180 | u32 suspended_ports; | ||
1181 | unsigned long resume_done[USB_MAXCHILDREN]; | ||
1182 | }; | ||
1183 | |||
1184 | static inline unsigned int hcd_index(struct usb_hcd *hcd) | ||
1185 | { | ||
1186 | if (hcd->speed == HCD_USB3) | ||
1187 | return 0; | ||
1188 | else | ||
1189 | return 1; | ||
1190 | } | ||
1191 | |||
1164 | /* There is one ehci_hci structure per controller */ | 1192 | /* There is one ehci_hci structure per controller */ |
1165 | struct xhci_hcd { | 1193 | struct xhci_hcd { |
1194 | struct usb_hcd *main_hcd; | ||
1195 | struct usb_hcd *shared_hcd; | ||
1166 | /* glue to PCI and HCD framework */ | 1196 | /* glue to PCI and HCD framework */ |
1167 | struct xhci_cap_regs __iomem *cap_regs; | 1197 | struct xhci_cap_regs __iomem *cap_regs; |
1168 | struct xhci_op_regs __iomem *op_regs; | 1198 | struct xhci_op_regs __iomem *op_regs; |
@@ -1224,9 +1254,6 @@ struct xhci_hcd { | |||
1224 | /* Host controller watchdog timer structures */ | 1254 | /* Host controller watchdog timer structures */ |
1225 | unsigned int xhc_state; | 1255 | unsigned int xhc_state; |
1226 | 1256 | ||
1227 | unsigned long bus_suspended; | ||
1228 | unsigned long next_statechange; | ||
1229 | |||
1230 | u32 command; | 1257 | u32 command; |
1231 | struct s3_save s3; | 1258 | struct s3_save s3; |
1232 | /* Host controller is dying - not responding to commands. "I'm not dead yet!" | 1259 | /* Host controller is dying - not responding to commands. "I'm not dead yet!" |
@@ -1242,18 +1269,15 @@ struct xhci_hcd { | |||
1242 | * There are no reports of xHCI host controllers that display this issue. | 1269 | * There are no reports of xHCI host controllers that display this issue. |
1243 | */ | 1270 | */ |
1244 | #define XHCI_STATE_DYING (1 << 0) | 1271 | #define XHCI_STATE_DYING (1 << 0) |
1272 | #define XHCI_STATE_HALTED (1 << 1) | ||
1245 | /* Statistics */ | 1273 | /* Statistics */ |
1246 | int noops_submitted; | ||
1247 | int noops_handled; | ||
1248 | int error_bitmask; | 1274 | int error_bitmask; |
1249 | unsigned int quirks; | 1275 | unsigned int quirks; |
1250 | #define XHCI_LINK_TRB_QUIRK (1 << 0) | 1276 | #define XHCI_LINK_TRB_QUIRK (1 << 0) |
1251 | #define XHCI_RESET_EP_QUIRK (1 << 1) | 1277 | #define XHCI_RESET_EP_QUIRK (1 << 1) |
1252 | #define XHCI_NEC_HOST (1 << 2) | 1278 | #define XHCI_NEC_HOST (1 << 2) |
1253 | u32 port_c_suspend[8]; /* port suspend change*/ | 1279 | /* There are two roothubs to keep track of bus suspend info for */ |
1254 | u32 suspended_ports[8]; /* which ports are | 1280 | struct xhci_bus_state bus_state[2]; |
1255 | suspended */ | ||
1256 | unsigned long resume_done[MAX_HC_PORTS]; | ||
1257 | /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */ | 1281 | /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */ |
1258 | u8 *port_array; | 1282 | u8 *port_array; |
1259 | /* Array of pointers to USB 3.0 PORTSC registers */ | 1283 | /* Array of pointers to USB 3.0 PORTSC registers */ |
@@ -1264,18 +1288,15 @@ struct xhci_hcd { | |||
1264 | unsigned int num_usb2_ports; | 1288 | unsigned int num_usb2_ports; |
1265 | }; | 1289 | }; |
1266 | 1290 | ||
1267 | /* For testing purposes */ | ||
1268 | #define NUM_TEST_NOOPS 0 | ||
1269 | |||
1270 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ | 1291 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ |
1271 | static inline struct xhci_hcd *hcd_to_xhci(struct usb_hcd *hcd) | 1292 | static inline struct xhci_hcd *hcd_to_xhci(struct usb_hcd *hcd) |
1272 | { | 1293 | { |
1273 | return (struct xhci_hcd *) (hcd->hcd_priv); | 1294 | return *((struct xhci_hcd **) (hcd->hcd_priv)); |
1274 | } | 1295 | } |
1275 | 1296 | ||
1276 | static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) | 1297 | static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) |
1277 | { | 1298 | { |
1278 | return container_of((void *) xhci, struct usb_hcd, hcd_priv); | 1299 | return xhci->main_hcd; |
1279 | } | 1300 | } |
1280 | 1301 | ||
1281 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING | 1302 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING |
@@ -1471,7 +1492,6 @@ struct xhci_segment *trb_in_td(struct xhci_segment *start_seg, | |||
1471 | dma_addr_t suspect_dma); | 1492 | dma_addr_t suspect_dma); |
1472 | int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code); | 1493 | int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code); |
1473 | void xhci_ring_cmd_db(struct xhci_hcd *xhci); | 1494 | void xhci_ring_cmd_db(struct xhci_hcd *xhci); |
1474 | void *xhci_setup_one_noop(struct xhci_hcd *xhci); | ||
1475 | int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id); | 1495 | int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id); |
1476 | int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, | 1496 | int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, |
1477 | u32 slot_id); | 1497 | u32 slot_id); |
@@ -1525,7 +1545,8 @@ int xhci_bus_resume(struct usb_hcd *hcd); | |||
1525 | #endif /* CONFIG_PM */ | 1545 | #endif /* CONFIG_PM */ |
1526 | 1546 | ||
1527 | u32 xhci_port_state_to_neutral(u32 state); | 1547 | u32 xhci_port_state_to_neutral(u32 state); |
1528 | int xhci_find_slot_id_by_port(struct xhci_hcd *xhci, u16 port); | 1548 | int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, |
1549 | u16 port); | ||
1529 | void xhci_ring_device(struct xhci_hcd *xhci, int slot_id); | 1550 | void xhci_ring_device(struct xhci_hcd *xhci, int slot_id); |
1530 | 1551 | ||
1531 | /* xHCI contexts */ | 1552 | /* xHCI contexts */ |