USB-详解/sys/kernel/debug/usb/devices

1、概述

USB设备通过debugfs导出/sys/kernel/debug/usb/devices显示内核已知的每个USB设备及其配置描述符。此文件对于用户模式下的状态查看工具非常方便,可以扫描文本格式并忽略大部分文本。 设备特定文件中提供了更详细的设备状态(包括类和供应商状态)。

2、示例

2.1 某项目

console:cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 4.19
S:  Manufacturer=Linux 4.19.81+ xhci-hcd	# xhci控制器
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.0.auto
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
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 4.19
S:  Manufacturer=Linux 4.19.81+ xhci-hcd	# xhci控制器
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.0.auto
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
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=5000 MxCh= 0
D:  Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  2
P:  Vendor=0bda ProdID=8153 Rev=31.00
S:  Manufacturer=Realtek	# Realtek网卡
S:  Product=USB 10/100/1000 LAN
S:  SerialNumber=000000000000
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=288mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl=16ms
C:  #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=288mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=
E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=16ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

2.2 个人开发板

# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.04
S:  Manufacturer=Linux 5.4.31 dwc2_hsotg	#otg设备
S:  Product=DWC OTG Controller
S:  SerialNumber=49000000.usb-otg
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
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.04
S:  Manufacturer=Linux 5.4.31 ehci_hcd	#ehci控制器
S:  Product=EHCI Host Controller
S:  SerialNumber=5800d000.usbh-ehci
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
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 7
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=1a40 ProdID=0201 Rev= 1.00
S:  Product=USB 2.0 Hub [MTT]	#USB2.0 hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=02 Lev=02 Prnt=02 Port=06 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=0125 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

2.3 OHCI、UHCI、EHCI、XHCI 区别联系

在这里插入图片描述

3、文件格式

3.1 T:Topology(拓扑结构)

T:  Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd
|   |      |      |       |       |      |        |        |__MaxChildren
|   |      |      |       |       |      |        |__Device Speed in Mbps
|   |      |      |       |       |      |__DeviceNumber
|   |      |      |       |       |__Count of devices at this level
|   |      |      |       |__Connector/Port on Parent for this device
|   |      |      |__Parent DeviceNumber
|   |      |__Level in topology for this bus
|   |__Bus number
|__Topology info tag

T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0

Bus:表示总线号。

Lev:表示此USB设备位于所在总线拓扑结构的层次,XHCI控制器对应的Lev=00,其下面挂接的USB网卡的Lev=01。

Prnt:表示父设备数量,比如XHCI控制器是root,位于最顶层,其Prnt=0,其下面挂载在HUB下的USB网卡的Prnt=01。

Port:此USB设备的父设备上的连接器/端口,比如USB网卡的父设备是XHCI控制器

Cnt:这层的枚举到的第几个USB设备,比如USB网卡的Cnt=01。

Dev:表示设备编号,XHCI为1,USB网卡为5,按顺序排列的,一个总线上最多挂127个;可以有多个总线。

Spd:设备速率,单位为Mbps

​ 可能的速率为:

​ 1.5 Mbit/s for low speed USB

​ 12 Mbit/s for full speed USB

​ 480 Mbit/s for high speed USB (added for USB 2.0); also used for Wireless USB, which has no fixed speed

​ 5000 Mbit/s for SuperSpeed USB (added for USB 3.0)

​ 10000 Mbit/s for SuperSpeed USB (added for USB 3.1)

MxCh:当前设备可连接的子设备最大数量,比如XHCI的MxCh=1表示XHCI下可以连接一个USB设备;

3.2 B:Bandwidth(带宽信息)

B:  Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
|   |                       |         |__Number of isochronous requests
|   |                       |__Number of interrupt requests
|   |__Total Bandwidth allocated to this bus
|__Bandwidth info tag

B = Bandwidth (applies only to USB host controllers, which are virtualized as root hubs)带宽信息,只用于USB Host控制器,它被虚拟为一个root hub

Alloc:该总线分配得到的带宽。宽带分配在使用中是一个近似值,此值表示一帧需要多少ms。

Int:中断请求数

Iso:同步请求数,USB有四大传输,中断、控制、批量和同步。

3.3 D:Device descriptor info(设备描述符信息)

D:  Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
|   |        |             |      |       |       |__NumberConfigurations
|   |        |             |      |       |__MaxPacketSize of Default Endpoint
|   |        |             |      |__DeviceProtocol
|   |        |             |__DeviceSubClass
|   |        |__DeviceClass
|   |__Device USB version
|__Device info tag #1

