USB device configuration

Hans Petter Selasky hps at bitfrost.no
Thu Oct 10 07:49:51 UTC 2013


Hi,

On 10/10/13 09:32, aseem.jolly wrote:
>> It is allowed to set the configuration multiple times. Refer to USB
>> 2.0 specification.
 >
> In what possible scenario would we want to set the configuration again? I
> know USB 2.0 specification allows it. I have also tried to modify the code
> and have sent SET_CONFIGURATION request to the device multiple times, and
> device didn't report any error.

Some devices have multiple configurations with different interfaces, 
which the application selects depending on the use-case. Many devices 
only have one configuration.

>
> Or do you mean different configurations of a device, if a device supports
> more that one configuration?
>
>> Is this making a difference for you?
> I have scene a case in which we were unable to attach the umass driver to
> the device but since USB_DEBUG was not enabled at that time so I was not
> able to get more information out of it and being extremely intermittent in
> nature, I am not able to reproduce it again. I am trying to figure out the
> possible scenarios in which we might end up not attaching the driver to the
> device. I believe if we are not able to select a configuration then we don't
> attach the driver to the device.
>
> In usb_unconfigure func:
>
>          udev->curr_config_no = USB_UNCONFIG_NO;
>          udev->curr_config_index = USB_UNCONFIG_INDEX
>
> In usb_probe_and_attach func:
>          if (udev->curr_config_index == USB_UNCONFIG_INDEX) {
>                  /* do nothing - no configuration has been set */
>                  goto done;
>          }
>
>>From the console logs, it is clear that SET_ADDRESS went successfully, have
> noticed that we have assigned a ugen name to the device and also request to
> get the String descriptors(Product, Manufacturer etc) went successfully so
> that make me believe that there might be an error in performing
> SET_CONFIGURATION request. Do you have any other suggestions?

You can use "usbdump" to figure out exactly what went wrong with regard 
to USB requests. That might get you a clearer picture of what's going on.

--HPS



More information about the freebsd-usb mailing list