summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-05 21:24:51 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-11 13:31:47 +0200
commit2c23090d49a51a59f293ae1afdf763d2cd9fbb49 (patch)
treeb51d5b595dd84823c3fa860c93adf8be8ff4643e
parent7c4ae8d7aa72e2e32cf456007d52ef11545b7f62 (diff)
downloadsecure-hid-2c23090d49a51a59f293ae1afdf763d2cd9fbb49.tar.gz
secure-hid-2c23090d49a51a59f293ae1afdf763d2cd9fbb49.tar.bz2
secure-hid-2c23090d49a51a59f293ae1afdf763d2cd9fbb49.zip
core: use new control wrapper to set configuration to device
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
-rw-r--r--include/driver/usbh_device_driver.h1
-rw-r--r--src/usbh_core.c23
2 files changed, 2 insertions, 22 deletions
diff --git a/include/driver/usbh_device_driver.h b/include/driver/usbh_device_driver.h
index f2190ae..7e013a0 100644
--- a/include/driver/usbh_device_driver.h
+++ b/include/driver/usbh_device_driver.h
@@ -74,7 +74,6 @@ enum USBH_ENUM_STATE {
USBH_ENUM_STATE_CONFIGURATION_DT_READ,
USBH_ENUM_STATE_CONFIGURATION_DT_READ_COMPLETE,
USBH_ENUM_STATE_SET_CONFIGURATION_SETUP,
- USBH_ENUM_STATE_SET_CONFIGURATION_EMPTY_READ,
USBH_ENUM_STATE_SET_CONFIGURATION_COMPLETE,
USBH_ENUM_STATE_FIND_DRIVER,
};
diff --git a/src/usbh_core.c b/src/usbh_core.c
index c7eca7f..0570ac3 100644
--- a/src/usbh_core.c
+++ b/src/usbh_core.c
@@ -609,27 +609,8 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
setup_data.wIndex = 0;
setup_data.wLength = 0;
- dev->state = USBH_ENUM_STATE_SET_CONFIGURATION_EMPTY_READ;
-
- device_xfer_control_write_setup(&setup_data, sizeof(setup_data), device_enumerate, dev);
- }
- break;
-
- case USBH_ENUM_STATE_SET_CONFIGURATION_EMPTY_READ:
- {
- switch (cb_data.status) {
- case USBH_PACKET_CALLBACK_STATUS_OK:
- dev->state = USBH_ENUM_STATE_SET_CONFIGURATION_COMPLETE;
- device_xfer_control_read(0, 0, device_enumerate, dev);
- break;
-
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
- device_enumeration_terminate(dev);
- ERROR(cb_data.status);
- break;
- }
+ dev->state = USBH_ENUM_STATE_SET_CONFIGURATION_COMPLETE;
+ device_control(dev, device_enumerate, &setup_data, 0);
}
break;