USB device configuration
aseem.jolly
aseem.jolly at gmail.com
Tue Oct 8 23:21:41 UTC 2013
In usb_device_alloc function, after putting the device into powered state. We
try to select configuration 1(default configuration of most of the USB
devices) by calling *usbd_set_config_index*
In *usb_set_config_index*, we check for power requirements, then make a
request to the device to select the configuration and if we see an error in
performing this request, we goto done where we unconfigure the usb.
Don't you think that we need to change the state back 'powered' again during
unconfiguration or we should change the state to configured only when
*usbd_req_set_config* return 0(success).
udev->power = power;
udev->curr_config_no = cdp->bConfigurationValue;
udev->curr_config_index = index;
*usb_set_device_state(udev, USB_STATE_CONFIGURED);*
/* Set the actual configuration value. */
err = *usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);*
if (err) {
goto done;
}
Basically, I mean somthing like
udev->power = power;
udev->curr_config_no = cdp->bConfigurationValue;
udev->curr_config_index = index;
/* Set the actual configuration value. */
err = *usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);*
if (err) {
goto done;
* } else {
usb_set_device_state(udev, USB_STATE_CONFIGURED);
}*
--
View this message in context: http://freebsd.1045724.n5.nabble.com/USB-device-configuration-tp5850403.html
Sent from the freebsd-usb mailing list archive at Nabble.com.
More information about the freebsd-usb
mailing list