From owner-p4-projects@FreeBSD.ORG Tue Jun 8 05:43:31 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4970316A4D1; Tue, 8 Jun 2004 05:43:31 +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 1E9DE16A4CE for ; Tue, 8 Jun 2004 05:43:31 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00C2043D53 for ; Tue, 8 Jun 2004 05:43:31 +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 i585hUgQ055375 for ; Tue, 8 Jun 2004 05:43:30 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i585hUZO055372 for perforce@freebsd.org; Tue, 8 Jun 2004 05:43:30 GMT (envelope-from scottl@freebsd.org) Date: Tue, 8 Jun 2004 05:43:30 GMT Message-Id: <200406080543.i585hUZO055372@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 54396 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 05:43:31 -0000 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; } }