Fix warnings in USB MSC when compiled for a high speed device; also fix USB MSC default VID/PID configuration

This commit is contained in:
Gregory Nutt 2013-09-07 10:12:02 -06:00
parent 0585cd5692
commit 9a9de5de81
4 changed files with 24 additions and 13 deletions

View File

@ -5520,4 +5520,6 @@
* drivers/usbdev/usbdev_strings.c: Extended decoding and stringifging
of USB trace output to include trace output from class drivers.
(2013-9-6).
* drivers/usbdev/usbmsc_desc.c: Fix a warning when USB MSC is
compiled for a high-speed device (2013-9-7).

View File

@ -443,9 +443,9 @@ CONFIG_USBMSC_NWRREQS=4
CONFIG_USBMSC_NRDREQS=4
CONFIG_USBMSC_BULKINREQLEN=512
CONFIG_USBMSC_BULKOUTREQLEN=512
CONFIG_USBMSC_VENDORID=0x00
CONFIG_USBMSC_VENDORID=0x584e
CONFIG_USBMSC_VENDORSTR="Nuttx"
CONFIG_USBMSC_PRODUCTID=0x00
CONFIG_USBMSC_PRODUCTID=0x5342
CONFIG_USBMSC_PRODUCTSTR="Mass Storage"
CONFIG_USBMSC_VERSIONNO=0x399
# CONFIG_USBMSC_REMOVABLE is not set
@ -640,6 +640,10 @@ CONFIG_EXAMPLES_USBMSC_DEVPATH2="/dev/mmcsd1"
CONFIG_EXAMPLES_USBMSC_DEVMINOR3=2
CONFIG_EXAMPLES_USBMSC_DEVPATH3="/dev/mmcsd2"
# CONFIG_EXAMPLES_USBMSC_DEBUGMM is not set
CONFIG_EXAMPLES_USBMSC_CMD_STACKSIZE=768
CONFIG_EXAMPLES_USBMSC_CMD_PRIORITY=100
CONFIG_EXAMPLES_USBMSC_DAEMON_STACKSIZE=2048
CONFIG_EXAMPLES_USBMSC_DAEMON_PRIORITY=100
# CONFIG_EXAMPLES_USBTERM is not set
# CONFIG_EXAMPLES_WATCHDOG is not set

View File

@ -127,8 +127,8 @@ config COMPOSITE_EP0MAXPACKET
config COMPOSITE_VENDORID
hex "Composite vendor ID"
default 0
default 0x0000
config COMPOSITE_VENDORSTR
string "Composite vendor ID"
default "Nuttx"
@ -137,8 +137,8 @@ config COMPOSITE_VENDORSTR
config COMPOSITE_PRODUCTID
hex "Composite product id"
default 0
default 0x0000
config COMPOSITE_PRODUCTSTR
string "Composite product string"
default "Composite device"
@ -523,8 +523,13 @@ config USBMSC_BULKOUTREQLEN
config USBMSC_VENDORID
hex "Mass storage Vendor ID"
default 0x00
default 0x584e
---help---
The vendor ID (VID). The value here is bogus. You should not use
it in any commercial products! You must go through the proper
channels to request a vendor ID for your company if you do not
already have one!
config USBMSC_VENDORSTR
string "Mass storage vendor string"
default "Nuttx"
@ -533,7 +538,9 @@ config USBMSC_VENDORSTR
config USBMSC_PRODUCTID
hex "Mass storage Product ID"
default 0x00
default 0x5342
---help---
The product ID (PID).
config USBMSC_PRODUCTSTR
string "Mass storage product string"

View File

@ -359,7 +359,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf)
#ifdef CONFIG_USBDEV_DUALSPEED
FAR const struct usb_epdesc_s *epdesc;
bool hispeed = (speed == USB_SPEED_HIGH);
uint16_t bulkmxpacket;
#endif
/* Configuration descriptor. If the USB mass storage device is
@ -388,12 +387,11 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf)
hispeed = !hispeed;
}
bulkmxpacket = USBMSC_BULKMAXPACKET(hispeed);
epdesc = USBMSC_EPBULKINDESC(hispeed);
epdesc = USBMSC_EPBULKINDESC(hispeed);
memcpy(buf, epdesc, USB_SIZEOF_EPDESC);
buf += USB_SIZEOF_EPDESC;
epdesc = USBMSC_EPBULKOUTDESC(hispeed);
epdesc = USBMSC_EPBULKOUTDESC(hispeed);
memcpy(buf, epdesc, USB_SIZEOF_EPDESC);
#else
memcpy(buf, &g_fsepbulkoutdesc, USB_SIZEOF_EPDESC);