Date: Mon, 27 Oct 2008 17:22:46 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184354 - head/sys/dev/ath Message-ID: <200810271722.m9RHMkHl046693@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Mon Oct 27 17:22:46 2008 New Revision: 184354 URL: http://svn.freebsd.org/changeset/base/184354 Log: add sys.dev.ath.X.intmit knob to enable/disable ANI (the intmit name is historical) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Oct 27 17:19:39 2008 (r184353) +++ head/sys/dev/ath/if_ath.c Mon Oct 27 17:22:46 2008 (r184354) @@ -6625,6 +6625,19 @@ ath_sysctl_tpcts(SYSCTL_HANDLER_ARGS) return !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0; } +static int +ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int intmit, error; + + intmit = ath_hal_getintmit(sc->sc_ah); + error = sysctl_handle_int(oidp, &intmit, 0, req); + if (error || !req->newptr) + return error; + return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0; +} + static void ath_sysctlattach(struct ath_softc *sc) { @@ -6713,6 +6726,11 @@ ath_sysctlattach(struct ath_softc *sc) "rfkill", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ath_sysctl_rfkill, "I", "enable/disable RF kill switch"); } + if (ath_hal_hasintmit(ah)) { + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "intmit", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_intmit, "I", "interference mitigation"); + } sc->sc_monpass = HAL_RXERR_DECRYPT | HAL_RXERR_MIC; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "monpass", CTLFLAG_RW, &sc->sc_monpass, 0, Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Oct 27 17:19:39 2008 (r184353) +++ head/sys/dev/ath/if_athvar.h Mon Oct 27 17:22:46 2008 (r184354) @@ -601,6 +601,12 @@ void ath_intr(void *); (ath_hal_getcapability(_ah, HAL_CAP_TPC_CTS, 0, _ptpcts) == HAL_OK) #define ath_hal_settpcts(_ah, _tpcts) \ ath_hal_setcapability(_ah, HAL_CAP_TPC_CTS, 0, _tpcts, NULL) +#define ath_hal_hasintmit(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 0, NULL) == HAL_OK) +#define ath_hal_getintmit(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 1, NULL) == HAL_OK) +#define ath_hal_setintmit(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_INTMIT, 1, _v, NULL) #define ath_hal_getchannoise(_ah, _c) \ ((*(_ah)->ah_getChanNoise)((_ah), (_c))) #if HAL_ABI_VERSION < 0x05122200
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810271722.m9RHMkHl046693>