0

I have a USB device and would like to see what it's parent device is, i.e. which hub it is connected to. The reason is that I'm debugging an issue with sleep mode. However, this is on an embedded plattform (Android), and my lsusb implementation is provided by toybox, so I can't use it to show a tree. Without cross compiling lsusb, how can I find this information?

I tried looking in /sys/bus/usb/devices/3-1/... for example, and I would like to find which /sys/bus/usb/devices/usb? corresponds to the (internal) hub that this is connected to.

1

Go back from number encoding of the device tree. For example, my webcam is at /sys/bus/usb/devices/3-1.1.2, which means it sits on bus 3, port 1 of the root hub of thus bus, port 1 of a hub below the root hub, and port of another hub of the last one.

Or with lsusb -t:

$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        |__ Port 1: Dev 102, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 2: Dev 103, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 103, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 2: Dev 103, If 3, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 103, If 1, Class=Video, Driver=uvcvideo, 480M

So your 3-1 would be on port 1 of the root hub of bus 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.