Commit ac56703e authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: fix ad-hoc nexttbtt calculation

rounding up the delta between last-beacon-tsf and tsf to intval is wrong
and can lead to misconfigured timers which breaks beacon transmission.
Fix this by adding intval and subtracting the offset of the tsf within the
current slot.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5b68138e
...@@ -654,7 +654,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, ...@@ -654,7 +654,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
delta = (tsf - sc->beacon.bc_tstamp); delta = (tsf - sc->beacon.bc_tstamp);
else else
delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp)); delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp));
nexttbtt = tsf + roundup(delta, intval); nexttbtt = tsf + intval - (delta % intval);
} }
ath_dbg(common, ATH_DBG_BEACON, ath_dbg(common, ATH_DBG_BEACON,
......
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