On Fri, Jun 15, 2001 at 03:58:47PM +0100, Jerram, Simon wrote:
>
> Sorry if I've sounded a bit frustrated. Anyway, thanks for the
> help so far, I'm getting closer...
>
> I'd like to ask about URBs, in particular the use of URBs for interrupts.
>
> I've seen two ways of dealing with the allocation. The first is to
> put a URB into the device driver structure, kmalloc an instance
> of this structure for the device in the probe function, then pass
> a pointer to this URB to FILL_INT_URB .
>
> The other is to put a pointer to a URB in the driver structure, to
> allocate a URB using the normal commands, and point the pointer at
> this URB. Then put the pointer as the first argument of
> the FILL_INT_URB macro.
The 'official' way is usb_alloc_urb(). However any URB that is
kmalloc()ed either via usb_alloc_urb(), or via kmalloc or being a part
of a larger structure is OK and will work.
Urbs on the stack or allocated via other means may or may not work on
various architectures.
> Is there a best practice for this or does it depend on what
> I'm trying to do? Also the bluetooth driver submits its
> Interrupt URB, should I be doing this, or is calling
> FILL_INT_URB suffcient.
Of course you'll need to submit the URB if you do want it to do
anything. The FILL* macros just set the most commonly used fields in the
urb struct.
--
Vojtech Pavlik
SuSE Labs
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel