diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-05-17 04:34:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-19 13:54:05 -0400 |
commit | ac56703e0e790509963ee42cddebe706fbd3b74c (patch) | |
tree | 83adac6e8a05fab9c9d7a6e62beb6d7104639231 | |
parent | 5b68138e5659cbfd5df2879d17f9ba0b66477fec (diff) |
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: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 2f659949e6e0..61b501aae5e9 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -654,7 +654,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, | |||
654 | delta = (tsf - sc->beacon.bc_tstamp); | 654 | delta = (tsf - sc->beacon.bc_tstamp); |
655 | else | 655 | else |
656 | delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp)); | 656 | delta = (tsf + 1 + (~0U - sc->beacon.bc_tstamp)); |
657 | nexttbtt = tsf + roundup(delta, intval); | 657 | nexttbtt = tsf + intval - (delta % intval); |
658 | } | 658 | } |
659 | 659 | ||
660 | ath_dbg(common, ATH_DBG_BEACON, | 660 | ath_dbg(common, ATH_DBG_BEACON, |