On Thu, Apr 06, 2006 at 03:33:46PM +0530, Srinivas G. wrote:
> Dear All,
> 
> I have developed a USB client driver for a custom device in 2.6.x kernel
> on a Fedora Core 3 Linux box.
> 
> This driver is very simple driver (it only contains simple read and
> write functionality) and I developed based on the skeleton driver that
> is available in the source tree.
> 
> To test the driver I have developed a small C application where I am
> writing a command and reading the response. The command I wrote is
> "0xbe" then I got the Serial Number as response. (I took this command
> one of my friends).
> 
> Now I need some help from you all to get the Vendor ID and Device ID as
> response to the commands. What are the commands to get the Device ID or
> Vendor ID of my custom device? 

cat /sys/bus/usb/devices/DEVICE_ID/idVendor
cat /sys/bus/usb/devices/DEVICE_ID/idProduct

will get you these values (replace DEVICE_ID with your device's id).

So in short, you don't need to make a kernel driver function for this,
it's already exported to userspace through sysfs.

hope this helps,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to