diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-06 13:07:29 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-06 13:07:29 -0600 |
commit | 1f978ce7a5066fbac3ec0f10095fc5946f457ab8 (patch) | |
tree | 4e6b4b7215cd44ecff710b710f9f8b914aba6516 /nuttx/drivers/usbdev | |
parent | 479fbfb6c4c17ae3520a4403fe68ea5939a74546 (diff) | |
download | px4-nuttx-1f978ce7a5066fbac3ec0f10095fc5946f457ab8.tar.gz px4-nuttx-1f978ce7a5066fbac3ec0f10095fc5946f457ab8.tar.bz2 px4-nuttx-1f978ce7a5066fbac3ec0f10095fc5946f457ab8.zip |
SAMA5D3x-EK: Add support for USB MSC device on AT25 serial flash
Diffstat (limited to 'nuttx/drivers/usbdev')
-rw-r--r-- | nuttx/drivers/usbdev/Kconfig | 12 | ||||
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc.c | 10 | ||||
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc_scsi.c | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/nuttx/drivers/usbdev/Kconfig b/nuttx/drivers/usbdev/Kconfig index 56e45ccf8..f95ca0fa1 100644 --- a/nuttx/drivers/usbdev/Kconfig +++ b/nuttx/drivers/usbdev/Kconfig @@ -486,14 +486,14 @@ config USBMSC_EP0MAXPACKET config USBMSC_EPBULKOUT int "Bulk OUT endpoint number" - default 0 + default 2 ---help--- The logical 7-bit address of a hardware endpoints that support bulk OUT and IN operations config USBMSC_EPBULKIN int "Bulk IN endpoint number" - default 0 + default 3 ---help--- The logical 7-bit address of a hardware endpoints that support bulk OUT and IN operations @@ -522,17 +522,17 @@ config USBMSC_BULKOUTREQLEN maxpacket and ideally as large as a block device sector. config USBMSC_VENDORID - hex "Mass stroage Vendor ID" + hex "Mass storage Vendor ID" default 0x00 config USBMSC_VENDORSTR - string "Mass stroage vendor string" + string "Mass storage vendor string" default "Nuttx" ---help--- The vendor ID code/string config USBMSC_PRODUCTID - hex "Mass stroage Product ID" + hex "Mass storage Product ID" default 0x00 config USBMSC_PRODUCTSTR @@ -544,7 +544,7 @@ config USBMSC_VERSIONNO default "0x399" config USBMSC_REMOVABLE - bool "Mass stroage remove able" + bool "Mass storage remove able" default n ---help--- Select if the media is removable diff --git a/nuttx/drivers/usbdev/usbmsc.c b/nuttx/drivers/usbdev/usbmsc.c index 8dafbae5d..ee4f6da2d 100644 --- a/nuttx/drivers/usbdev/usbmsc.c +++ b/nuttx/drivers/usbdev/usbmsc.c @@ -922,7 +922,6 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config) #ifdef CONFIG_USBDEV_DUALSPEED FAR const struct usb_epdesc_s *epdesc; bool hispeed = (priv->usbdev->speed == USB_SPEED_HIGH); - uint16_t bulkmxpacket; #endif int i; int ret = 0; @@ -966,12 +965,11 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config) /* Configure the IN bulk endpoint */ #ifdef CONFIG_USBDEV_DUALSPEED - bulkmxpacket = USBMSC_BULKMAXPACKET(hispeed); - epdesc = USBMSC_EPBULKINDESC(hispeed); - ret = EP_CONFIGURE(priv->epbulkin, epdesc, false); + epdesc = USBMSC_EPBULKINDESC(hispeed); + ret = EP_CONFIGURE(priv->epbulkin, epdesc, false); #else - ret = EP_CONFIGURE(priv->epbulkin, - usbmsc_getepdesc(USBMSC_EPFSBULKIN), false); + ret = EP_CONFIGURE(priv->epbulkin, + usbmsc_getepdesc(USBMSC_EPFSBULKIN), false); #endif if (ret < 0) { diff --git a/nuttx/drivers/usbdev/usbmsc_scsi.c b/nuttx/drivers/usbdev/usbmsc_scsi.c index ff551871c..fbeb0f192 100644 --- a/nuttx/drivers/usbdev/usbmsc_scsi.c +++ b/nuttx/drivers/usbdev/usbmsc_scsi.c @@ -784,6 +784,8 @@ static inline int usbmsc_cmdstartstopunit(FAR struct usbmsc_dev_s *priv) if (ret == OK) { #ifndef CONFIG_USBMSC_REMOVABLE + FAR struct usbmsc_lun_s *lun = priv->lun; + /* This command is not valid if the media is not removable */ usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_NOTREMOVABLE), 0); @@ -806,8 +808,8 @@ static inline int usbmsc_cmdpreventmediumremoval(FAR struct usbmsc_dev_s *priv) { #ifdef CONFIG_USBMSC_REMOVABLE FAR struct scsicmd_preventmediumremoval_s *pmr = (FAR struct scsicmd_preventmediumremoval_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; #endif + FAR struct usbmsc_lun_s *lun = priv->lun; int ret; priv->u.alloclen = 0; |