Date: Thu, 4 Nov 2004 22:55:02 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 64271 for review Message-ID: <200411042255.iA4Mt2uJ042777@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411042255.iA4Mt2uJ042777>