From owner-p4-projects@FreeBSD.ORG Thu Nov 4 22:55:03 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02E2016A4D0; Thu, 4 Nov 2004 22:55:02 +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 D201916A4CE for ; Thu, 4 Nov 2004 22:55:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C37F943D54 for ; Thu, 4 Nov 2004 22:55:02 +0000 (GMT) (envelope-from sam@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 iA4Mt2hZ042780 for ; Thu, 4 Nov 2004 22:55:02 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iA4Mt2uJ042777 for perforce@freebsd.org; Thu, 4 Nov 2004 22:55:02 GMT (envelope-from sam@freebsd.org) Date: Thu, 4 Nov 2004 22:55:02 GMT Message-Id: <200411042255.iA4Mt2uJ042777@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 64271 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: Thu, 04 Nov 2004 22:55:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=64271 Change 64271 by sam@sam_ebb on 2004/11/04 22:54:53 add mib variable to control the diagnostic register so folks have an example of how to disable h/w acks and the like Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#10 edit .. //depot/projects/wifi/sys/dev/ath/if_athvar.h#3 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#10 (text+ko) ==== @@ -3952,6 +3952,21 @@ return !ath_hal_setdiversity(sc->sc_ah, diversity) ? EINVAL : 0; } +static int +ath_sysctl_diag(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + u_int32_t diag; + int error; + + if (!ath_hal_getdiag(sc->sc_ah, &diag)) + return EINVAL; + error = sysctl_handle_int(oidp, &diag, 0, req); + if (error || !req->newptr) + return error; + return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0; +} + static void ath_sysctlattach(struct ath_softc *sc) { @@ -4000,6 +4015,9 @@ SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "txintrperiod", CTLFLAG_RW, &sc->sc_txintrperiod, 0, "tx descriptor batching"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "diag", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_diag, "I", "h/w diagnostic control"); } static void ==== //depot/projects/wifi/sys/dev/ath/if_athvar.h#3 (text+ko) ==== @@ -396,6 +396,10 @@ (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK) #define ath_hal_setdiversity(_ah, _v) \ ath_hal_setcapability(_ah, HAL_CAP_DIVERSITY, 1, _v, NULL) +#define ath_hal_getdiag(_ah, _pv) \ + (ath_hal_getcapability(_ah, HAL_CAP_DIAG, 0, _pv) == HAL_OK) +#define ath_hal_setdiag(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_DIAG, 0, _v, NULL) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq)))