Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2013 16:21:40 -0700 (PDT)
From:      "aseem.jolly" <aseem.jolly@gmail.com>
To:        freebsd-usb@freebsd.org
Subject:   USB device configuration
Message-ID:  <1381274499940-5850403.post@n5.nabble.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1381274499940-5850403.post>