Date: Mon, 18 Jun 2007 22:29:18 GMT From: Scott Long <scottl@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 121942 for review Message-ID: <200706182229.l5IMTIbK033231@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=121942 Change 121942 by scottl@scottl-deimos on 2007/06/18 22:28:45 Step through rev 1.185 of cam_xpt.c Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#67 integrate Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#67 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.184 2007/05/14 21:48:52 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.185 2007/05/16 16:54:23 scottl Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -5317,6 +5317,39 @@ xpt_free_ccb(done_ccb); } +cam_status +xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, + struct cam_path *path) +{ + struct ccb_setasync csa; + cam_status status; + int xptpath = 0; + + if (path == NULL) { + mtx_lock(&xsoftc.xpt_lock); + status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID, + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + if (status != CAM_REQ_CMP) { + mtx_unlock(&xsoftc.xpt_lock); + return (status); + } + xptpath = 1; + } + + xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5); + csa.ccb_h.func_code = XPT_SASYNC_CB; + csa.event_enable = event; + csa.callback = cbfunc; + csa.callback_arg = cbarg; + xpt_action((union ccb *)&csa); + status = csa.ccb_h.status; + if (xptpath) { + xpt_free_path(path); + mtx_unlock(&xsoftc.xpt_lock); + } + return (status); +} + static void xptaction(struct cam_sim *sim, union ccb *work_ccb) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706182229.l5IMTIbK033231>