]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/usb.h
USB: Introduce usb_queue_reset() to do resets from atomic contexts
[linux-2.6-omap-h63xx.git] / include / linux / usb.h
index 859a88e6ce9cf9b9951f5663bec820175d2b3eef..c8e55aa979deb23832a12f3d09594c5972ac970f 100644 (file)
@@ -120,6 +120,11 @@ enum usb_interface_condition {
  *     to the sysfs representation for that device.
  * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not
  *     allowed unless the counter is 0.
+ * @reset_ws: Used for scheduling resets from atomic context.
+ * @reset_running: set to 1 if the interface is currently running a
+ *      queued reset so that usb_cancel_queued_reset() doesn't try to
+ *      remove from the workqueue when running inside the worker
+ *      thread. See __usb_queue_reset_device().
  *
  * USB device drivers attach to interfaces on a physical device.  Each
  * interface encapsulates a single high level function, such as feeding
@@ -168,10 +173,12 @@ struct usb_interface {
        unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */
        unsigned needs_altsetting0:1;   /* switch to altsetting 0 is pending */
        unsigned needs_binding:1;       /* needs delayed unbind/rebind */
+       unsigned reset_running:1;
 
        struct device dev;              /* interface specific device info */
        struct device *usb_dev;
        int pm_usage_cnt;               /* usage counter for autosuspend */
+       struct work_struct reset_ws;    /* for resets in atomic context */
 };
 #define        to_usb_interface(d) container_of(d, struct usb_interface, dev)
 #define        interface_to_usbdev(intf) \
@@ -507,6 +514,7 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
 
 /* USB port reset for device reinitialization */
 extern int usb_reset_device(struct usb_device *dev);
+extern void usb_queue_reset_device(struct usb_interface *dev);
 
 extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);