title: 查看USB设备

date: 2019/4/23 19:10:00

toc: true

查看USB设备

原文更详细参考

lsusb

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

ll /sys/bus/usb/devices

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

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

cat /sys/kernel/debug/usb/devices

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

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

解析如下

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

dmesg

  1. #sudo rmmod uvcvideo
  2. #sudo modprobe uvcvideo
  3. #dmesg
  4. [ 5066.889529] usbcore: deregistering interface driver uvcvideo
  5. [ 5146.884778] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310)
  6. [ 5146.904548] uvcvideo 1-1:1.0: Entity type for entity Extension 4 was not initialized!
  7. [ 5146.904550] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
  8. [ 5146.904551] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
  9. [ 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
  10. [ 5146.905954] usbcore: registered new interface driver uvcvideo
  11. [ 5146.905955] USB Video Class driver (1.1.1)

(三) 查看USB设备的更多相关文章

  1. Linux下查看USB设备信息

    首先需要将usbfs挂载一下,然后才能查看.$ mount -t usbfs none /proc/bus/usb$ cat  /proc/bus/usb/devices或者在文件(/etc/fsta ...

  2. ros下怎么查看usb设备在哪个端口

    检查usb设备是否有权限以及在哪个端口,或者lsusb ls -l /dev |grep ttyUSB 查到设备端口,在启动文件下配置相应的端口号 <param name="seria ...

  3. Linux下查看USB设备的VID、PID命令

    Linux下查看PID命令 cat /proc/bus/usb/devices 或 lsusb 方法一:在/etc/init.d/rcS中添加mount -t usbfs none /proc/bus ...

  4. lsusb查看usb设备

    root@ubuntu:/home/lyd/work/code/cyusb# lsusb Bus 001 Device 009: ID 04b4:00f1 Cypress Semiconductor ...

  5. Linux系统下查看USB设备名及使用USB设备

    1.系统插入USB设备后,从控制台界面有如下提示: 从控制台信息可以看出插入的USB设备名. 从上图可以看出,插入的USB设备为sde4. 但是,如果是CRT工具远程连接过去,可以使用下面的命令来查看 ...

  6. linux(ubuntu) 查看系统设备信息 命令

    时间:2012-08-02 00:12   ubuntu查看版本命令 方法一: 在终端中执行下列指令: cat /etc/issue 方法二: 使用 lsb_release 命令也可以查看 Ubunt ...

  7. linux(ubuntu) 查看系统设备信息

    ubuntu查看版本命令 方法一: 在终端中执行下列指令: cat /etc/issue 方法二: 使用 lsb_release 命令也可以查看 Ubuntu 的版本号,与方法一相比,内容更为详细. ...

  8. linux常用查看硬件设备信息命令

    转载:http://blog.chinaunix.net/uid-26782198-id-3242120.html # uname -a               # 查看内核/操作系统/CPU信息 ...

  9. linux常用查看硬件设备信息命令(转载)

    系统 # uname -a                                       # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue         ...

随机推荐

  1. DbGridEh根据某一个字段的值显示对应底色或字体变化

    改变行底色: procedure TForm1.dggrideh1DrawColumnCell(Sender: TObject;const Rect: TRect; DataCol: Integer; ...

  2. 报错TypeError: $(...).live is not a function解决方法

    报错的原因是这个方法在jquery1.7以后就被废除了, 1.7以后的版本改用.on()方法 之前的用法: .live(events, function) 新方法: .on(eventType, se ...

  3. python接口自动化-post请求4

    云盘登录实操案例: 代码参考: # coding:utf-8 import requests ''' https的请求相对于http安全级别高,需要验证SSL证书 import urllib3 使用这 ...

  4. MUI版本升级更新程序IOS和andriod

    var wgtVer=null; function plusReady(){ // 获取本地应用资源版本号 plus.runtime.getProperty(plus.runtime.appid,fu ...

  5. python科学计算库numpy和绘图库PIL的结合,素描图片(原创)

    # 导入绘图库 from PIL import Image #导入科学计算库 import numpy as np #封装一个图像处理工具类 class TestNumpy(object): def ...

  6. scala的多种集合的使用(4)之列表List(ListBuffer)的操作

    1.List列表的创建和添加元素 1)最常见的创建list的方式之一. scala> val list = 1 :: 2 :: 3 :: Nil list: List[Int] = List(1 ...

  7. clipboardjs复制到粘贴板

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat=&qu ...

  8. 基于配置文件的方式配置AOP

    之前说的都是通过注释的方式配置,接下来说说如何使用配置文件配置AOP 还是原来的代码,去掉所有注释,接下来配置最基本的几个bean. 然后使用<aop:config>标签进行配置,然后配切 ...

  9. 时间插件datepicker(jQuery-UI,bootstrap)和jquery-steps的冲突解决。。。

    日期插件初始化:  $('.prelease_time').flatpickr(); let contentSteps = $("#content_form").steps({ h ...

  10. XML fragments parsed from previous mappers already contains value for xxxxx

    错误信息: Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file ...