diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-03-03 07:46:56 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-05 22:39:42 +0300 |
commit | b238e90e99fe51aed14d20eae8a6a1c04ce4ca30 (patch) | |
tree | b9cd8add0647c0ce98959710d682191300a71a9b /drivers/net/wireless/ath9k/main.c | |
parent | 5379c8a26686e12058e23322615df68f9123bccd (diff) | |
download | linux-b238e90e99fe51aed14d20eae8a6a1c04ce4ca30.tar.xz |
ath9k: Handle TSF properly for AP mode
The TSF has to be reset only once, upon bringing
the interface up in AP mode. For any beacon reconfigure calls
after that, resetting the TSF results in incorrect beacon generation.
The only exception is a change in the beacon interval,
which is indicated to the driver by mac80211 through
IEEE80211_CONF_CHANGE_BEACON_INTERVAL, handle this properly.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 9e8f954877c9..a25dcf949f36 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -2168,8 +2168,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, avp->av_opmode = ic_opmode; avp->av_bslot = -1; - if (ic_opmode == NL80211_IFTYPE_AP) + if (ic_opmode == NL80211_IFTYPE_AP) { ath9k_hw_set_tsfadjust(sc->sc_ah, 1); + sc->sc_flags |= SC_OP_TSF_RESET; + } sc->vifs[0] = conf->vif; sc->nvifs++; @@ -2291,6 +2293,16 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) if (changed & IEEE80211_CONF_CHANGE_POWER) sc->config.txpowlimit = 2 * conf->power_level; + /* + * The HW TSF has to be reset when the beacon interval changes. + * We set the flag here, and ath_beacon_config_ap() would take this + * into account when it gets called through the subsequent + * config_interface() call - with IFCC_BEACON in the changed field. + */ + + if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) + sc->sc_flags |= SC_OP_TSF_RESET; + mutex_unlock(&sc->mutex); return 0; |