From 5f737db4e495ebc1da1ac40b02836b529db77abe Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 24 Oct 2008 22:42:28 +0000 Subject: Add USB storage class driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1075 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/nuttx/scsi.h | 53 +++++++++--------- nuttx/include/nuttx/usbdev_trace.h | 108 ++++++++++++++++++------------------- 2 files changed, 80 insertions(+), 81 deletions(-) (limited to 'nuttx/include') diff --git a/nuttx/include/nuttx/scsi.h b/nuttx/include/nuttx/scsi.h index a7a568ed8..e21b7a90d 100644 --- a/nuttx/include/nuttx/scsi.h +++ b/nuttx/include/nuttx/scsi.h @@ -632,10 +632,11 @@ struct scsicmd_requestsense_s ubyte opcode; /* 0: 0x03 */ ubyte flags; /* 1: See SCSICMD_REQUESTSENSE_FLAGS_* */ ubyte reserved[2]; /* 2-3: Reserved */ - ubyte len; /* 4: Allocation length */ + ubyte alloclen; /* 4: Allocation length */ ubyte control; /* 5: Control */ }; #define SCSICMD_REQUESTSENSE_SIZEOF 6 +#define SCSICMD_REQUESTSENSE_MSSIZEOF 12 /* MS-Windows REQUEST SENSE with cbw->cdblen == 12 */ struct scsiresp_fixedsensedata_s { @@ -658,7 +659,7 @@ struct scscicmd_inquiry_s ubyte opcode; /* 0: 0x12 */ ubyte flags; /* 1: See SCSICMD_INQUIRY_FLAGS_* */ ubyte pagecode; /* 2: Page code */ - ubyte len[2]; /* 3-4: Allocation length */ + ubyte alloclen[2]; /* 3-4: Allocation length */ ubyte control; /* 5: Control */ }; #define SCSICMD_INQUIRY_SIZEOF 6 @@ -713,7 +714,7 @@ struct scsicmd_modesense6_s ubyte flags; /* 1: See SCSICMD_MODESENSE6_FLAGS_* */ ubyte pcpgcode; /* 2: Bits 6-7: PC, bits 0-5: page code */ ubyte subpgcode; /* 3: subpage code */ - ubyte len; /* 4: Allocation length */ + ubyte alloclen; /* 4: Allocation length */ ubyte control; /* 5: Control */ }; #define SCSICMD_MODESENSE6_SIZEOF 6 @@ -775,7 +776,7 @@ struct scsicmd_read6_s ubyte opcode; /* 0: 0x08 */ ubyte mslba; /* 1: Bits 5-7: reserved; Bits 0-6: MS Logical Block Address (LBA) */ ubyte lslba[2]; /* 2-3: LS Logical Block Address (LBA) */ - ubyte xfrlen; /* 4: Transfer length */ + ubyte xfrlen; /* 4: Transfer length (in contiguous logical blocks)*/ ubyte control; /* 5: Control */ }; #define SCSICMD_READ6_SIZEOF 6 @@ -785,7 +786,7 @@ struct scsicmd_write6_s ubyte opcode; /* 0: 0x0a */ ubyte mslba; /* 1: Bits 5-7: reserved; Bits 0-6: MS Logical Block Address (LBA) */ ubyte lslba[2]; /* 2-3: LS Logical Block Address (LBA) */ - ubyte xfrlen; /* 4: Transfer length */ + ubyte xfrlen; /* 4: Transfer length (in contiguous logical blocks) */ ubyte control; /* 5: Control */ }; #define SCSICMD_WRITE6_SIZEOF 6 @@ -830,12 +831,12 @@ struct scsiresp_readcapacity10_s struct scsicmd_read10_s { - ubyte opcode; /* 0x28 */ - ubyte flags; /* See SCSICMD_READ10FLAGS_* */ - ubyte lba[4]; /* Logical Block Address (LBA) */ - ubyte groupno; /* Bits 5-7: reserved; Bits 0-6: group number */ - ubyte xfrlen[2]; /* Transfer length */ - ubyte control; /* Control */ + ubyte opcode; /* 0: 0x28 */ + ubyte flags; /* 1: See SCSICMD_READ10FLAGS_* */ + ubyte lba[4]; /* 2-5: Logical Block Address (LBA) */ + ubyte groupno; /* 6: Bits 5-7: reserved; Bits 0-6: group number */ + ubyte xfrlen[2]; /* 7-8: Transfer length (in contiguous logical blocks) */ + ubyte control; /* 9: Control */ }; #define SCSICMD_READ10_SIZEOF 10 @@ -845,7 +846,7 @@ struct scsicmd_write10_s ubyte flags; /* 1: See SCSICMD_WRITE10FLAGS_* */ ubyte lba[4]; /* 2-5: Logical Block Address (LBA) */ ubyte groupno; /* 6: Bits 5-7: reserved; Bits 0-6: group number */ - ubyte xfrlen[2]; /* 7-8: Transfer length */ + ubyte xfrlen[2]; /* 7-8: Transfer length (in contiguous logical blocks) */ ubyte control; /* 9: Control */ }; #define SCSICMD_WRITE10_SIZEOF 10 @@ -877,7 +878,7 @@ struct scsicmd_modeselect10_s ubyte opcode; /* 0: 0x55 */ ubyte flags; /* 1: See SCSICMD_MODESELECT10_FLAGS_* */ ubyte reserved[5]; /* 2-6: Reserved */ - ubyte plen[2]; /* 7-8: Parameter list length */ + ubyte parmlen[2]; /* 7-8: Parameter list length */ ubyte control; /* 9: Control */ }; #define SCSICMD_MODESELECT10_SIZEOF 10 @@ -899,7 +900,7 @@ struct scsicmd_modesense10_s ubyte pcpgcode; /* 2: Bits 6-7: PC, bits 0-5: page code */ ubyte subpgcode; /* 3: subpage code */ ubyte reserved[3]; /* 4-6: reserved */ - ubyte len[2]; /* 7-8: Allocation length */ + ubyte alloclen[2]; /* 7-8: Allocation length */ ubyte control; /* 9: Control */ }; #define SCSICMD_MODESENSE10_SIZEOF 10 @@ -917,23 +918,23 @@ struct scsicmd_readcapacity16_s struct scsicmd_read12_s { - ubyte opcode; /* 0xa8 */ - ubyte flags; /* See SCSICMD_READ12FLAGS_* */ - ubyte lba[4]; /* Logical Block Address (LBA) */ - ubyte xfrlen[4]; /* Transfer length */ - ubyte groupno; /* Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ - ubyte control; /* Control */ + ubyte opcode; /* 0: 0xa8 */ + ubyte flags; /* 1: See SCSICMD_READ12FLAGS_* */ + ubyte lba[4]; /* 2-5: Logical Block Address (LBA) */ + ubyte xfrlen[4]; /* 6-9: Transfer length (in contiguous logical blocks) */ + ubyte groupno; /* 10: Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ + ubyte control; /* 11: Control */ }; #define SCSICMD_READ12_SIZEOF 12 struct scsicmd_write12_s { - ubyte opcode; /* 0xaa */ - ubyte flags; /* See SCSICMD_WRITE12FLAGS_* */ - ubyte lba[4]; /* Logical Block Address (LBA) */ - ubyte xfrlen[4]; /* Transfer length */ - ubyte groupno; /* Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ - ubyte control; /* Control */ + ubyte opcode; /* 0: 0xaa */ + ubyte flags; /* 1: See SCSICMD_WRITE12FLAGS_* */ + ubyte lba[4]; /* 2-5: Logical Block Address (LBA) */ + ubyte xfrlen[4]; /* 6-9: Transfer length (in contiguous logical blocks) */ + ubyte groupno; /* 10: Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ + ubyte control; /* 11: Control */ }; #define SCSICMD_WRITE12_SIZEOF 12 diff --git a/nuttx/include/nuttx/usbdev_trace.h b/nuttx/include/nuttx/usbdev_trace.h index 13a949f70..b2a2d0f25 100644 --- a/nuttx/include/nuttx/usbdev_trace.h +++ b/nuttx/include/nuttx/usbdev_trace.h @@ -288,61 +288,59 @@ #define USBSTRG_TRACEERR_PHASEERROR1 0x0040 #define USBSTRG_TRACEERR_PHASEERROR2 0x0041 #define USBSTRG_TRACEERR_PHASEERROR3 0x0042 -#define USBSTRG_TRACEERR_PREVENTMEDIUMREMOVALFLAGS 0x0043 -#define USBSTRG_TRACEERR_PREVENTMEDIUMREMOVALPREVENT 0x0044 -#define USBSTRG_TRACEERR_RDALLOCREQ 0x0045 -#define USBSTRG_TRACEERR_RDCOMPLETEINVALIDARGS 0x0046 -#define USBSTRG_TRACEERR_RDCOMPLETERDSUBMIT 0x0047 -#define USBSTRG_TRACEERR_RDSHUTDOWN 0x0048 -#define USBSTRG_TRACEERR_RDSUBMIT 0x0049 -#define USBSTRG_TRACEERR_RDUNEXPECTED 0x004a -#define USBSTRG_TRACEERR_READ10FLAGS 0x004b -#define USBSTRG_TRACEERR_READ10LBARANGE 0x004c -#define USBSTRG_TRACEERR_READ10MEDIANOTPRESENT 0x004d -#define USBSTRG_TRACEERR_READ12FLAGS 0x004e -#define USBSTRG_TRACEERR_READ12LBARANGE 0x004f -#define USBSTRG_TRACEERR_READ12MEDIANOTPRESENT 0x0050 -#define USBSTRG_TRACEERR_READ6FLAGS 0x0051 -#define USBSTRG_TRACEERR_READ6LBARANGE 0x0052 -#define USBSTRG_TRACEERR_READ6MEDIANOTPRESENT 0x0053 -#define USBSTRG_TRACEERR_READCAPACITYFLAGS 0x0054 -#define USBSTRG_TRACEERR_REALLOCIOBUFFER 0x0055 -#define USBSTRG_TRACEERR_REQRESULT 0x0056 -#define USBSTRG_TRACEERR_SETCONFIGINVALIDARGS 0x0057 -#define USBSTRG_TRACEERR_SETUPINVALIDARGS 0x0058 -#define USBSTRG_TRACEERR_SNDCSWFAIL 0x0059 -#define USBSTRG_TRACEERR_SNDPHERROR 0x005a -#define USBSTRG_TRACEERR_SNDSTATUSSUBMIT 0x005b -#define USBSTRG_TRACEERR_SYNCCACHEMEDIANOTPRESENT 0x005c -#define USBSTRG_TRACEERR_THREADCREATE 0x005d -#define USBSTRG_TRACEERR_TOOMANYLUNS 0x005e -#define USBSTRG_TRACEERR_UNBINDINVALIDARGS 0x005f -#define USBSTRG_TRACEERR_UNBINDLUNINVALIDARGS1 0x0060 -#define USBSTRG_TRACEERR_UNBINDLUNINVALIDARGS2 0x0061 -#define USBSTRG_TRACEERR_UNINITIALIZEINVALIDARGS 0x0062 -#define USBSTRG_TRACEERR_UNSUPPORTEDSTDREQ 0x0063 -#define USBSTRG_TRACEERR_VERIFY10FLAGS 0x0064 -#define USBSTRG_TRACEERR_VERIFY10LBARANGE 0x0065 -#define USBSTRG_TRACEERR_VERIFY10MEDIANOTPRESENT 0x0066 -#define USBSTRG_TRACEERR_VERIFY10NOBLOCKS 0x0067 -#define USBSTRG_TRACEERR_VERIFY10READFAIL 0x0068 -#define USBSTRG_TRACEERR_WRALLOCREQ 0x0069 -#define USBSTRG_TRACEERR_SNDPHERROR 0x006a -#define USBSTRG_TRACEERR_WRCOMPLETEINVALIDARGS 0x006b -#define USBSTRG_TRACEERR_WRITE10FLAGS 0x006c -#define USBSTRG_TRACEERR_WRITE10LBARANGE 0x006d -#define USBSTRG_TRACEERR_WRITE10MEDIANOTPRESENT 0x006e -#define USBSTRG_TRACEERR_WRITE10READONLY 0x006f -#define USBSTRG_TRACEERR_WRITE12FLAGS 0x0070 -#define USBSTRG_TRACEERR_WRITE12LBARANGE 0x0071 -#define USBSTRG_TRACEERR_WRITE12MEDIANOTPRESENT 0x0072 -#define USBSTRG_TRACEERR_WRITE12READONLY 0x0073 -#define USBSTRG_TRACEERR_WRITE6FLAGS 0x0074 -#define USBSTRG_TRACEERR_WRITE6LBARANGE 0x0075 -#define USBSTRG_TRACEERR_WRITE6MEDIANOTPRESENT 0x0076 -#define USBSTRG_TRACEERR_WRITE6READONLY 0x0077 -#define USBSTRG_TRACEERR_WRSHUTDOWN 0x0078 -#define USBSTRG_TRACEERR_WRUNEXPECTED 0x0079 +#define USBSTRG_TRACEERR_PREVENTMEDIUMREMOVALPREVENT 0x0043 +#define USBSTRG_TRACEERR_RDALLOCREQ 0x0044 +#define USBSTRG_TRACEERR_RDCOMPLETEINVALIDARGS 0x0045 +#define USBSTRG_TRACEERR_RDCOMPLETERDSUBMIT 0x0046 +#define USBSTRG_TRACEERR_RDSHUTDOWN 0x0047 +#define USBSTRG_TRACEERR_RDSUBMIT 0x0048 +#define USBSTRG_TRACEERR_RDUNEXPECTED 0x0049 +#define USBSTRG_TRACEERR_READ10FLAGS 0x004a +#define USBSTRG_TRACEERR_READ10LBARANGE 0x004b +#define USBSTRG_TRACEERR_READ10MEDIANOTPRESENT 0x004c +#define USBSTRG_TRACEERR_READ12FLAGS 0x004d +#define USBSTRG_TRACEERR_READ12LBARANGE 0x004e +#define USBSTRG_TRACEERR_READ12MEDIANOTPRESENT 0x004f +#define USBSTRG_TRACEERR_READ6LBARANGE 0x0050 +#define USBSTRG_TRACEERR_READ6MEDIANOTPRESENT 0x0051 +#define USBSTRG_TRACEERR_READCAPACITYFLAGS 0x0052 +#define USBSTRG_TRACEERR_REALLOCIOBUFFER 0x0053 +#define USBSTRG_TRACEERR_REQRESULT 0x0054 +#define USBSTRG_TRACEERR_SCSICMDCONTROL 0x0055 +#define USBSTRG_TRACEERR_SETCONFIGINVALIDARGS 0x0056 +#define USBSTRG_TRACEERR_SETUPINVALIDARGS 0x0057 +#define USBSTRG_TRACEERR_SNDCSWFAIL 0x0058 +#define USBSTRG_TRACEERR_SNDPHERROR 0x0059 +#define USBSTRG_TRACEERR_SNDSTATUSSUBMIT 0x005a +#define USBSTRG_TRACEERR_SYNCCACHEMEDIANOTPRESENT 0x005b +#define USBSTRG_TRACEERR_THREADCREATE 0x005c +#define USBSTRG_TRACEERR_TOOMANYLUNS 0x005d +#define USBSTRG_TRACEERR_UNBINDINVALIDARGS 0x005e +#define USBSTRG_TRACEERR_UNBINDLUNINVALIDARGS1 0x005f +#define USBSTRG_TRACEERR_UNBINDLUNINVALIDARGS2 0x0060 +#define USBSTRG_TRACEERR_UNINITIALIZEINVALIDARGS 0x0061 +#define USBSTRG_TRACEERR_UNSUPPORTEDSTDREQ 0x0062 +#define USBSTRG_TRACEERR_VERIFY10FLAGS 0x0063 +#define USBSTRG_TRACEERR_VERIFY10LBARANGE 0x0064 +#define USBSTRG_TRACEERR_VERIFY10MEDIANOTPRESENT 0x0065 +#define USBSTRG_TRACEERR_VERIFY10NOBLOCKS 0x0066 +#define USBSTRG_TRACEERR_VERIFY10READFAIL 0x0067 +#define USBSTRG_TRACEERR_WRALLOCREQ 0x0068 +#define USBSTRG_TRACEERR_SNDPHERROR 0x0069 +#define USBSTRG_TRACEERR_WRCOMPLETEINVALIDARGS 0x006a +#define USBSTRG_TRACEERR_WRITE10FLAGS 0x006b +#define USBSTRG_TRACEERR_WRITE10LBARANGE 0x006c +#define USBSTRG_TRACEERR_WRITE10MEDIANOTPRESENT 0x006d +#define USBSTRG_TRACEERR_WRITE10READONLY 0x006e +#define USBSTRG_TRACEERR_WRITE12FLAGS 0x006f +#define USBSTRG_TRACEERR_WRITE12LBARANGE 0x0070 +#define USBSTRG_TRACEERR_WRITE12MEDIANOTPRESENT 0x0071 +#define USBSTRG_TRACEERR_WRITE12READONLY 0x0072 +#define USBSTRG_TRACEERR_WRITE6LBARANGE 0x0073 +#define USBSTRG_TRACEERR_WRITE6MEDIANOTPRESENT 0x0074 +#define USBSTRG_TRACEERR_WRITE6READONLY 0x0075 +#define USBSTRG_TRACEERR_WRSHUTDOWN 0x0076 +#define USBSTRG_TRACEERR_WRUNEXPECTED 0x0077 /**************************************************************************** * Public Types -- cgit v1.2.3