Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Dec 2012 08:26:20 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244812 - projects/altix2/sys/dev/mpt
Message-ID:  <201212290826.qBT8QKuO085274@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212290826.qBT8QKuO085274>