summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorAndiry Xu <andiry.xu@amd.com>2012-03-05 13:49:34 +0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2012-03-13 20:29:55 +0400
commitb008df60c6369ba0290fa7daa177375407a12e07 (patch)
tree05a59c4a4d8d624b18ad0844949841f36b241c17 /drivers/usb/host/xhci.h
parent3fe4fe083d3355537565b2b0a678807513dfa013 (diff)
downloadlinux-b008df60c6369ba0290fa7daa177375407a12e07.tar.xz
xHCI: count free TRBs on transfer ring
In the past, the room_on_ring() check was implemented by walking all over the ring, which is wasteful and complicated. Count the number of free TRBs instead. The free TRBs number should be updated when enqueue/dequeue pointer is updated, or upon the completion of a set dequeue pointer command. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 2337a8e80b60..ea8fc237d158 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1278,6 +1278,8 @@ struct xhci_ring {
u32 cycle_state;
unsigned int stream_id;
unsigned int num_segs;
+ unsigned int num_trbs_free;
+ unsigned int num_trbs_free_temp;
enum xhci_ring_type type;
bool last_td_was_short;
};