Quoting Andy Armstrong <[EMAIL PROTECTED]>:

> > So, I translate URB_FUNCTION_SELECT_CONFIGURATION into
> > usb_set_configuration()
> > and the configuration selected is what appears on the line
> > ConfigurationDescriptor : bConfigurationValue.
> > That is 1 in your case.
> 
> OK, if I don't have any luck with Dmitri's suggestion (just leave it
> out) I'll try that, thanks.

I doubt you want to call usb_set_configuration, ever. This is because
this procedure commands the device to change its configuration, but
nothing in USB stack is updated! This is a very low-level procedure.
See linux/drivers/usb/usb.c - it's there. If you really intend to call
usb_set_configuration() then you need to call other procedures too,
exactly as the stack does when it opens and closes the device. This
is not recommended.

Selection of a configuration is one of first steps of enumerating a
device, after it gets assigned an address. See usb_new_device() in
usb.c for an example how the device is configured once it is plugged
in. If you want to change the configuration you'd better unplug the
device and replug it with different configuration value used in
usb_new_device().

This issue is not new. USB configurations were introduced as means of
enabling and disabling and reshaping whole interfaces (collections
of pipes). It means that a device can be a microphone in configuration
0 and a mouse in configuration 1, for example. So it is not obvious
how to choose a configuration. How the OS can know whether you want
a mouse or a microphone this time?

It is that complicated in Windows world as well. MS has a lengthy
document where they explain how it might be done. But it is still
complicated because the decision about configuration has to be made
each time you plug the device in. So many (if not most) devices live
happily with one configuration. This is just one of many unnecessary
complexities of USB - it was designed by a committee, after all :-)

Dmitri

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to