Add provisions to support multiple altsettings

This commit implements the support for one interface to have multiple
altsettings. It also adds hook that user can use to perform actions
when the alsetting switch is performed by host.

Changes:
* For backward compatibility, placed a pointer instead of allocating memory for whole interface struct.
* Always execute callback (even if the current interface alternate-settings matches).
* Multiple configuration support.

Signed-off-by: Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com>
This commit is contained in:
Andrey Smirnov
2012-11-15 16:02:36 -08:00
committed by Karl Palsson
parent fd141a8131
commit db58d5ae82
4 changed files with 48 additions and 13 deletions

View File

@@ -89,6 +89,9 @@ struct _usbd_device {
void (*user_callback_set_config[MAX_USER_SET_CONFIG_CALLBACK])
(usbd_device *usbd_dev, uint16_t wValue);
void (*user_callback_set_altsetting)(usbd_device *usbd_dev,
uint16_t wIndex, uint16_t wValue);
const struct _usbd_driver *driver;
/* private driver data */