i'm using Linux (similar to ubuntu, 2.6.38) and connect multiple network adapters via USB.
i want to find the USB number of where the adapter is currently connected.
- usb-serial devices, for instance, have ttyUSB handlers so i can used udevadm
to get its USB location (e.g. '/devices/pci0000:00/0000:00:17.0/0000:01:00.0/0000:02:02.3/usb1/1-1/1-1:1.0/ttyUSB0')
- ethernet devices (and USB-to-ETH adapters) has the 'device' node in /sys/class/net/ethN/device
which refers to the device filesystem.
i'm searching for another tricky way to find the same thing for a WiFi USB-dongle i connect.
The WiFi is based on ralink, and i'm using the rt5370sta.ko module to make it work.
so it works, and creates the ra0
interface, but i don't find a way to get it's USB number.
i tried searching ra0
in /sys/devices
, but all i get is /sys/devices/virtual/net/ra0
which doesn't help a lot.
is there an offline solution that doesn't require checking dmesg/udev (i less prefer these kind of solutions)?
lsusb
do?