diff options
author | Andiry Xu <andiry.xu@amd.com> | 2010-07-22 18:23:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 17:35:41 -0400 |
commit | 8e51adccd4c4b9ffcd509d7f2afce0a906139f75 (patch) | |
tree | ddd035c4775db7f504878574d3925f5bf4c87ccd /drivers/usb/host/xhci.h | |
parent | d18240db797ed749b511b8dc910c5dcf08be46d6 (diff) |
USB: xHCI: Introduce urb_priv structure
Add urb_priv data structure to xHCI driver. This structure allows multiple
xhci TDs to be linked to one urb, which is essential for isochronous
transfer. For non-isochronous urb, only one TD is needed for one urb;
for isochronous urb, the TD number for the urb is equal to
urb->number_of_packets.
The length field of urb_priv indicates the number of TDs in the urb.
The td_cnt field indicates the number of TDs already processed by xHC.
When td_cnt matches length, the urb can be given back to usbcore.
When an urb is dequeued or cancelled, add all the unprocessed TDs to the
endpoint's cancelled_td_list. When process a cancelled TD, increase
td_cnt field. When td_cnt equals urb_priv->length, giveback the
cancelled urb.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
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.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index f4dfb26a65aa..ebf62082950b 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1090,6 +1090,12 @@ struct xhci_scratchpad { | |||
1090 | dma_addr_t *sp_dma_buffers; | 1090 | dma_addr_t *sp_dma_buffers; |
1091 | }; | 1091 | }; |
1092 | 1092 | ||
1093 | struct urb_priv { | ||
1094 | int length; | ||
1095 | int td_cnt; | ||
1096 | struct xhci_td *td[0]; | ||
1097 | }; | ||
1098 | |||
1093 | /* | 1099 | /* |
1094 | * Each segment table entry is 4*32bits long. 1K seems like an ok size: | 1100 | * Each segment table entry is 4*32bits long. 1K seems like an ok size: |
1095 | * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, | 1101 | * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, |
@@ -1347,6 +1353,7 @@ struct xhci_ring *xhci_stream_id_to_ring( | |||
1347 | struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, | 1353 | struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, |
1348 | bool allocate_in_ctx, bool allocate_completion, | 1354 | bool allocate_in_ctx, bool allocate_completion, |
1349 | gfp_t mem_flags); | 1355 | gfp_t mem_flags); |
1356 | void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv); | ||
1350 | void xhci_free_command(struct xhci_hcd *xhci, | 1357 | void xhci_free_command(struct xhci_hcd *xhci, |
1351 | struct xhci_command *command); | 1358 | struct xhci_command *command); |
1352 | 1359 | ||