Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2004 22:46:14 GMT
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54360 for review
Message-ID:  <200406072246.i57MkEfN050376@repoman.freebsd.org>

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

Change 54360 by scottl@scottl-esp-sparc64 on 2004/06/07 22:46:06

	Add some macros from NetBSD that help determine the message type.
	Tidy up a few other areas and comment out the target renegotiating
	code for now.

Affected files ...

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

Differences ...

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

@@ -88,6 +88,7 @@
 #include <sys/mutex.h>
 #include <sys/queue.h>
 #include <sys/time.h>
+#include <sys/callout.h>
 #include <vm/uma.h>
 
 #include <cam/cam.h>
@@ -301,7 +302,9 @@
 	sc->sc_path = path;
 
 	/* Reset state & bus */
+#if 0
 	sc->sc_cfflags = sc->sc_dev.dv_cfdata->cf_flags;
+#endif
 	sc->sc_state = 0;
 	ncr53c9x_init(sc, 1);
 
@@ -881,6 +884,7 @@
 		break;
 	}
 
+#if 0
 	case XPT_SET_TRAN_SETTINGS:
 	{
 		struct ncr53c9x_tinfo *ti;
@@ -923,6 +927,7 @@
 			ncr53c9x_update_xfer_mode(sc, xm->xm_target);
 	    }
 		break;
+#endif
 	default:
 		break;
 	}
@@ -935,6 +940,7 @@
 	struct ncr53c9x_softc *sc;
 	int target;
 {
+#if 0
 	struct scsipi_xfer_mode xm;
 	struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[target];
 
@@ -955,6 +961,7 @@
 		xm.xm_mode |= PERIPH_CAP_TQING;
 
 	scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_XFER_MODE, &xm);
+#endif
 }
 
 /*
@@ -1148,27 +1155,31 @@
 			ccb->ccb_h.status = CAM_CMD_TIMEOUT;
 		} else if ((ecb->flags & ECB_SENSE) != 0) {
 			ccb->ccb_h.status = CAM_AUTOSENSE_FAIL;
-		} else if ((ecb->stat & ST_MASK) == SCSI_CHECK) {
+		} else if (ecb->stat == SCSI_STATUS_CHECK_COND) {
 			/* First, save the return values */
-			ecb->ccb->csio.resid = ecb->dleft;
+			ccb->csio.resid = ecb->dleft;
 			ncr53c9x_sense(sc, ecb);
 			return;
 		} else {
-			xs->resid = ecb->dleft;
+			ccb->csio.resid = ecb->dleft;
 		}
+#if 0
 		if (xs->status == SCSI_QUEUE_FULL || xs->status == XS_BUSY)
 			xs->error = XS_BUSY;
+#endif
 	}
 
 #ifdef NCR53C9X_DEBUG
 	if (ncr53c9x_debug & NCR_SHOWTRAC) {
-		if (xs->resid != 0)
-			printf("resid=%d ", xs->resid);
+		if (ccb->csio.resid != 0)
+			printf("resid=%d ", ccb->csio.resid);
+#if 0
 		if (xs->error == XS_SENSE)
 			printf("sense=0x%02x\n",
 			    xs->sense.scsi_sense.error_code);
 		else
 			printf("error=%d\n", xs->error);
+#endif
 	}
 #endif
 
@@ -1448,6 +1459,12 @@
 	return (1);
 }
 
+/* From NetBSD.  These should go into CAM at some point */
+#define MSG_ISEXTENDED(m)	((m) == MSG_EXTENDED)
+#define MSG_IS1BYTE(m) \
+	((!MSG_ISEXTENDED(m) && (m) < 0x20) || MSG_ISIDENTIFY(m))
+#define MSG_IS2BYTE(m)		(((m) & 0xf0) == 0x20)
+
 static inline int
 __verify_msg_format(u_char *p, int len)
 {



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