PERFORCE change 54407 for review

Scott Long scottl at FreeBSD.org
Tue Jun 8 07:58:36 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=54407

Change 54407 by scottl at scottl-esp-sparc64 on 2004/06/08 07:58:23

	Fix a mistake with XPT_BUS_RESET and XPT_DEVICE_RESET being
	switched.  Hook ncr53c9x_scsi_reset() up to XPT_BUS_RESET.  It
	might need a mandatory delay of some sort.  Sanity check the
	incoming target number as CAM seems to like to send an id of
	'-1' on bootup.

Affected files ...

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

Differences ...

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

@@ -823,8 +823,9 @@
 	mtx_lock(&sc->sc_lock);
 
 	switch (ccb->ccb_h.func_code) {
-	case XPT_RESET_DEV:
-		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+	case XPT_RESET_BUS:
+		ncr53c9x_scsi_reset(sc);
+		ccb->ccb_h.status = CAM_REQ_CMP;
 		mtx_unlock(&sc->sc_lock);
 		xpt_done(ccb);
 		return;
@@ -889,10 +890,17 @@
 		xpt_done(ccb);
 		return;
 	case XPT_SCSI_IO:
-	case XPT_RESET_BUS:
+	case XPT_RESET_DEV:
 	{
 		struct ccb_scsiio *csio;
 
+		if (ccb->ccb_h.target_id < 0 ||
+		    ccb->ccb_h.target_id >= sc->sc_ntarg) {
+			ccb->ccb_h.status = CAM_PATH_INVALID;
+			mtx_unlock(&sc->sc_lock);
+			xpt_done(ccb);
+			return;
+		}
 		/* Get an ECB to use. */
 		ecb = ncr53c9x_get_ecb(sc);
 		/*


More information about the p4-projects mailing list