D = Device descriptor info.设备描述符信息

Ver:USB协议版本,比如Ver=3.00。

Cls:由USB-IF(USB Implementers Forum)分配的设备类类码,Hub对应09;厂家自定义的为ff;如果该字段为0x00,表示由接口描述符bInterfaceClass来指定。

参考链接:usb class codes
在这里插入图片描述
Cls=09h,可知是Hub类

Sub:设备子类,USB子类代码,由USB-IF分配。

Prot:设备协议码,由USB-IF分配。如果D的Cls和Sub都为00,则该字段也必须为00,采用I的Prot=50。
在这里插入图片描述在这里插入图片描述

3.4 P:Product ID info(产品ID信息)

P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx
|   |           |           |__Product revision number
|   |           |__Product ID code
|   |__Vendor ID code
|__Device info tag #2

P = Product ID info. (from Device descriptor, but they won’t fit together on one line)产品ID信息,来至于设备描述符。

Vendor:厂商ID,比如XCHI的vendor=1d6b

ProdID:厂商产品的ID,比如XCHI的ProdID=0003表示支持USB3.0的产品。

Rev:产品版本号,比如4.19这里指linux内核版本。

参考链接:USB ids
在这里插入图片描述
在这里插入图片描述

3.5 S:String descriptors(字符串描述符信息)

S:  Manufacturer=ssss
|   |__Manufacturer of this device as read from the device.
|      For USB host controller drivers (virtual root hubs) this may
|      be omitted, or (for newer drivers) will identify the kernel
|      version and the driver which provides this hub emulation.
|__String info tag

S:  Product=ssss
|   |__Product description of this device as read from the device.
|      For older USB host controller drivers (virtual root hubs) this
|      indicates the driver; for newer ones, it's a product (and vendor)
|      description that often comes from the kernel's PCI ID database.
|__String info tag

S:  SerialNumber=ssss
|   |__Serial Number of this device as read from the device.
|      For USB host controller drivers (virtual root hubs) this is
|      some unique ID, normally a bus ID (address or slot name) that
|      can't be shared with any other device.
|__String info tag

S = String descriptors.字符串描述符

Manufacturer:从设备中读到的生产商描述性信息,比如USB网卡Manufacturer=Realtek.

Product:从设备中读取的产品描述性信息。

SerialNumber:从设备中读取的产品序列号。
在这里插入图片描述

3.6 C:Configuration descriptor info(配置描述符信息)

C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA
| | |       |       |      |__MaxPower in mA
| | |       |       |__Attributes
| | |       |__ConfiguratioNumber
| | |__NumberOfInterfaces
| |__ "*" indicates the active configuration (others are " ")
|__Config info tag

C = Configuration descriptor info. (* = active configuration)配置描述符信息

Ifs:此配置支持的USB接口数量,每个配置有一个或多个接口组成,每个接口具有独特的功能,并且绑定到不同的USB设备驱动。

Cfg:此配置配置数量。

Atr:属性,供电配置,位详细定义如下:

​ D7 保留,必须置1

​ D6 自供电模式

​ D5 远程唤醒

​ D4~D0 保留

0xe0: 1110 0000

0xa0: 1010 0000

MPwr:最大功耗,以2mA为单位,例如0x32为50*2=100mA。 USB设备供电有两种方式,self-powered和bus-powered两种方式,驱动代码会判断设备标志寄存器是否过流的。最大500mA。
在这里插入图片描述
在这里插入图片描述

3.7 I:Interface descriptor info(接口描述符信息)

I:* If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss
| | |      |      |       |             |      |       |__Driver name
| | |      |      |       |             |      |          or "(none)"
| | |      |      |       |             |      |__InterfaceProtocol
| | |      |      |       |             |__InterfaceSubClass
| | |      |      |       |__InterfaceClass
| | |      |      |__NumberOfEndpoints
| | |      |__AlternateSettingNumber
| | |__InterfaceNumber
| |__ "*" indicates the active altsetting (others are " ")
|__Interface info tag

I = Interface descriptor info.接口描述符信息

If:该接口编号,接口编号从0开始分配,当一个配置有多个接口时,就用该字段来区分不同的接口。

Alt:USB设备配置与USB配置描述符是一一对应的, 即一个配置只能有一个配置描述符。

Eps:端点数量,不包括端点0。USB网卡这里的Alt=3(不包括Endpoint0)

Cls:接口类码,比如HUB的为09h,USB-IF分配的类代码,0预览未来使用,0xFF表示接口类是厂家自定义,其他值由USB-IF指定。

Sub:接口子类码。USB-IF分配的子类代码,由Cls限制

Prot:接口的协议,如果一个接口支持特定类请求,此代码标识由特定设备类定义的协议,如果该字段为0,设备部在此接口不使特定类的协议,如果该字段为0xFF,设备为此接口使用厂家自定义协议。

Driver:驱动名字
在这里插入图片描述
在这里插入图片描述

3.8 E:Endpoint descriptor info(端点描述符信息)

E:  Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss
|   |        |            |         |__Interval (max) between transfers
|   |        |            |__EndpointMaxPacketSize
|   |        |__Attributes(EndpointType)
|   |__EndpointAddress(I=In,O=Out)
|__Endpoint info tag

E = Endpoint descriptor info.端点描述符信息

Ad:端点地址(I=In,O=out)

Atr:端点属性。

MxPS:端点所支持最大数据包的长度。

Ivl:端点数据传输的访问时间间隔。对于全速/低速的中断端点,取值范围为 1~255,对于高速中断端点,取值范围为1-16,详细定义可以参考USB协议。比如HUB的Ivl=256ms。
在这里插入图片描述
在这里插入图片描述

4、描述符的内核代码

注:以660代码为示例:kernel/msm-4.4/include/uapi/linux/usb/ch9.h

4.1 描述符类型

usb2.0规范

在这里插入图片描述

usb3.0规范

在这里插入图片描述

4.2 设备描述符

/* USB_DT_DEVICE: Device descriptor */
struct usb_device_descriptor {
	__u8  bLength;					// 此描述表的字节数
	__u8  bDescriptorType;			// 描述符的类型(此处应为0x01,即设备描述符)

	__le16 bcdUSB;					// 此设备与描述表兼容的USB设备说明版本号(BCD 码)
	
    __u8  bDeviceClass;				// 设备类码:
                                    // 如果此域的值为0则一个设置下每个接口指出它自己的类,各个接口各自独立工作。 
                                    // 如果此域的值处于1~FEH之间,则设备在不同的接口上支持不同的类。并这些接口可能不能独立工作。
                                    // 此值指出了这些接口集体的类定义。如果此域设为FFH,则此设备的类由厂商定义。
	
    __u8  bDeviceSubClass;			// 子类掩码 
                                    // 这些码值的具体含义根据bDeviceClass 域来看。 
                                    // 如bDeviceClass 域为零,此域也须为零 
                                    // 如bDeviceClass 域为FFH,此域的所有值保留。
	
    __u8  bDeviceProtocol;			// 协议码 
                                    // 这些码的值视bDeviceClass 和 bDeviceSubClass 的值而定。 
                                    // 如果设备支持设备类相关的协议,此码标志了设备类的值。如果此域的值为零,则此设备不支持设备类相关的协议,然而,
        							// 可能它的接口支持设备类相关的协议。如果此域的值为FFH,此设备使用厂商定义的协议。
	
    __u8  bMaxPacketSize0;			// 端点0的最大包大小(仅8,16,32,64为合法值)
	__le16 idVendor;				// 厂商标志(由USB-IF组织赋值)
	__le16 idProduct;				// 产品标志(由厂商赋值)
	__le16 bcdDevice;				// 设备发行号(BCD 码)
	__u8  iManufacturer;			// 描述厂商信息的字符串描述符的索引值。
	__u8  iProduct;					// 描述产品信息的字串描述符的索引值。
	__u8  iSerialNumber;			// 描述设备序列号信息的字串描述符的索引值。
	__u8  bNumConfigurations;		// 可能的配置描述符数目
} __attribute__ ((packed));

4.3 配置描述符

/* USB_DT_CONFIG: Configuration descriptor information.
 *
 * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
 * descriptor type is different.  Highspeed-capable devices can look
 * different depending on what speed they're currently running.  Only
 * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
 * descriptors.
 */
struct usb_config_descriptor {
	__u8  bLength;					// 此描述表的字节数
	__u8  bDescriptorType;			// 配置描述表类型(此处为0x02)

	__le16 wTotalLength;			// 此配置信息的总长(包括配置,接口,端点和设备类及厂商定义的描述符)
	__u8  bNumInterfaces;			// 此配置所支持的接口个数
	__u8  bConfigurationValue;		// 在SetConfiguration()请求中用作参数来选定此配置。
	__u8  iConfiguration;			// 描述此配置的字串描述表索引
    
