/* Generic function for queueing a TRB on a ring. The caller must have checked to make sure there's room on the ring. */
static struct xhci_generic_trb* queue_trb(struct xhci_ctrl *ctrl, struct xhci_ring *ring, bool more_trbs_coming, unsigned int *trb_fields)
/* Generic function for queueing a TRB on a ring. The caller must have checked to make sure there's room on the ring. */
static struct xhci_generic_trb* queue_trb(struct xhci_ctrl *ctrl, struct xhci_ring *ring, bool more_trbs_coming, unsigned int *trb_fields)
{
	struct xhci_generic_trb *trb;
	int i;
	trb = &ring->enqueue->generic;
	for (i = 0; i < 4; i++)
		trb->field[i] = cpu_to_le32(trb_fields[i]);
	xhci_flush_cache((uintptr_t)trb, sizeof(struct xhci_generic_trb));
	inc_enq(ctrl, ring, more_trbs_coming);
	return trb;
}