Add USB storage class driver

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1075 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2008-10-24 22:42:28 +00:00
parent 953a01d0f1
commit a6944dfe49
8 changed files with 5100 additions and 93 deletions
+4
View File
@@ -509,4 +509,8 @@
* Fixed a problem with a un-initialized variable in the USB serial driver.
* Added USB storage NXP LPC214x configuration
* Added a test for USB storage under examples/usbstorage
* Fixed a bug in the LPC214x USB driver: It was not properly clearing a HALTed
endpoints (other than EP) on receipt of CLEAR FEATURES request.
* Added USB storage class device side driver (BBB)
+13 -12
View File
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: October 23, 2008</p>
<p>Last Updated: October 24, 2008</p>
</td>
</tr>
</table>
@@ -356,7 +356,7 @@
<td><br></td>
<td>
<p>
<li>Network, serial, CAN, driver architecture.</li>
<li>Network, USB (device), serial, CAN, driver architecture.</li>
</p>
</tr>
@@ -374,7 +374,6 @@
<li>Mount-able volumes. Bind mountpoint, filesystem, and block device driver.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -382,7 +381,6 @@
<li>FAT12/16/32 filesystem support.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -390,13 +388,13 @@
<li>ROMFS filesystem support.</li>
</p>
</tr>
<tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td bgcolor="#5eaee1">
<b>C Library</b>
</td>
</tr>
<tr>
<td><br></td>
<td>
@@ -411,7 +409,6 @@
<b>Networking</b>
</td>
</tr>
<tr>
<td><br></td>
<td>
@@ -419,7 +416,6 @@
<li>TCP/IP, UDP, ICMP stacks.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -427,7 +423,6 @@
<li>Small footprint (based on uIP).</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -435,7 +430,6 @@
<li>BSD compatible socket layer.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -450,7 +444,6 @@
<b>USB Device Support</b>
</td>
</tr>
<tr>
<td><br></td>
<td>
@@ -458,7 +451,6 @@
<li><i>Gadget</i>-like architecture for USB device controller drivers and device-dependent USB class drivers.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -466,7 +458,6 @@
<li>USB device controller drivers available for the NXP LPC214x and TI DM320.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
@@ -474,6 +465,13 @@
<li>Device-dependent USB class drivers available for USB serial.</li>
</p>
</tr>
<tr>
<td><br></td>
<td>
<p>
<li>Bult-in USB trace functionality for USB debug.</li>
</p>
</tr>
</table></center>
@@ -1141,6 +1139,9 @@ nuttx-0.3.17 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Fixed a problem with a un-initialized variable in the USB serial driver.
* Added USB storage NXP LPC214x configuration
* Added a test for USB storage under examples/usbstorage
* Fixed a bug in the LPC214x USB driver: It was not properly clearing a HALTed
endpoints (other than EP) on receipt of CLEAR FEATURES request.
* Added USB storage class device side driver (BBB)
pascal-0.1.3 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+3
View File
@@ -40,6 +40,9 @@ ifeq ($(CONFIG_USBDEV),y)
ifeq ($(CONFIG_USBSER),y)
USBDEV_CSRCS += usbdev_serial.c
endif
ifeq ($(CONFIG_USBSTRG),y)
USBDEV_CSRCS += usbdev_storage.c usbdev_scsi.c
endif
USBDEV_CSRCS += usbdev_trace.c
endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+27 -26
View File
@@ -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
+53 -55
View File
@@ -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