Commit e239d859 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: implement coverage class support

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0005baf4
...@@ -1195,6 +1195,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) ...@@ -1195,6 +1195,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
{ {
struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
int acktimeout; int acktimeout;
int slottime;
int sifstime; int sifstime;
ath_print(ath9k_hw_common(ah), ATH_DBG_RESET, "ah->misc_mode 0x%x\n", 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,8 +1210,10 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
else else
sifstime = 10; sifstime = 10;
acktimeout = ah->slottime + sifstime; /* As defined by IEEE 802.11-2007 17.3.8.6 */
ath9k_hw_setslottime(ah, ah->slottime); slottime = ah->slottime + 3 * ah->coverage_class;
acktimeout = slottime + sifstime;
ath9k_hw_setslottime(ah, slottime);
ath9k_hw_set_ack_timeout(ah, acktimeout); ath9k_hw_set_ack_timeout(ah, acktimeout);
ath9k_hw_set_cts_timeout(ah, acktimeout); ath9k_hw_set_cts_timeout(ah, acktimeout);
if (ah->globaltxtimeout != (u32) -1) if (ah->globaltxtimeout != (u32) -1)
......
...@@ -551,6 +551,7 @@ struct ath_hw { ...@@ -551,6 +551,7 @@ struct ath_hw {
u32 *bank6Temp; u32 *bank6Temp;
int16_t txpower_indexoffset; int16_t txpower_indexoffset;
int coverage_class;
u32 beacon_interval; u32 beacon_interval;
u32 slottime; u32 slottime;
u32 globaltxtimeout; u32 globaltxtimeout;
......
...@@ -2014,6 +2014,18 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) ...@@ -2014,6 +2014,18 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
} }
static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
{
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah;
mutex_lock(&sc->mutex);
ah->coverage_class = coverage_class;
ath9k_hw_init_global_settings(ah);
mutex_unlock(&sc->mutex);
}
struct ieee80211_ops ath9k_ops = { struct ieee80211_ops ath9k_ops = {
.tx = ath9k_tx, .tx = ath9k_tx,
.start = ath9k_start, .start = ath9k_start,
...@@ -2033,4 +2045,5 @@ struct ieee80211_ops ath9k_ops = { ...@@ -2033,4 +2045,5 @@ struct ieee80211_ops ath9k_ops = {
.sw_scan_start = ath9k_sw_scan_start, .sw_scan_start = ath9k_sw_scan_start,
.sw_scan_complete = ath9k_sw_scan_complete, .sw_scan_complete = ath9k_sw_scan_complete,
.rfkill_poll = ath9k_rfkill_poll_state, .rfkill_poll = ath9k_rfkill_poll_state,
.set_coverage_class = ath9k_set_coverage_class,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment