Changeset 708d8fcd in mainline for uspace/drv/bus/usb/xhci/endpoint.h


Ignore:
Timestamp:
2018-01-10T00:46:29Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f92f6b1
Parents:
4793023
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-09 19:26:55)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-10 00:46:29)
Message:

xhci: rewritten isochronous transfers

There was a fundamental problem with relying on hardware to send
RING_OVERRUN/UNDERRUN events, which QEMU (and possibly others) do not
send. That resulted in not knowing if the transfer is still on schedule,
and having to ring the doorbell every time. That is not feasible,
because then the transfer can be more frequent than it should be.
Furthermore, it ignored the fact that isochronous TRBs are to be
scheduled not too late, but also not too soon (see 4.11.2.5 of the xHCI
spec).

Now, scheduling the TRBs to hardware is called feeding, and can be
delayed by setting a timer. Ring overruns/underruns are detected also at
the end of handling an event.

File:
1 edited

Legend:

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

    r4793023 r708d8fcd  
    4545#include <ddf/driver.h>
    4646
     47#include "isoch.h"
     48#include "transfers.h"
    4749#include "trb_ring.h"
    48 
    49 #include "transfers.h"
    5050
    5151typedef struct xhci_device xhci_device_t;
     
    9494
    9595        /** This field is a valid pointer for (and only for) isochronous transfers. */
    96         struct {
    97                 /** The maximum size of an isochronous transfer and therefore the size of buffers */
    98                 size_t max_size;
    99 
    100                 /** Isochronous scheduled transfers with respective buffers */
    101                 #define XHCI_ISOCH_BUFFER_COUNT 4
    102                 xhci_isoch_transfer_t transfers[XHCI_ISOCH_BUFFER_COUNT];
    103 
    104                 /** Indices to transfers */
    105                 size_t dequeue, enqueue;
    106 
    107                 /** Are isochronous transfers started? */
    108                 bool started;
    109 
    110                 /** Protects common buffers. */
    111                 fibril_mutex_t guard;
    112 
    113                 /** Signals filled buffer. */
    114                 fibril_condvar_t avail;
    115         } isoch [0];
     96        xhci_isoch_t isoch [0];
    11697} xhci_endpoint_t;
    11798
Note: See TracChangeset for help on using the changeset viewer.