/************************************************************************************************************/
#if 0
/* Interface association descriptor of Mass Storage. */
0x08,
0x0b,
0x01, //bFirstInterface
0x01, //bInterfaceCount
0x08, //bFunctionClass:08--MASS STORAGE Class
0x06,
0x00,
0x00,
#endif
/*******************************The descriptor of Mass Storage ************************************/
/* Mass Storage Class Interface Descriptor Requirement */
0x09,
0x04,
0x02, //bInterfaceNumber
0x00, //bAlternateSetting
0x02, //bNumEndpoints:two endpoints for IN and OUT
0x08, //bInterfaceClass:08--MASS STORAGE Class
0x06, //bInterfaceSubClass:SCSI transparent
0x50,
0x00,
/* Mass Storage Class Endpoint 4 Descriptor Requirement */
0x07,
0x05,
0x84, //bEndpointAddress:IN, EndpointID=4
0x02, //bmAttributes:Bulk
0x00, 0x02, //wMaxPacketSize:0200h=512--high_speed
0x00,
/* Mass Storage Class Endpoint 5 Descriptor Requirement */
0x07,
0x05,
0x05, //bEndpointAddress:OUT, EndpointID=5
0x02, //bmAttributes:Bulk
0x00, 0x02, //wMaxPacketSize:0200h=512--high_speed
0x00,
/*********************************************************************************************/
};
将该描述符在目标平台运行并接入Linux主机,用“dmesg”查看打印信息如下:
[ 1925.208169] u*** 2-4: new high-speed USB device number 5 using ehci-pci
[ 1925.341185] u*** 2-4: config 1 has an invalid descriptor of length 7, skipping remainder of the config
[ 1925.341203] u*** 2-4: config 1 interface 2 altsetting 0 has 0 endpoint descriptors, different from the interface descriptor's value: 2
[ 1925.342182] u*** 2-4: New USB device found, idVendor=8484, idProduct=0100
[ 1925.342190] u*** 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1925.342197] u*** 2-4: Product: EL Composite device
[ 1925.342203] u*** 2-4: Manufacturer: Expres Logic
[ 1925.342209] u*** 2-4: SerialNumber: 0001
[ 1925.380015] cdc_acm 2-4:1.0: ttyACM0: USB ACM device
[ 1925.380545] u***core: registered new interface driver cdc_acm
[ 1925.380548] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1925.392882] u***-storage 2-4:1.2: USB Mass Storage device detected
[ 1925.394796] u***-storage: probe of 2-4:1.2 failed with error -5
[ 1925.394834] u***core: registered new interface driver u***-storage
[ 1925.437745] u***core: registered new interface driver uas
第二条和第三条报错怎么改也都有......还有Mass Storage能被检测到,但失败了,根据“probe of 2-4:1.2 failed with error -5”报错信息也没查到,是因为缺少处理Mass Storage接口的命令吗?因为这个是自己添加的,CDC是原先USB协议栈里自带定义好的.......
大伙帮忙看看,拜谢了!