Commit 81168e50 authored by Fabrice Deyber's avatar Fabrice Deyber Committed by John W. Linville

ath9k: Further fix for mesh beaconing

This fix ensure the timers to be set at beacon interval boundaries.
Without this change timers can be set improperly resulting in the absence of beacons.
Signed-off-by: default avatarFabrice Deyber <fabricedeyber@agilemesh.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b942471b
...@@ -652,22 +652,13 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, ...@@ -652,22 +652,13 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
{ {
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
u32 tsf, delta, intval, nexttbtt; u32 tsf, intval, nexttbtt;
ath9k_reset_beacon_status(sc); ath9k_reset_beacon_status(sc);
tsf = ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE);
intval = TU_TO_USEC(conf->beacon_interval); intval = TU_TO_USEC(conf->beacon_interval);
tsf = roundup(ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE), intval);
if (!sc->beacon.bc_tstamp)
nexttbtt = tsf + intval; nexttbtt = tsf + intval;
else {
if (tsf > sc->beacon.bc_tstamp)
delta = (tsf - sc->beacon.bc_tstamp);
else
delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp));
nexttbtt = tsf + intval - (delta % intval);
}
ath_dbg(common, ATH_DBG_BEACON, ath_dbg(common, ATH_DBG_BEACON,
"IBSS nexttbtt %u intval %u (%u)\n", "IBSS nexttbtt %u intval %u (%u)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment