Hi,

this patch set introduces usb_anchor and uses it to implement all modern
APIs in the skeleton driver.

- implementation of pre/post_reset

        Regards
                Oliver
Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
----

--- linux-2.6.22-rc2/drivers/usb/usb-skeleton.c.2       2007-05-25 
13:08:11.000000000 +0200
+++ linux-2.6.22-rc2-autosuspend/drivers/usb/usb-skeleton.c     2007-05-25 
13:10:41.000000000 +0200
@@ -476,12 +476,31 @@ static int skel_resume (struct usb_inter
        return 0;
 }
 
+static void skel_pre_reset(struct usb_interface *intf)
+{
+       struct usb_skel *dev = usb_get_intfdata(intf);
+
+       mutex_lock(&dev->io_mutex);
+       skel_draw_down(dev);
+}
+
+static void skel_post_reset(struct usb_interface *intf)
+{
+       struct usb_skel *dev = usb_get_intfdata(intf);
+
+       /* we are sure no URBs are active - no locking needed */
+       dev->errors = -EPIPE;
+       mutex_unlock(&dev->io_mutex);
+}
+
 static struct usb_driver skel_driver = {
        .name =         "skeleton",
        .probe =        skel_probe,
        .disconnect =   skel_disconnect,
        .suspend =      skel_suspend,
        .resume =       skel_resume,
+       .pre_reset =    skel_pre_reset,
+       .post_reset =   skel_post_reset,
        .id_table =     skel_table,
        .supports_autosuspend = 1,
 };

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to