[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OHCI/usb pass through
From: |
Gerd Hoffmann |
Subject: |
Re: OHCI/usb pass through |
Date: |
Fri, 1 Oct 2021 14:22:00 +0200 |
Hi,
> > > We can get the endpoint from a packet and from ohci so
> > > I wonder if we can get the active packet from ep->queue (and how to do
> > > that)
> >
> > I think ohci never looks beyond the active td so there should never be
> > more than one packet on the list.
>
> OK, how to get the packet from that QTAILQ list? If there are multiple
> packets is the active one first or last? How to get that? I could try to
> find the answers in the code but I realy did not want to spend much time
> with it just trying to help Howard so I'd like to ask for some help with
> this.
See include/qemu/queue.h, QTAILQ_FIRST() is what you need. Returns NULL
when the queue is empty. There is also a separate QLIST_EMPTY() helper.
grepping in hw/usb/*.c should find you code examples in other host
adapters code.
take care,
Gerd