Alan Stern wrote:
On Wed, 12 Dec 2007, Phil Endecott wrote:

I have a camera (07b4:0102 Olympus Optical Co., Ltd Camedia E-10/C-220/C-50 Camera) which doesn't like getting a second set_configuration() call without first getting a reset.

I think that my solution for the time being will be to first test whether the configuration that I want to use is the same as the one that the kernel has chosen (which I think I can find via sysfs; it's not possible via usbdevice_fs is it?),

Sort of.  You can send a Get-Configuration request directly to the
device and see what it says.

Hmmm, and hope that they have implemented that request correctly....

I presume that reading /sys/bConfigurationValue just returns the kernel's record of which configuration was most recently set, rather than actually doing a get_configuration on the bus - doesn't it?

There is no ioctl to retrieve the value
directly.  Using sysfs might be easier.

and only call ioctl(USBDEVFS_SETCONFIGURATION) if it differs.

I'm now doing this and it at least gets past this particular quirk.

One thing to watch out for is that the USBDEVFS_SETCONFIGURATION call will fail if any interface is bound to a driver.

I disconnect the kernel drivers on all interfaces before calling USBDEVFS_SETCONFIGURATION, and it seems to work.

Writing to the sysfs bConfigurationValue file doesn't have this requirement.

Ah, I didn't know that that was writeable. Interesting. Maybe there is more that I can achieve by writing to sysfs. I'll have to think about that. Oh and BTW, there is also a sysfs file just called 'configuration'; what does that do?

Anyway, I'm sending this message as a "heads up" that this issue exists; I understand that there is a new replacement for usbdevice_fs in the works, and if it could do anything to sidestep the problem, that would be useful.

The real problem here is the camera's failure to respond to a second Set-Config command.

Yes.

I don't see how anything we do can fix that.

Well, if the core didn't do a set_configuration until after the device had been claimed by a driver (kernel or user-space) then only one set_configuration would happen. Of course drivers claim interfaces, not devices....


Regards,

Phil.




-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to