• Uncategorized

About linux : How-to-get-the-vendor-and-product-ID-of-a-usb-device-from-sysbusdevicesusbdevices

Question Detail

I have a WiFi adapter plugged into my computer, I can find it’s ID numbers by looking through the output of lsusb.

Bus 005 Device 009: ID 1737:0071 Linksys WUSB600N v1 Dual-Band Wireless-N Network Adapter [Ralink RT2870]

This is the only wiFi adapter I have plugged in currently, so this obviously is it. I searched around in /sys/bus/usb/devices/ until I found this path on my machine

# ls -l /sys/bus/usb/devices/5-3.1:1.0/
total 0
-rw-r--r-- 1 root root 4096 Dec 28 18:11 authorized
-r--r--r-- 1 root root 4096 Dec 28 18:11 bAlternateSetting
-r--r--r-- 1 root root 4096 Dec 28 18:06 bInterfaceClass
-r--r--r-- 1 root root 4096 Dec 28 18:06 bInterfaceNumber
-r--r--r-- 1 root root 4096 Dec 28 18:06 bInterfaceProtocol
-r--r--r-- 1 root root 4096 Dec 28 18:06 bInterfaceSubClass
-r--r--r-- 1 root root 4096 Dec 28 18:11 bNumEndpoints
lrwxrwxrwx 1 root root    0 Dec 28 18:06 driver -> ../../../../../../../../bus/usb/drivers/rt2800usb
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_01
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_02
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_03
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_04
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_05
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_06
drwxr-xr-x 3 root root    0 Dec 28 18:11 ep_81
drwxr-xr-x 3 root root    0 Dec 28 18:06 ieee80211
drwxr-xr-x 5 root root    0 Dec 28 18:06 leds
-r--r--r-- 1 root root 4096 Dec 28 18:11 modalias
drwxr-xr-x 3 root root    0 Dec 28 18:06 net
drwxr-xr-x 2 root root    0 Dec 28 18:11 power
lrwxrwxrwx 1 root root    0 Dec 28 18:06 subsystem -> ../../../../../../../../bus/usb
-r--r--r-- 1 root root 4096 Dec 28 18:11 supports_autosuspend
-rw-r--r-- 1 root root 4096 Dec 28 18:06 uevent

By looking at the driver symbolic link I see this is using the rt2800usb driver. So this has to be the correct entry for my WiFi adapter. But identifying based off kernel driver name is inexact and I would prefer not do it that way. Is there a file under /sys/bus/usb/devices/5-3.1:1.0/ that can tell me the vendor ID and the product ID of the entry I am looking at?

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.