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.
_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Reply via email to