diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-05-16 21:50:30 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-05-16 21:50:30 +0000 |
commit | 7cf29ea9aead5eb84b61e4b19d2cc9adebce5fa1 (patch) | |
tree | 4e811f16691946dca51d8e263a7d47720849f8b1 /package | |
parent | a9b557d1dc3da23be7cb833394ad5a5320392da1 (diff) | |
download | upstream-7cf29ea9aead5eb84b61e4b19d2cc9adebce5fa1.tar.gz upstream-7cf29ea9aead5eb84b61e4b19d2cc9adebce5fa1.tar.bz2 upstream-7cf29ea9aead5eb84b61e4b19d2cc9adebce5fa1.zip |
ath9k: fix issues with ad-hoc beacon slot selection
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26913 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/mac80211/patches/570-ath9k_fix_adhoc_beacons.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/package/mac80211/patches/570-ath9k_fix_adhoc_beacons.patch b/package/mac80211/patches/570-ath9k_fix_adhoc_beacons.patch new file mode 100644 index 0000000000..d3eb764090 --- /dev/null +++ b/package/mac80211/patches/570-ath9k_fix_adhoc_beacons.patch @@ -0,0 +1,50 @@ +--- a/drivers/net/wireless/ath/ath9k/beacon.c ++++ b/drivers/net/wireless/ath/ath9k/beacon.c +@@ -351,9 +351,7 @@ void ath_beacon_tasklet(unsigned long da + struct ath_buf *bf = NULL; + struct ieee80211_vif *vif; + int slot; +- u32 bfaddr, bc = 0, tsftu; +- u64 tsf; +- u16 intval; ++ u32 bfaddr, bc = 0; + + /* + * Check if the previous beacon has gone out. If +@@ -388,17 +386,27 @@ void ath_beacon_tasklet(unsigned long da + * on the tsf to safeguard against missing an swba. + */ + +- intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL; + +- tsf = ath9k_hw_gettsf64(ah); +- tsf += TU_TO_USEC(ah->config.sw_beacon_response_time); +- tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF); +- slot = (tsftu % (intval * ATH_BCBUF)) / intval; +- vif = sc->beacon.bslot[slot]; ++ if (ah->opmode == NL80211_IFTYPE_AP) { ++ u16 intval; ++ u32 tsftu; ++ u64 tsf; ++ ++ intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL; ++ tsf = ath9k_hw_gettsf64(ah); ++ tsf += TU_TO_USEC(ah->config.sw_beacon_response_time); ++ tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF); ++ slot = (tsftu % (intval * ATH_BCBUF)) / intval; ++ vif = sc->beacon.bslot[slot]; ++ ++ ath_dbg(common, ATH_DBG_BEACON, ++ "slot %d [tsf %llu tsftu %u intval %u] vif %p\n", ++ slot, tsf, tsftu / ATH_BCBUF, intval, vif); ++ } else { ++ slot = 0; ++ vif = sc->beacon.bslot[slot]; ++ } + +- ath_dbg(common, ATH_DBG_BEACON, +- "slot %d [tsf %llu tsftu %u intval %u] vif %p\n", +- slot, tsf, tsftu / ATH_BCBUF, intval, vif); + + bfaddr = 0; + if (vif) { |