usb: get_configuration should return bConfigurationValue

Rather than the index of the config. This happens to be the same
thing if you have zero based sequential configurations.
This commit is contained in:
Karl Palsson 2014-04-20 14:49:05 +05:30
parent 7cd7212577
commit 53c1d2c8d9
1 changed files with 2 additions and 1 deletions

View File

@ -310,7 +310,8 @@ static int usb_standard_get_configuration(usbd_device *usbd_dev,
if (*len > 1) {
*len = 1;
}
(*buf)[0] = usbd_dev->current_config;
const struct usb_config_descriptor *cfg = &usbd_dev->config[usbd_dev->current_config - 1];
(*buf)[0] = cfg->bConfigurationValue;
return 1;
}