阅读:1244回复:1
使用EZ-USB FX2开发Mass Storage成功枚举之后遇到的问题求教
我用FX2模拟一个大容量存储设备,用BUSHOUND观察,当设备正确枚举之后,主机向设备发了一个DO包,之后过了一段时间设备RESET,然后主机又发了一个相同的DO包给设备,过一段时间之后设备又RESET,如此重复了3次,之后再没响应了。设备被识别为MASS STORAGE DEVICE ,但是无法安装驱动。我的问题是,这三个DO包是干嘛的?怎么解读这个包的数据? BUSHOUND抓的数据我贴在下面,请大牛帮我看看
Device Phase Data Description Cmd.Phase.Ofs(rep) Delta Date Time ------ ----- ------------------------ ---------------- ------------------ ----- ---------- ------------ 29.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0 23sc 2009-08-12 11:24:43.127 29.0 DI 12 01 00 02 00 00 00 40 .......@ 1.2.0 199us 2009-08-12 11:24:43.127 06 05 07 10 01 00 01 02 ........ 1.2.8 00 01 .. 1.2.16 29.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0 18us 2009-08-12 11:24:43.127 29.0 DI 09 02 20 00 01 01 00 80 .. ..... 2.2.0 211us 2009-08-12 11:24:43.127 20 2.2.8 29.0 CTL 80 06 00 02 00 00 20 00 GET DESCRIPTOR 3.1.0 12us 2009-08-12 11:24:43.127 29.0 DI 09 02 20 00 01 01 00 80 .. ..... 3.2.0 245us 2009-08-12 11:24:43.127 20 09 04 00 00 02 08 06 ....... 3.2.8 50 00 07 05 86 02 00 02 P....... 3.2.16 00 07 05 02 02 00 02 00 ........ 3.2.24 29.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0 13us 2009-08-12 11:24:43.127 29.0 CTL 01 0b 00 00 00 00 00 00 SET INTERFACE 5.1.0 35ms 2009-08-12 11:24:43.163 29.0 CTL a1 fe 00 00 00 00 01 00 GET MAX LUN 6.1.0 35ms 2009-08-12 11:24:43.198 29.0 DI 00 . 6.2.0 262us 2009-08-12 11:24:43.198 29.2 DO 55 53 42 43 10 16 c3 85 USBC.... 7.1.0 248us 2009-08-12 11:24:43.198 24 00 00 00 80 00 06 12 $....... 7.1.8 00 00 00 24 00 00 00 00 ...$.... 7.1.16 00 00 00 00 00 00 00 ....... 1.24 29 RSET 8.1.0 19sc 2009-08-12 11:25:02.619 29.2 DO 55 53 42 43 10 16 c3 85 USBC.... 9.1.0 381ms 2009-08-12 11:25:03 24 00 00 00 80 00 06 12 $....... 9.1.8 00 00 00 24 00 00 00 00 ...$.... 9.1.16 00 00 00 00 00 00 00 ....... 9.1.24 29 RSET 10.1.0 19sc 2009-08-12 11:25:22.619 29.2 DO 55 53 42 43 10 16 c3 85 USBC.... 11.1.0 381ms 2009-08-12 11:25:23.000 24 00 00 00 80 00 06 12 $....... 11.1.8 00 00 00 24 00 00 00 00 ...$.... 11.1.16 00 00 00 00 00 00 00 ....... 11.1.24 29 RSET 12.1.0 19sc 2009-08-12 11:25:42.619 |
|
沙发#
发布于:2009-08-13 10:59
在看了本网站一些前辈的帖子之后终于明白了,成功枚举之后主机发给设备的DO包是CBW,其中各个位的含义如下:
CBW: dCBWSignature: 55 53 42 43 dCBWTag: 10 16 c3 85 dCBWDataTransferLength: 24 00 00 00 bmCBWFlags: 80 bCBWLUN: 00 bCBWCBLength: 06 CBWCB: 12 00 00 00 24 00 00 00 00 00 00 00 其中CBWCB 即为SCSI格式的命令块,解读如下: Operation Code: 12 Logicol unit Number: 00 Logical block address: 00 00 24 00 Transfer length: 00 00 00 00 Reserved: 00 Control: 00 由Operation Code,查询SCSI指令集可知此为INQUIRY请求, 再根据文档中的格式要求返回相应CSW。。。FINALLY。。 此文写给和我一样的菜鸟们。。。。大家一起加油~ |
|