On Wed, Feb 28, 2001 at 10:01:07AM +0000, Alan Cox wrote:
> > we do this by using {u,m}delay, but we want to do this in a better way. Are
> > there any timers in the USB subsystem that we could make use of? We will
> > need a resolution in the 100us-1ms area. We have been thinking of sending
> 
> The obvious source of a 1mS interrupt would be the SOF from the USB itself,

        Revisiting this issue...

        A bit of backgroung : every now and then (link turnaround,
every 100ms), we need to kill a bit of time before sending an IrDA
packet. The other end tell us how much time it needs before beeing
ready to receive a packet, so we need to make sure to not send the
packet too early.
        As Dag said above, normal kernel timer are too coarse, and it
happen too often to be happy with mdelay() (especially that the mdelay
will impact the USB controller).

        Based on the advice of Alan, I see four options :
        1) Schedule the Tx URB in a specific USB frame. For example,
if we schedule it at (current + 5), this give us a 5ms delay.
        2) Send a NOP URB that does nothing but waste some frames. All
subsequent URB have to wait for the NOP. If the NOP span 5 frames,
this gives a 5 ms delay.
        3) Get a direct callback from the USB interrupt handler.

        I spend the day staring at the USB code (usb-uhci), and the
conclusion are :
        Number 1 is impossible : as soon as we submit a URB, the TD
are linked in the hardware, and the hardware doesn't have such
flexibility.
        Number 2 is impossible as well, for the same reason...
        Number 3 is possible, but that mean lot's of new API and
hacking all over the place. Yuck...

        The dongle has also the following pipe :
------------------------------
    Endpoint:
      bLength             =    7
      bDescriptorType     =   05
      bEndpointAddress    =   83 (in)
      bmAttributes        =   03 (Interrupt)
      wMaxPacketSize      = 0001
      bInterval           =   01
------------------------------
        Would it be possible to use this in any way ? How such pipes
are supposed to work ?

        Thanks...

        Jean

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to