Date: Sun, 12 May 2013 12:24:29 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250562 - in stable/8/sys/dev/usb: . controller Message-ID: <201305121224.r4CCOTS4092346@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Sun May 12 12:24:29 2013 New Revision: 250562 URL: http://svnweb.freebsd.org/changeset/base/250562 Log: MFC r249795: Add convenience wrapper functions to run callbacks in the context of the USB explore thread. Modified: stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/usb_process.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Sun May 12 12:20:04 2013 (r250561) +++ stable/8/sys/dev/usb/controller/usb_controller.c Sun May 12 12:24:29 2013 (r250562) @@ -877,3 +877,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(&udev->bus->explore_proc, pm1, pm2); +} + +void * +usb_proc_explore_msignal(struct usb_device *udev, void *pm1, void *pm2) +{ + return (usb_proc_msignal(&udev->bus->explore_proc, 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: stable/8/sys/dev/usb/usb_process.h ============================================================================== --- stable/8/sys/dev/usb/usb_process.h Sun May 12 12:20:04 2013 (r250561) +++ stable/8/sys/dev/usb/usb_process.h Sun May 12 12:24:29 2013 (r250562) @@ -42,6 +42,7 @@ /* structure prototypes */ struct usb_proc_msg; +struct usb_device; /* * The following structure defines the USB process. @@ -79,4 +80,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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305121224.r4CCOTS4092346>