On Fri, Mar 08, 2002 at 10:14:33AM -0600, Victor Ditoro wrote:
> Hello all!
> 
> I have been implementing some code to drive a USB device in user space using
> the usbdevfs. It appears as though basic communication is working, but I'm
> puzzled by one thing (which, unfortunately, is probably a stupid question):
> 
> Why, in usbdevice_fs.h are IOCTL's like "Set interface" declared using the
> _IOR macro when they are really used to *write* data to the device, not
> *read* from it.
> 
> Similarly, all the "Get XXX" functions are declared using the _IOW macro
> when they *read* from the device instead of *write* to it.
> 
> In this case, the code I have is working, I'm just trying to understand why
> the IOCTL macro declarations seem to be reversed.

The direction takes only the parameter passing to/from the kernel into
account. GET* writes data into userspace, so _IOW, SET* vice versa.

-- 
         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:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to