소스 검색

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>
Felix Fietkau 14 년 전
부모
커밋
ac56703e0e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/net/wireless/ath/ath9k/beacon.c

+ 1 - 1
drivers/net/wireless/ath/ath9k/beacon.c

@@ -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,