Re: hiddev

Folkert van Heusden <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization www.unixexpert.nl
Message-ID <[email protected]>
> > > HIDIOCGSTRING - struct hiddev_string_descriptor (read/write) Gets a 
> > > string descriptor from the device. The caller must fill in the "index" 
> > > field to indicate which descriptor should be returned.
> > Can you please tell me in what range this index is?
> 
> Please refer to USB specification.
> The string descriptor indexes are fully optional and are referenced by the 
> other descriptors (device descriptors, configuration descriptors, etc). So 
> the valid range differs from device to device and depends of how much of 
> the descriptor information has available the corresponding string (human 
> readable) representation.

Yes I understood that. I needed this info to investigate an USB device
for which no documentation exists. But I think I found the information
that I need:
in linux/drivers/usb/core/message.c there's the following code snippet:
                result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
                        USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
                        (USB_DT_STRING << 8) + index, langid, buf, size,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That means that index may not be bigger then 255 as else it would garble the
value of 'USB_DT_STRING << 8'.


Folkert van Heusden

-- 

Multitail - gibkaja utilita po sledovaniju log-fajlov i vyvoda
kommand. Fil'trovanie, raskrašivanie, slijanie, vizual'noe sravnenie,
i t.d.  http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.