Date: Thu, 5 Mar 2009 00:15:43 +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: r189380 - head/sys/dev/ath Message-ID: <200903050015.n250FhZZ057112@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Thu Mar 5 00:15:43 2009 New Revision: 189380 URL: http://svn.freebsd.org/changeset/base/189380 Log: add a sysctl to ena/dis frobbing cca 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 Thu Mar 5 00:04:32 2009 (r189379) +++ head/sys/dev/ath/if_ath.c Thu Mar 5 00:15:43 2009 (r189380) @@ -6861,6 +6861,22 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0; } +#ifdef ATH_SUPPORT_TDMA +static int +ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int setcca, error; + + setcca = sc->sc_setcca; + error = sysctl_handle_int(oidp, &setcca, 0, req); + if (error || !req->newptr) + return error; + sc->sc_setcca = (setcca != 0); + return 0; +} +#endif /* ATH_SUPPORT_TDMA */ + static void ath_sysctlattach(struct ath_softc *sc) { @@ -6974,6 +6990,9 @@ ath_sysctlattach(struct ath_softc *sc) SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "superframe", CTLFLAG_RD, &sc->sc_tdmabintval, 0, "TDMA calculated super frame"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "setcca", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_setcca, "I", "enable CCA control"); } #endif } @@ -7423,7 +7442,8 @@ ath_tdma_config(struct ath_softc *sc, st ath_hal_intrset(ah, 0); ath_beaconq_config(sc); /* setup h/w beacon q */ - ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ + if (sc->sc_setcca) + ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ ath_tdma_bintvalsetup(sc, tdma); /* calculate beacon interval */ ath_tdma_settimers(sc, sc->sc_tdmabintval, sc->sc_tdmabintval | HAL_BEACON_RESET_TSF); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Mar 5 00:04:32 2009 (r189379) +++ head/sys/dev/ath/if_athvar.h Thu Mar 5 00:15:43 2009 (r189380) @@ -255,6 +255,7 @@ struct ath_softc { sc_wmetkipmic:1,/* can do WME+TKIP MIC */ sc_resume_up: 1,/* on resume, start all vaps */ sc_tdma : 1,/* TDMA in use */ + sc_setcca : 1,/* set/clr CCA with TDMA */ sc_resetcal : 1;/* reset cal state next trip */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903050015.n250FhZZ057112>