Linux/USB

From Omnia
Jump to navigation Jump to search

USB 3.0

"The Linux kernel has supported USB 3.0 since version 2.6.31, which was released in September 2009." [1] [2]

List USB Devices

$ lsusb
$ usb-devices

listusb: [3]

#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    syspath="${sysdevpath%/dev}"
    devname="$(udevadm info -q name -p $syspath)"
    [[ "$devname" == "bus/"* ]] && continue
    eval "$(udevadm info -q property --export -p $syspath)"
    [[ -z "$ID_SERIAL" ]] && continue
    echo "/dev/$devname - $ID_SERIAL"
done

Linux USB Discovery

USB 3.0 HDD: (dmesg)

usb 9-2: new SuperSpeed USB device number 6 using xhci_hcd
usb 9-2: New USB device found, idVendor=0480, idProduct=d000
usb 9-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
usb 9-2: Product: External USB 3.0
usb 9-2: Manufacturer: TOSHIBA
usb 9-2: SerialNumber: 2013122801534E
usb 9-2: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi6 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
scsi 6:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 0    PQ: 0 ANSI: 6
sd 6:0:0:0: Attached scsi generic sg6 type 0
sd 6:0:0:0: [sdg] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 6:0:0:0: [sdg] Write Protect is off
sd 6:0:0:0: [sdg] Assuming drive cache: write through
sd 6:0:0:0: [sdg] Assuming drive cache: write through
sdg: sdg1
sd 6:0:0:0: [sdg] Assuming drive cache: write through
sd 6:0:0:0: [sdg] Attached SCSI disk

USB 2.0 HDD: (dmesg)

usb 1-3: new high speed USB device number 5 using ehci_hcd
usb 1-3: New USB device found, idVendor=0bc2, idProduct=3001
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-3: Product: FreeAgent
usb 1-3: Manufacturer: Seagate
usb 1-3: SerialNumber: 2GEX3WBF
usb 1-3: configuration #1 chosen from 1 choice
scsi7 : SCSI emulation for USB Mass Storage devices
scsi 7:0:0:0: Direct-Access     Seagate  FreeAgent        102D PQ: 0 ANSI: 4
sd 7:0:0:0: Attached scsi generic sg7 type 0
sd 7:0:0:0: [sdh] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
sd 7:0:0:0: [sdh] Write Protect is off
sd 7:0:0:0: [sdh] Assuming drive cache: write through
sd 7:0:0:0: [sdh] Assuming drive cache: write through
sdh: sdh1
sd 7:0:0:0: [sdh] Assuming drive cache: write through
sd 7:0:0:0: [sdh] Attached SCSI disk


usb-devices:

--------------- USB 3.0 DEVICE & CONTROLLER ---------------
T:  Bus=09 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  6 Spd=5000 MxCh= 0
D:  Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=0480 ProdID=d000 Rev=01.00
S:  Manufacturer=TOSHIBA
S:  Product=External USB 3.0
S:  SerialNumber=2013122801534E
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=36mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

T:  Bus=09 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 2
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=02.06
S:  Manufacturer=Linux 2.6.32-431.23.3.el6.x86_64 xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:03:00.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub


--------------- USB 2.0 DEVICE & CONTROLLER ---------------
T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0bc2 ProdID=3001 Rev=00.00
S:  Manufacturer=Seagate
S:  Product=FreeAgent
S:  SerialNumber=2GEX3WBF
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 5
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=02.06
S:  Manufacturer=Linux 2.6.32-431.23.3.el6.x86_64 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:12.2
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub