Store the ring's last segment pointer and number of segments for ring expansion usage. Signed-off-by: Andiry Xu <andiry.xu@xxxxxxx> --- drivers/usb/host/xhci-mem.c | 2 ++ drivers/usb/host/xhci.h | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index c4a2e5e..7ebf897 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -164,6 +164,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, if (!ring) return NULL; + ring->num_segs = num_segs; INIT_LIST_HEAD(&ring->td_list); if (num_segs == 0) return ring; @@ -186,6 +187,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, num_segs--; } xhci_link_segments(xhci, prev, ring->first_seg, link_trbs, isoc); + ring->last_seg = prev; if (link_trbs) { /* See section 4.9.2.1 and 6.4.4.1 */ diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 2d4b665..df7407e 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1130,6 +1130,7 @@ struct xhci_dequeue_state { struct xhci_ring { struct xhci_segment *first_seg; + struct xhci_segment *last_seg; union xhci_trb *enqueue; struct xhci_segment *enq_seg; unsigned int enq_updates; @@ -1144,6 +1145,7 @@ struct xhci_ring { */ u32 cycle_state; unsigned int stream_id; + unsigned int num_segs; bool last_td_was_short; }; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html