On Sun, 26 Dec 2004, tim bisson wrote:

> I'm learning how to write a USB device driver using delcom's USB 6 Digit 
> Numeric Display device. I've been following the example from 
> drivers/usb/misc/usbled.c and from someone's device driver 
> implementation of  delcom's usb numeric display 
> (http://sourceforge.net/project/showfiles.php?group_id=106606).  After 
> reading source code and delcom's manual for several hours, I still can't 
> figure out where some of the parameter values in usb_control_msg() come 
> from.
> 
> usb_control_msg() prototype:
> |int *usb_control_msg *|(struct usb_device * dev, unsigned int pipe, 
> __u8 request, __u8 requesttype, __u16 value, __u16 index, void * data, 
> __u16 size, int timeout);
> 
> My question is this: How are the /request, //requesttype, value, /and/ 
> index/ values figured out for a particular USB device?

Some of the bit positions (like those in requesttype) have generic 
meanings, defined in the USB specification.  But in general, the answer is 
that the values are defined by a class specification or by the device 
manufacturer.

> I've looked at chapter 9.3 in the "Universal Serial Bus Specification" 
> (www.scaramanga.co.uk/stuff/qemu-usb/usb11.pdf) document which specifies 
> some standard device requests in table 9-3, but neither requesttypes in 
> the examples below (0xc8 or 0x48) are listed in table 9-3.

You should use an up-to-date document: the USB 2.0 Specification,
available from www.usb.org.  But it won't answer your questions, since it
doesn't list the meaning of those codes either.  All it says that 0xc8
refers to an IN transfer while 0x48 refers to an OUT transfer, and the
transfer is defined at the Vendor level.  For more information you'll have
to look through the documentation supplied by the manufacturer.

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to