狠狠撸

狠狠撸Share a Scribd company logo
Introduction of USB Device by Using USB Storage
Overview Device Requests
Storage Commands
Device Requests Get Descriptor Get Configuration Get String Others
Device Requests Device Descriptor 12 01  0002  00 00 0040  0713   6301  0001  01 02 0301 Field Offset Size Example RequestType 0 1 Direction, Recipient Request 1 1 GET_STATUS, SET_ADDRESS DescriptorType 2 2 DEVICE, CONFIGURATION wLength 6 2 min(wLength, Return bLength) Format of Setup Data Field Offset Size Description bLength 0 1 Size of this package DescriptorType 1 1 Response DescriptorType DeviceClass 4 2 Assign device, like printer(0x7), vendor assign(0xFF), multiple classes(0x0) idVendor 8 2 Assigned by USB-IF idProduct 8 2 Assigned by manufacturer iManufacturer 14 1 Index of string for munufacturer Device Descriptor Get Descriptor 8006   0001  0000  12 00
Device Requests Configuration Descriptor 09 02 20 00  01 010080 32 09 04 00  0002 0806   50 00 07 05   01 02 0002  00 07 05 81  02 0002 00 Field Offset Size Description bLength 0 1 Size of this endpoint DescriptorType 1 1 Endpoint EndpointAddress 2 1 Bit 3...0: Index of this endpoint Bit 7: 0 = OUT, 1 = In MaxPacketSize 4 2 Maximum size of this endpoint Get Configuration 8006 0002  0000FF00 Field Offset Size Description bLength 0 1 Size of this configuration DescriptorType 1 1 Configuration TotalLength 2 2 Size of this package NumberInterfaces 4 1 Number of interfaces in this device Field Offset Size Description bLength 0 1 Size of this interface DescriptorType 1 1 Interface InterfaceNumber 2 1 Index of this interface InterfaceClass 5 2 Assigned by USB-IF InterfaceProtocol 7 1 Qualified by InterfaceClass Endpoint Descriptor Configuration Descriptor Device Descriptor
Device Requests Get String 8006 0203  0904FF00 Field Offset Size Description bLeng th 0 1 Size of this string DescriptorType 1 1 String bString 2 N UNICODE encoded string UNICODE String Descriptor String Descriptor 16 03 4600 6C006100 73006800 20004400 69007300 6B00 F  l  a  s  h  _  D  i  s  k Unknown A1FE0000 00000100 00 A1000000 0000F103 HMFG:ARGOX A-254  ;CMD:EPL;MDL:203dpi;CLS:PRINTER;PROTOCOLS:IEEE1284.4;
Storage Command bit Byte 7 6 5 4 3 2 1 0 0-3 dCBWSignature 4-7 dCBWTag 8-11 dCBWDataTransferLength 12 bmCBWFlags 13 Reserved(0) bCBWLUN 14 Reserved(0) bCBWCBLength 15-30 CBWCB Command Block Wrapper bit Byte 7 6 5 4 3 2 1 0 0-3 dCBWSignature 4-7 dCBWTag 8-11 dCBWDataTransferLength 12 bmCBWFlags Command Status Wrapper
Storage Command bit Byte 7 6 5 4 3 2 1 0 0 Operation Code (28h) 1 dCBWTag 2 (MSB) 3 Logical Block Address 4 5 (LSB) 6 Reserved 7 Transfer Length (MSB) 8 Transfer Length (LSB) 9 Reserved 10 Reserved 11 Reserved Command Block Wrapper Command Block - Read(10) 55534243 08603284 FC000000 80000A23 00000000 000000FC 00000000 000000 > 00000008 003C3FFE 02000200 322E3020 55534220 466C6173 … < 55534253 08603284 00000000 00 <

More Related Content

Usb Device20090717

  • 1. Introduction of USB Device by Using USB Storage
  • 4. Device Requests Get Descriptor Get Configuration Get String Others
  • 5. Device Requests Device Descriptor 12 01 0002 00 00 0040 0713 6301 0001 01 02 0301 Field Offset Size Example RequestType 0 1 Direction, Recipient Request 1 1 GET_STATUS, SET_ADDRESS DescriptorType 2 2 DEVICE, CONFIGURATION wLength 6 2 min(wLength, Return bLength) Format of Setup Data Field Offset Size Description bLength 0 1 Size of this package DescriptorType 1 1 Response DescriptorType DeviceClass 4 2 Assign device, like printer(0x7), vendor assign(0xFF), multiple classes(0x0) idVendor 8 2 Assigned by USB-IF idProduct 8 2 Assigned by manufacturer iManufacturer 14 1 Index of string for munufacturer Device Descriptor Get Descriptor 8006 0001 0000 12 00
  • 6. Device Requests Configuration Descriptor 09 02 20 00 01 010080 32 09 04 00 0002 0806 50 00 07 05 01 02 0002 00 07 05 81 02 0002 00 Field Offset Size Description bLength 0 1 Size of this endpoint DescriptorType 1 1 Endpoint EndpointAddress 2 1 Bit 3...0: Index of this endpoint Bit 7: 0 = OUT, 1 = In MaxPacketSize 4 2 Maximum size of this endpoint Get Configuration 8006 0002 0000FF00 Field Offset Size Description bLength 0 1 Size of this configuration DescriptorType 1 1 Configuration TotalLength 2 2 Size of this package NumberInterfaces 4 1 Number of interfaces in this device Field Offset Size Description bLength 0 1 Size of this interface DescriptorType 1 1 Interface InterfaceNumber 2 1 Index of this interface InterfaceClass 5 2 Assigned by USB-IF InterfaceProtocol 7 1 Qualified by InterfaceClass Endpoint Descriptor Configuration Descriptor Device Descriptor
  • 7. Device Requests Get String 8006 0203 0904FF00 Field Offset Size Description bLeng th 0 1 Size of this string DescriptorType 1 1 String bString 2 N UNICODE encoded string UNICODE String Descriptor String Descriptor 16 03 4600 6C006100 73006800 20004400 69007300 6B00 F l a s h _ D i s k Unknown A1FE0000 00000100 00 A1000000 0000F103 HMFG:ARGOX A-254 ;CMD:EPL;MDL:203dpi;CLS:PRINTER;PROTOCOLS:IEEE1284.4;
  • 8. Storage Command bit Byte 7 6 5 4 3 2 1 0 0-3 dCBWSignature 4-7 dCBWTag 8-11 dCBWDataTransferLength 12 bmCBWFlags 13 Reserved(0) bCBWLUN 14 Reserved(0) bCBWCBLength 15-30 CBWCB Command Block Wrapper bit Byte 7 6 5 4 3 2 1 0 0-3 dCBWSignature 4-7 dCBWTag 8-11 dCBWDataTransferLength 12 bmCBWFlags Command Status Wrapper
  • 9. Storage Command bit Byte 7 6 5 4 3 2 1 0 0 Operation Code (28h) 1 dCBWTag 2 (MSB) 3 Logical Block Address 4 5 (LSB) 6 Reserved 7 Transfer Length (MSB) 8 Transfer Length (LSB) 9 Reserved 10 Reserved 11 Reserved Command Block Wrapper Command Block - Read(10) 55534243 08603284 FC000000 80000A23 00000000 000000FC 00000000 000000 > 00000008 003C3FFE 02000200 322E3020 55534220 466C6173 … < 55534253 08603284 00000000 00 <