From owner-p4-projects@FreeBSD.ORG Mon Jun 7 22:46:15 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0040A16A4D1; Mon, 7 Jun 2004 22:46:14 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEA0D16A4CE for ; Mon, 7 Jun 2004 22:46:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B13F543D49 for ; Mon, 7 Jun 2004 22:46:14 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i57MkEZ0050379 for ; Mon, 7 Jun 2004 22:46:14 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i57MkEfN050376 for perforce@freebsd.org; Mon, 7 Jun 2004 22:46:14 GMT (envelope-from scottl@freebsd.org) Date: Mon, 7 Jun 2004 22:46:14 GMT Message-Id: <200406072246.i57MkEfN050376@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Subject: PERFORCE change 54360 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2004 22:46:15 -0000 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 #include #include +#include #include #include @@ -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) {