Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Dec 2012 18:36:52 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244036 - in projects/physbio/sys/dev: mfi virtio/scsi wds
Message-ID:  <201212081836.qB8Iaq91094015@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Sat Dec  8 18:36:51 2012
New Revision: 244036
URL: http://svnweb.freebsd.org/changeset/base/244036

Log:
   - Convert the last few drivers to the new CAM_DATA_* format.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  projects/physbio/sys/dev/mfi/mfi_cam.c
  projects/physbio/sys/dev/virtio/scsi/virtio_scsi.c
  projects/physbio/sys/dev/wds/wd7000.c

Modified: projects/physbio/sys/dev/mfi/mfi_cam.c
==============================================================================
--- projects/physbio/sys/dev/mfi/mfi_cam.c	Sat Dec  8 18:35:45 2012	(r244035)
+++ projects/physbio/sys/dev/mfi/mfi_cam.c	Sat Dec  8 18:36:51 2012	(r244036)
@@ -265,11 +265,7 @@ mfip_cam_action(struct cam_sim *sim, uni
 			break;
 		}
 		if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
-			if (ccbh->flags & CAM_DATA_PHYS) {
-				ccbh->status = CAM_REQ_INVALID;
-				break;
-			}
-			if (ccbh->flags & CAM_SCATTER_VALID) {
+			if ((ccbh->flags & CAM_DATA_MASK) != CAM_DATA_VADDR) {
 				ccbh->status = CAM_REQ_INVALID;
 				break;
 			}

Modified: projects/physbio/sys/dev/virtio/scsi/virtio_scsi.c
==============================================================================
--- projects/physbio/sys/dev/virtio/scsi/virtio_scsi.c	Sat Dec  8 18:35:45 2012	(r244035)
+++ projects/physbio/sys/dev/virtio/scsi/virtio_scsi.c	Sat Dec  8 18:36:51 2012	(r244036)
@@ -964,28 +964,31 @@ vtscsi_sg_append_scsi_buf(struct vtscsi_
 	ccbh = &csio->ccb_h;
 	error = 0;
 
-	if ((ccbh->flags & CAM_SCATTER_VALID) == 0) {
-
-		if ((ccbh->flags & CAM_DATA_PHYS) == 0)
+	switch ((ccbh->flags & CAM_DATA_MASK)) {
+	case CAM_DATA_VADDR:
+		error = sglist_append(sg, csio->data_ptr, csio->dxfer_len);
+		break;
+	case CAM_DATA_PADDR:
+		error = sglist_append_phys(sg,
+		    (vm_paddr_t)(vm_offset_t) csio->data_ptr, csio->dxfer_len);
+		break;
+	case CAM_DATA_SG:
+		for (i = 0; i < csio->sglist_cnt && error == 0; i++) {
+			dseg = &((struct bus_dma_segment *)csio->data_ptr)[i];
 			error = sglist_append(sg,
-			    csio->data_ptr, csio->dxfer_len);
-		else
-			error = sglist_append_phys(sg,
-			    (vm_paddr_t)(vm_offset_t) csio->data_ptr,
-			    csio->dxfer_len);
-	} else {
-
+			    (void *)(vm_offset_t) dseg->ds_addr, dseg->ds_len);
+		}
+		break;
+	case CAM_DATA_SG_PADDR:
 		for (i = 0; i < csio->sglist_cnt && error == 0; i++) {
 			dseg = &((struct bus_dma_segment *)csio->data_ptr)[i];
-
-			if ((ccbh->flags & CAM_SG_LIST_PHYS) == 0)
-				error = sglist_append(sg,
-				    (void *)(vm_offset_t) dseg->ds_addr,
-				    dseg->ds_len);
-			else
-				error = sglist_append_phys(sg,
-				    (vm_paddr_t) dseg->ds_addr, dseg->ds_len);
+			error = sglist_append_phys(sg,
+			    (vm_paddr_t) dseg->ds_addr, dseg->ds_len);
 		}
+		break;
+	default:
+		error = EINVAL;
+		break;
 	}
 
 	return (error);

Modified: projects/physbio/sys/dev/wds/wd7000.c
==============================================================================
--- projects/physbio/sys/dev/wds/wd7000.c	Sat Dec  8 18:35:45 2012	(r244035)
+++ projects/physbio/sys/dev/wds/wd7000.c	Sat Dec  8 18:36:51 2012	(r244036)
@@ -1066,7 +1066,7 @@ wds_scsi_io(struct cam_sim * sim, struct
 		xpt_done((union ccb *) csio);
 		return;
 	}
-	if (ccb_h->flags & (CAM_CDB_PHYS | CAM_SCATTER_VALID | CAM_DATA_PHYS)) {
+	if ((ccb_h->flags & CAM_DATA_MASK) != CAM_DATA_VADDR) {
 		/* don't support these */
 		ccb_h->status = CAM_REQ_INVALID;
 		xpt_done((union ccb *) csio);



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