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.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 6c7e3430ec93..34a60d9f056a 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -720,6 +720,14 @@ struct xhci_virt_ep {
720 struct timer_list stop_cmd_timer; 720 struct timer_list stop_cmd_timer;
721 int stop_cmds_pending; 721 int stop_cmds_pending;
722 struct xhci_hcd *xhci; 722 struct xhci_hcd *xhci;
723 /*
724 * Sometimes the xHC can not process isochronous endpoint ring quickly
725 * enough, and it will miss some isoc tds on the ring and generate
726 * a Missed Service Error Event.
727 * Set skip flag when receive a Missed Service Error Event and
728 * process the missed tds on the endpoint ring.
729 */
730 bool skip;
723}; 731};
724 732
725struct xhci_virt_device { 733struct xhci_virt_device {
@@ -911,6 +919,9 @@ struct xhci_event_cmd {
911/* Control transfer TRB specific fields */ 919/* Control transfer TRB specific fields */
912#define TRB_DIR_IN (1<<16) 920#define TRB_DIR_IN (1<<16)
913 921
922/* Isochronous TRB specific fields */
923#define TRB_SIA (1<<31)
924
914struct xhci_generic_trb { 925struct xhci_generic_trb {
915 u32 field[4]; 926 u32 field[4];
916}; 927};
@@ -1082,6 +1093,12 @@ struct xhci_scratchpad {
1082 dma_addr_t *sp_dma_buffers; 1093 dma_addr_t *sp_dma_buffers;
1083}; 1094};
1084 1095
1096struct urb_priv {
1097 int length;
1098 int td_cnt;
1099 struct xhci_td *td[0];
1100};
1101
1085/* 1102/*
1086 * Each segment table entry is 4*32bits long. 1K seems like an ok size: 1103 * Each segment table entry is 4*32bits long. 1K seems like an ok size:
1087 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, 1104 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table,
@@ -1130,7 +1147,7 @@ struct xhci_hcd {
1130 int page_size; 1147 int page_size;
1131 /* Valid values are 12 to 20, inclusive */ 1148 /* Valid values are 12 to 20, inclusive */
1132 int page_shift; 1149 int page_shift;
1133 /* only one MSI vector for now, but might need more later */ 1150 /* msi-x vectors */
1134 int msix_count; 1151 int msix_count;
1135 struct msix_entry *msix_entries; 1152 struct msix_entry *msix_entries;
1136 /* data structures */ 1153 /* data structures */
@@ -1327,11 +1344,6 @@ void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci,
1327struct xhci_ring *xhci_dma_to_transfer_ring( 1344struct xhci_ring *xhci_dma_to_transfer_ring(
1328 struct xhci_virt_ep *ep, 1345 struct xhci_virt_ep *ep,
1329 u64 address); 1346 u64 address);
1330struct xhci_ring *xhci_urb_to_transfer_ring(struct xhci_hcd *xhci,
1331 struct urb *urb);
1332struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci,
1333 unsigned int slot_id, unsigned int ep_index,
1334 unsigned int stream_id);
1335struct xhci_ring *xhci_stream_id_to_ring( 1347struct xhci_ring *xhci_stream_id_to_ring(
1336 struct xhci_virt_device *dev, 1348 struct xhci_virt_device *dev,
1337 unsigned int ep_index, 1349 unsigned int ep_index,
@@ -1339,6 +1351,7 @@ struct xhci_ring *xhci_stream_id_to_ring(
1339struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, 1351struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
1340 bool allocate_in_ctx, bool allocate_completion, 1352 bool allocate_in_ctx, bool allocate_completion,
1341 gfp_t mem_flags); 1353 gfp_t mem_flags);
1354void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv);
1342void xhci_free_command(struct xhci_hcd *xhci, 1355void xhci_free_command(struct xhci_hcd *xhci,
1343 struct xhci_command *command); 1356 struct xhci_command *command);
1344 1357
@@ -1358,6 +1371,7 @@ void xhci_stop(struct usb_hcd *hcd);
1358void xhci_shutdown(struct usb_hcd *hcd); 1371void xhci_shutdown(struct usb_hcd *hcd);
1359int xhci_get_frame(struct usb_hcd *hcd); 1372int xhci_get_frame(struct usb_hcd *hcd);
1360irqreturn_t xhci_irq(struct usb_hcd *hcd); 1373irqreturn_t xhci_irq(struct usb_hcd *hcd);
1374irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd);
1361int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev); 1375int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev);
1362void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev); 1376void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev);
1363int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev, 1377int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
@@ -1386,8 +1400,6 @@ struct xhci_segment *trb_in_td(struct xhci_segment *start_seg,
1386int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code); 1400int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code);
1387void xhci_ring_cmd_db(struct xhci_hcd *xhci); 1401void xhci_ring_cmd_db(struct xhci_hcd *xhci);
1388void *xhci_setup_one_noop(struct xhci_hcd *xhci); 1402void *xhci_setup_one_noop(struct xhci_hcd *xhci);
1389void xhci_handle_event(struct xhci_hcd *xhci);
1390void xhci_set_hc_event_deq(struct xhci_hcd *xhci);
1391int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id); 1403int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id);
1392int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1404int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1393 u32 slot_id); 1405 u32 slot_id);
@@ -1401,6 +1413,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1401 int slot_id, unsigned int ep_index); 1413 int slot_id, unsigned int ep_index);
1402int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, 1414int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1403 int slot_id, unsigned int ep_index); 1415 int slot_id, unsigned int ep_index);
1416int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
1417 struct urb *urb, int slot_id, unsigned int ep_index);
1404int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1418int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1405 u32 slot_id, bool command_must_succeed); 1419 u32 slot_id, bool command_must_succeed);
1406int xhci_queue_evaluate_context(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1420int xhci_queue_evaluate_context(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,