On Wed, 27 Jul 2005, Pete Zaitcev wrote:
> Alan & others:
>
> Does anyone know off-hand if the string for iConfiguration is freed
> anywhere in the new code in 2.6.13-rc3? This is the allocation:
>
> int usb_set_configuration(struct usb_device *dev, int configuration)
> {
> struct usb_host_config *cp = NULL;
>
> for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
> if (dev->config[i].desc.bConfigurationValue == configuration) {
> cp = &dev->config[i];
> break;
> }
> }
>
> if ((cp->desc.iConfiguration) &&
> (cp->string == NULL)) {
> cp->string = kmalloc(256, GFP_KERNEL);
> if (cp->string)
> usb_string(dev, cp->desc.iConfiguration,
> cp->string, 256);
> }
It is freed in config.c:usb_destroy_configuration.
> I only noticed because Pixar is having a problem with some of their
> Intel/HP kit which is unable to transfer a very long string, and they
> use a color calibrator with a long iConfiguration string.
> What is that string for anyway? Everything worked fine until 2.6.11.
Now we preallocate and retrieve from the device the vendor, product,
config, and interface strings. The idea is that actions like reading
/proc/bus/usb/devices will be able to avoid sending requests to the
device to fetch the strings. Among other things, this will help
mass-storage devices that can't handle control requests while carrying out
I/O.
Until recently we didn't fetch the iConfiguration string at all, IIRC.
Alan Stern
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel