From owner-freebsd-scsi Sun Jun 24 11:46:12 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 8453337B401; Sun, 24 Jun 2001 11:46:07 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f5OIk7g82070; Sun, 24 Jun 2001 11:46:07 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Sun, 24 Jun 2001 11:46:06 -0700 (PDT) From: Matthew Jacob Reply-To: To: Cc: Subject: scsi_low changes for CAM_NEW_TRAN_CODE Message-ID: <20010624114453.L627-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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