USB device driver question: timeout() and usbd_do_request()

Rita Lin ritalin at comcast.net
Mon May 3 13:49:30 PDT 2004


> But I don't understand the whole issue you have.
> Just schedule a request and wait for the device to ack.
> The Host controller does the polling for you as long as the request is
> queued and the timeout value supplied with the request did not time out.
> That has nothing to do with FreeBSD - it's how things work with USB in
> general.
I needed a "task" or a timer that periodicaly polls the modem status from
the USB device.
I think you meant the timeout value inside the usbd_do_request(). I needed
something that
periodically calls usbd_do_request().

The mention of FreeBSD device polling was something I found on the Web. The
FreeBSD allows network driver to do polling instead of interrupt. The
implementation requires the first interrupt from the device in order to
register the callback for the polling. When I first saw the device polling
support in FreeBSD, I thought I could call usbd_do_request() in the callback
routine. I was wrong.

Mike Silbersack suggested the use of kthread. I added it today, tested it
out, and it works. Thanks, Mike!

By the way, for people who are writing USB drivers that uses ucom support,
you do not need to modify ucom.c to support multiple ports. By doing a trick
in declaring xxx_softc, I was able to create 4 ucom ports with one single
physical device.

Rita
>
> --
> B.Walter                   BWCT                http://www.bwct.de
> bernd at bwct.de                                  info at bwct.de
>



More information about the freebsd-hackers mailing list