From owner-svn-src-projects@FreeBSD.ORG Sat Dec 29 08:26:20 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4E5FDF8; Sat, 29 Dec 2012 08:26:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B95A28FC08; Sat, 29 Dec 2012 08:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBT8QKpe085275; Sat, 29 Dec 2012 08:26:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBT8QKuO085274; Sat, 29 Dec 2012 08:26:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201212290826.qBT8QKuO085274@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Dec 2012 08:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244812 - projects/altix2/sys/dev/mpt X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2012 08:26:20 -0000 Author: marcel Date: Sat Dec 29 08:26:20 2012 New Revision: 244812 URL: http://svnweb.freebsd.org/changeset/base/244812 Log: Invoke the callback with a NULL busdma_md_t argument to handle the CAM_DIR_NONE case. Modified: projects/altix2/sys/dev/mpt/mpt_cam.c Modified: projects/altix2/sys/dev/mpt/mpt_cam.c ============================================================================== --- projects/altix2/sys/dev/mpt/mpt_cam.c Sat Dec 29 05:50:16 2012 (r244811) +++ projects/altix2/sys/dev/mpt/mpt_cam.c Sat Dec 29 08:26:20 2012 (r244812) @@ -1352,9 +1352,7 @@ bad: memset(&mpt_off[tidx], 0xff, MPT_REQUEST_AREA - tidx); } - nseg = busdma_md_get_nsegs(md); - - if (nseg == 0) { + if (md == NULL) { SGE_SIMPLE32 *se1 = (SGE_SIMPLE32 *) sglp; MPI_pSGE_SET_FLAGS(se1, (MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | @@ -1363,6 +1361,7 @@ bad: goto out; } + nseg = busdma_md_get_nsegs(md); flags = MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_64_BIT_ADDRESSING; if (istgt == 0) { @@ -1618,7 +1617,7 @@ out: mpt_prt(mpt, "mpt_execute_req_a64: I/O cancelled (status 0x%x)\n", ccb->ccb_h.status & CAM_STATUS_MASK); - if (nseg && (ccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0) { + if (md != NULL && (ccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0) { busdma_md_unload(req->md); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; @@ -1749,9 +1748,7 @@ bad: memset(&mpt_off[tidx], 0xff, MPT_REQUEST_AREA - tidx); } - nseg = busdma_md_get_nsegs(md); - - if (nseg == 0) { + if (md == NULL) { SGE_SIMPLE32 *se1 = (SGE_SIMPLE32 *) sglp; MPI_pSGE_SET_FLAGS(se1, (MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | @@ -1760,6 +1757,7 @@ bad: goto out; } + nseg = busdma_md_get_nsegs(md); flags = MPI_SGE_FLAGS_SIMPLE_ELEMENT; if (istgt == 0) { @@ -1996,7 +1994,7 @@ out: mpt_prt(mpt, "mpt_execute_req: I/O cancelled (status 0x%x)\n", ccb->ccb_h.status & CAM_STATUS_MASK); - if (nseg && (ccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0) { + if (md != NULL && (ccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0) { busdma_md_unload(req->md); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; @@ -2253,9 +2251,7 @@ mpt_start(struct cam_sim *sim, union ccb #endif } } else { -#if 0 - (*cb)(req, NULL, 0, 0); -#endif + (*cb)(req, NULL, 0); } }