summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-10-27 17:22:46 +0000
committersam <sam@FreeBSD.org>2008-10-27 17:22:46 +0000
commit01ab47defe8297ae136a02274992e7115685a15b (patch)
tree1ff085ef8a6ed25491dae84edd9fb1dcf5f1eb15
parent6a321e4bfc73267dbb340d7992eae928581b0a7f (diff)
downloadFreeBSD-src-01ab47defe8297ae136a02274992e7115685a15b.zip
FreeBSD-src-01ab47defe8297ae136a02274992e7115685a15b.tar.gz
add sys.dev.ath.X.intmit knob to enable/disable ANI
(the intmit name is historical)
-rw-r--r--sys/dev/ath/if_ath.c18
-rw-r--r--sys/dev/ath/if_athvar.h6
2 files changed, 24 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 94351fc..094320f 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -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,
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index a62db40..d8d94db 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -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
OpenPOWER on IntegriCloud