Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Dec 2010 12:02:15 -0500 (EST)
From:      "Brian J. McGovern" <mcgovern@spoon.beta.com>
To:        questions@freebsd.org
Subject:   USB Stack/# of bytes to read?
Message-ID:  <201012071702.oB7H2F03002972@spoon.beta.com>

next in thread | raw e-mail | index | archive | help
All,

  I have a couple of quick questions about the USB stack in 8.x that I'm hoping
someone with a bit more experience than I can answer.

  I am currently working on a device driver for a Velleman K8055 board. 
Basically, it does digital and analog I/O under the control of a PC via USB. 
I've got the basic driver working fine, and I'm moving data back and forth 
without issue.

  What I'd like to be able to do, however, is poll the driver to see how much
data is sitting in the input buffer, or at least see how many packet/buffers
are waiting. Looking through the control structures, it appears that something
like sc->fifo.fp[USB_FIFO_TX]->used_q.ifq_len would be the right field, but it
never appears to be set anywhere (and is always 0). Using something like 
USB_IF_POLL() on the used_q suggests there is something to write, but not how
much.

  On a similar line of thinking, how about flushing the queue entirely? Should
I call usb_fifo_reset() directly? Or should I just reimplement the logic?

  -B



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012071702.oB7H2F03002972>