On Wed, 13 Feb 2002, Roland King wrote:

>The device has interrupt endpoints. I see special transfer ioctls
>for bulk, but not interrupt. I've been assuming that I need to
>submit a usbdevfs_urb and then go and reap it. Does that sound
>about right? Is there any sample code or a good example which
>uses these functions?

Yes, you submit a BULK type usbdevfs_urb to the interrupt endpoint.
It gets one packet of data.  You can submit multiple ones that will
queue up.  and I'm guessing 'reap' is REAd Pointer, not like the grim
reaper (although maybe it is...:)

>Unrelated question, if you're writing a normal device driver and
>your device has interrupt endpoints and you submit an interrupt
>urb, will you be called each time there's an interrupt continuously
>until you unlink the urb, or do you have to resubmit it? I found one

Yes, unless you're on UHCI hardware and interval == 0.  OHCI resubmits
regardless of interval.  On UHCI, 0-interval behaves like BULK (except
for its priority).

Note you should not use interrupt type usbdevfs_urbs if your hardware
is OHCI, as OHCI will resubmit it
http://lxr.linux.no/source/drivers/usb/usb-ohci.c#L486
then you reap it
http://lxr.linux.no/source/drivers/usb/devio.c#L978
which frees the URB (part of the struct async)
http://lxr.linux.no/source/drivers/usb/devio.c#L188
and then bad things happen (kernel accessing freed memory).


-- 
Dan Streetman
[EMAIL PROTECTED]
--------------------------------------------------
186,282 miles per second:
It isn't just a good idea, it's the law!


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

Reply via email to