	__u8  bmAttributes;				// 配置特性: 
                                    // D7: 保留(设为一) 
                                    // D6: 自给电源 
                                    // D5: 远程唤醒 
                                    // D4..0:保留(设为一) 
                                    // 一个既用总线电源又有自给电源的设备会在MaxPower域指出需要从总线取的电量。并设置D6为一。
                                    // 运行时期的实际电源模式可由GetStatus(DEVICE) 请求得到。
    
	__u8  bMaxPower;				// 在此配置下的总线电源耗费量。以 2mA 为一个单位。
} __attribute__ ((packed));

4.4 字符串描述符

/* USB_DT_STRING: String descriptor */
struct usb_string_descriptor {
	__u8  bLength;					// 此描述表的字节数(bString域的数值N+2)
	__u8  bDescriptorType;			// 字串描述表类型(此处应为0x03)

	__le16 wData[1];		/* UTF-16LE encoded */
} __attribute__ ((packed));			// UNICODE 编码的字串

4.5 接口描述符

/* USB_DT_INTERFACE: Interface descriptor */
struct usb_interface_descriptor {
	__u8  bLength;					// 此描述表的字节数
	__u8  bDescriptorType;			// 接口描述表类(此处应为0x04)

	__u8  bInterfaceNumber;			// 接口号,当前配置支持的接口数组索引(从零开始)。
	__u8  bAlternateSetting;		// 可选设置的索引值。
	__u8  bNumEndpoints;			// 此接口用的端点数量,如果是零则说明此接口只用缺省控制管道。
	
    __u8  bInterfaceClass;			// 接口所属的类值: 
                                    // 零值为将来的标准保留。 
                                    // 如果此域的值设为FFH,则此接口类由厂商说明。 
                                    // 所有其它的值由USB 说明保留。
	
    __u8  bInterfaceSubClass;		// 子类码 
                                    // 这些值的定义视bInterfaceClass域而定。 
                                    // 如果bInterfaceClass域的值为零则此域的值必须为零。 
                                    // bInterfaceClass域不为FFH则所有值由USB 所保留。
	
    __u8  bInterfaceProtocol;		// 协议码:bInterfaceClass 和bInterfaceSubClass 域的值而定.如果一个接口支持设备类相关的请求此域
    								// 的值指出了设备类说明中所定义的协议.
	
    __u8  iInterface;				// 描述此接口的字串描述表的索引值。
} __attribute__ ((packed));

4.6 端点描述符

/* USB_DT_ENDPOINT: Endpoint descriptor */
struct usb_endpoint_descriptor {
	__u8  bLength;					// 此描述表的字节数
	__u8  bDescriptorType;			// 端点描述表类(此处应为0x05)

	__u8  bEndpointAddress;			// 此描述表所描述的端点的地址、方向: 
                                    // Bit 3..0 : 端点号.
                                    // Bit 6..4 : 保留,为零 
                                    // Bit 7:    方向,如果控制端点则略。 
                                    // 0:输出端点(主机到设备) 
                                    // 1:输入端点(设备到主机)
	
	__u8  bmAttributes;				// 此域的值描述的是在bConfigurationValue域所指的配置下端点的特性。 
                                    // Bit 1..0 :传送类型 
                                    // 00=控制传送 
                                    // 01=同步传送 
                                    // 10=批传送 
                                    // 11=中断传送 
                                    // 所有其它的位都保留。
	
    __le16 wMaxPacketSize;			// 当前配置下此端点能够接收或发送的最大数据包的大小。 
                                    // 对于实进传输,此值用于为每帧的数据净负荷预留时间。在实际运行时,管道可能不完全需要预留的带宽,实际带宽可由设备
                                    // 通过一种非USB定义的机制汇报给主机。对于中断传输,批量传输和控制传输,端点可能发送比之短的数据包
	
    __u8  bInterval;				// 周期数据传输端点的时间间隙。此域的值对于批传送的端点及控制传送的端点无意义。对于同步传送的端点此域必需为1,
    								// 表示周期为1ms。对于中断传送的端点此域值的范围为1ms到255ms。

	/* NOTE:  these two are _only_ in audio endpoints. */
	/* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
	__u8  bRefresh;
	__u8  bSynchAddress;
} __attribute__ ((packed));
  • 11
    点赞
  • 53
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

华佗_PCIe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值