aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-06-01 13:33:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 18:04:15 -0400
commit79efa097e75018a2918155f343f0e08e61ee8a8c (patch)
tree336237ca96191aeb9cac6ed8706bc479545f3108 /include
parentefcaa20525fde82bbb4fb8cd9e9016f6fabc6509 (diff)
[PATCH] usbcore: port reset for composite devices
This patch (as699) adds usb_reset_composite_device(), a routine for sending a USB port reset to a device with multiple interfaces owned by different drivers. Drivers are notified about impending and completed resets through two new methods in the usb_driver structure. The patch modifieds the usbfs ioctl code to make it use the new routine instead of usb_reset_device(). Follow-up patches will modify the hub, usb-storage, and usbhid drivers so they can utilize this new API. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 317ec9f28bce..5ad30cefe7b2 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -386,6 +386,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
386 386
387/* USB port reset for device reinitialization */ 387/* USB port reset for device reinitialization */
388extern int usb_reset_device(struct usb_device *dev); 388extern int usb_reset_device(struct usb_device *dev);
389extern int usb_reset_composite_device(struct usb_device *dev,
390 struct usb_interface *iface);
389 391
390extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 392extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
391 393
@@ -554,6 +556,10 @@ struct usb_dynids {
554 * do (or don't) show up otherwise in the filesystem. 556 * do (or don't) show up otherwise in the filesystem.
555 * @suspend: Called when the device is going to be suspended by the system. 557 * @suspend: Called when the device is going to be suspended by the system.
556 * @resume: Called when the device is being resumed by the system. 558 * @resume: Called when the device is being resumed by the system.
559 * @pre_reset: Called by usb_reset_composite_device() when the device
560 * is about to be reset.
561 * @post_reset: Called by usb_reset_composite_device() after the device
562 * has been reset.
557 * @id_table: USB drivers use ID table to support hotplugging. 563 * @id_table: USB drivers use ID table to support hotplugging.
558 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 564 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
559 * or your driver's probe function will never get called. 565 * or your driver's probe function will never get called.
@@ -592,6 +598,9 @@ struct usb_driver {
592 int (*suspend) (struct usb_interface *intf, pm_message_t message); 598 int (*suspend) (struct usb_interface *intf, pm_message_t message);
593 int (*resume) (struct usb_interface *intf); 599 int (*resume) (struct usb_interface *intf);
594 600
601 void (*pre_reset) (struct usb_interface *intf);
602 void (*post_reset) (struct usb_interface *intf);
603
595 const struct usb_device_id *id_table; 604 const struct usb_device_id *id_table;
596 605
597 struct usb_dynids dynids; 606 struct usb_dynids dynids;