svn commit: r249795 - in head/sys/dev/usb: . controller

Hans Petter Selasky hselasky at FreeBSD.org
Tue Apr 23 10:42:16 UTC 2013


Author: hselasky
Date: Tue Apr 23 10:42:15 2013
New Revision: 249795
URL: http://svnweb.freebsd.org/changeset/base/249795

Log:
  Add convenience wrapper functions to run callbacks in the context of the
  USB explore thread.

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_process.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c	Tue Apr 23 10:30:47 2013	(r249794)
+++ head/sys/dev/usb/controller/usb_controller.c	Tue Apr 23 10:42:15 2013	(r249795)
@@ -901,3 +901,28 @@ usb_bus_mem_free_all(struct usb_bus *bus
 
 	mtx_destroy(&bus->bus_mtx);
 }
+
+/* convenience wrappers */
+void
+usb_proc_explore_mwait(struct usb_device *udev, void *pm1, void *pm2)
+{
+	usb_proc_mwait(USB_BUS_EXPLORE_PROC(udev->bus), pm1, pm2);
+}
+
+void	*
+usb_proc_explore_msignal(struct usb_device *udev, void *pm1, void *pm2)
+{
+	return (usb_proc_msignal(USB_BUS_EXPLORE_PROC(udev->bus), pm1, pm2));
+}
+
+void
+usb_proc_explore_lock(struct usb_device *udev)
+{
+	USB_BUS_LOCK(udev->bus);
+}
+
+void
+usb_proc_explore_unlock(struct usb_device *udev)
+{
+	USB_BUS_UNLOCK(udev->bus);
+}

Modified: head/sys/dev/usb/usb_process.h
==============================================================================
--- head/sys/dev/usb/usb_process.h	Tue Apr 23 10:30:47 2013	(r249794)
+++ head/sys/dev/usb/usb_process.h	Tue Apr 23 10:42:15 2013	(r249795)
@@ -44,6 +44,7 @@
 /* structure prototypes */
 
 struct usb_proc_msg;
+struct usb_device;
 
 /*
  * The following structure defines the USB process.
@@ -81,4 +82,9 @@ void	usb_proc_free(struct usb_process *u
 void   *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1);
 void	usb_proc_rewakeup(struct usb_process *up);
 
+void	usb_proc_explore_mwait(struct usb_device *, void *, void *);
+void   *usb_proc_explore_msignal(struct usb_device *, void *, void *);
+void	usb_proc_explore_lock(struct usb_device *);
+void	usb_proc_explore_unlock(struct usb_device *);
+
 #endif					/* _USB_PROCESS_H_ */


More information about the svn-src-head mailing list