On Wed, Mar 31, Greg KH wrote:
> Other than that, it looks sane. Let us know if there are any problems
> reported with it.
I will add this version.
diff -purNX /kernel_exclude.txt
linux-2.6.5-rc3-olh-usb.orig/drivers/usb/core/driverfs.c
linux-2.6.5-rc3-olh-usb/drivers/usb/core/driverfs.c
--- linux-2.6.5-rc3-olh-usb.orig/drivers/usb/core/driverfs.c 2004-03-31
11:17:44.000000000 +0000
+++ linux-2.6.5-rc3-olh-usb/drivers/usb/core/driverfs.c 2004-03-31 15:59:32.000000000
+0000
@@ -70,7 +70,9 @@ static ssize_t show_##name(struct devic
int len; \
\
udev = to_usb_device (dev); \
- len = usb_string(udev, udev->descriptor.field, buf, PAGE_SIZE); \
+ if (!udev->field) \
+ return 0; \
+ len = snprintf(buf, 256, "%s", udev->field); \
if (len < 0) \
return 0; \
buf[len] = '\n'; \
@@ -79,9 +81,9 @@ static ssize_t show_##name(struct devic
} \
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
-usb_string_attr(product, iProduct);
-usb_string_attr(manufacturer, iManufacturer);
-usb_string_attr(serial, iSerialNumber);
+usb_string_attr(product, static_product); /* iProduct); */
+usb_string_attr(manufacturer, static_vendor); /* iManufacturer); */
+usb_string_attr(serial, static_serial); /* iSerialNumber); */
static ssize_t
show_speed (struct device *dev, char *buf)
diff -purNX /kernel_exclude.txt linux-2.6.5-rc3-olh-usb.orig/drivers/usb/core/usb.c
linux-2.6.5-rc3-olh-usb/drivers/usb/core/usb.c
--- linux-2.6.5-rc3-olh-usb.orig/drivers/usb/core/usb.c 2004-03-31 11:17:44.000000000
+0000
+++ linux-2.6.5-rc3-olh-usb/drivers/usb/core/usb.c 2004-03-31 19:39:37.000000000
+0000
@@ -992,6 +992,9 @@ void usb_disconnect(struct usb_device **
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
usbfs_remove_device(dev);
}
+ kfree(dev->static_vendor);
+ kfree(dev->static_product);
+ kfree(dev->static_serial);
up(&dev->serialize);
device_unregister(&dev->dev);
}
@@ -1044,17 +1047,16 @@ int usb_set_address(struct usb_device *d
return retval;
}
-static inline void usb_show_string(struct usb_device *dev, char *id, int index)
+static void usb_add_static_info(struct usb_device *dev, int index, char **info)
{
char *buf;
-
if (!index)
return;
if (!(buf = kmalloc(256, GFP_KERNEL)))
return;
if (usb_string(dev, index, buf, 256) > 0)
- dev_printk(KERN_INFO, &dev->dev, "%s: %s\n", id, buf);
- kfree(buf);
+ *info = buf;
+ return;
}
/*
@@ -1155,13 +1157,19 @@ int usb_new_device(struct usb_device *de
dev_dbg(&dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
dev->descriptor.iManufacturer, dev->descriptor.iProduct,
dev->descriptor.iSerialNumber);
-#ifdef DEBUG
if (dev->descriptor.iProduct)
- usb_show_string(dev, "Product", dev->descriptor.iProduct);
+ usb_add_static_info(dev, dev->descriptor.iProduct,
&dev->static_product);
if (dev->descriptor.iManufacturer)
- usb_show_string(dev, "Manufacturer", dev->descriptor.iManufacturer);
+ usb_add_static_info(dev, dev->descriptor.iManufacturer,
&dev->static_vendor);
if (dev->descriptor.iSerialNumber)
- usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
+ usb_add_static_info(dev, dev->descriptor.iSerialNumber,
&dev->static_serial);
+#if 1
+ if (dev->static_product)
+ dev_printk(KERN_INFO, &dev->dev, "Product: %s\n", dev->static_product);
+ if (dev->static_vendor)
+ dev_printk(KERN_INFO, &dev->dev, "Manufacturer: %s\n",
dev->static_vendor);
+ if (dev->static_serial)
+ dev_printk(KERN_INFO, &dev->dev, "SerialNumber: %s\n",
dev->static_serial);
#endif
/* put device-specific files into sysfs */
diff -purNX /kernel_exclude.txt linux-2.6.5-rc3-olh-usb.orig/include/linux/usb.h
linux-2.6.5-rc3-olh-usb/include/linux/usb.h
--- linux-2.6.5-rc3-olh-usb.orig/include/linux/usb.h 2004-03-31 11:17:45.000000000
+0000
+++ linux-2.6.5-rc3-olh-usb/include/linux/usb.h 2004-03-31 14:47:39.000000000 +0000
@@ -301,6 +301,9 @@ struct usb_device {
int maxchild; /* Number of ports if hub */
struct usb_device *children[USB_MAXCHILDREN];
+ char *static_vendor;
+ char *static_product;
+ char *static_serial;
};
#define to_usb_device(d) container_of(d, struct usb_device, dev)
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÃRNBERG
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel