/* Does this link TRB point to the first segment in a ring, or was the previous TRB the last TRB on the last segment in the ERST? */
static bool last_trb_on_last_seg(struct xhci_ctrl *ctrl, struct xhci_ring *ring, struct xhci_segment *seg, union xhci_trb *trb)
/* Does this link TRB point to the first segment in a ring, or was the previous TRB the last TRB on the last segment in the ERST? */
static bool last_trb_on_last_seg(struct xhci_ctrl *ctrl, struct xhci_ring *ring, struct xhci_segment *seg, union xhci_trb *trb)
{
	if (ring == ctrl->event_ring)
		return ((trb == &seg->trbs[TRBS_PER_SEGMENT]) &&
			(seg->next == ring->first_seg));
	else
		return le32_to_cpu(trb->link.control) & LINK_TOGGLE;
}