Never Ending Security

It starts all here

How to list and identify connected USB devices on a Debian Linux machine

How to list and identify the USB devices that are connected to you computer.

/!\ Make sure the device is powered-up and enabled before listing the devices.

Device are mainly identified using a pair of hexadecimal numbers, like 04b3:3108.

  • The 4 first hexadecimal digits are the Vendor ID (04b3 = IBM).
  • The 4 last hexadecimal digits are the Device ID (3108 = ThinkPad 800dpi Optical Travel Mouse).

See references for more information.

Most of the devices (device-ids) handled by Debian are listed in the page : DeviceDatabase/USB.

Many people simply use lsusb, which is available on almost every Debian system, to list the devices on their computer. Gnome users can install and use the hardinfo method. KDE user can use kinfocenter.

lsusb

lsusb (package:usbutils) is the standard tool to query the connected USB devices.

#lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 006: ID 0a5c:2110 Broadcom Corp.
Bus 004 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
  • if your device description says “Unknown device”, you can update your local usb-id definition by running update-usbids as root.

To get something slightly more verbose, but still readable, I use :

#lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
Bus 005 Device 001: ID 0000:0000
  bDeviceClass            9 Hub
  bDeviceProtocol         1 Single TT
  iProduct                2 EHCI Host Controller
Bus 004 Device 006: ID 0a5c:2110 Broadcom Corp.
  bDeviceClass          224 Wireless
  bDeviceProtocol         1 Bluetooth
  iProduct                2 BCM2045B
  (Bus Powered)
Bus 004 Device 001: ID 0000:0000
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed hub
  iProduct                2 UHCI Host Controller
Bus 001 Device 001: ID 0000:0000
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed hub
  iProduct                2 UHCI Host Controller
Bus 002 Device 001: ID 0000:0000
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed hub
  iProduct                2 UHCI Host Controller
Bus 003 Device 001: ID 0000:0000
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed hub
  iProduct                2 UHCI Host Controller

{i} man lspci(8)

Under Gnome : hardinfo

Gnomes’s System Information (Hardinfo in Menu Applications/System Tools, from package:hardinfo) has an information page on the “USB” cards.

hardinfo.png
note the “Vendor” and “Product ID”.

Under KDE : KInfocenter

KDE’s KInfoCenter (in K Menu / System / KInfoCenter Info Center, from package:kcontrol) has an information page on the “USB” cards.

KInfoCenter.png

discover

The discover package has a nice command too:

discover --vendor-id --model-id usb
0000 0000 unknown unknown
0000 0000 unknown unknown
0a5c 2110 unknown unknown
0000 0000 unknown unknown
0000 0000 unknown unknown
0000 0000 unknown unknown

{i} man (1)discover
{i} discover uses its own files : /lib/discover/usb-busclass.xml, /lib/discover/usb-device.xml, /lib/discover/usb-vendor.xml

Digging by hand

/proc/bus/usb/devices

If lsusb isn’t available (!), you can display the contents of /proc/bus/usb/devices to list vendor and device IDs and other technical details:

#use grep to filter important line.
cat /proc/bus/usb/devices | grep -E "^([TSPD]:.*|)$"
T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 8
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.18-4-686 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1d.7

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.18-4-686 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.3

T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0a5c ProdID=2110 Rev= 1.00
S:  Manufacturer=Broadcom Corp
S:  Product=BCM2045B

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.18-4-686 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.2

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.18-4-686 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.1

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.18-4-686 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.0

References

How to identify a PC Card

/!\ PC Card is a generic name for two technologies of hot-pluggable cards (the size of a smart card, but about 5mm thick):

  • 16-bit PC Card (PCMCIA)
  • 32-bit CardBus

This page covers “16-bit PC Card” devices, previously named “PCMCIA”.

pccardctl

Install the pcmciautils package to provide the pccardctl utility.

pccardctl ident

Socket 0:
  product info: "The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", "RevA"
  manfid: 0x0274, 0x1613
  function: 6 (network)

pccardctl info

PRODID_1="The Linksys Group, Inc."
PRODID_2="Instant Wireless Network PC Card"
PRODID_3="ISL37300P"
PRODID_4="RevA"
MANFID=0274,1613
FUNCID=6

pccardctl status

Socket 0:
  5.0V 16-bit PC Card
  Subdevice 0 (function 0) [unbound]

Under GNOME: hardinfo

Hardinfo doesn’t list PCMCIA cards.

Under KDE: KInfocenter

KDE’s KInfoCenter (in K Menu / System / KInfoCenter Info Center, from package kcontrol) has an information page on PC Cards.

KInfoCenter.png
Note: Sometimes, KInfoCenter doesn’t detect PCMCIA cards.

dmidecode

The motherboard DMI zone has information about the system’s slots. dmidecode can be used to retrieve this information.

dmidecode -t 9
# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0020, DMI type 9, 13 bytes
System Slot Information
        Designation: ExpressCard Slot 1
        Type: x1 PCI Express
        Current Usage: Available
        Length: Other
        ID: 0
        Characteristics:
                Hot-plug devices are supported

Handle 0x0021, DMI type 9, 13 bytes
System Slot Information
        Designation: CardBus Slot 1
        Type: 32-bit PC Card (PCMCIA)
        Current Usage: Available
        Length: Other
        ID: Adapter 1, Socket 0
        Characteristics:
                5.0 V is provided
                3.3 V is provided
                PC Card-16 is supported
                Cardbus is supported
                Zoom Video is supported
                Modem ring resume is supported
                PME signal is supported
                Hot-plug devices are supported

lspci

32-bit CardBus devices are usually visible (bridged) as a PCI device.

/proc/bus/pccard/*

TODO

/sys/bus/pcmcia/*

TODO

References

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s