diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-07-17 07:46:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-17 15:11:39 -0400 |
commit | 2f8e82e8ab4629e648925c566cc26bdcf25f0aec (patch) | |
tree | c03d3a52350bc399f63af700ad7d686e3239feb6 /drivers/net/wireless/ath/ath9k | |
parent | 7e52c8aa35c987236a80b7063c418a3d29b51052 (diff) |
ath9k: Set the TSF adjust value properly
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 3 |
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 00a22683981a..4aca1e5dd712 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -421,6 +421,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, | |||
421 | u32 changed); | 421 | u32 changed); |
422 | void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | 422 | void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); |
423 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | 423 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); |
424 | void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif); | ||
424 | void ath9k_set_beacon(struct ath_softc *sc); | 425 | void ath9k_set_beacon(struct ath_softc *sc); |
425 | void ath9k_set_beaconing_status(struct ath_softc *sc, bool status); | 426 | void ath9k_set_beaconing_status(struct ath_softc *sc, bool status); |
426 | 427 | ||
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 02fbd3eebc2b..f2a2131c5ce5 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -268,6 +268,23 @@ void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif) | |||
268 | tasklet_enable(&sc->bcon_tasklet); | 268 | tasklet_enable(&sc->bcon_tasklet); |
269 | } | 269 | } |
270 | 270 | ||
271 | void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif) | ||
272 | { | ||
273 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
274 | struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; | ||
275 | struct ath_vif *avp = (void *)vif->drv_priv; | ||
276 | u64 tsfadjust; | ||
277 | |||
278 | if (avp->av_bslot == 0) | ||
279 | return; | ||
280 | |||
281 | tsfadjust = cur_conf->beacon_interval * avp->av_bslot / ATH_BCBUF; | ||
282 | avp->tsf_adjust = cpu_to_le64(TU_TO_USEC(tsfadjust)); | ||
283 | |||
284 | ath_dbg(common, CONFIG, "tsfadjust is: %llu for bslot: %d\n", | ||
285 | (unsigned long long)tsfadjust, avp->av_bslot); | ||
286 | } | ||
287 | |||
271 | void ath_beacon_tasklet(unsigned long data) | 288 | void ath_beacon_tasklet(unsigned long data) |
272 | { | 289 | { |
273 | struct ath_softc *sc = (struct ath_softc *)data; | 290 | struct ath_softc *sc = (struct ath_softc *)data; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index d8ae0f5e3da7..915bd4881b3f 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1531,6 +1531,9 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
1531 | 1531 | ||
1532 | if ((changed & BSS_CHANGED_BEACON_ENABLED) || | 1532 | if ((changed & BSS_CHANGED_BEACON_ENABLED) || |
1533 | (changed & BSS_CHANGED_BEACON_INT)) { | 1533 | (changed & BSS_CHANGED_BEACON_INT)) { |
1534 | if (ah->opmode == NL80211_IFTYPE_AP && | ||
1535 | bss_conf->enable_beacon) | ||
1536 | ath9k_set_tsfadjust(sc, vif); | ||
1534 | if (ath9k_allow_beacon_config(sc, vif)) | 1537 | if (ath9k_allow_beacon_config(sc, vif)) |
1535 | ath9k_beacon_config(sc, vif, changed); | 1538 | ath9k_beacon_config(sc, vif, changed); |
1536 | } | 1539 | } |