(三) 查看USB设备

查看USB设备

原文更详细参考

[TOC]

lsusb

1# 列出所有设备 2$ lsusb 3Bus 001 Device 002: ID 05a3:9310 ARC International 4Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 5Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub 6Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse 7Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 8 9# 打印指定USB设备的具体的描述符 -d 指定usb -v 显示详细信息 10lsusb -d 05a3:9310 -v

ll /sys/bus/usb/devices

其中 usbx/第x个总线,x-y:a.b/的目录格式,x表示总线号,y表示端口,a表示配置,b表示接口。 更详细的子目录查看

1book@100ask:/sys/bus/usb/devices$ cd /sys/bus/usb/devices 2book@100ask:/sys/bus/usb/devices$ ls 31-0:1.0 1-1 1-1:1.0 1-1:1.1 1-1:1.2 1-1:1.3 2-0:1.0 2-1 2-1:1.0 2-2 2-2:1.0 usb1 usb2 4book@100ask:/sys/bus/usb/devices$ ll 5总用量 0 6drwxr-xr-x 2 root root 0 418 18:04 ./ 7drwxr-xr-x 4 root root 0 418 17:29 ../ 8lrwxrwxrwx 1 root root 0 418 17:29 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-0:1.0/ 9lrwxrwxrwx 1 root root 0 418 18:04 1-1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/ 10lrwxrwxrwx 1 root root 0 418 18:04 1-1:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/ 11lrwxrwxrwx 1 root root 0 418 18:04 1-1:1.1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.1/ 12lrwxrwxrwx 1 root root 0 418 18:04 1-1:1.2 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.2/ 13lrwxrwxrwx 1 root root 0 418 18:04 1-1:1.3 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.3/ 14lrwxrwxrwx 1 root root 0 418 17:29 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-0:1.0/ 15lrwxrwxrwx 1 root root 0 418 17:29 2-1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/ 16lrwxrwxrwx 1 root root 0 418 17:29 2-1:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/2-1:1.0/ 17lrwxrwxrwx 1 root root 0 418 17:29 2-2 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/ 18lrwxrwxrwx 1 root root 0 418 17:29 2-2:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2:1.0/ 19lrwxrwxrwx 1 root root 0 418 17:29 usb1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/ 20lrwxrwxrwx 1 root root 0 418 17:29 usb2 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/ 21

cat /sys/kernel/debug/usb/devices

信息的详细解析可以参照 Linux源代码中 Documentation/usb/proc_usb_info.txt 文件

1book@100ask:/sys/bus/usb/devices$ sudo cat /sys/kernel/debug/usb/devices 2[sudo] book 的密码: 3 4T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6 5B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0 6D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 7P: Vendor=1d6b ProdID=0002 Rev= 4.13 8S: Manufacturer=Linux 4.13.0-36-generic ehci_hcd 9S: Product=EHCI Host Controller 10S: SerialNumber=0000:02:03.0 11C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA 12I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 13E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms 14 15T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 16D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 17P: Vendor=05a3 ProdID=9310 Rev= 0.00 18S: Manufacturer=HD Camera Manufacturer 19S: Product=USB 2.0 Camera 20C:* #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA 21A: FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00 22A: FirstIf#= 2 IfCount= 2 Cls=01(audio) Sub=00 Prot=00 23I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo 24E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=4ms 25I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 26I: If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 27E: Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=125us 28I: If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 29E: Ad=81(I) Atr=05(Isoc) MxPS= 256 Ivl=125us 30I: If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 31E: Ad=81(I) Atr=05(Isoc) MxPS= 800 Ivl=125us 32I: If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 33E: Ad=81(I) Atr=05(Isoc) MxPS=1600 Ivl=125us 34I: If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 35E: Ad=81(I) Atr=05(Isoc) MxPS=2400 Ivl=125us 36I: If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo 37E: Ad=81(I) Atr=05(Isoc) MxPS=3072 Ivl=125us 38I:* If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio 39I:* If#= 3 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio 40I: If#= 3 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio 41E: Ad=84(I) Atr=05(Isoc) MxPS= 400 Ivl=1ms 42 43T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 44B: Alloc= 17/900 us ( 2%), #Int= 1, #Iso= 0 45D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 46P: Vendor=1d6b ProdID=0001 Rev= 4.13 47S: Manufacturer=Linux 4.13.0-36-generic uhci_hcd 48S: Product=UHCI Host Controller 49S: SerialNumber=0000:02:00.0 50C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA 51I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 52E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms 53 54T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 55D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 56P: Vendor=0e0f ProdID=0003 Rev= 1.03 57S: Manufacturer=VMware 58S: Product=VMware Virtual USB Mouse 59C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA 60I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid 61E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=1ms 62 63T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 3 Spd=12 MxCh= 7 64D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 65P: Vendor=0e0f ProdID=0002 Rev= 1.00 66S: Product=VMware Virtual USB Hub 67C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA 68I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 69E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms 70

