[patch 4/5] introduction of usb_anchor and overhaul of usb-skeleton

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Novell
Message-ID <[email protected]>
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/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.