aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usbh/hal_usbh_msd.c
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-07-13 16:45:31 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-07-13 16:45:31 -0300
commitc044306ad058689783b1a6941a2a44d5baf738a2 (patch)
tree5ccc2a53c2e4c61450b5cad5208ca704e79fd741 /os/hal/src/usbh/hal_usbh_msd.c
parentc9cc2abf3e6854f68a87f72e73cd4eec92262317 (diff)
downloadChibiOS-Contrib-c044306ad058689783b1a6941a2a44d5baf738a2.tar.gz
ChibiOS-Contrib-c044306ad058689783b1a6941a2a44d5baf738a2.tar.bz2
ChibiOS-Contrib-c044306ad058689783b1a6941a2a44d5baf738a2.zip
USBH: Add flexibility to the enumeration process
Diffstat (limited to 'os/hal/src/usbh/hal_usbh_msd.c')
-rw-r--r--os/hal/src/usbh/hal_usbh_msd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c
index f212516..abc58f3 100644
--- a/os/hal/src/usbh/hal_usbh_msd.c
+++ b/os/hal/src/usbh/hal_usbh_msd.c
@@ -91,7 +91,7 @@ static const usbh_classdriver_vmt_t class_driver_vmt = {
};
const usbh_classdriverinfo_t usbhmsdClassDriverInfo = {
- 0x08, 0x06, 0x50, "MSD", &class_driver_vmt
+ "MSD", &class_driver_vmt
};
#define MSD_REQ_RESET 0xFF
@@ -103,15 +103,14 @@ static usbh_baseclassdriver_t *_msd_load(usbh_device_t *dev, const uint8_t *desc
uint8_t luns;
usbh_urbstatus_t stat;
- if ((rem < descriptor[0]) || (descriptor[1] != USBH_DT_INTERFACE))
+ if (_usbh_match_descriptor(descriptor, rem, USBH_DT_INTERFACE,
+ 0x08, 0x06, 0x50) != HAL_SUCCESS)
return NULL;
const usbh_interface_descriptor_t * const ifdesc = (const usbh_interface_descriptor_t *)descriptor;
if ((ifdesc->bAlternateSetting != 0)
- || (ifdesc->bNumEndpoints < 2)
- || (ifdesc->bInterfaceSubClass != 0x06)
- || (ifdesc->bInterfaceProtocol != 0x50)) {
+ || (ifdesc->bNumEndpoints < 2)) {
return NULL;
}