From owner-p4-projects@FreeBSD.ORG Tue Jun 8 07:58:36 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F3BB516A4D1; Tue, 8 Jun 2004 07:58:35 +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 CD47816A4CE for ; Tue, 8 Jun 2004 07:58:35 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C76F843D5A for ; Tue, 8 Jun 2004 07:58:35 +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 i587wNNd084250 for ; Tue, 8 Jun 2004 07:58:23 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i587wNEH084247 for perforce@freebsd.org; Tue, 8 Jun 2004 07:58:23 GMT (envelope-from scottl@freebsd.org) Date: Tue, 8 Jun 2004 07:58:23 GMT Message-Id: <200406080758.i587wNEH084247@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 54407 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: Tue, 08 Jun 2004 07:58:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=54407 Change 54407 by scottl@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); /*