解析如下

1Each line is tagged with a one-character ID for that line: 2 3T = Topology (etc.) 4B = Bandwidth (applies only to USB host controllers, which are 5 virtualized as root hubs) 6D = Device descriptor info. 7P = Product ID info. (from Device descriptor, but they won't fit 8 together on one line) 9S = String descriptors. 10C = Configuration descriptor info. (* = active configuration) 11I = Interface descriptor info. 12E = Endpoint descriptor info. 13 14Legend: 15 d = decimal number (may have leading spaces or 0's) 16 x = hexadecimal number (may have leading spaces or 0's) 17 s = string 18 19 20Topology info: 21 22T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd 23| | | | | | | | |__MaxChildren 24| | | | | | | |__Device Speed in Mbps 25| | | | | | |__DeviceNumber 26| | | | | |__Count of devices at this level 27| | | | |__Connector/Port on Parent for this device 28| | | |__Parent DeviceNumber 29| | |__Level in topology for this bus 30| |__Bus number 31|__Topology info tag 32 33 Speed may be: 34 1.5 Mbit/s for low speed USB 35 12 Mbit/s for full speed USB 36 480 Mbit/s for high speed USB (added for USB 2.0); 37 also used for Wireless USB, which has no fixed speed 38 5000 Mbit/s for SuperSpeed USB (added for USB 3.0) 39 40 For reasons lost in the mists of time, the Port number is always 41 too low by 1. For example, a device plugged into port 4 will 42 show up with "Port=03". 43 44Bandwidth info: 45B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd 46| | | |__Number of isochronous requests 47| | |__Number of interrupt requests 48| |__Total Bandwidth allocated to this bus 49|__Bandwidth info tag 50 51 Bandwidth allocation is an approximation of how much of one frame 52 (millisecond) is in use. It reflects only periodic transfers, which 53 are the only transfers that reserve bandwidth. Control and bulk 54 transfers use all other bandwidth, including reserved bandwidth that 55 is not used for transfers (such as for short packets). 56 57 The percentage is how much of the "reserved" bandwidth is scheduled by 58 those transfers. For a low or full speed bus (loosely, "USB 1.1"), 59 90% of the bus bandwidth is reserved. For a high speed bus (loosely, 60 "USB 2.0") 80% is reserved. 61 62 63Device descriptor info & Product ID info: 64 65D: Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd 66P: Vendor=xxxx ProdID=xxxx Rev=xx.xx 67 68where 69D: Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd 70| | | | | | |__NumberConfigurations 71| | | | | |__MaxPacketSize of Default Endpoint 72| | | | |__DeviceProtocol 73| | | |__DeviceSubClass 74| | |__DeviceClass 75| |__Device USB version 76|__Device info tag #1 77 78where 79P: Vendor=xxxx ProdID=xxxx Rev=xx.xx 80| | | |__Product revision number 81| | |__Product ID code 82| |__Vendor ID code 83|__Device info tag #2 84 85 86String descriptor info: 87 88S: Manufacturer=ssss 89| |__Manufacturer of this device as read from the device. 90| For USB host controller drivers (virtual root hubs) this may 91| be omitted, or (for newer drivers) will identify the kernel 92| version and the driver which provides this hub emulation. 93|__String info tag 94 95S: Product=ssss 96| |__Product description of this device as read from the device. 97| For older USB host controller drivers (virtual root hubs) this 98| indicates the driver; for newer ones, it's a product (and vendor) 99| description that often comes from the kernel's PCI ID database. 100|__String info tag 101 102S: SerialNumber=ssss 103| |__Serial Number of this device as read from the device. 104| For USB host controller drivers (virtual root hubs) this is 105| some unique ID, normally a bus ID (address or slot name) that 106| can't be shared with any other device. 107|__String info tag 108 109 110 111Configuration descriptor info: 112 113C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA 114| | | | | |__MaxPower in mA 115| | | | |__Attributes 116| | | |__ConfiguratioNumber 117| | |__NumberOfInterfaces 118| |__ "*" indicates the active configuration (others are " ") 119|__Config info tag 120 121 USB devices may have multiple configurations, each of which act 122 rather differently. For example, a bus-powered configuration 123 might be much less capable than one that is self-powered. Only 124 one device configuration can be active at a time; most devices 125 have only one configuration. 126 127 Each configuration consists of one or more interfaces. Each 128 interface serves a distinct "function", which is typically bound 129 to a different USB device driver. One common example is a USB 130 speaker with an audio interface for playback, and a HID interface 131 for use with software volume control. 132 133 134Interface descriptor info (can be multiple per Config): 135 136I:* If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss 137| | | | | | | | |__Driver name 138| | | | | | | | or "(none)" 139| | | | | | | |__InterfaceProtocol 140| | | | | | |__InterfaceSubClass 141| | | | | |__InterfaceClass 142| | | | |__NumberOfEndpoints 143| | | |__AlternateSettingNumber 144| | |__InterfaceNumber 145| |__ "*" indicates the active altsetting (others are " ") 146|__Interface info tag 147 148 A given interface may have one or more "alternate" settings. 149 For example, default settings may not use more than a small 150 amount of periodic bandwidth. To use significant fractions 151 of bus bandwidth, drivers must select a non-default altsetting. 152 153 Only one setting for an interface may be active at a time, and 154 only one driver may bind to an interface at a time. Most devices 155 have only one alternate setting per interface. 156 157 158Endpoint descriptor info (can be multiple per Interface): 159 160E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss 161| | | | |__Interval (max) between transfers 162| | | |__EndpointMaxPacketSize 163| | |__Attributes(EndpointType) 164| |__EndpointAddress(I=In,O=Out) 165|__Endpoint info tag 166 167 The interval is nonzero for all periodic (interrupt or isochronous) 168 endpoints. For high speed endpoints the transfer interval may be 169 measured in microseconds rather than milliseconds. 170 171 For high speed periodic endpoints, the "MaxPacketSize" reflects 172 the per-microframe data transfer size. For "high bandwidth" 173 endpoints, that can reflect two or three packets (for up to 174 3KBytes every 125 usec) per endpoint. 175 176 With the Linux-USB stack, periodic bandwidth reservations use the 177 transfer intervals and sizes provided by URBs, which can be less 178 than those found in endpoint descriptor. 179

dmesg

1#sudo rmmod uvcvideo 2#sudo modprobe uvcvideo 3#dmesg 4 5[ 5066.889529] usbcore: deregistering interface driver uvcvideo 6[ 5146.884778] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310) 7[ 5146.904548] uvcvideo 1-1:1.0: Entity type for entity Extension 4 was not initialized! 8[ 5146.904550] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized! 9[ 5146.904551] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized! 10[ 5146.905329] input: USB 2.0 Camera: HD USB Camera as /devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/input/input7 11[ 5146.905954] usbcore: registered new interface driver uvcvideo 12[ 5146.905955] USB Video Class driver (1.1.1)
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )