aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-11-16 13:41:28 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 13:48:32 -0800
commit733260ff9c45bd4db60f45d17e8560a4a68dff4d (patch)
treee7f09a9a9e2d7a9f22288c9777f7b03906a89e20 /include
parentddae41be6145f5f9cb4e6df35661a09121b90672 (diff)
[PATCH] USB: add dynamic id functionality to USB core
Echo the usb vendor and product id to the "new_id" file in the driver's sysfs directory, and then that driver will be able to bind to a device with those ids if it is present. Example: echo 0557 2008 > /sys/bus/usb/drivers/foo_driver/new_id adds the hex values 0557 and 2008 to the device id table for the foo_driver. Note, usb-serial drivers do not currently work with this capability yet. usb-storage also might have some oddities. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d81b050e595..0dd96ef78c1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -529,6 +529,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
/* ----------------------------------------------------------------------- */
+struct usb_dynids {
+ spinlock_t lock;
+ struct list_head list;
+};
+
/**
* struct usb_driver - identifies USB driver to usbcore
* @owner: Pointer to the module owner of this driver; initialize
@@ -553,6 +558,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
* @id_table: USB drivers use ID table to support hotplugging.
* Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
* or your driver's probe function will never get called.
+ * @dynids: used internally to hold the list of dynamically added device
+ * ids for this driver.
* @driver: the driver model core driver structure.
*
* USB drivers must provide a name, probe() and disconnect() methods,
@@ -588,6 +595,7 @@ struct usb_driver {
const struct usb_device_id *id_table;
+ struct usb_dynids dynids;
struct device_driver driver;
};
#define to_usb_driver(d) container_of(d, struct usb_driver, driver)