On Thu, Jun 07, 2001 at 10:43:23AM +0100, Jerram, Simon wrote:
> 
> Just a bit of advice really on best practice.
> 
> I'm implementing a device where messages on the control pipe are always
> followed
> by a response.  Going through the usb.c code, usb_control_msg 
> is a legacy function for backwards compaitibilty.  I will also not
> be able to use this in the context of an interrupt from the notification
> pipe.
> 
> My question is which is best: should I use usb_control_msg where I can, or 
> should I write my own code using the appropriate usb routines
> to assign, pack, and submit urbs together with my own routine for
> dealing with the callback.

The usb_control_msg-wrappers can be used, if you don't need asynchronous
operation or availability from an interrupt context. So you don't have to
re-invent the wheel again. Usually they are taken for setting up the device
in the beginning or only "user"-driven IO. If you want it in interrupts, you
have to implement the functionality on your own. IMHO mixing synchronous and
asynchronous behavior is possible, when the usage can be clearly divided,
otherwise I tend to a totally asynchronous design.

-- 
         Georg Acher, [EMAIL PROTECTED]         
         http://www.in.tum.de/~acher/
          "Oh no, not again !" The bowl of petunias          

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

Reply via email to