On Tue, Jul 12, 2011 at 17:51, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, 12 Jul 2011, Sudarshan Jagadale wrote:
>> If i dont want to use any library or usb.h in my hotplug detection and
>> removal code then is there other way to do this?
>
> You can copy the code from libusb into your own program, if you're
> willing to follow the license requirements.
>
>> I just want following information from system/kernel to my module like,
>> idvendor,idproduct, bus_info, system device name?
>> Bus info should be like we use in /dev/video0? is there any way to do this?
>> in short i would like to make path equivalant to *usb_make_path()? how can i
>> achive this ?
>
> You can look through the directories under /sys/bus/usb/devices/.
> Ignore directory names that start with "usb" or that contain a ':',
> because they don't refer to external devices.
>
> Within each of the remaining directories, the vendor ID is in a file
> named idVendor and the product ID is in a file named idProduct. I
> don't know what you mean by "bus_info" or "system device name".
This is a rather old, but still almost valid example of a
full-hotplug-support program handling video devices:
http://article.gmane.org/gmane.linux.hotplug.devel/13925
(I still can see only Alan's mails. Alan, you are the HTML-filter? :))
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux DVB]
[Video Technology]
[Asterisk]
[Photo]
[DCCP]
[Netdev]
[Xorg]
[Util Linux NG]
[Xfree86]
[Devices]
[Fedora Women]
[ALSA Devel]
[Linux USB]