aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-01-14 20:34:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-15 17:03:00 -0500
commite239d8591843945630521ec85edca08289f1a751 (patch)
treee5c99976901afcd8d8189c8a854518fbbca02c10 /drivers/net/wireless/ath/ath9k
parent0005baf4a31efe6de6f922f73ccbd3762a110062 (diff)
ath9k: implement coverage class support
Signed-off-by: Felix Fietkau <nbd@openwrt.org> 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/hw.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c13
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index e1fd4cc9fae2..0b1dd10f1d84 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1195,6 +1195,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
1195{ 1195{
1196 struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; 1196 struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
1197 int acktimeout; 1197 int acktimeout;
1198 int slottime;
1198 int sifstime; 1199 int sifstime;
1199 1200
1200 ath_print(ath9k_hw_common(ah), ATH_DBG_RESET, "ah->misc_mode 0x%x\n", 1201 ath_print(ath9k_hw_common(ah), ATH_DBG_RESET, "ah->misc_mode 0x%x\n",
@@ -1209,8 +1210,10 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
1209 else 1210 else
1210 sifstime = 10; 1211 sifstime = 10;
1211 1212
1212 acktimeout = ah->slottime + sifstime; 1213 /* As defined by IEEE 802.11-2007 17.3.8.6 */
1213 ath9k_hw_setslottime(ah, ah->slottime); 1214 slottime = ah->slottime + 3 * ah->coverage_class;
1215 acktimeout = slottime + sifstime;
1216 ath9k_hw_setslottime(ah, slottime);
1214 ath9k_hw_set_ack_timeout(ah, acktimeout); 1217 ath9k_hw_set_ack_timeout(ah, acktimeout);
1215 ath9k_hw_set_cts_timeout(ah, acktimeout); 1218 ath9k_hw_set_cts_timeout(ah, acktimeout);
1216 if (ah->globaltxtimeout != (u32) -1) 1219 if (ah->globaltxtimeout != (u32) -1)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index a7ff07537bc4..ab1f1981d857 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -551,6 +551,7 @@ struct ath_hw {
551 u32 *bank6Temp; 551 u32 *bank6Temp;
552 552
553 int16_t txpower_indexoffset; 553 int16_t txpower_indexoffset;
554 int coverage_class;
554 u32 beacon_interval; 555 u32 beacon_interval;
555 u32 slottime; 556 u32 slottime;
556 u32 globaltxtimeout; 557 u32 globaltxtimeout;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 580ecca0182c..c0c571c2e8c4 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2014,6 +2014,18 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
2014 mutex_unlock(&sc->mutex); 2014 mutex_unlock(&sc->mutex);
2015} 2015}
2016 2016
2017static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
2018{
2019 struct ath_wiphy *aphy = hw->priv;
2020 struct ath_softc *sc = aphy->sc;
2021 struct ath_hw *ah = sc->sc_ah;
2022
2023 mutex_lock(&sc->mutex);
2024 ah->coverage_class = coverage_class;
2025 ath9k_hw_init_global_settings(ah);
2026 mutex_unlock(&sc->mutex);
2027}
2028
2017struct ieee80211_ops ath9k_ops = { 2029struct ieee80211_ops ath9k_ops = {
2018 .tx = ath9k_tx, 2030 .tx = ath9k_tx,
2019 .start = ath9k_start, 2031 .start = ath9k_start,
@@ -2033,4 +2045,5 @@ struct ieee80211_ops ath9k_ops = {
2033 .sw_scan_start = ath9k_sw_scan_start, 2045 .sw_scan_start = ath9k_sw_scan_start,
2034 .sw_scan_complete = ath9k_sw_scan_complete, 2046 .sw_scan_complete = ath9k_sw_scan_complete,
2035 .rfkill_poll = ath9k_rfkill_poll_state, 2047 .rfkill_poll = ath9k_rfkill_poll_state,
2048 .set_coverage_class = ath9k_set_coverage_class,
2036}; 2049};