Changeset 2bff2cc2 in mainline for uspace/drv/bus/usb/xhci/trb_ring.h


Ignore:
Timestamp:
2018-01-18T14:00:57Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c0564c
Parents:
0f79283b
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-18 13:30:15)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-18 14:00:57)
Message:

xhci: implement sw trb ring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/trb_ring.h

    r0f79283b r2bff2cc2  
    119119int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);
    120120
     121/**
     122 * A TRB ring of which the software is both consumer and provider.
     123 */
     124typedef struct xhci_sw_ring {
     125        xhci_trb_t *begin, *end;
     126        xhci_trb_t *enqueue, *dequeue;
     127
     128        fibril_mutex_t guard;
     129        fibril_condvar_t enqueued_cv, dequeued_cv;
     130
     131        bool running;
     132} xhci_sw_ring_t;
     133
     134void xhci_sw_ring_init(xhci_sw_ring_t *, size_t);
     135
     136/* Both may block if the ring is full/empty. */
     137int xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *);
     138int xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *);
     139
     140void xhci_sw_ring_stop(xhci_sw_ring_t *);
     141void xhci_sw_ring_fini(xhci_sw_ring_t *);
     142
    121143#endif
     144
     145/**
     146 * @}
     147 */
Note: See TracChangeset for help on using the changeset viewer.