diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-10-28 00:30:42 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-10-28 00:30:42 +0000 |
commit | b164f177fd439b1ad22f0cd02926114d92cd2349 (patch) | |
tree | 2e280c1689b4673378224c9bac9a5cba32e483d3 /nuttx | |
parent | 487a06cc5aab3a1d55273e634a0b8c41f2153ab7 (diff) | |
download | px4-nuttx-b164f177fd439b1ad22f0cd02926114d92cd2349.tar.gz px4-nuttx-b164f177fd439b1ad22f0cd02926114d92cd2349.tar.bz2 px4-nuttx-b164f177fd439b1ad22f0cd02926114d92cd2349.zip |
Correct handling of GETMAXLUN request
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1087 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/drivers/usbdev/usbdev_storage.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nuttx/drivers/usbdev/usbdev_storage.c b/nuttx/drivers/usbdev/usbdev_storage.c index a84669701..c06046019 100644 --- a/nuttx/drivers/usbdev/usbdev_storage.c +++ b/nuttx/drivers/usbdev/usbdev_storage.c @@ -22,6 +22,9 @@ * "SCSI Block Commands -2 (SBC-2)," American National Standard * for Information Technology, November 13, 2004 * + * "SCSI Multimedia Commands - 3 (MMC-3)," American National Standard + * for Information Technology, November 12, 2001 + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -193,8 +196,8 @@ static const struct usb_ifdesc_s g_ifdesc = { USB_SIZEOF_IFDESC, /* len */ USB_DESC_TYPE_INTERFACE, /* type */ - 0, /* ifno */ - 0, /* alt */ + USBSTRG_INTERFACEID, /* ifno */ + USBSTRG_ALTINTERFACEID, /* alt */ USBSTRG_NENDPOINTS, /* neps */ USB_CLASS_MASS_STORAGE, /* class */ SUBSTRG_SUBCLASS_SCSI, /* subclass */ @@ -942,11 +945,11 @@ static int usbstrg_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *c case USBSTRG_REQ_GETMAXLUN: /* Return number LUNs supported */ { - if (ctrl->type != USBSTRG_TYPE_SETUPIN && value == 0) + if (ctrl->type == USBSTRG_TYPE_SETUPIN && value == 0) { /* Only one interface is supported */ - if (index != USBSTRG_CONFIGID) + if (index != USBSTRG_INTERFACEID) { usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_GETMAXLUNNDX), index); ret = -EDOM; |