Shows detailed up-to-date information about the USB devices. On my system with a camera and two small hard drives pluged in, the output of this command is:
Bus 003 Device 003: ID 054c:004e Sony Corp. DSC-xxx (ptp) Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 019: ID 090c:1000 Feiya Technology Corp. Memory Bar Bus 001 Device 020: ID 13fe:1a00 Bus 001 Device 001: ID 0000:0000
This output is updated within about a second of any hardware or software configuration changes.
A truly complete listing provided by "lspci -v" of the USB controllers, hubs, and devices with all configuration information is much longer. For this same set up, it is
This output is particularly useful for programmers because each descriptor has been shown using the variables referred to in the USB 2.0 Standard.
Shows information about the hardware connected to the computer's PCI bus, some of which are USB bus controllers. On my computer the USB-related output of this command is:
00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI]) Subsystem: ASRock Incorporation Unknown device 7001 Flags: bus master, medium devsel, latency 32, IRQ 20 Memory at cfff8000 (32-bit, non-prefetchable) [size=4K] 00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI]) Subsystem: ASRock Incorporation Unknown device 7001 Flags: bus master, medium devsel, latency 32, IRQ 21 Memory at cfff9000 (32-bit, non-prefetchable) [size=4K] 00:03.2 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller (prog-if 20 [EHCI]) Subsystem: ASRock Incorporation Unknown device 7002 Flags: bus master, medium devsel, latency 32, IRQ 19 Memory at cfffa000 (32-bit, non-prefetchable) [size=4K] Capabilities: [50] Power Management version 2
This shows that I have 3 USB controllers, two USB 1.0 OHCI controllers and one USB 2.0 EHCI controller.
This command should be run as root otherwise the Capabilities will not be shown.
The /sys directory gives access to all that the Linux kernel knows about its devices and device drivers and allows some user interaction with the drivers. Its files and directories are adjusted when devices and drivers are added or removed. An "ls -lR /sys" listing can have thousands of lines of output. Here is an extract of such a listing from my system.
The /proc directory gives access to all that the Linux kernel knows about the system. Its files and directories are created "on the fly" when read and therefore represent precisely up-to-date information. Certain of its files can be written to in order to change parameters. Some are accessible by all users while others are only accessible by the root user.
The abbreviations in the /proc/bus/usb/drivers
file are explained here (part of the USB Guide, last updated way back in October 2000).
For my device which is the 003 device on the 003 bus, I can, as root, do hexedit /proc/bus/usb/003/003
and see the device, configuration, interface, and end point descriptor bytes returned when the device was enumerated. This can be useful, but the /proc/bus/usb/devices
file displays this information plus the manufacturer, product, and device strings as well.
Device driver writing advice can be found in the following directories and files in the Documentation directory of the Linux source code:
There is an FTDI serial driver (header file) in the Linux source code tree. It is included in the kernel when CONFIG_USB_SERIAL_FTDI_SIO=y is set. It supports the dual-channel FT2232C chip and appears as device /dev/ttyUSB0 (or ttyUSB1, etc.).
Of course, the actual source code for existing USB drivers should also be studied if you are so adventuresome as to write a special-purpose driver for your USB gadget. The Linux source code tree even includes usb-skeleton.c which contains the basic framework for writing USB device drivers.
Last updated: January 1, 2007
Contact Craig Van Degrift if you have problems or questions with this web site.