Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2004 05:43:30 GMT
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54396 for review
Message-ID:  <200406080543.i585hUZO055372@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54396

Change 54396 by scottl@scottl-esp-sparc64 on 2004/06/08 05:42:46

	De-hackify XPT_PATH_INQ and add a somewhat correct implementation
	for XPT_CALC_GEOMETRY and XPT_GET_TRANS_SETTINGS.  Add default stubs
	for other ops.
	Set the CCB status to CAM_REQ_CMP when a command completes
	successfully from the phase engine.  This allows the driver to
	start doing i/o, though it is only at async-narrow.

Affected files ...

.. //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#14 edit

Differences ...

==== //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#14 (text+ko) ====

@@ -824,21 +824,28 @@
 
 	switch (ccb->ccb_h.func_code) {
 	case XPT_RESET_DEV:
-		break;
+		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+		mtx_unlock(&sc->sc_lock);
+		xpt_done(ccb);
+		return;
 	case XPT_CALC_GEOMETRY:
-		break;
+		mtx_unlock(&sc->sc_lock);
+		cam_calc_geometry(&ccb->ccg, 0);	/* XXX Extended? */
+		xpt_done(ccb);
+		return;
 	case XPT_PATH_INQ:
 	{
 		struct ccb_pathinq *cpi = &ccb->cpi;
 
 		cpi->version_num = 1;
-		cpi->hba_inquiry = PI_WIDE_16;
+		cpi->hba_inquiry =
+		    (sc->sc_rev == NCR_VARIANT_FAS366) ? PI_WIDE_16 : 0;
 		cpi->target_sprt = 0;
 		cpi->hba_misc = 0;
 		cpi->hba_eng_cnt = 0;
-		cpi->max_target = 15;
+		cpi->max_target = sc->sc_ntarg - 1;
 		cpi->max_lun = 8;
-		cpi->initiator_id = 7;
+		cpi->initiator_id = sc->sc_id;
 		cpi->bus_id = 0;
 		cpi->base_transfer_speed = 3300;
 		strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
@@ -851,11 +858,36 @@
 		return;
 	}
 	case XPT_GET_TRAN_SETTINGS:
-		break;
+	{
+		struct ccb_trans_settings *cts = &ccb->cts;
+		struct ncr53c9x_tinfo *ti;
+
+		ti = &sc->sc_tinfo[ccb->ccb_h.target_id];
+
+		cts->sync_period = ti->period;
+		cts->sync_offset = ti->offset;
+		cts->bus_width = ti->width;
+		cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
+		cts->valid = CCB_TRANS_BUS_WIDTH_VALID |
+			     CCB_TRANS_SYNC_RATE_VALID |
+			     CCB_TRANS_SYNC_OFFSET_VALID |
+			     CCB_TRANS_DISC_VALID |
+			     CCB_TRANS_TQ_VALID;
+		ccb->ccb_h.status = CAM_REQ_CMP;
+		mtx_unlock(&sc->sc_lock);
+		xpt_done(ccb);
+		return;
+	}
 	case XPT_ABORT:
-		break;
+		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+		mtx_unlock(&sc->sc_lock);
+		xpt_done(ccb);
+		return;
 	case XPT_TERM_IO:
-		break;
+		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+		mtx_unlock(&sc->sc_lock);
+		xpt_done(ccb);
+		return;
 	case XPT_SCSI_IO:
 	case XPT_RESET_BUS:
 	{
@@ -917,6 +949,11 @@
 		break;
 	}
 
+	case XPT_SET_TRAN_SETTINGS:
+		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+		mtx_unlock(&sc->sc_lock);
+		xpt_done(ccb);
+		return;
 #if 0
 	case XPT_SET_TRAN_SETTINGS:
 	{
@@ -2321,6 +2358,7 @@
 			goto sched;
 
 		case NCR_CMDCOMPLETE:
+			ecb->ccb->ccb_h.status = CAM_REQ_CMP;
 			goto finish;
 		}
 	}



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