ChangeSet 1.823.3.16, 2002/11/14 11:25:24-08:00, david-b@pacbell.net [PATCH] usb sysfs shows bNumConfigurations This patch shows how many configurations a device has, which will be important for eventual user mode tools that manage configurations. diff -Nru a/drivers/usb/core/driverfs.c b/drivers/usb/core/driverfs.c --- a/drivers/usb/core/driverfs.c Thu Nov 14 14:12:16 2002 +++ b/drivers/usb/core/driverfs.c Thu Nov 14 14:12:16 2002 @@ -148,23 +148,31 @@ usb_descriptor_attr (bDeviceClass, "%02x\n") usb_descriptor_attr (bDeviceSubClass, "%02x\n") usb_descriptor_attr (bDeviceProtocol, "%02x\n") +usb_descriptor_attr (bNumConfigurations, "%d\n") void usb_create_driverfs_dev_files (struct usb_device *udev) { struct device *dev = &udev->dev; + /* current configuration's attributes */ device_create_file (dev, &dev_attr_bNumInterfaces); device_create_file (dev, &dev_attr_bConfigurationValue); device_create_file (dev, &dev_attr_bmAttributes); device_create_file (dev, &dev_attr_bMaxPower); + + /* device attributes */ device_create_file (dev, &dev_attr_idVendor); device_create_file (dev, &dev_attr_idProduct); device_create_file (dev, &dev_attr_bcdDevice); device_create_file (dev, &dev_attr_bDeviceClass); device_create_file (dev, &dev_attr_bDeviceSubClass); device_create_file (dev, &dev_attr_bDeviceProtocol); + device_create_file (dev, &dev_attr_bNumConfigurations); + + /* speed varies depending on how you connect the device */ device_create_file (dev, &dev_attr_speed); + // FIXME iff there are other speed configs, show how many if (udev->descriptor.iManufacturer) device_create_file (dev, &dev_attr_manufacturer);