xHCI: store ring's last segment and segment numbers

Store the ring's last segment pointer and number of segments for ring
expansion usage.

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>
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 1699df9..bdea4de 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -154,6 +154,7 @@
 	if (!ring)
 		return NULL;
 
+	ring->num_segs = num_segs;
 	INIT_LIST_HEAD(&ring->td_list);
 	ring->type = type;
 	if (num_segs == 0)
@@ -177,6 +178,7 @@
 		num_segs--;
 	}
 	xhci_link_segments(xhci, prev, ring->first_seg, type);
+	ring->last_seg = prev;
 
 	/* Only event ring does not use link TRB */
 	if (type != TYPE_EVENT) {