Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jun 2001 11:46:06 -0700 (PDT)
From:      Matthew Jacob <mjacob@feral.com>
To:        <non@freebsd.org>
Cc:        <scsi@freebsd.org>
Subject:   scsi_low changes for CAM_NEW_TRAN_CODE
Message-ID:  <20010624114453.L627-100000@wonky.feral.com>

next in thread | raw e-mail | index | archive | help

I can't test, but these do compile. Let me know if you can commit them soon.

Index: scsi_low.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/scsi/scsi_low.c,v
retrieving revision 1.9
diff -u -r1.9 scsi_low.c
--- scsi_low.c	2001/06/15 00:07:27	1.9
+++ scsi_low.c	2001/06/24 18:44:14
@@ -700,6 +700,41 @@
 			while ((li = LIST_NEXT(li, lun_chain)) != NULL)
 				if (li->li_lun == lun)
 					break;
+#ifdef	CAM_NEW_TRAN_CODE
+		if (li != NULL && cts->type == CTS_TYPE_CURRENT_SETTINGS) {
+			struct ccb_trans_settings_scsi *scsi =
+			    &cts->proto_specific.scsi;
+			struct ccb_trans_settings_spi *spi =
+			    &cts->xport_specific.spi;
+			cts->protocol = PROTO_SCSI;
+			cts->protocol_version = SCSI_REV_2;
+			cts->transport = XPORT_SPI;
+			cts->transport_version = 2;
+
+			scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
+			spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
+
+			if (li->li_cfgflags & SCSI_LOW_DISC)
+				spi->flags |= CTS_SPI_FLAGS_DISC_ENB;
+			if (li->li_cfgflags & SCSI_LOW_QTAG)
+				scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB;
+
+			spi->sync_period = ti->ti_maxsynch.period;
+			spi->valid |= CTS_SPI_VALID_SYNC_RATE;
+			spi->sync_offset = ti->ti_maxsynch.offset;
+			spi->valid |= CTS_SPI_VALID_SYNC_OFFSET;
+
+			spi->valid |= CTS_SPI_VALID_BUS_WIDTH;
+			spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
+
+			if (cts->ccb_h.target_lun != CAM_LUN_WILDCARD) {
+				scsi->valid = CTS_SCSI_VALID_TQ;
+				spi->valid |= CTS_SPI_VALID_DISC;
+			} else
+				scsi->valid = 0;
+		} else
+			ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+#else
 		if (li != NULL && (cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
 			if (li->li_cfgflags & SCSI_LOW_DISC)
 				cts->flags = CCB_TRANS_DISC_ENB;
@@ -720,6 +755,7 @@
 			ccb->ccb_h.status = CAM_REQ_CMP;
 		} else
 			ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+#endif

 		splx(s);
 		xpt_done(ccb);
@@ -774,6 +810,12 @@
 		cpi->initiator_id = 7; /* HOST_SCSI_ID */
 		cpi->bus_id = cam_sim_bus(sim);
 		cpi->base_transfer_speed = 3300;
+#ifdef	CAM_NEW_TRAN_CODE
+		cpi->transport = XPORT_SPI;
+		cpi->transport_version = 2;
+		cpi->protocol = PROTO_SCSI;
+		cpi->protocol_version = SCSI_REV_2;
+#endif
 		strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
 		strncpy(cpi->hba_vid, "SCSI_LOW", HBA_IDLEN);
 		strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




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