From owner-p4-projects@FreeBSD.ORG Mon Jun 18 22:29:19 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C21A416A473; Mon, 18 Jun 2007 22:29:18 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98B2216A400 for ; Mon, 18 Jun 2007 22:29:18 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 895A913C48C for ; Mon, 18 Jun 2007 22:29:18 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5IMTILj033239 for ; Mon, 18 Jun 2007 22:29:18 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5IMTIbK033231 for perforce@freebsd.org; Mon, 18 Jun 2007 22:29:18 GMT (envelope-from scottl@freebsd.org) Date: Mon, 18 Jun 2007 22:29:18 GMT Message-Id: <200706182229.l5IMTIbK033231@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 121942 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2007 22:29:19 -0000 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 -__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 #include @@ -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) {