how do I figure out where a usb controller is in /dev?

0

This is a linux question, how do I figure out where a usb controller is in /dev?

I have tried doing ls /dev > before.txt ls /dev > after.txt diff before.txt after.txt pluging the device in when I go to take the after text file. I still can not find the device. dmesg reports:

[50276.080032] usb 5-1: new full-speed USB device number 3 using uhci_hcd
[50276.298047] usb 5-1: New USB device found, idVendor=1430, idProduct=4748
[50276.298054] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[50276.298058] usb 5-1: Product: Guitar Hero X-plorer  
[50276.298061] usb 5-1: Manufacturer: RedOctane Inc(c)2006 
[50276.298065] usb 5-1: SerialNumber: 05D18E3
[50276.301272] input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input12

but I dont know where that is. how can I find this device?

j0h

Posted 2016-12-22T13:53:33.593

Reputation: 918

1Are you looking for a USB device or a USB (host) controller? USB controllers do not have nodes in /dev, just like network devices (e.g. eth0) do not. – sawdust – 2016-12-23T02:40:56.030

Answers

2

If the device has a name in /dev, then the simplest answer, since you already have the DEVPATH, i.e. /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input12, is to use udevadm:

udevadm info -q all /sys/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input12 | grep DEVNAME

MariusMatutiae

Posted 2016-12-22T13:53:33.593

Reputation: 41 321

1And additionally, if the kernel doesn't recognize the device because there's no matching driver and/or nor matching udev rules, then there will be no device node (what is probably meant by "usb controller" in the question) in /dev. – dirkt – 2016-12-23T07:00:31.740

0

lsblk will provide you a nicer overview about your currently plugged in block devices. It reads the sysfs filesystem to get the information.

Julian Berger

Posted 2016-12-22T13:53:33.593

Reputation: 1

its not a block device, its a controller, (a character device). and lsblk shows nothing for it. (of course) – j0h – 2016-12-22T14:30:40.283

oh, right. please check if lsusbprovide you the desired output. – Julian Berger – 2016-12-22T14:36:30.473

lsusb doesnt show the file in /dev I also tried lsusb -v – j0h – 2016-12-22T14:44:56.593

1

I'm sure this should be helpful! http://unix.stackexchange.com/questions/144029/command-to-determine-ports-of-a-device-like-dev-ttyusb0

– Julian Berger – 2016-12-22T14:55:18.020