From: Rajkumar Manoharan Date: Fri, 13 Apr 2012 07:46:34 +0000 (+0530) Subject: ath9k: fix ibss beacon next tbtt X-Git-Tag: v3.5-rc1~109^2~410^2~43 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=de5f8fc3a3fd4db14568332ffe39a117eaae5498;p=linux.git ath9k: fix ibss beacon next tbtt Sync-up ibss beacon timer with the beacon frame's timestamp. When the node acts as joiner, it has to sync with the received beacon timestamp instead of reading tsf from hw. As the hw tsf wont wont be update till bssid is configured. This patch programs hw tsf with the received beacon timestamp if beacon timers are yet to be configured. Signed-off-by: Rajkumar Manoharan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index df5b6acd805f..1bf2f57b091c 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c @@ -653,6 +653,8 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, u32 tsf, intval, nexttbtt; ath9k_reset_beacon_status(sc); + if (!(sc->sc_flags & SC_OP_BEACONS)) + ath9k_hw_settsf64(ah, sc->beacon.bc_tstamp); intval = TU_TO_USEC(conf->beacon_interval); tsf = roundup(ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE), intval);