From owner-p4-projects@FreeBSD.ORG Tue Jun 8 03:16:30 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6513616A4D1; Tue, 8 Jun 2004 03:16:30 +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 3C86916A4CE for ; Tue, 8 Jun 2004 03:16:30 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EC3243D2F for ; Tue, 8 Jun 2004 03:16:30 +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 i583GTR6017285 for ; Tue, 8 Jun 2004 03:16:29 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i583GT5I017282 for perforce@freebsd.org; Tue, 8 Jun 2004 03:16:29 GMT (envelope-from scottl@freebsd.org) Date: Tue, 8 Jun 2004 03:16:29 GMT Message-Id: <200406080316.i583GT5I017282@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 54389 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 03:16:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=54389 Change 54389 by scottl@scottl-esp-sparc64 on 2004/06/08 03:16:23 For some unpleasant reason, giving an alignment arg of '8' to uma_zcreate() results in uma_zalloc() getting unaligned chunks. Add a basic implementation of XPT_PATH_INQ. The driver can now somewhat play with CAM. Affected files ... .. //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#13 edit Differences ... ==== //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#13 (text+ko) ==== @@ -102,7 +102,7 @@ #include #include -int ncr53c9x_debug = NCR_SHOWMISC; /*NCR_SHOWPHASE|NCR_SHOWMISC|NCR_SHOWTRAC|NCR_SHOWCMDS;*/ +int ncr53c9x_debug = NCR_SHOWMISC|NCR_SHOWPHASE|NCR_SHOWMISC|NCR_SHOWTRAC|NCR_SHOWCMDS; #ifdef DEBUG int ncr53c9x_notag = 0; #endif @@ -439,7 +439,7 @@ /* All instances share this zone */ ecb_zone = uma_zcreate("ncr53c9x ecb zone", sizeof(struct ncr53c9x_ecb), NULL, NULL, - NULL, NULL, 8, M_NOWAIT); + NULL, NULL, 0, 0); ecb_zone_initialized = 1; } @@ -794,7 +794,7 @@ ecb = (struct ncr53c9x_ecb *)uma_zalloc(ecb_zone, M_NOWAIT); if (ecb) { - memset(ecb, 0, sizeof(*ecb)); + bzero(ecb, sizeof(struct ncr53c9x_ecb)); ecb->flags |= ECB_ALLOC; ecb->sc = sc; } @@ -817,12 +817,45 @@ struct ncr53c9x_softc *sc; struct ncr53c9x_ecb *ecb; - NCR_TRACE(("[ncr53c9x_action] ")); + NCR_TRACE(("[ncr53c9x_action %d]", ccb->ccb_h.func_code)); sc = cam_sim_softc(sim); mtx_lock(&sc->sc_lock); switch (ccb->ccb_h.func_code) { + case XPT_RESET_DEV: + break; + case XPT_CALC_GEOMETRY: + break; + case XPT_PATH_INQ: + { + struct ccb_pathinq *cpi = &ccb->cpi; + + cpi->version_num = 1; + cpi->hba_inquiry = PI_WIDE_16; + cpi->target_sprt = 0; + cpi->hba_misc = 0; + cpi->hba_eng_cnt = 0; + cpi->max_target = 15; + cpi->max_lun = 8; + cpi->initiator_id = 7; + cpi->bus_id = 0; + cpi->base_transfer_speed = 3300; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, "Sun", HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + ccb->ccb_h.status = CAM_REQ_CMP; + mtx_unlock(&sc->sc_lock); + xpt_done(ccb); + return; + } + case XPT_GET_TRAN_SETTINGS: + break; + case XPT_ABORT: + break; + case XPT_TERM_IO: + break; case XPT_SCSI_IO: case XPT_RESET_BUS: { @@ -929,7 +962,12 @@ break; #endif default: - break; + printf("%s: Unhandled function code %d\n", sc->dv_name, + ccb->ccb_h.func_code); + ccb->ccb_h.status = CAM_PROVIDE_FAIL; + mtx_unlock(&sc->sc_lock); + xpt_done(ccb); + return; } mtx_unlock(&sc->sc_lock);