diff options
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index fb99c8379142..91074fdab3eb 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1223,10 +1223,7 @@ union xhci_trb { | |||
1223 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ | 1223 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ |
1224 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) | 1224 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) |
1225 | #define SEGMENT_SIZE (TRBS_PER_SEGMENT*16) | 1225 | #define SEGMENT_SIZE (TRBS_PER_SEGMENT*16) |
1226 | /* SEGMENT_SHIFT should be log2(SEGMENT_SIZE). | 1226 | #define SEGMENT_SHIFT (__ffs(SEGMENT_SIZE)) |
1227 | * Change this if you change TRBS_PER_SEGMENT! | ||
1228 | */ | ||
1229 | #define SEGMENT_SHIFT 10 | ||
1230 | /* TRB buffer pointers can't cross 64KB boundaries */ | 1227 | /* TRB buffer pointers can't cross 64KB boundaries */ |
1231 | #define TRB_MAX_BUFF_SHIFT 16 | 1228 | #define TRB_MAX_BUFF_SHIFT 16 |
1232 | #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) | 1229 | #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) |
@@ -1253,8 +1250,19 @@ struct xhci_dequeue_state { | |||
1253 | int new_cycle_state; | 1250 | int new_cycle_state; |
1254 | }; | 1251 | }; |
1255 | 1252 | ||
1253 | enum xhci_ring_type { | ||
1254 | TYPE_CTRL = 0, | ||
1255 | TYPE_ISOC, | ||
1256 | TYPE_BULK, | ||
1257 | TYPE_INTR, | ||
1258 | TYPE_STREAM, | ||
1259 | TYPE_COMMAND, | ||
1260 | TYPE_EVENT, | ||
1261 | }; | ||
1262 | |||
1256 | struct xhci_ring { | 1263 | struct xhci_ring { |
1257 | struct xhci_segment *first_seg; | 1264 | struct xhci_segment *first_seg; |
1265 | struct xhci_segment *last_seg; | ||
1258 | union xhci_trb *enqueue; | 1266 | union xhci_trb *enqueue; |
1259 | struct xhci_segment *enq_seg; | 1267 | struct xhci_segment *enq_seg; |
1260 | unsigned int enq_updates; | 1268 | unsigned int enq_updates; |
@@ -1269,6 +1277,10 @@ struct xhci_ring { | |||
1269 | */ | 1277 | */ |
1270 | u32 cycle_state; | 1278 | u32 cycle_state; |
1271 | unsigned int stream_id; | 1279 | unsigned int stream_id; |
1280 | unsigned int num_segs; | ||
1281 | unsigned int num_trbs_free; | ||
1282 | unsigned int num_trbs_free_temp; | ||
1283 | enum xhci_ring_type type; | ||
1272 | bool last_td_was_short; | 1284 | bool last_td_was_short; |
1273 | }; | 1285 | }; |
1274 | 1286 | ||
@@ -1344,6 +1356,7 @@ struct xhci_bus_state { | |||
1344 | /* ports suspend status arrays - max 31 ports for USB2, 15 for USB3 */ | 1356 | /* ports suspend status arrays - max 31 ports for USB2, 15 for USB3 */ |
1345 | u32 port_c_suspend; | 1357 | u32 port_c_suspend; |
1346 | u32 suspended_ports; | 1358 | u32 suspended_ports; |
1359 | u32 port_remote_wakeup; | ||
1347 | unsigned long resume_done[USB_MAXCHILDREN]; | 1360 | unsigned long resume_done[USB_MAXCHILDREN]; |
1348 | }; | 1361 | }; |
1349 | 1362 | ||
@@ -1609,6 +1622,8 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, | |||
1609 | struct usb_device *udev, struct usb_host_endpoint *ep, | 1622 | struct usb_device *udev, struct usb_host_endpoint *ep, |
1610 | gfp_t mem_flags); | 1623 | gfp_t mem_flags); |
1611 | void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring); | 1624 | void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring); |
1625 | int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring, | ||
1626 | unsigned int num_trbs, gfp_t flags); | ||
1612 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, | 1627 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, |
1613 | struct xhci_virt_device *virt_dev, | 1628 | struct xhci_virt_device *virt_dev, |
1614 | unsigned int ep_index); | 1629 | unsigned int ep_index); |
@@ -1648,6 +1663,17 @@ static inline int xhci_register_pci(void) { return 0; } | |||
1648 | static inline void xhci_unregister_pci(void) {} | 1663 | static inline void xhci_unregister_pci(void) {} |
1649 | #endif | 1664 | #endif |
1650 | 1665 | ||
1666 | #if defined(CONFIG_USB_XHCI_PLATFORM) \ | ||
1667 | || defined(CONFIG_USB_XHCI_PLATFORM_MODULE) | ||
1668 | int xhci_register_plat(void); | ||
1669 | void xhci_unregister_plat(void); | ||
1670 | #else | ||
1671 | static inline int xhci_register_plat(void) | ||
1672 | { return 0; } | ||
1673 | static inline void xhci_unregister_plat(void) | ||
1674 | { } | ||
1675 | #endif | ||
1676 | |||
1651 | /* xHCI host controller glue */ | 1677 | /* xHCI host controller glue */ |
1652 | typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *); | 1678 | typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *); |
1653 | void xhci_quiesce(struct xhci_hcd *xhci); | 1679 | void xhci_quiesce(struct xhci_hcd *xhci); |