From b008df60c6369ba0290fa7daa177375407a12e07 Mon Sep 17 00:00:00 2001 From: Andiry Xu Date: Mon, 5 Mar 2012 17:49:34 +0800 Subject: 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 Signed-off-by: Sarah Sharp Tested-by: Paul Zimmerman --- drivers/usb/host/xhci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/usb/host/xhci.h') 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; }; -- cgit v1.2.3