summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/mac80211/Makefile6
-rw-r--r--package/mac80211/patches/008-led_default.patch4
-rw-r--r--package/mac80211/patches/013-disable_b43_nphy.patch4
-rw-r--r--package/mac80211/patches/300-ath9k_gpio_settings.patch4
-rw-r--r--package/mac80211/patches/310-ath9k_pending_work.patch (renamed from package/mac80211/patches/550-ath9k_disable_hw_rfkill.patch)95
-rw-r--r--package/mac80211/patches/310-mac80211_tpt_led.patch470
-rw-r--r--package/mac80211/patches/320-ath9k_pending_work.patch80
-rw-r--r--package/mac80211/patches/321-ath9k_pending_cleanups.patch1657
-rw-r--r--package/mac80211/patches/330-ibss_supress_proberesp.patch11
-rw-r--r--package/mac80211/patches/404-ath_regd_optional.patch2
-rw-r--r--package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch6
-rw-r--r--package/mac80211/patches/409-ath9k_platform_settings.patch4
-rw-r--r--package/mac80211/patches/510-ath9k_led_cleanup.patch13
-rw-r--r--package/mac80211/patches/520-ath9k_paprd_ht40_fix.patch57
-rw-r--r--package/mac80211/patches/520-ath9k_slottime_init.patch11
-rw-r--r--package/mac80211/patches/521-ath9k_fix_distance_setting.patch11
-rw-r--r--package/mac80211/patches/530-ath9k_chainmask_read_fix.patch28
-rw-r--r--package/mac80211/patches/530-ath9k_paprd_thermal.patch122
-rw-r--r--package/mac80211/patches/531-ath9k_paprd_rate_mask.patch28
-rw-r--r--package/mac80211/patches/532-ath9k_paprd_training_power.patch233
-rw-r--r--package/mac80211/patches/533-ar9003_radar_initvals_update.patch27
-rw-r--r--package/mac80211/patches/534-ar9003_clc_initvals_update.patch129
-rw-r--r--package/mac80211/patches/540-ath9k_aggr_depth_fix.patch89
-rw-r--r--package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch4
-rw-r--r--package/mac80211/patches/601-rt2x00-fix-hang-on-ifdown.patch10
-rw-r--r--package/mac80211/patches/610-set_pci_mwi.patch2
-rw-r--r--package/mac80211/patches/800-b43-gpio-mask-module-option.patch4
-rw-r--r--package/mac80211/patches/810-b43_no_pio.patch2
28 files changed, 209 insertions, 2904 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index e1ffd3ce9..d8af462bb 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -10,12 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
-PKG_VERSION:=2010-12-09
+PKG_VERSION:=2010-12-16
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
-# http://wireless.kernel.org/download/compat-wireless-2.6
-PKG_MD5SUM:=94b6eaaa2c8245d1b5d6b6f16b75a701
+PKG_MD5SUM:=39196307aa67c1f19f498b570b994112
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
diff --git a/package/mac80211/patches/008-led_default.patch b/package/mac80211/patches/008-led_default.patch
index 80d288708..8a36f1669 100644
--- a/package/mac80211/patches/008-led_default.patch
+++ b/package/mac80211/patches/008-led_default.patch
@@ -16,9 +16,9 @@
-CONFIG_B43_LEDS=y
+# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
- CONFIG_B43_NPHY=y
+ CONFIG_B43_PHY_N=y
# CONFIG_B43_FORCE_PIO=y
-@@ -251,7 +251,7 @@ CONFIG_B43_NPHY=y
+@@ -251,7 +251,7 @@ CONFIG_B43_PHY_N=y
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
diff --git a/package/mac80211/patches/013-disable_b43_nphy.patch b/package/mac80211/patches/013-disable_b43_nphy.patch
index 4e970ef13..94c09fce7 100644
--- a/package/mac80211/patches/013-disable_b43_nphy.patch
+++ b/package/mac80211/patches/013-disable_b43_nphy.patch
@@ -4,8 +4,8 @@
endif #CONFIG_PCMCIA
# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
--CONFIG_B43_NPHY=y
-+# CONFIG_B43_NPHY is not set
+-CONFIG_B43_PHY_N=y
++# CONFIG_B43_PHY_N=y
# CONFIG_B43_FORCE_PIO=y
# CONFIG_B43_DEBUG=y
diff --git a/package/mac80211/patches/300-ath9k_gpio_settings.patch b/package/mac80211/patches/300-ath9k_gpio_settings.patch
index 56bf8ceee..ec2d5a72e 100644
--- a/package/mac80211/patches/300-ath9k_gpio_settings.patch
+++ b/package/mac80211/patches/300-ath9k_gpio_settings.patch
@@ -15,7 +15,7 @@
err:
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -795,6 +795,8 @@ struct ath_hw {
+@@ -788,6 +788,8 @@ struct ath_hw {
int initPDADC;
int PDADCdelta;
u8 led_pin;
@@ -47,7 +47,7 @@
bool ath9k_hw_check_alive(struct ath_hw *ah)
{
int count = 50;
-@@ -1457,6 +1471,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1459,6 +1473,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
if (AR_SREV_9300_20_OR_LATER(ah))
ar9003_hw_bb_watchdog_config(ah);
diff --git a/package/mac80211/patches/550-ath9k_disable_hw_rfkill.patch b/package/mac80211/patches/310-ath9k_pending_work.patch
index 83cd9a1ce..ec0a26197 100644
--- a/package/mac80211/patches/550-ath9k_disable_hw_rfkill.patch
+++ b/package/mac80211/patches/310-ath9k_pending_work.patch
@@ -29,7 +29,7 @@
priv_ops->do_getnf = ar5008_hw_do_getnf;
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
-@@ -748,28 +748,6 @@ static void ar9003_hw_rfbus_done(struct
+@@ -745,28 +745,6 @@ static void ar9003_hw_rfbus_done(struct
REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0);
}
@@ -58,7 +58,7 @@
static void ar9003_hw_set_diversity(struct ath_hw *ah, bool value)
{
u32 v = REG_READ(ah, AR_PHY_CCK_DETECT);
-@@ -1206,7 +1184,6 @@ void ar9003_hw_attach_phy_ops(struct ath
+@@ -1203,7 +1181,6 @@ void ar9003_hw_attach_phy_ops(struct ath
priv_ops->set_delta_slope = ar9003_hw_set_delta_slope;
priv_ops->rfbus_req = ar9003_hw_rfbus_req;
priv_ops->rfbus_done = ar9003_hw_rfbus_done;
@@ -66,6 +66,16 @@
priv_ops->set_diversity = ar9003_hw_set_diversity;
priv_ops->ani_control = ar9003_hw_ani_control;
priv_ops->do_getnf = ar9003_hw_do_getnf;
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -189,6 +189,7 @@ struct ath_txq {
+ struct list_head axq_q;
+ spinlock_t axq_lock;
+ u32 axq_depth;
++ u32 axq_ampdu_depth;
+ bool stopped;
+ bool axq_tx_inprogress;
+ struct list_head axq_acq;
--- a/drivers/net/wireless/ath/ath9k/hw-ops.h
+++ b/drivers/net/wireless/ath/ath9k/hw-ops.h
@@ -223,11 +223,6 @@ static inline void ath9k_hw_rfbus_done(s
@@ -82,7 +92,7 @@
if (!ath9k_hw_private_ops(ah)->restore_chainmask)
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1406,7 +1406,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1399,7 +1399,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
ath9k_hw_init_qos(ah);
if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
@@ -101,3 +111,82 @@
void (*restore_chainmask)(struct ath_hw *ah);
void (*set_diversity)(struct ath_hw *ah, bool value);
u32 (*compute_pll_control)(struct ath_hw *ah,
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -838,7 +838,7 @@ static void ath_tx_sched_aggr(struct ath
+ ath_tx_txqaddbuf(sc, txq, &bf_q);
+ TX_STAT_INC(txq->axq_qnum, a_aggr);
+
+- } while (txq->axq_depth < ATH_AGGR_MIN_QDEPTH &&
++ } while (txq->axq_ampdu_depth < ATH_AGGR_MIN_QDEPTH &&
+ status != ATH_AGGR_BAW_CLOSED);
+ }
+
+@@ -999,6 +999,7 @@ struct ath_txq *ath_txq_setup(struct ath
+ INIT_LIST_HEAD(&txq->axq_acq);
+ spin_lock_init(&txq->axq_lock);
+ txq->axq_depth = 0;
++ txq->axq_ampdu_depth = 0;
+ txq->axq_tx_inprogress = false;
+ sc->tx.txqsetup |= 1<<qnum;
+
+@@ -1068,6 +1069,12 @@ int ath_cabq_update(struct ath_softc *sc
+ return 0;
+ }
+
++static bool bf_is_ampdu_not_probing(struct ath_buf *bf)
++{
++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu);
++ return bf_isampdu(bf) && !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE);
++}
++
+ /*
+ * Drain a given TX queue (could be Beacon or Data)
+ *
+@@ -1126,7 +1133,8 @@ void ath_draintxq(struct ath_softc *sc,
+ }
+
+ txq->axq_depth--;
+-
++ if (bf_is_ampdu_not_probing(bf))
++ txq->axq_ampdu_depth--;
+ spin_unlock_bh(&txq->axq_lock);
+
+ if (bf_isampdu(bf))
+@@ -1316,6 +1324,8 @@ static void ath_tx_txqaddbuf(struct ath_
+ ath9k_hw_txstart(ah, txq->axq_qnum);
+ }
+ txq->axq_depth++;
++ if (bf_is_ampdu_not_probing(bf))
++ txq->axq_ampdu_depth++;
+ }
+
+ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
+@@ -1336,7 +1346,7 @@ static void ath_tx_send_ampdu(struct ath
+ */
+ if (!list_empty(&tid->buf_q) || tid->paused ||
+ !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
+- txctl->txq->axq_depth >= ATH_AGGR_MIN_QDEPTH) {
++ txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
+ /*
+ * Add this frame to software queue for scheduling later
+ * for aggregation.
+@@ -2040,6 +2050,9 @@ static void ath_tx_processq(struct ath_s
+ txq->axq_tx_inprogress = false;
+ if (bf_held)
+ list_del(&bf_held->list);
++
++ if (bf_is_ampdu_not_probing(bf))
++ txq->axq_ampdu_depth--;
+ spin_unlock_bh(&txq->axq_lock);
+
+ if (bf_held)
+@@ -2168,6 +2181,8 @@ void ath_tx_edma_tasklet(struct ath_soft
+ INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH);
+ txq->axq_depth--;
+ txq->axq_tx_inprogress = false;
++ if (bf_is_ampdu_not_probing(bf))
++ txq->axq_ampdu_depth--;
+ spin_unlock_bh(&txq->axq_lock);
+
+ txok = !(txs.ts_status & ATH9K_TXERR_MASK);
diff --git a/package/mac80211/patches/310-mac80211_tpt_led.patch b/package/mac80211/patches/310-mac80211_tpt_led.patch
deleted file mode 100644
index 9318f8c46..000000000
--- a/package/mac80211/patches/310-mac80211_tpt_led.patch
+++ /dev/null
@@ -1,470 +0,0 @@
---- a/net/mac80211/led.c
-+++ b/net/mac80211/led.c
-@@ -54,12 +54,22 @@ void ieee80211_led_radio(struct ieee8021
- led_trigger_event(local->radio_led, LED_OFF);
- }
-
-+void ieee80211_led_names(struct ieee80211_local *local)
-+{
-+ snprintf(local->rx_led_name, sizeof(local->rx_led_name),
-+ "%srx", wiphy_name(local->hw.wiphy));
-+ snprintf(local->tx_led_name, sizeof(local->tx_led_name),
-+ "%stx", wiphy_name(local->hw.wiphy));
-+ snprintf(local->assoc_led_name, sizeof(local->assoc_led_name),
-+ "%sassoc", wiphy_name(local->hw.wiphy));
-+ snprintf(local->radio_led_name, sizeof(local->radio_led_name),
-+ "%sradio", wiphy_name(local->hw.wiphy));
-+}
-+
- void ieee80211_led_init(struct ieee80211_local *local)
- {
- local->rx_led = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
- if (local->rx_led) {
-- snprintf(local->rx_led_name, sizeof(local->rx_led_name),
-- "%srx", wiphy_name(local->hw.wiphy));
- local->rx_led->name = local->rx_led_name;
- if (led_trigger_register(local->rx_led)) {
- kfree(local->rx_led);
-@@ -69,8 +79,6 @@ void ieee80211_led_init(struct ieee80211
-
- local->tx_led = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
- if (local->tx_led) {
-- snprintf(local->tx_led_name, sizeof(local->tx_led_name),
-- "%stx", wiphy_name(local->hw.wiphy));
- local->tx_led->name = local->tx_led_name;
- if (led_trigger_register(local->tx_led)) {
- kfree(local->tx_led);
-@@ -80,8 +88,6 @@ void ieee80211_led_init(struct ieee80211
-
- local->assoc_led = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
- if (local->assoc_led) {
-- snprintf(local->assoc_led_name, sizeof(local->assoc_led_name),
-- "%sassoc", wiphy_name(local->hw.wiphy));
- local->assoc_led->name = local->assoc_led_name;
- if (led_trigger_register(local->assoc_led)) {
- kfree(local->assoc_led);
-@@ -91,14 +97,19 @@ void ieee80211_led_init(struct ieee80211
-
- local->radio_led = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
- if (local->radio_led) {
-- snprintf(local->radio_led_name, sizeof(local->radio_led_name),
-- "%sradio", wiphy_name(local->hw.wiphy));
- local->radio_led->name = local->radio_led_name;
- if (led_trigger_register(local->radio_led)) {
- kfree(local->radio_led);
- local->radio_led = NULL;
- }
- }
-+
-+ if (local->tpt_led_trigger) {
-+ if (led_trigger_register(&local->tpt_led_trigger->trig)) {
-+ kfree(local->tpt_led_trigger);
-+ local->tpt_led_trigger = NULL;
-+ }
-+ }
- }
-
- void ieee80211_led_exit(struct ieee80211_local *local)
-@@ -119,15 +130,18 @@ void ieee80211_led_exit(struct ieee80211
- led_trigger_unregister(local->rx_led);
- kfree(local->rx_led);
- }
-+
-+ if (local->tpt_led_trigger) {
-+ led_trigger_unregister(&local->tpt_led_trigger->trig);
-+ kfree(local->tpt_led_trigger);
-+ }
- }
-
- char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
- {
- struct ieee80211_local *local = hw_to_local(hw);
-
-- if (local->radio_led)
-- return local->radio_led_name;
-- return NULL;
-+ return local->radio_led_name;
- }
- EXPORT_SYMBOL(__ieee80211_get_radio_led_name);
-
-@@ -135,9 +149,7 @@ char *__ieee80211_get_assoc_led_name(str
- {
- struct ieee80211_local *local = hw_to_local(hw);
-
-- if (local->assoc_led)
-- return local->assoc_led_name;
-- return NULL;
-+ return local->assoc_led_name;
- }
- EXPORT_SYMBOL(__ieee80211_get_assoc_led_name);
-
-@@ -145,9 +157,7 @@ char *__ieee80211_get_tx_led_name(struct
- {
- struct ieee80211_local *local = hw_to_local(hw);
-
-- if (local->tx_led)
-- return local->tx_led_name;
-- return NULL;
-+ return local->tx_led_name;
- }
- EXPORT_SYMBOL(__ieee80211_get_tx_led_name);
-
-@@ -155,8 +165,115 @@ char *__ieee80211_get_rx_led_name(struct
- {
- struct ieee80211_local *local = hw_to_local(hw);
-
-- if (local->rx_led)
-- return local->rx_led_name;
-- return NULL;
-+ return local->rx_led_name;
- }
- EXPORT_SYMBOL(__ieee80211_get_rx_led_name);
-+
-+static unsigned long tpt_trig_traffic(struct ieee80211_local *local,
-+ struct tpt_led_trigger *tpt_trig)
-+{
-+ unsigned long traffic, delta;
-+
-+ traffic = tpt_trig->tx_bytes + tpt_trig->rx_bytes;
-+
-+ delta = traffic - tpt_trig->prev_traffic;
-+ tpt_trig->prev_traffic = traffic;
-+ return DIV_ROUND_UP(delta, 1024 / 8);
-+}
-+
-+static void tpt_trig_timer(unsigned long data)
-+{
-+ struct ieee80211_local *local = (void *)data;
-+ struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger;
-+ struct led_classdev *led_cdev;
-+ unsigned long on, off, tpt;
-+ int i;
-+
-+ if (!tpt_trig->running)
-+ return;
-+
-+ mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ));
-+
-+ tpt = tpt_trig_traffic(local, tpt_trig);
-+
-+ /* default to just solid on */
-+ on = 1;
-+ off = 0;
-+
-+ for (i = tpt_trig->blink_table_len - 1; i >= 0; i--) {
-+ if (tpt_trig->blink_table[i].throughput < 0 ||
-+ tpt > tpt_trig->blink_table[i].throughput) {
-+ off = tpt_trig->blink_table[i].blink_time / 2;
-+ on = tpt_trig->blink_table[i].blink_time - off;
-+ break;
-+ }
-+ }
-+
-+ read_lock(&tpt_trig->trig.leddev_list_lock);
-+ list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list)
-+ led_blink_set(led_cdev, &on, &off);
-+ read_unlock(&tpt_trig->trig.leddev_list_lock);
-+}
-+
-+extern char *__ieee80211_create_tpt_led_trigger(
-+ struct ieee80211_hw *hw,
-+ const struct ieee80211_tpt_blink *blink_table,
-+ unsigned int blink_table_len)
-+{
-+ struct ieee80211_local *local = hw_to_local(hw);
-+ struct tpt_led_trigger *tpt_trig;
-+
-+ if (WARN_ON(local->tpt_led_trigger))
-+ return NULL;
-+
-+ tpt_trig = kzalloc(sizeof(struct tpt_led_trigger), GFP_KERNEL);
-+ if (!tpt_trig)
-+ return NULL;
-+
-+ snprintf(tpt_trig->name, sizeof(tpt_trig->name),
-+ "%stpt", wiphy_name(local->hw.wiphy));
-+
-+ tpt_trig->trig.name = tpt_trig->name;
-+
-+ tpt_trig->blink_table = blink_table;
-+ tpt_trig->blink_table_len = blink_table_len;
-+
-+ setup_timer(&tpt_trig->timer, tpt_trig_timer, (unsigned long)local);
-+
-+ local->tpt_led_trigger = tpt_trig;
-+
-+ return tpt_trig->name;
-+}
-+EXPORT_SYMBOL(__ieee80211_create_tpt_led_trigger);
-+
-+void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
-+{
-+ struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger;
-+
-+ if (!tpt_trig)
-+ return;
-+
-+ /* reset traffic */
-+ tpt_trig_traffic(local, tpt_trig);
-+ tpt_trig->running = true;
-+
-+ tpt_trig_timer((unsigned long)local);
-+ mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ));
-+}
-+
-+void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local)
-+{
-+ struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger;
-+ struct led_classdev *led_cdev;
-+
-+ if (!tpt_trig)
-+ return;
-+
-+ tpt_trig->running = false;
-+ del_timer_sync(&tpt_trig->timer);
-+
-+ read_lock(&tpt_trig->trig.leddev_list_lock);
-+ list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list)
-+ led_brightness_set(led_cdev, LED_OFF);
-+ read_unlock(&tpt_trig->trig.leddev_list_lock);
-+}
---- a/net/mac80211/led.h
-+++ b/net/mac80211/led.h
-@@ -12,14 +12,17 @@
- #include "ieee80211_i.h"
-
- #ifdef CONFIG_MAC80211_LEDS
--extern void ieee80211_led_rx(struct ieee80211_local *local);
--extern void ieee80211_led_tx(struct ieee80211_local *local, int q);
--extern void ieee80211_led_assoc(struct ieee80211_local *local,
-- bool associated);
--extern void ieee80211_led_radio(struct ieee80211_local *local,
-- bool enabled);
--extern void ieee80211_led_init(struct ieee80211_local *local);
--extern void ieee80211_led_exit(struct ieee80211_local *local);
-+void ieee80211_led_rx(struct ieee80211_local *local);
-+void ieee80211_led_tx(struct ieee80211_local *local, int q);
-+void ieee80211_led_assoc(struct ieee80211_local *local,
-+ bool associated);
-+void ieee80211_led_radio(struct ieee80211_local *local,
-+ bool enabled);
-+void ieee80211_led_names(struct ieee80211_local *local);
-+void ieee80211_led_init(struct ieee80211_local *local);
-+void ieee80211_led_exit(struct ieee80211_local *local);
-+void ieee80211_start_tpt_led_trig(struct ieee80211_local *local);
-+void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local);
- #else
- static inline void ieee80211_led_rx(struct ieee80211_local *local)
- {
-@@ -35,10 +38,37 @@ static inline void ieee80211_led_radio(s
- bool enabled)
- {
- }
-+static inline void ieee80211_led_names(struct ieee80211_local *local)
-+{
-+}
- static inline void ieee80211_led_init(struct ieee80211_local *local)
- {
- }
- static inline void ieee80211_led_exit(struct ieee80211_local *local)
- {
- }
-+static inline void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
-+{
-+}
-+static inline void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local)
-+{
-+}
-+#endif
-+
-+static inline void
-+ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, __le16 fc, int bytes)
-+{
-+#ifdef CONFIG_MAC80211_LEDS
-+ if (local->tpt_led_trigger && ieee80211_is_data(fc))
-+ local->tpt_led_trigger->tx_bytes += bytes;
-+#endif
-+}
-+
-+static inline void
-+ieee80211_tpt_led_trig_rx(struct ieee80211_local *local, __le16 fc, int bytes)
-+{
-+#ifdef CONFIG_MAC80211_LEDS
-+ if (local->tpt_led_trigger && ieee80211_is_data(fc))
-+ local->tpt_led_trigger->rx_bytes += bytes;
- #endif
-+}
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -602,6 +602,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(
- /* init dummy netdev for use w/ NAPI */
- init_dummy_netdev(&local->napi_dev);
-
-+ ieee80211_led_names(local);
-+
- return local_to_hw(local);
- }
- EXPORT_SYMBOL(ieee80211_alloc_hw);
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -1856,11 +1856,26 @@ struct ieee80211_hw *ieee80211_alloc_hw(
- */
- int ieee80211_register_hw(struct ieee80211_hw *hw);
-
-+/**
-+ * struct ieee80211_tpt_blink - throughput blink description
-+ * @throughput: throughput in Kbit/sec
-+ * @blink_time: blink time in milliseconds
-+ * (full cycle, ie. one off + one on period)
-+ */
-+struct ieee80211_tpt_blink {
-+ int throughput;
-+ int blink_time;
-+};
-+
- #ifdef CONFIG_MAC80211_LEDS
- extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
- extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
- extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
- extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
-+extern char *__ieee80211_create_tpt_led_trigger(
-+ struct ieee80211_hw *hw,
-+ const struct ieee80211_tpt_blink *blink_table,
-+ unsigned int blink_table_len);
- #endif
- /**
- * ieee80211_get_tx_led_name - get name of TX LED
-@@ -1939,6 +1954,29 @@ static inline char *ieee80211_get_radio_
- }
-
- /**
-+ * ieee80211_create_tpt_led_trigger - create throughput LED trigger
-+ * @hw: the hardware to create the trigger for
-+ * @blink_table: the blink table -- needs to be ordered by throughput
-+ * @blink_table_len: size of the blink table
-+ *
-+ * This function returns %NULL (in case of error, or if no LED
-+ * triggers are configured) or the name of the new trigger.
-+ * This function must be called before ieee80211_register_hw().
-+ */
-+static inline char *
-+ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
-+ const struct ieee80211_tpt_blink *blink_table,
-+ unsigned int blink_table_len)
-+{
-+#ifdef CONFIG_MAC80211_LEDS
-+ return __ieee80211_create_tpt_led_trigger(hw, blink_table,
-+ blink_table_len);
-+#else
-+ return NULL;
-+#endif
-+}
-+
-+/**
- * ieee80211_unregister_hw - Unregister a hardware device
- *
- * This function instructs mac80211 to free allocated resources
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -23,6 +23,7 @@
- #include <linux/types.h>
- #include <linux/spinlock.h>
- #include <linux/etherdevice.h>
-+#include <linux/leds.h>
- #include <net/ieee80211_radiotap.h>
- #include <net/cfg80211.h>
- #include <net/mac80211.h>
-@@ -629,6 +630,19 @@ enum queue_stop_reason {
- IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
- };
-
-+#ifdef CONFIG_MAC80211_LEDS
-+struct tpt_led_trigger {
-+ struct led_trigger trig;
-+ char name[32];
-+ const struct ieee80211_tpt_blink *blink_table;
-+ unsigned int blink_table_len;
-+ struct timer_list timer;
-+ bool running;
-+ unsigned long prev_traffic;
-+ unsigned long tx_bytes, rx_bytes;
-+};
-+#endif
-+
- /**
- * mac80211 scan flags - currently active scan mode
- *
-@@ -842,6 +856,7 @@ struct ieee80211_local {
- #ifdef CONFIG_MAC80211_LEDS
- int tx_led_counter, rx_led_counter;
- struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
-+ struct tpt_led_trigger *tpt_led_trigger;
- char tx_led_name[32], rx_led_name[32],
- assoc_led_name[32], radio_led_name[32];
- #endif
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -220,6 +220,7 @@ static int ieee80211_do_open(struct net_
- /* we're brought up, everything changes */
- hw_reconf_flags = ~0;
- ieee80211_led_radio(local, true);
-+ ieee80211_start_tpt_led_trig(local);
- }
-
- /*
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2888,6 +2888,9 @@ void ieee80211_rx(struct ieee80211_hw *h
- return;
- }
-
-+ ieee80211_tpt_led_trig_rx(local,
-+ ((struct ieee80211_hdr *)skb->data)->frame_control,
-+ skb->len);
- __ieee80211_rx_handle_packet(hw, skb);
-
- rcu_read_unlock();
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -1293,6 +1293,7 @@ static int __ieee80211_tx(struct ieee802
-
- while (skb) {
- int q = skb_get_queue_mapping(skb);
-+ __le16 fc;
-
- spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
- ret = IEEE80211_TX_OK;
-@@ -1335,6 +1336,7 @@ static int __ieee80211_tx(struct ieee802
- else
- info->control.sta = NULL;
-
-+ fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
- ret = drv_tx(local, skb);
- if (WARN_ON(ret != NETDEV_TX_OK && skb->len != len)) {
- dev_kfree_skb(skb);
-@@ -1345,6 +1347,7 @@ static int __ieee80211_tx(struct ieee802
- return IEEE80211_TX_AGAIN;
- }
-
-+ ieee80211_tpt_led_trig_tx(local, fc, len);
- *skbp = skb = next;
- ieee80211_led_tx(local, 1);
- fragm = true;
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -1141,6 +1141,7 @@ u32 ieee80211_sta_get_rates(struct ieee8
- void ieee80211_stop_device(struct ieee80211_local *local)
- {
- ieee80211_led_radio(local, false);
-+ ieee80211_stop_tpt_led_trig(local);
-
- cancel_work_sync(&local->reconfig_filter);
-
-@@ -1175,6 +1176,7 @@ int ieee80211_reconfig(struct ieee80211_
- }
-
- ieee80211_led_radio(local, true);
-+ ieee80211_start_tpt_led_trig(local);
- }
-
- /* add interfaces */
diff --git a/package/mac80211/patches/320-ath9k_pending_work.patch b/package/mac80211/patches/320-ath9k_pending_work.patch
deleted file mode 100644
index baeeb064b..000000000
--- a/package/mac80211/patches/320-ath9k_pending_work.patch
+++ /dev/null
@@ -1,80 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1685,17 +1685,20 @@ static void ath_tx_start_dma(struct ath_
- struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- struct list_head bf_head;
-- struct ath_atx_tid *tid;
-+ struct ath_atx_tid *tid = NULL;
- u8 tidno;
-
- spin_lock_bh(&txctl->txq->axq_lock);
-
-- if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && txctl->an) {
-+ if (ieee80211_is_data_qos(hdr->frame_control) && txctl->an) {
- tidno = ieee80211_get_qos_ctl(hdr)[0] &
- IEEE80211_QOS_CTL_TID_MASK;
- tid = ATH_AN_2_TID(txctl->an, tidno);
-
- WARN_ON(tid->ac->txq != txctl->txq);
-+ }
-+
-+ if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) {
- /*
- * Try aggregation if it's a unicast data frame
- * and the destination is HT capable.
-@@ -1712,7 +1715,7 @@ static void ath_tx_start_dma(struct ath_
- ar9003_hw_set_paprd_txdesc(sc->sc_ah, bf->bf_desc,
- bf->bf_state.bfs_paprd);
-
-- ath_tx_send_normal(sc, txctl->txq, NULL, &bf_head);
-+ ath_tx_send_normal(sc, txctl->txq, tid, &bf_head);
- }
-
- spin_unlock_bh(&txctl->txq->axq_lock);
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -284,11 +284,9 @@ static void ath9k_hw_read_revisions(stru
-
- static void ath9k_hw_disablepcie(struct ath_hw *ah)
- {
-- if (AR_SREV_9100(ah))
-+ if (!AR_SREV_5416(ah))
- return;
-
-- ENABLE_REGWRITE_BUFFER(ah);
--
- REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00);
- REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924);
- REG_WRITE(ah, AR_PCIE_SERDES, 0x28000029);
-@@ -300,8 +298,6 @@ static void ath9k_hw_disablepcie(struct
- REG_WRITE(ah, AR_PCIE_SERDES, 0x000e1007);
-
- REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000);
--
-- REGWRITE_BUFFER_FLUSH(ah);
- }
-
- /* This should work for all families including legacy */
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1940,7 +1940,9 @@ static u64 ath9k_get_tsf(struct ieee8021
- struct ath_softc *sc = aphy->sc;
-
- mutex_lock(&sc->mutex);
-+ ath9k_ps_wakeup(sc);
- tsf = ath9k_hw_gettsf64(sc->sc_ah);
-+ ath9k_ps_restore(sc);
- mutex_unlock(&sc->mutex);
-
- return tsf;
-@@ -1952,7 +1954,9 @@ static void ath9k_set_tsf(struct ieee802
- struct ath_softc *sc = aphy->sc;
-
- mutex_lock(&sc->mutex);
-+ ath9k_ps_wakeup(sc);
- ath9k_hw_settsf64(sc->sc_ah, tsf);
-+ ath9k_ps_restore(sc);
- mutex_unlock(&sc->mutex);
- }
-
diff --git a/package/mac80211/patches/321-ath9k_pending_cleanups.patch b/package/mac80211/patches/321-ath9k_pending_cleanups.patch
deleted file mode 100644
index 8b61e7830..000000000
--- a/package/mac80211/patches/321-ath9k_pending_cleanups.patch
+++ /dev/null
@@ -1,1657 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
-@@ -26,24 +26,6 @@ MODULE_PARM_DESC(nohwcrypt, "Force new A
-
- /* General hardware code for the A5008/AR9001/AR9002 hadware families */
-
--static bool ar9002_hw_macversion_supported(u32 macversion)
--{
-- switch (macversion) {
-- case AR_SREV_VERSION_5416_PCI:
-- case AR_SREV_VERSION_5416_PCIE:
-- case AR_SREV_VERSION_9160:
-- case AR_SREV_VERSION_9100:
-- case AR_SREV_VERSION_9280:
-- case AR_SREV_VERSION_9285:
-- case AR_SREV_VERSION_9287:
-- case AR_SREV_VERSION_9271:
-- return true;
-- default:
-- break;
-- }
-- return false;
--}
--
- static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
- {
- if (AR_SREV_9271(ah)) {
-@@ -565,7 +547,6 @@ void ar9002_hw_attach_ops(struct ath_hw
-
- priv_ops->init_mode_regs = ar9002_hw_init_mode_regs;
- priv_ops->init_mode_gain_regs = ar9002_hw_init_mode_gain_regs;
-- priv_ops->macversion_supported = ar9002_hw_macversion_supported;
-
- ops->config_pci_powersave = ar9002_hw_configpcipowersave;
-
---- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
-@@ -283,7 +283,6 @@ static void ar9002_hw_set11n_txdesc(stru
- {
- struct ar5416_desc *ads = AR5416DESC(ds);
-
-- txPower += ah->txpower_indexoffset;
- if (txPower > 63)
- txPower = 63;
-
---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-@@ -72,7 +72,7 @@ static const struct ar9300_eeprom ar9300
- .regDmn = { LE16(0), LE16(0x1f) },
- .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
- .opCapFlags = {
-- .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
-+ .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
- .eepMisc = 0,
- },
- .rfSilent = 0,
-@@ -649,7 +649,7 @@ static const struct ar9300_eeprom ar9300
- .regDmn = { LE16(0), LE16(0x1f) },
- .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
- .opCapFlags = {
-- .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
-+ .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
- .eepMisc = 0,
- },
- .rfSilent = 0,
-@@ -1227,7 +1227,7 @@ static const struct ar9300_eeprom ar9300
- .regDmn = { LE16(0), LE16(0x1f) },
- .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
- .opCapFlags = {
-- .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
-+ .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
- .eepMisc = 0,
- },
- .rfSilent = 0,
-@@ -1805,7 +1805,7 @@ static const struct ar9300_eeprom ar9300
- .regDmn = { LE16(0), LE16(0x1f) },
- .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
- .opCapFlags = {
-- .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
-+ .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
- .eepMisc = 0,
- },
- .rfSilent = 0,
-@@ -2382,7 +2382,7 @@ static const struct ar9300_eeprom ar9300
- .regDmn = { LE16(0), LE16(0x1f) },
- .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */
- .opCapFlags = {
-- .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
-+ .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
- .eepMisc = 0,
- },
- .rfSilent = 0,
-@@ -2974,7 +2974,7 @@ static const struct ar9300_eeprom *ar900
-
- static u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
- {
-- if (fbin == AR9300_BCHAN_UNUSED)
-+ if (fbin == AR5416_BCHAN_UNUSED)
- return fbin;
-
- return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
-@@ -3427,18 +3427,6 @@ static int ath9k_hw_ar9300_get_eeprom_re
- return 0;
- }
-
--static u8 ath9k_hw_ar9300_get_num_ant_config(struct ath_hw *ah,
-- enum ath9k_hal_freq_band freq_band)
--{
-- return 1;
--}
--
--static u32 ath9k_hw_ar9300_get_eeprom_antenna_cfg(struct ath_hw *ah,
-- struct ath9k_channel *chan)
--{
-- return -EINVAL;
--}
--
- static s32 ar9003_hw_xpa_bias_level_get(struct ath_hw *ah, bool is2ghz)
- {
- struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
-@@ -4485,7 +4473,7 @@ static u16 ar9003_hw_get_indirect_edge_p
- return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge - 1]);
- }
-
-- return AR9300_MAX_RATE_POWER;
-+ return MAX_RATE_POWER;
- }
-
- /*
-@@ -4494,7 +4482,7 @@ static u16 ar9003_hw_get_indirect_edge_p
- static u16 ar9003_hw_get_max_edge_power(struct ar9300_eeprom *eep,
- u16 freq, int idx, bool is2GHz)
- {
-- u16 twiceMaxEdgePower = AR9300_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- u8 *ctl_freqbin = is2GHz ?
- &eep->ctl_freqbin_2G[idx][0] :
- &eep->ctl_freqbin_5G[idx][0];
-@@ -4504,7 +4492,7 @@ static u16 ar9003_hw_get_max_edge_power(
-
- /* Get the edge power */
- for (edge = 0;
-- (edge < num_edges) && (ctl_freqbin[edge] != AR9300_BCHAN_UNUSED);
-+ (edge < num_edges) && (ctl_freqbin[edge] != AR5416_BCHAN_UNUSED);
- edge++) {
- /*
- * If there's an exact channel match or an inband flag set
-@@ -4542,9 +4530,9 @@ static void ar9003_hw_set_power_per_rate
- struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
- struct ath_common *common = ath9k_hw_common(ah);
- struct ar9300_eeprom *pEepData = &ah->eeprom.ar9300_eep;
-- u16 twiceMaxEdgePower = AR9300_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- static const u16 tpScaleReductionTable[5] = {
-- 0, 3, 6, 9, AR9300_MAX_RATE_POWER
-+ 0, 3, 6, 9, MAX_RATE_POWER
- };
- int i;
- int16_t twiceLargestAntenna;
-@@ -4848,8 +4836,6 @@ const struct eeprom_ops eep_ar9300_ops =
- .fill_eeprom = ath9k_hw_ar9300_fill_eeprom,
- .get_eeprom_ver = ath9k_hw_ar9300_get_eeprom_ver,
- .get_eeprom_rev = ath9k_hw_ar9300_get_eeprom_rev,
-- .get_num_ant_config = ath9k_hw_ar9300_get_num_ant_config,
-- .get_eeprom_antenna_cfg = ath9k_hw_ar9300_get_eeprom_antenna_cfg,
- .set_board_values = ath9k_hw_ar9300_set_board_values,
- .set_addac = ath9k_hw_ar9300_set_addac,
- .set_txpower = ath9k_hw_ar9300_set_txpower,
---- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
-@@ -21,18 +21,6 @@
-
- /* General hardware code for the AR9003 hadware family */
-
--static bool ar9003_hw_macversion_supported(u32 macversion)
--{
-- switch (macversion) {
-- case AR_SREV_VERSION_9300:
-- case AR_SREV_VERSION_9485:
-- return true;
-- default:
-- break;
-- }
-- return false;
--}
--
- /*
- * The AR9003 family uses a new INI format (pre, core, post
- * arrays per subsystem). This provides support for the
-@@ -322,7 +310,6 @@ void ar9003_hw_attach_ops(struct ath_hw
-
- priv_ops->init_mode_regs = ar9003_hw_init_mode_regs;
- priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs;
-- priv_ops->macversion_supported = ar9003_hw_macversion_supported;
-
- ops->config_pci_powersave = ar9003_hw_configpcipowersave;
-
---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-@@ -322,7 +322,6 @@ static void ar9003_hw_set11n_txdesc(stru
- if (txpower > ah->txpower_limit)
- txpower = ah->txpower_limit;
-
-- txpower += ah->txpower_indexoffset;
- if (txpower > 63)
- txpower = 63;
-
---- a/drivers/net/wireless/ath/ath9k/eeprom.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
-@@ -234,7 +234,7 @@ void ath9k_hw_get_target_powers(struct a
- u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower,
- bool is2GHz, int num_band_edges)
- {
-- u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- int i;
-
- for (i = 0; (i < num_band_edges) &&
-@@ -279,6 +279,219 @@ void ath9k_hw_update_regulatory_maxpower
- }
- }
-
-+void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
-+ struct ath9k_channel *chan,
-+ void *pRawDataSet,
-+ u8 *bChans, u16 availPiers,
-+ u16 tPdGainOverlap,
-+ u16 *pPdGainBoundaries, u8 *pPDADCValues,
-+ u16 numXpdGains)
-+{
-+ int i, j, k;
-+ int16_t ss;
-+ u16 idxL = 0, idxR = 0, numPiers;
-+ static u8 vpdTableL[AR5416_NUM_PD_GAINS]
-+ [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-+ static u8 vpdTableR[AR5416_NUM_PD_GAINS]
-+ [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-+ static u8 vpdTableI[AR5416_NUM_PD_GAINS]
-+ [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-+
-+ u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR;
-+ u8 minPwrT4[AR5416_NUM_PD_GAINS];
-+ u8 maxPwrT4[AR5416_NUM_PD_GAINS];
-+ int16_t vpdStep;
-+ int16_t tmpVal;
-+ u16 sizeCurrVpdTable, maxIndex, tgtIndex;
-+ bool match;
-+ int16_t minDelta = 0;
-+ struct chan_centers centers;
-+ int pdgain_boundary_default;
-+ struct cal_data_per_freq *data_def = pRawDataSet;
-+ struct cal_data_per_freq_4k *data_4k = pRawDataSet;
-+ struct cal_data_per_freq_ar9287 *data_9287 = pRawDataSet;
-+ bool eeprom_4k = AR_SREV_9285(ah) || AR_SREV_9271(ah);
-+ int intercepts;
-+
-+ if (AR_SREV_9287(ah))
-+ intercepts = AR9287_PD_GAIN_ICEPTS;
-+ else
-+ intercepts = AR5416_PD_GAIN_ICEPTS;
-+
-+ memset(&minPwrT4, 0, AR5416_NUM_PD_GAINS);
-+ ath9k_hw_get_channel_centers(ah, chan, &centers);
-+
-+ for (numPiers = 0; numPiers < availPiers; numPiers++) {
-+ if (bChans[numPiers] == AR5416_BCHAN_UNUSED)
-+ break;
-+ }
-+
-+ match = ath9k_hw_get_lower_upper_index((u8)FREQ2FBIN(centers.synth_center,
-+ IS_CHAN_2GHZ(chan)),
-+ bChans, numPiers, &idxL, &idxR);
-+
-+ if (match) {
-+ if (AR_SREV_9287(ah)) {
-+ /* FIXME: array overrun? */
-+ for (i = 0; i < numXpdGains; i++) {
-+ minPwrT4[i] = data_9287[idxL].pwrPdg[i][0];
-+ maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4];
-+ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-+ data_9287[idxL].pwrPdg[i],
-+ data_9287[idxL].vpdPdg[i],
-+ intercepts,
-+ vpdTableI[i]);
-+ }
-+ } else if (eeprom_4k) {
-+ for (i = 0; i < numXpdGains; i++) {
-+ minPwrT4[i] = data_4k[idxL].pwrPdg[i][0];
-+ maxPwrT4[i] = data_4k[idxL].pwrPdg[i][4];
-+ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-+ data_4k[idxL].pwrPdg[i],
-+ data_4k[idxL].vpdPdg[i],
-+ intercepts,
-+ vpdTableI[i]);
-+ }
-+ } else {
-+ for (i = 0; i < numXpdGains; i++) {
-+ minPwrT4[i] = data_def[idxL].pwrPdg[i][0];
-+ maxPwrT4[i] = data_def[idxL].pwrPdg[i][4];
-+ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-+ data_def[idxL].pwrPdg[i],
-+ data_def[idxL].vpdPdg[i],
-+ intercepts,
-+ vpdTableI[i]);
-+ }
-+ }
-+ } else {
-+ for (i = 0; i < numXpdGains; i++) {
-+ if (AR_SREV_9287(ah)) {
-+ pVpdL = data_9287[idxL].vpdPdg[i];
-+ pPwrL = data_9287[idxL].pwrPdg[i];
-+ pVpdR = data_9287[idxR].vpdPdg[i];
-+ pPwrR = data_9287[idxR].pwrPdg[i];
-+ } else if (eeprom_4k) {
-+ pVpdL = data_4k[idxL].vpdPdg[i];
-+ pPwrL = data_4k[idxL].pwrPdg[i];
-+ pVpdR = data_4k[idxR].vpdPdg[i];
-+ pPwrR = data_4k[idxR].pwrPdg[i];
-+ } else {
-+ pVpdL = data_def[idxL].vpdPdg[i];
-+ pPwrL = data_def[idxL].pwrPdg[i];
-+ pVpdR = data_def[idxR].vpdPdg[i];
-+ pPwrR = data_def[idxR].pwrPdg[i];
-+ }
-+
-+ minPwrT4[i] = max(pPwrL[0], pPwrR[0]);
-+
-+ maxPwrT4[i] =
-+ min(pPwrL[intercepts - 1],
-+ pPwrR[intercepts - 1]);
-+
-+
-+ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-+ pPwrL, pVpdL,
-+ intercepts,
-+ vpdTableL[i]);
-+ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-+ pPwrR, pVpdR,
-+ intercepts,
-+ vpdTableR[i]);
-+
-+ for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) {
-+ vpdTableI[i][j] =
-+ (u8)(ath9k_hw_interpolate((u16)
-+ FREQ2FBIN(centers.
-+ synth_center,
-+ IS_CHAN_2GHZ
-+ (chan)),
-+ bChans[idxL], bChans[idxR],
-+ vpdTableL[i][j], vpdTableR[i][j]));
-+ }
-+ }
-+ }
-+
-+ k = 0;
-+
-+ for (i = 0; i < numXpdGains; i++) {
-+ if (i == (numXpdGains - 1))
-+ pPdGainBoundaries[i] =
-+ (u16)(maxPwrT4[i] / 2);
-+ else
-+ pPdGainBoundaries[i] =
-+ (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4);
-+
-+ pPdGainBoundaries[i] =
-+ min((u16)MAX_RATE_POWER, pPdGainBoundaries[i]);
-+
-+ if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) {
-+ minDelta = pPdGainBoundaries[0] - 23;
-+ pPdGainBoundaries[0] = 23;
-+ } else {
-+ minDelta = 0;
-+ }
-+
-+ if (i == 0) {
-+ if (AR_SREV_9280_20_OR_LATER(ah))
-+ ss = (int16_t)(0 - (minPwrT4[i] / 2));
-+ else
-+ ss = 0;
-+ } else {
-+ ss = (int16_t)((pPdGainBoundaries[i - 1] -
-+ (minPwrT4[i] / 2)) -
-+ tPdGainOverlap + 1 + minDelta);
-+ }
-+ vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]);
-+ vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
-+
-+ while ((ss < 0) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-+ tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep);
-+ pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal);
-+ ss++;
-+ }
-+
-+ sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1);
-+ tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap -
-+ (minPwrT4[i] / 2));
-+ maxIndex = (tgtIndex < sizeCurrVpdTable) ?
-+ tgtIndex : sizeCurrVpdTable;
-+
-+ while ((ss < maxIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-+ pPDADCValues[k++] = vpdTableI[i][ss++];
-+ }
-+
-+ vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] -
-+ vpdTableI[i][sizeCurrVpdTable - 2]);
-+ vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
-+
-+ if (tgtIndex >= maxIndex) {
-+ while ((ss <= tgtIndex) &&
-+ (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-+ tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] +
-+ (ss - maxIndex + 1) * vpdStep));
-+ pPDADCValues[k++] = (u8)((tmpVal > 255) ?
-+ 255 : tmpVal);
-+ ss++;
-+ }
-+ }
-+ }
-+
-+ if (eeprom_4k)
-+ pdgain_boundary_default = 58;
-+ else
-+ pdgain_boundary_default = pPdGainBoundaries[i - 1];
-+
-+ while (i < AR5416_PD_GAINS_IN_MASK) {
-+ pPdGainBoundaries[i] = pdgain_boundary_default;
-+ i++;
-+ }
-+
-+ while (k < AR5416_NUM_PDADC_VALUES) {
-+ pPDADCValues[k] = pPDADCValues[k - 1];
-+ k++;
-+ }
-+}
-+
- int ath9k_hw_eeprom_init(struct ath_hw *ah)
- {
- int status;
---- a/drivers/net/wireless/ath/ath9k/eeprom.h
-+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
-@@ -17,6 +17,8 @@
- #ifndef EEPROM_H
- #define EEPROM_H
-
-+#define AR_EEPROM_MODAL_SPURS 5
-+
- #include "../ath.h"
- #include <net/cfg80211.h>
- #include "ar9003_eeprom.h"
-@@ -149,8 +151,6 @@
- #define AR5416_NUM_PD_GAINS 4
- #define AR5416_PD_GAINS_IN_MASK 4
- #define AR5416_PD_GAIN_ICEPTS 5
--#define AR5416_EEPROM_MODAL_SPURS 5
--#define AR5416_MAX_RATE_POWER 63
- #define AR5416_NUM_PDADC_VALUES 128
- #define AR5416_BCHAN_UNUSED 0xFF
- #define AR5416_MAX_PWR_RANGE_IN_HALF_DB 64
-@@ -175,8 +175,6 @@
- #define AR5416_EEP4K_NUM_CTLS 12
- #define AR5416_EEP4K_NUM_BAND_EDGES 4
- #define AR5416_EEP4K_NUM_PD_GAINS 2
--#define AR5416_EEP4K_PD_GAINS_IN_MASK 4
--#define AR5416_EEP4K_PD_GAIN_ICEPTS 5
- #define AR5416_EEP4K_MAX_CHAINS 1
-
- #define AR9280_TX_GAIN_TABLE_SIZE 22
-@@ -198,35 +196,12 @@
- #define AR9287_NUM_2G_40_TARGET_POWERS 3
- #define AR9287_NUM_CTLS 12
- #define AR9287_NUM_BAND_EDGES 4
--#define AR9287_NUM_PD_GAINS 4
--#define AR9287_PD_GAINS_IN_MASK 4
- #define AR9287_PD_GAIN_ICEPTS 1
--#define AR9287_EEPROM_MODAL_SPURS 5
--#define AR9287_MAX_RATE_POWER 63
--#define AR9287_NUM_PDADC_VALUES 128
--#define AR9287_NUM_RATES 16
--#define AR9287_BCHAN_UNUSED 0xFF
--#define AR9287_MAX_PWR_RANGE_IN_HALF_DB 64
--#define AR9287_OPFLAGS_11A 0x01
--#define AR9287_OPFLAGS_11G 0x02
--#define AR9287_OPFLAGS_2G_HT40 0x08
--#define AR9287_OPFLAGS_2G_HT20 0x20
--#define AR9287_OPFLAGS_5G_HT40 0x04
--#define AR9287_OPFLAGS_5G_HT20 0x10
- #define AR9287_EEPMISC_BIG_ENDIAN 0x01
- #define AR9287_EEPMISC_WOW 0x02
- #define AR9287_MAX_CHAINS 2
- #define AR9287_ANT_16S 32
--#define AR9287_custdatasize 20
-
--#define AR9287_NUM_ANT_CHAIN_FIELDS 6
--#define AR9287_NUM_ANT_COMMON_FIELDS 4
--#define AR9287_SIZE_ANT_CHAIN_FIELD 2
--#define AR9287_SIZE_ANT_COMMON_FIELD 4
--#define AR9287_ANT_CHAIN_MASK 0x3
--#define AR9287_ANT_COMMON_MASK 0xf
--#define AR9287_CHAIN_0_IDX 0
--#define AR9287_CHAIN_1_IDX 1
- #define AR9287_DATA_SZ 32
-
- #define AR9287_PWR_TABLE_OFFSET_DB -5
-@@ -396,7 +371,7 @@ struct modal_eep_header {
- u16 xpaBiasLvlFreq[3];
- u8 futureModal[6];
-
-- struct spur_chan spurChans[AR5416_EEPROM_MODAL_SPURS];
-+ struct spur_chan spurChans[AR_EEPROM_MODAL_SPURS];
- } __packed;
-
- struct calDataPerFreqOpLoop {
-@@ -464,7 +439,7 @@ struct modal_eep_4k_header {
- u8 db2_4:4, reserved:4;
- #endif
- u8 futureModal[4];
-- struct spur_chan spurChans[AR5416_EEPROM_MODAL_SPURS];
-+ struct spur_chan spurChans[AR_EEPROM_MODAL_SPURS];
- } __packed;
-
- struct base_eep_ar9287_header {
-@@ -522,7 +497,7 @@ struct modal_eep_ar9287_header {
- u8 ob_qam;
- u8 ob_pal_off;
- u8 futureModal[30];
-- struct spur_chan spurChans[AR9287_EEPROM_MODAL_SPURS];
-+ struct spur_chan spurChans[AR_EEPROM_MODAL_SPURS];
- } __packed;
-
- struct cal_data_per_freq {
-@@ -531,8 +506,8 @@ struct cal_data_per_freq {
- } __packed;
-
- struct cal_data_per_freq_4k {
-- u8 pwrPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_EEP4K_PD_GAIN_ICEPTS];
-- u8 vpdPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_EEP4K_PD_GAIN_ICEPTS];
-+ u8 pwrPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
-+ u8 vpdPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
- } __packed;
-
- struct cal_target_power_leg {
-@@ -558,8 +533,8 @@ struct cal_data_op_loop_ar9287 {
- } __packed;
-
- struct cal_data_per_freq_ar9287 {
-- u8 pwrPdg[AR9287_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS];
-- u8 vpdPdg[AR9287_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS];
-+ u8 pwrPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS];
-+ u8 vpdPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS];
- } __packed;
-
- union cal_data_per_freq_ar9287_u {
-@@ -674,10 +649,6 @@ struct eeprom_ops {
- bool (*fill_eeprom)(struct ath_hw *hw);
- int (*get_eeprom_ver)(struct ath_hw *hw);
- int (*get_eeprom_rev)(struct ath_hw *hw);
-- u8 (*get_num_ant_config)(struct ath_hw *hw,
-- enum ath9k_hal_freq_band band);
-- u32 (*get_eeprom_antenna_cfg)(struct ath_hw *hw,
-- struct ath9k_channel *chan);
- void (*set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan);
- void (*set_addac)(struct ath_hw *hw, struct ath9k_channel *chan);
- void (*set_txpower)(struct ath_hw *hw, struct ath9k_channel *chan,
-@@ -716,6 +687,14 @@ u16 ath9k_hw_get_max_edge_power(u16 freq
- void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah);
- int ath9k_hw_eeprom_init(struct ath_hw *ah);
-
-+void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
-+ struct ath9k_channel *chan,
-+ void *pRawDataSet,
-+ u8 *bChans, u16 availPiers,
-+ u16 tPdGainOverlap,
-+ u16 *pPdGainBoundaries, u8 *pPDADCValues,
-+ u16 numXpdGains);
-+
- #define ar5416_get_ntxchains(_txchainmask) \
- (((_txchainmask >> 2) & 1) + \
- ((_txchainmask >> 1) & 1) + (_txchainmask & 1))
---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
-@@ -153,7 +153,7 @@ static int ath9k_hw_4k_check_eeprom(stru
- eep->modalHeader.antCtrlChain[i] = integer;
- }
-
-- for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
-+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
- word = swab16(eep->modalHeader.spurChans[i].spurChan);
- eep->modalHeader.spurChans[i].spurChan = word;
- }
-@@ -227,173 +227,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct
- }
- }
-
--static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah,
-- struct ath9k_channel *chan,
-- struct cal_data_per_freq_4k *pRawDataSet,
-- u8 *bChans, u16 availPiers,
-- u16 tPdGainOverlap,
-- u16 *pPdGainBoundaries, u8 *pPDADCValues,
-- u16 numXpdGains)
--{
--#define TMP_VAL_VPD_TABLE \
-- ((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex + 1) * vpdStep));
-- int i, j, k;
-- int16_t ss;
-- u16 idxL = 0, idxR = 0, numPiers;
-- static u8 vpdTableL[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableR[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableI[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
--
-- u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR;
-- u8 minPwrT4[AR5416_EEP4K_NUM_PD_GAINS];
-- u8 maxPwrT4[AR5416_EEP4K_NUM_PD_GAINS];
-- int16_t vpdStep;
-- int16_t tmpVal;
-- u16 sizeCurrVpdTable, maxIndex, tgtIndex;
-- bool match;
-- int16_t minDelta = 0;
-- struct chan_centers centers;
--#define PD_GAIN_BOUNDARY_DEFAULT 58;
--
-- memset(&minPwrT4, 0, AR9287_NUM_PD_GAINS);
-- ath9k_hw_get_channel_centers(ah, chan, &centers);
--
-- for (numPiers = 0; numPiers < availPiers; numPiers++) {
-- if (bChans[numPiers] == AR5416_BCHAN_UNUSED)
-- break;
-- }
--
-- match = ath9k_hw_get_lower_upper_index(
-- (u8)FREQ2FBIN(centers.synth_center,
-- IS_CHAN_2GHZ(chan)), bChans, numPiers,
-- &idxL, &idxR);
--
-- if (match) {
-- for (i = 0; i < numXpdGains; i++) {
-- minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0];
-- maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4];
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pRawDataSet[idxL].pwrPdg[i],
-- pRawDataSet[idxL].vpdPdg[i],
-- AR5416_EEP4K_PD_GAIN_ICEPTS,
-- vpdTableI[i]);
-- }
-- } else {
-- for (i = 0; i < numXpdGains; i++) {
-- pVpdL = pRawDataSet[idxL].vpdPdg[i];
-- pPwrL = pRawDataSet[idxL].pwrPdg[i];
-- pVpdR = pRawDataSet[idxR].vpdPdg[i];
-- pPwrR = pRawDataSet[idxR].pwrPdg[i];
--
-- minPwrT4[i] = max(pPwrL[0], pPwrR[0]);
--
-- maxPwrT4[i] =
-- min(pPwrL[AR5416_EEP4K_PD_GAIN_ICEPTS - 1],
-- pPwrR[AR5416_EEP4K_PD_GAIN_ICEPTS - 1]);
--
--
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrL, pVpdL,
-- AR5416_EEP4K_PD_GAIN_ICEPTS,
-- vpdTableL[i]);
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrR, pVpdR,
-- AR5416_EEP4K_PD_GAIN_ICEPTS,
-- vpdTableR[i]);
--
-- for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) {
-- vpdTableI[i][j] =
-- (u8)(ath9k_hw_interpolate((u16)
-- FREQ2FBIN(centers.
-- synth_center,
-- IS_CHAN_2GHZ
-- (chan)),
-- bChans[idxL], bChans[idxR],
-- vpdTableL[i][j], vpdTableR[i][j]));
-- }
-- }
-- }
--
-- k = 0;
--
-- for (i = 0; i < numXpdGains; i++) {
-- if (i == (numXpdGains - 1))
-- pPdGainBoundaries[i] =
-- (u16)(maxPwrT4[i] / 2);
-- else
-- pPdGainBoundaries[i] =
-- (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4);
--
-- pPdGainBoundaries[i] =
-- min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]);
--
-- if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) {
-- minDelta = pPdGainBoundaries[0] - 23;
-- pPdGainBoundaries[0] = 23;
-- } else {
-- minDelta = 0;
-- }
--
-- if (i == 0) {
-- if (AR_SREV_9280_20_OR_LATER(ah))
-- ss = (int16_t)(0 - (minPwrT4[i] / 2));
-- else
-- ss = 0;
-- } else {
-- ss = (int16_t)((pPdGainBoundaries[i - 1] -
-- (minPwrT4[i] / 2)) -
-- tPdGainOverlap + 1 + minDelta);
-- }
-- vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- while ((ss < 0) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep);
-- pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal);
-- ss++;
-- }
--
-- sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1);
-- tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap -
-- (minPwrT4[i] / 2));
-- maxIndex = (tgtIndex < sizeCurrVpdTable) ?
-- tgtIndex : sizeCurrVpdTable;
--
-- while ((ss < maxIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1)))
-- pPDADCValues[k++] = vpdTableI[i][ss++];
--
-- vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] -
-- vpdTableI[i][sizeCurrVpdTable - 2]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- if (tgtIndex >= maxIndex) {
-- while ((ss <= tgtIndex) &&
-- (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t) TMP_VAL_VPD_TABLE;
-- pPDADCValues[k++] = (u8)((tmpVal > 255) ?
-- 255 : tmpVal);
-- ss++;
-- }
-- }
-- }
--
-- while (i < AR5416_EEP4K_PD_GAINS_IN_MASK) {
-- pPdGainBoundaries[i] = PD_GAIN_BOUNDARY_DEFAULT;
-- i++;
-- }
--
-- while (k < AR5416_NUM_PDADC_VALUES) {
-- pPDADCValues[k] = pPDADCValues[k - 1];
-- k++;
-- }
--
-- return;
--#undef TMP_VAL_VPD_TABLE
--}
--
- static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
- struct ath9k_channel *chan,
- int16_t *pTxPowerIndexOffset)
-@@ -404,7 +237,7 @@ static void ath9k_hw_set_4k_power_cal_ta
- u8 *pCalBChans = NULL;
- u16 pdGainOverlap_t2;
- static u8 pdadcValues[AR5416_NUM_PDADC_VALUES];
-- u16 gainBoundaries[AR5416_EEP4K_PD_GAINS_IN_MASK];
-+ u16 gainBoundaries[AR5416_PD_GAINS_IN_MASK];
- u16 numPiers, i, j;
- u16 numXpdGain, xpdMask;
- u16 xpdGainValues[AR5416_EEP4K_NUM_PD_GAINS] = { 0, 0 };
-@@ -426,12 +259,12 @@ static void ath9k_hw_set_4k_power_cal_ta
-
- numXpdGain = 0;
-
-- for (i = 1; i <= AR5416_EEP4K_PD_GAINS_IN_MASK; i++) {
-- if ((xpdMask >> (AR5416_EEP4K_PD_GAINS_IN_MASK - i)) & 1) {
-+ for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) {
-+ if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) {
- if (numXpdGain >= AR5416_EEP4K_NUM_PD_GAINS)
- break;
- xpdGainValues[numXpdGain] =
-- (u16)(AR5416_EEP4K_PD_GAINS_IN_MASK - i);
-+ (u16)(AR5416_PD_GAINS_IN_MASK - i);
- numXpdGain++;
- }
- }
-@@ -455,7 +288,7 @@ static void ath9k_hw_set_4k_power_cal_ta
- if (pEepData->baseEepHeader.txMask & (1 << i)) {
- pRawDataset = pEepData->calPierData2G[i];
-
-- ath9k_hw_get_4k_gain_boundaries_pdadcs(ah, chan,
-+ ath9k_hw_get_gain_boundaries_pdadcs(ah, chan,
- pRawDataset, pCalBChans,
- numPiers, pdGainOverlap_t2,
- gainBoundaries,
-@@ -528,7 +361,7 @@ static void ath9k_hw_set_4k_power_per_ra
- int i;
- int16_t twiceLargestAntenna;
- u16 twiceMinEdgePower;
-- u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
- u16 numCtlModes;
- const u16 *pCtlMode;
-@@ -537,7 +370,7 @@ static void ath9k_hw_set_4k_power_per_ra
- struct cal_ctl_data_4k *rep;
- struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
- static const u16 tpScaleReductionTable[5] =
-- { 0, 3, 6, 9, AR5416_MAX_RATE_POWER };
-+ { 0, 3, 6, 9, MAX_RATE_POWER };
- struct cal_target_power_leg targetPowerOfdm, targetPowerCck = {
- 0, { 0, 0, 0, 0}
- };
-@@ -613,7 +446,7 @@ static void ath9k_hw_set_4k_power_per_ra
-
- if (ah->eep_ops->get_eeprom_ver(ah) == 14 &&
- ah->eep_ops->get_eeprom_rev(ah) <= 2)
-- twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ twiceMaxEdgePower = MAX_RATE_POWER;
-
- for (i = 0; (i < AR5416_EEP4K_NUM_CTLS) &&
- pEepData->ctlIndex[i]; i++) {
-@@ -752,8 +585,8 @@ static void ath9k_hw_4k_set_txpower(stru
- regulatory->max_power_level = 0;
- for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
- ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
-- if (ratesArray[i] > AR5416_MAX_RATE_POWER)
-- ratesArray[i] = AR5416_MAX_RATE_POWER;
-+ if (ratesArray[i] > MAX_RATE_POWER)
-+ ratesArray[i] = MAX_RATE_POWER;
-
- if (ratesArray[i] > regulatory->max_power_level)
- regulatory->max_power_level = ratesArray[i];
-@@ -937,8 +770,7 @@ static void ath9k_hw_4k_set_board_values
- pModal = &eep->modalHeader;
- txRxAttenLocal = 23;
-
-- REG_WRITE(ah, AR_PHY_SWITCH_COM,
-- ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
-+ REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon);
-
- /* Single chain for 4K EEPROM*/
- ath9k_hw_4k_set_gain(ah, pModal, eep, txRxAttenLocal);
-@@ -1154,21 +986,6 @@ static void ath9k_hw_4k_set_board_values
- }
- }
-
--static u32 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah,
-- struct ath9k_channel *chan)
--{
-- struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
-- struct modal_eep_4k_header *pModal = &eep->modalHeader;
--
-- return pModal->antCtrlCommon;
--}
--
--static u8 ath9k_hw_4k_get_num_ant_config(struct ath_hw *ah,
-- enum ath9k_hal_freq_band freq_band)
--{
-- return 1;
--}
--
- static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
- {
- #define EEP_MAP4K_SPURCHAN \
-@@ -1205,8 +1022,6 @@ const struct eeprom_ops eep_4k_ops = {
- .fill_eeprom = ath9k_hw_4k_fill_eeprom,
- .get_eeprom_ver = ath9k_hw_4k_get_eeprom_ver,
- .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev,
-- .get_num_ant_config = ath9k_hw_4k_get_num_ant_config,
-- .get_eeprom_antenna_cfg = ath9k_hw_4k_get_eeprom_antenna_cfg,
- .set_board_values = ath9k_hw_4k_set_board_values,
- .set_addac = ath9k_hw_4k_set_addac,
- .set_txpower = ath9k_hw_4k_set_txpower,
---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
-@@ -150,7 +150,7 @@ static int ath9k_hw_ar9287_check_eeprom(
- eep->modalHeader.antCtrlChain[i] = integer;
- }
-
-- for (i = 0; i < AR9287_EEPROM_MODAL_SPURS; i++) {
-+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
- word = swab16(eep->modalHeader.spurChans[i].spurChan);
- eep->modalHeader.spurChans[i].spurChan = word;
- }
-@@ -220,163 +220,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(st
- }
- }
-
--static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah,
-- struct ath9k_channel *chan,
-- struct cal_data_per_freq_ar9287 *pRawDataSet,
-- u8 *bChans, u16 availPiers,
-- u16 tPdGainOverlap,
-- u16 *pPdGainBoundaries,
-- u8 *pPDADCValues,
-- u16 numXpdGains)
--{
--#define TMP_VAL_VPD_TABLE \
-- ((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex + 1) * vpdStep));
--
-- int i, j, k;
-- int16_t ss;
-- u16 idxL = 0, idxR = 0, numPiers;
-- u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR;
-- u8 minPwrT4[AR9287_NUM_PD_GAINS];
-- u8 maxPwrT4[AR9287_NUM_PD_GAINS];
-- int16_t vpdStep;
-- int16_t tmpVal;
-- u16 sizeCurrVpdTable, maxIndex, tgtIndex;
-- bool match;
-- int16_t minDelta = 0;
-- struct chan_centers centers;
-- static u8 vpdTableL[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableR[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableI[AR5416_EEP4K_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
--
-- memset(&minPwrT4, 0, AR9287_NUM_PD_GAINS);
-- ath9k_hw_get_channel_centers(ah, chan, &centers);
--
-- for (numPiers = 0; numPiers < availPiers; numPiers++) {
-- if (bChans[numPiers] == AR9287_BCHAN_UNUSED)
-- break;
-- }
--
-- match = ath9k_hw_get_lower_upper_index(
-- (u8)FREQ2FBIN(centers.synth_center, IS_CHAN_2GHZ(chan)),
-- bChans, numPiers, &idxL, &idxR);
--
-- if (match) {
-- for (i = 0; i < numXpdGains; i++) {
-- minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0];
-- maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4];
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pRawDataSet[idxL].pwrPdg[i],
-- pRawDataSet[idxL].vpdPdg[i],
-- AR9287_PD_GAIN_ICEPTS,
-- vpdTableI[i]);
-- }
-- } else {
-- for (i = 0; i < numXpdGains; i++) {
-- pVpdL = pRawDataSet[idxL].vpdPdg[i];
-- pPwrL = pRawDataSet[idxL].pwrPdg[i];
-- pVpdR = pRawDataSet[idxR].vpdPdg[i];
-- pPwrR = pRawDataSet[idxR].pwrPdg[i];
--
-- minPwrT4[i] = max(pPwrL[0], pPwrR[0]);
--
-- maxPwrT4[i] = min(pPwrL[AR9287_PD_GAIN_ICEPTS - 1],
-- pPwrR[AR9287_PD_GAIN_ICEPTS - 1]);
--
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrL, pVpdL,
-- AR9287_PD_GAIN_ICEPTS,
-- vpdTableL[i]);
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrR, pVpdR,
-- AR9287_PD_GAIN_ICEPTS,
-- vpdTableR[i]);
--
-- for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) {
-- vpdTableI[i][j] = (u8)(ath9k_hw_interpolate(
-- (u16)FREQ2FBIN(centers. synth_center,
-- IS_CHAN_2GHZ(chan)),
-- bChans[idxL], bChans[idxR],
-- vpdTableL[i][j], vpdTableR[i][j]));
-- }
-- }
-- }
--
-- k = 0;
--
-- for (i = 0; i < numXpdGains; i++) {
-- if (i == (numXpdGains - 1))
-- pPdGainBoundaries[i] =
-- (u16)(maxPwrT4[i] / 2);
-- else
-- pPdGainBoundaries[i] =
-- (u16)((maxPwrT4[i] + minPwrT4[i+1]) / 4);
--
-- pPdGainBoundaries[i] = min((u16)AR5416_MAX_RATE_POWER,
-- pPdGainBoundaries[i]);
--
--
-- minDelta = 0;
--
-- if (i == 0) {
-- if (AR_SREV_9280_20_OR_LATER(ah))
-- ss = (int16_t)(0 - (minPwrT4[i] / 2));
-- else
-- ss = 0;
-- } else {
-- ss = (int16_t)((pPdGainBoundaries[i-1] -
-- (minPwrT4[i] / 2)) -
-- tPdGainOverlap + 1 + minDelta);
-- }
--
-- vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- while ((ss < 0) && (k < (AR9287_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep);
-- pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal);
-- ss++;
-- }
--
-- sizeCurrVpdTable = (u8)((maxPwrT4[i] - minPwrT4[i]) / 2 + 1);
-- tgtIndex = (u8)(pPdGainBoundaries[i] +
-- tPdGainOverlap - (minPwrT4[i] / 2));
-- maxIndex = (tgtIndex < sizeCurrVpdTable) ?
-- tgtIndex : sizeCurrVpdTable;
--
-- while ((ss < maxIndex) && (k < (AR9287_NUM_PDADC_VALUES - 1)))
-- pPDADCValues[k++] = vpdTableI[i][ss++];
--
-- vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] -
-- vpdTableI[i][sizeCurrVpdTable - 2]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- if (tgtIndex > maxIndex) {
-- while ((ss <= tgtIndex) &&
-- (k < (AR9287_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t) TMP_VAL_VPD_TABLE;
-- pPDADCValues[k++] =
-- (u8)((tmpVal > 255) ? 255 : tmpVal);
-- ss++;
-- }
-- }
-- }
--
-- while (i < AR9287_PD_GAINS_IN_MASK) {
-- pPdGainBoundaries[i] = pPdGainBoundaries[i-1];
-- i++;
-- }
--
-- while (k < AR9287_NUM_PDADC_VALUES) {
-- pPDADCValues[k] = pPDADCValues[k-1];
-- k++;
-- }
--
--#undef TMP_VAL_VPD_TABLE
--}
--
- static void ar9287_eeprom_get_tx_gain_index(struct ath_hw *ah,
- struct ath9k_channel *chan,
- struct cal_data_op_loop_ar9287 *pRawDatasetOpLoop,
-@@ -389,7 +232,7 @@ static void ar9287_eeprom_get_tx_gain_in
- ath9k_hw_get_channel_centers(ah, chan, &centers);
-
- for (numPiers = 0; numPiers < availPiers; numPiers++) {
-- if (pCalChans[numPiers] == AR9287_BCHAN_UNUSED)
-+ if (pCalChans[numPiers] == AR5416_BCHAN_UNUSED)
- break;
- }
-
-@@ -455,11 +298,11 @@ static void ath9k_hw_set_ar9287_power_ca
- struct cal_data_op_loop_ar9287 *pRawDatasetOpenLoop;
- u8 *pCalBChans = NULL;
- u16 pdGainOverlap_t2;
-- u8 pdadcValues[AR9287_NUM_PDADC_VALUES];
-- u16 gainBoundaries[AR9287_PD_GAINS_IN_MASK];
-+ u8 pdadcValues[AR5416_NUM_PDADC_VALUES];
-+ u16 gainBoundaries[AR5416_PD_GAINS_IN_MASK];
- u16 numPiers = 0, i, j;
- u16 numXpdGain, xpdMask;
-- u16 xpdGainValues[AR9287_NUM_PD_GAINS] = {0, 0, 0, 0};
-+ u16 xpdGainValues[AR5416_NUM_PD_GAINS] = {0, 0, 0, 0};
- u32 reg32, regOffset, regChainOffset, regval;
- int16_t modalIdx, diff = 0;
- struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
-@@ -487,12 +330,12 @@ static void ath9k_hw_set_ar9287_power_ca
- numXpdGain = 0;
-
- /* Calculate the value of xpdgains from the xpdGain Mask */
-- for (i = 1; i <= AR9287_PD_GAINS_IN_MASK; i++) {
-- if ((xpdMask >> (AR9287_PD_GAINS_IN_MASK - i)) & 1) {
-- if (numXpdGain >= AR9287_NUM_PD_GAINS)
-+ for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) {
-+ if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) {
-+ if (numXpdGain >= AR5416_NUM_PD_GAINS)
- break;
- xpdGainValues[numXpdGain] =
-- (u16)(AR9287_PD_GAINS_IN_MASK-i);
-+ (u16)(AR5416_PD_GAINS_IN_MASK-i);
- numXpdGain++;
- }
- }
-@@ -525,7 +368,7 @@ static void ath9k_hw_set_ar9287_power_ca
- (struct cal_data_per_freq_ar9287 *)
- pEepData->calPierData2G[i];
-
-- ath9k_hw_get_ar9287_gain_boundaries_pdadcs(ah, chan,
-+ ath9k_hw_get_gain_boundaries_pdadcs(ah, chan,
- pRawDataset,
- pCalBChans, numPiers,
- pdGainOverlap_t2,
-@@ -561,13 +404,13 @@ static void ath9k_hw_set_ar9287_power_ca
- (int32_t)AR9287_PWR_TABLE_OFFSET_DB);
- diff *= 2;
-
-- for (j = 0; j < ((u16)AR9287_NUM_PDADC_VALUES-diff); j++)
-+ for (j = 0; j < ((u16)AR5416_NUM_PDADC_VALUES-diff); j++)
- pdadcValues[j] = pdadcValues[j+diff];
-
-- for (j = (u16)(AR9287_NUM_PDADC_VALUES-diff);
-- j < AR9287_NUM_PDADC_VALUES; j++)
-+ for (j = (u16)(AR5416_NUM_PDADC_VALUES-diff);
-+ j < AR5416_NUM_PDADC_VALUES; j++)
- pdadcValues[j] =
-- pdadcValues[AR9287_NUM_PDADC_VALUES-diff];
-+ pdadcValues[AR5416_NUM_PDADC_VALUES-diff];
- }
-
- if (!ath9k_hw_ar9287_get_eeprom(ah, EEP_OL_PWRCTRL)) {
-@@ -610,9 +453,9 @@ static void ath9k_hw_set_ar9287_power_pe
- #define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10
-
- struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-- u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- static const u16 tpScaleReductionTable[5] =
-- { 0, 3, 6, 9, AR5416_MAX_RATE_POWER };
-+ { 0, 3, 6, 9, MAX_RATE_POWER };
- int i;
- int16_t twiceLargestAntenna;
- struct cal_ctl_data_ar9287 *rep;
-@@ -877,8 +720,8 @@ static void ath9k_hw_ar9287_set_txpower(
- regulatory->max_power_level = 0;
- for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
- ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
-- if (ratesArray[i] > AR9287_MAX_RATE_POWER)
-- ratesArray[i] = AR9287_MAX_RATE_POWER;
-+ if (ratesArray[i] > MAX_RATE_POWER)
-+ ratesArray[i] = MAX_RATE_POWER;
-
- if (ratesArray[i] > regulatory->max_power_level)
- regulatory->max_power_level = ratesArray[i];
-@@ -1023,8 +866,7 @@ static void ath9k_hw_ar9287_set_board_va
- antWrites[j++] = (u16)(pModal->antCtrlChain[i] & 0x3);
- }
-
-- REG_WRITE(ah, AR_PHY_SWITCH_COM,
-- ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
-+ REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon);
-
- for (i = 0; i < AR9287_MAX_CHAINS; i++) {
- regChainOffset = i * 0x1000;
-@@ -1125,21 +967,6 @@ static void ath9k_hw_ar9287_set_board_va
- pModal->xpaBiasLvl);
- }
-
--static u8 ath9k_hw_ar9287_get_num_ant_config(struct ath_hw *ah,
-- enum ath9k_hal_freq_band freq_band)
--{
-- return 1;
--}
--
--static u32 ath9k_hw_ar9287_get_eeprom_antenna_cfg(struct ath_hw *ah,
-- struct ath9k_channel *chan)
--{
-- struct ar9287_eeprom *eep = &ah->eeprom.map9287;
-- struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
--
-- return pModal->antCtrlCommon;
--}
--
- static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
- u16 i, bool is2GHz)
- {
-@@ -1177,8 +1004,6 @@ const struct eeprom_ops eep_ar9287_ops =
- .fill_eeprom = ath9k_hw_ar9287_fill_eeprom,
- .get_eeprom_ver = ath9k_hw_ar9287_get_eeprom_ver,
- .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev,
-- .get_num_ant_config = ath9k_hw_ar9287_get_num_ant_config,
-- .get_eeprom_antenna_cfg = ath9k_hw_ar9287_get_eeprom_antenna_cfg,
- .set_board_values = ath9k_hw_ar9287_set_board_values,
- .set_addac = ath9k_hw_ar9287_set_addac,
- .set_txpower = ath9k_hw_ar9287_set_txpower,
---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
-@@ -206,7 +206,7 @@ static int ath9k_hw_def_check_eeprom(str
- pModal->antCtrlChain[i] = integer;
- }
-
-- for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
-+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
- word = swab16(pModal->spurChans[i].spurChan);
- pModal->spurChans[i].spurChan = word;
- }
-@@ -374,8 +374,7 @@ static void ath9k_hw_def_set_board_value
- pModal = &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
- txRxAttenLocal = IS_CHAN_2GHZ(chan) ? 23 : 44;
-
-- REG_WRITE(ah, AR_PHY_SWITCH_COM,
-- ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
-+ REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon & 0xffff);
-
- for (i = 0; i < AR5416_MAX_CHAINS; i++) {
- if (AR_SREV_9280(ah)) {
-@@ -588,168 +587,6 @@ static void ath9k_hw_def_set_addac(struc
- #undef XPA_LVL_FREQ
- }
-
--static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
-- struct ath9k_channel *chan,
-- struct cal_data_per_freq *pRawDataSet,
-- u8 *bChans, u16 availPiers,
-- u16 tPdGainOverlap,
-- u16 *pPdGainBoundaries, u8 *pPDADCValues,
-- u16 numXpdGains)
--{
-- int i, j, k;
-- int16_t ss;
-- u16 idxL = 0, idxR = 0, numPiers;
-- static u8 vpdTableL[AR5416_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableR[AR5416_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
-- static u8 vpdTableI[AR5416_NUM_PD_GAINS]
-- [AR5416_MAX_PWR_RANGE_IN_HALF_DB];
--
-- u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR;
-- u8 minPwrT4[AR5416_NUM_PD_GAINS];
-- u8 maxPwrT4[AR5416_NUM_PD_GAINS];
-- int16_t vpdStep;
-- int16_t tmpVal;
-- u16 sizeCurrVpdTable, maxIndex, tgtIndex;
-- bool match;
-- int16_t minDelta = 0;
-- struct chan_centers centers;
--
-- memset(&minPwrT4, 0, AR9287_NUM_PD_GAINS);
-- ath9k_hw_get_channel_centers(ah, chan, &centers);
--
-- for (numPiers = 0; numPiers < availPiers; numPiers++) {
-- if (bChans[numPiers] == AR5416_BCHAN_UNUSED)
-- break;
-- }
--
-- match = ath9k_hw_get_lower_upper_index((u8)FREQ2FBIN(centers.synth_center,
-- IS_CHAN_2GHZ(chan)),
-- bChans, numPiers, &idxL, &idxR);
--
-- if (match) {
-- for (i = 0; i < numXpdGains; i++) {
-- minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0];
-- maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4];
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pRawDataSet[idxL].pwrPdg[i],
-- pRawDataSet[idxL].vpdPdg[i],
-- AR5416_PD_GAIN_ICEPTS,
-- vpdTableI[i]);
-- }
-- } else {
-- for (i = 0; i < numXpdGains; i++) {
-- pVpdL = pRawDataSet[idxL].vpdPdg[i];
-- pPwrL = pRawDataSet[idxL].pwrPdg[i];
-- pVpdR = pRawDataSet[idxR].vpdPdg[i];
-- pPwrR = pRawDataSet[idxR].pwrPdg[i];
--
-- minPwrT4[i] = max(pPwrL[0], pPwrR[0]);
--
-- maxPwrT4[i] =
-- min(pPwrL[AR5416_PD_GAIN_ICEPTS - 1],
-- pPwrR[AR5416_PD_GAIN_ICEPTS - 1]);
--
--
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrL, pVpdL,
-- AR5416_PD_GAIN_ICEPTS,
-- vpdTableL[i]);
-- ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
-- pPwrR, pVpdR,
-- AR5416_PD_GAIN_ICEPTS,
-- vpdTableR[i]);
--
-- for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) {
-- vpdTableI[i][j] =
-- (u8)(ath9k_hw_interpolate((u16)
-- FREQ2FBIN(centers.
-- synth_center,
-- IS_CHAN_2GHZ
-- (chan)),
-- bChans[idxL], bChans[idxR],
-- vpdTableL[i][j], vpdTableR[i][j]));
-- }
-- }
-- }
--
-- k = 0;
--
-- for (i = 0; i < numXpdGains; i++) {
-- if (i == (numXpdGains - 1))
-- pPdGainBoundaries[i] =
-- (u16)(maxPwrT4[i] / 2);
-- else
-- pPdGainBoundaries[i] =
-- (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4);
--
-- pPdGainBoundaries[i] =
-- min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]);
--
-- if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) {
-- minDelta = pPdGainBoundaries[0] - 23;
-- pPdGainBoundaries[0] = 23;
-- } else {
-- minDelta = 0;
-- }
--
-- if (i == 0) {
-- if (AR_SREV_9280_20_OR_LATER(ah))
-- ss = (int16_t)(0 - (minPwrT4[i] / 2));
-- else
-- ss = 0;
-- } else {
-- ss = (int16_t)((pPdGainBoundaries[i - 1] -
-- (minPwrT4[i] / 2)) -
-- tPdGainOverlap + 1 + minDelta);
-- }
-- vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- while ((ss < 0) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep);
-- pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal);
-- ss++;
-- }
--
-- sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1);
-- tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap -
-- (minPwrT4[i] / 2));
-- maxIndex = (tgtIndex < sizeCurrVpdTable) ?
-- tgtIndex : sizeCurrVpdTable;
--
-- while ((ss < maxIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-- pPDADCValues[k++] = vpdTableI[i][ss++];
-- }
--
-- vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] -
-- vpdTableI[i][sizeCurrVpdTable - 2]);
-- vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
--
-- if (tgtIndex >= maxIndex) {
-- while ((ss <= tgtIndex) &&
-- (k < (AR5416_NUM_PDADC_VALUES - 1))) {
-- tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] +
-- (ss - maxIndex + 1) * vpdStep));
-- pPDADCValues[k++] = (u8)((tmpVal > 255) ?
-- 255 : tmpVal);
-- ss++;
-- }
-- }
-- }
--
-- while (i < AR5416_PD_GAINS_IN_MASK) {
-- pPdGainBoundaries[i] = pPdGainBoundaries[i - 1];
-- i++;
-- }
--
-- while (k < AR5416_NUM_PDADC_VALUES) {
-- pPDADCValues[k] = pPDADCValues[k - 1];
-- k++;
-- }
--}
--
- static int16_t ath9k_change_gain_boundary_setting(struct ath_hw *ah,
- u16 *gb,
- u16 numXpdGain,
-@@ -782,7 +619,7 @@ static int16_t ath9k_change_gain_boundar
- /* Because of a hardware limitation, ensure the gain boundary
- * is not larger than (63 - overlap)
- */
-- gb_limit = (u16)(AR5416_MAX_RATE_POWER - pdGainOverlap_t2);
-+ gb_limit = (u16)(MAX_RATE_POWER - pdGainOverlap_t2);
-
- for (k = 0; k < numXpdGain; k++)
- gb[k] = (u16)min(gb_limit, gb[k]);
-@@ -916,7 +753,7 @@ static void ath9k_hw_set_def_power_cal_t
- ath9k_olc_get_pdadcs(ah, pcdacIdx,
- txPower/2, pdadcValues);
- } else {
-- ath9k_hw_get_def_gain_boundaries_pdadcs(ah,
-+ ath9k_hw_get_gain_boundaries_pdadcs(ah,
- chan, pRawDataset,
- pCalBChans, numPiers,
- pdGainOverlap_t2,
-@@ -1001,9 +838,9 @@ static void ath9k_hw_set_def_power_per_r
-
- struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
- struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
-- u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ u16 twiceMaxEdgePower = MAX_RATE_POWER;
- static const u16 tpScaleReductionTable[5] =
-- { 0, 3, 6, 9, AR5416_MAX_RATE_POWER };
-+ { 0, 3, 6, 9, MAX_RATE_POWER };
-
- int i;
- int16_t twiceLargestAntenna;
-@@ -1148,7 +985,7 @@ static void ath9k_hw_set_def_power_per_r
-
- if (ah->eep_ops->get_eeprom_ver(ah) == 14 &&
- ah->eep_ops->get_eeprom_rev(ah) <= 2)
-- twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
-+ twiceMaxEdgePower = MAX_RATE_POWER;
-
- for (i = 0; (i < AR5416_NUM_CTLS) && pEepData->ctlIndex[i]; i++) {
- if ((((cfgCtl & ~CTL_MODE_M) |
-@@ -1293,8 +1130,8 @@ static void ath9k_hw_def_set_txpower(str
- regulatory->max_power_level = 0;
- for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
- ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
-- if (ratesArray[i] > AR5416_MAX_RATE_POWER)
-- ratesArray[i] = AR5416_MAX_RATE_POWER;
-+ if (ratesArray[i] > MAX_RATE_POWER)
-+ ratesArray[i] = MAX_RATE_POWER;
- if (ratesArray[i] > regulatory->max_power_level)
- regulatory->max_power_level = ratesArray[i];
- }
-@@ -1426,34 +1263,6 @@ static void ath9k_hw_def_set_txpower(str
- | ATH9K_POW_SM(pModal->pwrDecreaseFor2Chain, 0));
- }
-
--static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah,
-- enum ath9k_hal_freq_band freq_band)
--{
-- struct ar5416_eeprom_def *eep = &ah->eeprom.def;
-- struct modal_eep_header *pModal =
-- &(eep->modalHeader[freq_band]);
-- struct base_eep_header *pBase = &eep->baseEepHeader;
-- u8 num_ant_config;
--
-- num_ant_config = 1;
--
-- if (pBase->version >= 0x0E0D &&
-- (pModal->lna_ctl & LNA_CTL_USE_ANT1))
-- num_ant_config += 1;
--
-- return num_ant_config;
--}
--
--static u32 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
-- struct ath9k_channel *chan)
--{
-- struct ar5416_eeprom_def *eep = &ah->eeprom.def;
-- struct modal_eep_header *pModal =
-- &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
--
-- return pModal->antCtrlCommon;
--}
--
- static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
- {
- #define EEP_DEF_SPURCHAN \
-@@ -1490,8 +1299,6 @@ const struct eeprom_ops eep_def_ops = {
- .fill_eeprom = ath9k_hw_def_fill_eeprom,
- .get_eeprom_ver = ath9k_hw_def_get_eeprom_ver,
- .get_eeprom_rev = ath9k_hw_def_get_eeprom_rev,
-- .get_num_ant_config = ath9k_hw_def_get_num_ant_config,
-- .get_eeprom_antenna_cfg = ath9k_hw_def_get_eeprom_antenna_cfg,
- .set_board_values = ath9k_hw_def_set_board_values,
- .set_addac = ath9k_hw_def_set_addac,
- .set_txpower = ath9k_hw_def_set_txpower,
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -54,13 +54,6 @@ static void ath9k_hw_init_mode_regs(stru
- ath9k_hw_private_ops(ah)->init_mode_regs(ah);
- }
-
--static bool ath9k_hw_macversion_supported(struct ath_hw *ah)
--{
-- struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
--
-- return priv_ops->macversion_supported(ah->hw_version.macVersion);
--}
--
- static u32 ath9k_hw_compute_pll_control(struct ath_hw *ah,
- struct ath9k_channel *chan)
- {
-@@ -414,7 +407,6 @@ static void ath9k_hw_init_defaults(struc
- ah->sta_id1_defaults =
- AR_STA_ID1_CRPT_MIC_ENABLE |
- AR_STA_ID1_MCAST_KSRCH;
-- ah->beacon_interval = 100;
- ah->enable_32kHz_clock = DONT_USE_32KHZ;
- ah->slottime = (u32) -1;
- ah->globaltxtimeout = (u32) -1;
-@@ -534,10 +526,22 @@ static int __ath9k_hw_init(struct ath_hw
- else
- ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
-
-- if (!ath9k_hw_macversion_supported(ah)) {
-- ath_err(common,
-- "Mac Chip Rev 0x%02x.%x is not supported by this driver\n",
-- ah->hw_version.macVersion, ah->hw_version.macRev);
-+ switch (ah->hw_version.macVersion) {
-+ case AR_SREV_VERSION_5416_PCI:
-+ case AR_SREV_VERSION_5416_PCIE:
-+ case AR_SREV_VERSION_9160:
-+ case AR_SREV_VERSION_9100:
-+ case AR_SREV_VERSION_9280:
-+ case AR_SREV_VERSION_9285:
-+ case AR_SREV_VERSION_9287:
-+ case AR_SREV_VERSION_9271:
-+ case AR_SREV_VERSION_9300:
-+ case AR_SREV_VERSION_9485:
-+ break;
-+ default:
-+ ath_err(common, "Mac Chip Rev 0x%02x.%x is not supported by "
-+ "this driver\n", ah->hw_version.macVersion,
-+ ah->hw_version.macRev);
- return -EOPNOTSUPP;
- }
-
-@@ -1639,8 +1643,6 @@ void ath9k_hw_beaconinit(struct ath_hw *
- {
- int flags = 0;
-
-- ah->beacon_interval = beacon_period;
--
- ENABLE_REGWRITE_BUFFER(ah);
-
- switch (ah->opmode) {
-@@ -1932,11 +1934,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw
- AR_SREV_5416(ah))
- pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND;
-
-- pCap->num_antcfg_5ghz =
-- ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_5GHZ);
-- pCap->num_antcfg_2ghz =
-- ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
--
- if (AR_SREV_9280_20_OR_LATER(ah) && common->btcoex_enabled) {
- btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
- btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -204,8 +204,6 @@ struct ath9k_hw_capabilities {
- u16 tx_triglevel_max;
- u16 reg_cap;
- u8 num_gpio_pins;
-- u8 num_antcfg_2ghz;
-- u8 num_antcfg_5ghz;
- u8 rx_hp_qdepth;
- u8 rx_lp_qdepth;
- u8 rx_status_len;
-@@ -238,7 +236,6 @@ struct ath9k_ops_config {
- #define SPUR_DISABLE 0
- #define SPUR_ENABLE_IOCTL 1
- #define SPUR_ENABLE_EEPROM 2
--#define AR_EEPROM_MODAL_SPURS 5
- #define AR_SPUR_5413_1 1640
- #define AR_SPUR_5413_2 1200
- #define AR_NO_SPUR 0x8000
-@@ -535,7 +532,6 @@ struct ath_hw_radar_conf {
- *
- * @init_mode_regs: Initializes mode registers
- * @init_mode_gain_regs: Initialize TX/RX gain registers
-- * @macversion_supported: If this specific mac revision is supported
- *
- * @rf_set_freq: change frequency
- * @spur_mitigate_freq: spur mitigation
-@@ -557,7 +553,6 @@ struct ath_hw_private_ops {
-
- void (*init_mode_regs)(struct ath_hw *ah);
- void (*init_mode_gain_regs)(struct ath_hw *ah);
-- bool (*macversion_supported)(u32 macversion);
- void (*setup_calibration)(struct ath_hw *ah,
- struct ath9k_cal_list *currCal);
-
-@@ -767,9 +762,7 @@ struct ath_hw {
- u32 *bank6Temp;
-
- u8 txpower_limit;
-- int16_t txpower_indexoffset;
- int coverage_class;
-- u32 beacon_interval;
- u32 slottime;
- u32 globaltxtimeout;
-
---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
-@@ -20,48 +20,17 @@
- /* #define AR9300_NUM_CTLS 21 */
- #define AR9300_NUM_CTLS_5G 9
- #define AR9300_NUM_CTLS_2G 12
--#define AR9300_CTL_MODE_M 0xF
- #define AR9300_NUM_BAND_EDGES_5G 8
- #define AR9300_NUM_BAND_EDGES_2G 4
--#define AR9300_NUM_PD_GAINS 4
--#define AR9300_PD_GAINS_IN_MASK 4
--#define AR9300_PD_GAIN_ICEPTS 5
--#define AR9300_EEPROM_MODAL_SPURS 5
--#define AR9300_MAX_RATE_POWER 63
--#define AR9300_NUM_PDADC_VALUES 128
--#define AR9300_NUM_RATES 16
--#define AR9300_BCHAN_UNUSED 0xFF
--#define AR9300_MAX_PWR_RANGE_IN_HALF_DB 64
--#define AR9300_OPFLAGS_11A 0x01
--#define AR9300_OPFLAGS_11G 0x02
--#define AR9300_OPFLAGS_5G_HT40 0x04
--#define AR9300_OPFLAGS_2G_HT40 0x08
--#define AR9300_OPFLAGS_5G_HT20 0x10
--#define AR9300_OPFLAGS_2G_HT20 0x20
- #define AR9300_EEPMISC_BIG_ENDIAN 0x01
- #define AR9300_EEPMISC_WOW 0x02
- #define AR9300_CUSTOMER_DATA_SIZE 20
-
--#define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5))
- #define FBIN2FREQ(x, y) ((y) ? (2300 + x) : (4800 + 5 * x))
- #define AR9300_MAX_CHAINS 3
- #define AR9300_ANT_16S 25
- #define AR9300_FUTURE_MODAL_SZ 6
-
--#define AR9300_NUM_ANT_CHAIN_FIELDS 7
--#define AR9300_NUM_ANT_COMMON_FIELDS 4
--#define AR9300_SIZE_ANT_CHAIN_FIELD 3
--#define AR9300_SIZE_ANT_COMMON_FIELD 4
--#define AR9300_ANT_CHAIN_MASK 0x7
--#define AR9300_ANT_COMMON_MASK 0xf
--#define AR9300_CHAIN_0_IDX 0
--#define AR9300_CHAIN_1_IDX 1
--#define AR9300_CHAIN_2_IDX 2
--
--#define AR928X_NUM_ANT_CHAIN_FIELDS 6
--#define AR928X_SIZE_ANT_CHAIN_FIELD 2
--#define AR928X_ANT_CHAIN_MASK 0x3
--
- /* Delta from which to start power to pdadc table */
- /* This offset is used in both open loop and closed loop power control
- * schemes. In open loop power control, it is not really needed, but for
-@@ -71,12 +40,8 @@
- */
- #define AR9300_PWR_TABLE_OFFSET 0
-
--/* enable flags for voltage and temp compensation */
--#define ENABLE_TEMP_COMPENSATION 0x01
--#define ENABLE_VOLT_COMPENSATION 0x02
- /* byte addressable */
- #define AR9300_EEPROM_SIZE (16*1024)
--#define FIXED_CCA_THRESHOLD 15
-
- #define AR9300_BASE_ADDR_4K 0xfff
- #define AR9300_BASE_ADDR 0x3ff
-@@ -226,7 +191,7 @@ struct ar9300_modal_eep_header {
- int8_t tempSlope;
- int8_t voltSlope;
- /* spur channels in usual fbin coding format */
-- u8 spurChans[AR9300_EEPROM_MODAL_SPURS];
-+ u8 spurChans[AR_EEPROM_MODAL_SPURS];
- /* 3 Check if the register is per chain */
- int8_t noiseFloorThreshCh[AR9300_MAX_CHAINS];
- u8 ob[AR9300_MAX_CHAINS];
diff --git a/package/mac80211/patches/330-ibss_supress_proberesp.patch b/package/mac80211/patches/330-ibss_supress_proberesp.patch
deleted file mode 100644
index 0c8d1481b..000000000
--- a/package/mac80211/patches/330-ibss_supress_proberesp.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/net/mac80211/driver-ops.h
-+++ b/net/mac80211/driver-ops.h
-@@ -381,7 +381,7 @@ static inline void drv_reset_tsf(struct
-
- static inline int drv_tx_last_beacon(struct ieee80211_local *local)
- {
-- int ret = 1;
-+ int ret = 0; /* default unsuported op for less congestion */
-
- might_sleep();
-
diff --git a/package/mac80211/patches/404-ath_regd_optional.patch b/package/mac80211/patches/404-ath_regd_optional.patch
index 9bda94b03..9e44359a1 100644
--- a/package/mac80211/patches/404-ath_regd_optional.patch
+++ b/package/mac80211/patches/404-ath_regd_optional.patch
@@ -33,7 +33,7 @@
if (!wiphy->bands[IEEE80211_BAND_5GHZ])
return;
-@@ -449,6 +461,10 @@ ath_regd_init_wiphy(struct ath_regulator
+@@ -457,6 +469,10 @@ ath_regd_init_wiphy(struct ath_regulator
{
const struct ieee80211_regdomain *regd;
diff --git a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
index 2444db4bc..daebf33b4 100644
--- a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
+++ b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
@@ -18,7 +18,7 @@
#include "ath9k.h"
-@@ -522,6 +523,7 @@ static void ath9k_init_misc(struct ath_s
+@@ -526,6 +527,7 @@ static void ath9k_init_misc(struct ath_s
static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
const struct ath_bus_ops *bus_ops)
{
@@ -26,7 +26,7 @@
struct ath_hw *ah = NULL;
struct ath_common *common;
int ret = 0, i;
-@@ -535,7 +537,7 @@ static int ath9k_init_softc(u16 devid, s
+@@ -539,7 +541,7 @@ static int ath9k_init_softc(u16 devid, s
ah->hw_version.subsysid = subsysid;
sc->sc_ah = ah;
@@ -35,7 +35,7 @@
ah->ah_flags |= AH_USE_EEPROM;
common = ath9k_hw_common(ah);
-@@ -568,6 +570,9 @@ static int ath9k_init_softc(u16 devid, s
+@@ -572,6 +574,9 @@ static int ath9k_init_softc(u16 devid, s
if (ret)
goto err_hw;
diff --git a/package/mac80211/patches/409-ath9k_platform_settings.patch b/package/mac80211/patches/409-ath9k_platform_settings.patch
index b6df84f20..7b735a10b 100644
--- a/package/mac80211/patches/409-ath9k_platform_settings.patch
+++ b/package/mac80211/patches/409-ath9k_platform_settings.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -537,8 +537,14 @@ static int ath9k_init_softc(u16 devid, s
+@@ -541,8 +541,14 @@ static int ath9k_init_softc(u16 devid, s
ah->hw_version.subsysid = subsysid;
sc->sc_ah = ah;
@@ -18,7 +18,7 @@
common->ops = &ath9k_common_ops;
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -787,7 +787,7 @@ struct ath_hw {
+@@ -786,7 +786,7 @@ struct ath_hw {
u32 originalGain[22];
int initPDADC;
int PDADCdelta;
diff --git a/package/mac80211/patches/510-ath9k_led_cleanup.patch b/package/mac80211/patches/510-ath9k_led_cleanup.patch
index b855bb295..be26a883c 100644
--- a/package/mac80211/patches/510-ath9k_led_cleanup.patch
+++ b/package/mac80211/patches/510-ath9k_led_cleanup.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -438,26 +438,20 @@ void ath9k_btcoex_timer_pause(struct ath
+@@ -441,26 +441,20 @@ void ath9k_btcoex_timer_pause(struct ath
#define ATH_LED_PIN_DEF 1
#define ATH_LED_PIN_9287 8
@@ -38,7 +38,7 @@
/* Antenna diversity/combining */
#define ATH_ANT_RX_CURRENT_SHIFT 4
-@@ -608,15 +602,11 @@ struct ath_softc {
+@@ -611,15 +605,11 @@ struct ath_softc {
struct ath_beacon beacon;
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
@@ -253,7 +253,7 @@
/* Rfkill */
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1275,9 +1275,6 @@ static void ath9k_stop(struct ieee80211_
+@@ -1295,9 +1295,6 @@ static void ath9k_stop(struct ieee80211_
aphy->state = ATH_WIPHY_INACTIVE;
@@ -265,7 +265,7 @@
cancel_work_sync(&sc->hw_check_work);
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -139,6 +139,21 @@ static struct ieee80211_rate ath9k_legac
+@@ -143,6 +143,21 @@ static struct ieee80211_rate ath9k_legac
RATE(540, 0x0c, 0),
};
@@ -287,14 +287,15 @@
static void ath9k_deinit_softc(struct ath_softc *sc);
/*
-@@ -742,6 +757,12 @@ int ath9k_init_device(u16 devid, struct
+@@ -746,6 +761,13 @@ int ath9k_init_device(u16 devid, struct
ath9k_init_txpower_limits(sc);
+#ifdef CONFIG_MAC80211_LEDS
+ /* must be initialized before ieee80211_register_hw */
+ sc->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(sc->hw,
-+ ath9k_tpt_blink, ARRAY_SIZE(ath9k_tpt_blink));
++ IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_tpt_blink,
++ ARRAY_SIZE(ath9k_tpt_blink));
+#endif
+
/* Register with mac80211 */
diff --git a/package/mac80211/patches/520-ath9k_paprd_ht40_fix.patch b/package/mac80211/patches/520-ath9k_paprd_ht40_fix.patch
new file mode 100644
index 000000000..cea8f2e37
--- /dev/null
+++ b/package/mac80211/patches/520-ath9k_paprd_ht40_fix.patch
@@ -0,0 +1,57 @@
+--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+@@ -4762,6 +4762,7 @@ static void ath9k_hw_ar9300_set_txpower(
+ struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
++ struct ar9300_modal_eep_header *modal_hdr;
+ u8 targetPowerValT2[ar9300RateSize];
+ u8 target_power_val_t2_eep[ar9300RateSize];
+ unsigned int i = 0, paprd_scale_factor = 0;
+@@ -4771,15 +4772,17 @@ static void ath9k_hw_ar9300_set_txpower(
+
+ if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) {
+ if (IS_CHAN_2GHZ(chan))
+- ah->paprd_ratemask = (IS_CHAN_HT40(chan) ?
+- le32_to_cpu(eep->modalHeader2G.papdRateMaskHt40) :
+- le32_to_cpu(eep->modalHeader2G.papdRateMaskHt20))
+- & AR9300_PAPRD_RATE_MASK;
++ modal_hdr = &eep->modalHeader2G;
+ else
+- ah->paprd_ratemask = (IS_CHAN_HT40(chan) ?
+- le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40) :
+- le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20))
+- & AR9300_PAPRD_RATE_MASK;
++ modal_hdr = &eep->modalHeader5G;
++
++ ah->paprd_ratemask =
++ le32_to_cpu(modal_hdr->papdRateMaskHt20) &
++ AR9300_PAPRD_RATE_MASK;
++
++ ah->paprd_ratemask_ht40 =
++ le32_to_cpu(modal_hdr->papdRateMaskHt40) &
++ AR9300_PAPRD_RATE_MASK;
+
+ paprd_scale_factor = ar9003_get_paprd_scale_factor(ah, chan);
+ min_pwridx = IS_CHAN_HT40(chan) ? ALL_TARGET_HT40_0_8_16 :
+--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+@@ -134,7 +134,7 @@ static int ar9003_paprd_setup_single_tab
+ REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK,
+ ah->paprd_ratemask);
+ REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK,
+- AR_PHY_PAPRD_HT40_MASK);
++ ah->paprd_ratemask_ht40);
+
+ for (i = 0; i < ah->caps.max_txchains; i++) {
+ REG_RMW_FIELD(ah, ctrl0[i],
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -837,6 +837,7 @@ struct ath_hw {
+ unsigned int paprd_target_power;
+ unsigned int paprd_training_power;
+ unsigned int paprd_ratemask;
++ unsigned int paprd_ratemask_ht40;
+ bool paprd_table_write_done;
+ u32 paprd_gain_table_entries[PAPRD_GAIN_TABLE_ENTRIES];
+ u8 paprd_gain_table_index[PAPRD_GAIN_TABLE_ENTRIES];
diff --git a/package/mac80211/patches/520-ath9k_slottime_init.patch b/package/mac80211/patches/520-ath9k_slottime_init.patch
deleted file mode 100644
index 847afeca9..000000000
--- a/package/mac80211/patches/520-ath9k_slottime_init.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -409,7 +409,7 @@ static void ath9k_hw_init_defaults(struc
- AR_STA_ID1_CRPT_MIC_ENABLE |
- AR_STA_ID1_MCAST_KSRCH;
- ah->enable_32kHz_clock = DONT_USE_32KHZ;
-- ah->slottime = (u32) -1;
-+ ah->slottime = 9;
- ah->globaltxtimeout = (u32) -1;
- ah->power_mode = ATH9K_PM_UNDEFINED;
- }
diff --git a/package/mac80211/patches/521-ath9k_fix_distance_setting.patch b/package/mac80211/patches/521-ath9k_fix_distance_setting.patch
deleted file mode 100644
index fd0a5c63f..000000000
--- a/package/mac80211/patches/521-ath9k_fix_distance_setting.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -817,7 +817,7 @@ void ath9k_hw_init_global_settings(struc
- if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ)
- acktimeout += 64 - sifstime - ah->slottime;
-
-- ath9k_hw_setslottime(ah, slottime);
-+ ath9k_hw_setslottime(ah, ah->slottime);
- ath9k_hw_set_ack_timeout(ah, acktimeout);
- ath9k_hw_set_cts_timeout(ah, acktimeout);
- if (ah->globaltxtimeout != (u32) -1)
diff --git a/package/mac80211/patches/530-ath9k_chainmask_read_fix.patch b/package/mac80211/patches/530-ath9k_chainmask_read_fix.patch
new file mode 100644
index 000000000..a0eebf597
--- /dev/null
+++ b/package/mac80211/patches/530-ath9k_chainmask_read_fix.patch
@@ -0,0 +1,28 @@
+--- a/drivers/net/wireless/ath/ath9k/debug.c
++++ b/drivers/net/wireless/ath/ath9k/debug.c
+@@ -81,11 +81,10 @@ static ssize_t read_file_tx_chainmask(st
+ size_t count, loff_t *ppos)
+ {
+ struct ath_softc *sc = file->private_data;
+- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ char buf[32];
+ unsigned int len;
+
+- len = sprintf(buf, "0x%08x\n", common->tx_chainmask);
++ len = sprintf(buf, "0x%08x\n", sc->sc_ah->caps.tx_chainmask);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+ }
+
+@@ -124,11 +123,10 @@ static ssize_t read_file_rx_chainmask(st
+ size_t count, loff_t *ppos)
+ {
+ struct ath_softc *sc = file->private_data;
+- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ char buf[32];
+ unsigned int len;
+
+- len = sprintf(buf, "0x%08x\n", common->rx_chainmask);
++ len = sprintf(buf, "0x%08x\n", sc->sc_ah->caps.rx_chainmask);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+ }
+
diff --git a/package/mac80211/patches/530-ath9k_paprd_thermal.patch b/package/mac80211/patches/530-ath9k_paprd_thermal.patch
deleted file mode 100644
index 09c7a6645..000000000
--- a/package/mac80211/patches/530-ath9k_paprd_thermal.patch
+++ /dev/null
@@ -1,122 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -320,6 +320,42 @@ static void ath_paprd_activate(struct at
- ath9k_ps_restore(sc);
- }
-
-+static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain)
-+{
-+ struct ieee80211_hw *hw = sc->hw;
-+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
-+ struct ath_tx_control txctl;
-+ int time_left;
-+
-+ memset(&txctl, 0, sizeof(txctl));
-+ txctl.txq = sc->tx.txq_map[WME_AC_BE];
-+
-+ memset(tx_info, 0, sizeof(*tx_info));
-+ tx_info->band = hw->conf.channel->band;
-+ tx_info->flags |= IEEE80211_TX_CTL_NO_ACK;
-+ tx_info->control.rates[0].idx = 0;
-+ tx_info->control.rates[0].count = 1;
-+ tx_info->control.rates[0].flags = IEEE80211_TX_RC_MCS;
-+ tx_info->control.rates[1].idx = -1;
-+
-+ init_completion(&sc->paprd_complete);
-+ sc->paprd_pending = true;
-+ txctl.paprd = BIT(chain);
-+ if (ath_tx_start(hw, skb, &txctl) != 0)
-+ return false;
-+
-+ time_left = wait_for_completion_timeout(&sc->paprd_complete,
-+ msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
-+ sc->paprd_pending = false;
-+
-+ if (!time_left)
-+ ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_CALIBRATE,
-+ "Timeout waiting for paprd training on TX chain %d\n",
-+ chain);
-+
-+ return !!time_left;
-+}
-+
- void ath_paprd_calibrate(struct work_struct *work)
- {
- struct ath_softc *sc = container_of(work, struct ath_softc, paprd_work);
-@@ -327,18 +363,12 @@ void ath_paprd_calibrate(struct work_str
- struct ath_hw *ah = sc->sc_ah;
- struct ieee80211_hdr *hdr;
- struct sk_buff *skb = NULL;
-- struct ieee80211_tx_info *tx_info;
-- int band = hw->conf.channel->band;
-- struct ieee80211_supported_band *sband = &sc->sbands[band];
-- struct ath_tx_control txctl;
- struct ath9k_hw_cal_data *caldata = ah->caldata;
- struct ath_common *common = ath9k_hw_common(ah);
- int ftype;
- int chain_ok = 0;
- int chain;
- int len = 1800;
-- int time_left;
-- int i;
-
- if (!caldata)
- return;
-@@ -347,8 +377,6 @@ void ath_paprd_calibrate(struct work_str
- if (!skb)
- return;
-
-- tx_info = IEEE80211_SKB_CB(skb);
--
- skb_put(skb, len);
- memset(skb->data, 0, len);
- hdr = (struct ieee80211_hdr *)skb->data;
-@@ -359,9 +387,6 @@ void ath_paprd_calibrate(struct work_str
- memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
- memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
-
-- memset(&txctl, 0, sizeof(txctl));
-- txctl.txq = sc->tx.txq_map[WME_AC_BE];
--
- ath9k_ps_wakeup(sc);
- ar9003_paprd_init_table(ah);
- for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
-@@ -369,30 +394,19 @@ void ath_paprd_calibrate(struct work_str
- continue;
-
- chain_ok = 0;
-- memset(tx_info, 0, sizeof(*tx_info));
-- tx_info->band = band;
-
-- for (i = 0; i < 4; i++) {
-- tx_info->control.rates[i].idx = sband->n_bitrates - 1;
-- tx_info->control.rates[i].count = 6;
-- }
-+ ath_dbg(common, ATH_DBG_CALIBRATE,
-+ "Sending PAPRD frame for thermal measurement "
-+ "on chain %d\n", chain);
-+ if (!ath_paprd_send_frame(sc, skb, chain))
-+ goto fail_paprd;
-
-- init_completion(&sc->paprd_complete);
-- sc->paprd_pending = true;
- ar9003_paprd_setup_gain_table(ah, chain);
-- txctl.paprd = BIT(chain);
-- if (ath_tx_start(hw, skb, &txctl) != 0)
-- break;
-
-- time_left = wait_for_completion_timeout(&sc->paprd_complete,
-- msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
-- sc->paprd_pending = false;
-- if (!time_left) {
-- ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
-- "Timeout waiting for paprd training on TX chain %d\n",
-- chain);
-+ ath_dbg(common, ATH_DBG_CALIBRATE,
-+ "Sending PAPRD training frame on chain %d\n", chain);
-+ if (!ath_paprd_send_frame(sc, skb, chain))
- goto fail_paprd;
-- }
-
- if (!ar9003_paprd_is_done(ah))
- break;
diff --git a/package/mac80211/patches/531-ath9k_paprd_rate_mask.patch b/package/mac80211/patches/531-ath9k_paprd_rate_mask.patch
deleted file mode 100644
index 153fb90a1..000000000
--- a/package/mac80211/patches/531-ath9k_paprd_rate_mask.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
-@@ -31,6 +31,12 @@
- #define AR9300_ANT_16S 25
- #define AR9300_FUTURE_MODAL_SZ 6
-
-+#define AR9300_PAPRD_RATE_MASK 0x01ffffff
-+#define AR9300_PAPRD_SCALE_1 0x0e000000
-+#define AR9300_PAPRD_SCALE_1_S 25
-+#define AR9300_PAPRD_SCALE_2 0x70000000
-+#define AR9300_PAPRD_SCALE_2_S 28
-+
- /* Delta from which to start power to pdadc table */
- /* This offset is used in both open loop and closed loop power control
- * schemes. In open loop power control, it is not really needed, but for
---- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-@@ -52,8 +52,8 @@ static void ar9003_paprd_setup_single_ta
- else
- hdr = &eep->modalHeader2G;
-
-- am_mask = le32_to_cpu(hdr->papdRateMaskHt20);
-- ht40_mask = le32_to_cpu(hdr->papdRateMaskHt40);
-+ am_mask = le32_to_cpu(hdr->papdRateMaskHt20) & AR9300_PAPRD_RATE_MASK;
-+ ht40_mask = le32_to_cpu(hdr->papdRateMaskHt40) & AR9300_PAPRD_RATE_MASK;
-
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, am_mask);
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, am_mask);
diff --git a/package/mac80211/patches/532-ath9k_paprd_training_power.patch b/package/mac80211/patches/532-ath9k_paprd_training_power.patch
deleted file mode 100644
index 2f8200772..000000000
--- a/package/mac80211/patches/532-ath9k_paprd_training_power.patch
+++ /dev/null
@@ -1,233 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-@@ -30,9 +30,69 @@ void ar9003_paprd_enable(struct ath_hw *
- }
- EXPORT_SYMBOL(ar9003_paprd_enable);
-
--static void ar9003_paprd_setup_single_table(struct ath_hw *ah)
-+static int ar9003_get_training_power_2g(struct ath_hw *ah)
- {
- struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
-+ struct ar9300_modal_eep_header *hdr = &eep->modalHeader2G;
-+ unsigned int power, scale, delta;
-+
-+ scale = MS(le32_to_cpu(hdr->papdRateMaskHt20), AR9300_PAPRD_SCALE_1);
-+ power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5,
-+ AR_PHY_POWERTX_RATE5_POWERTXHT20_0);
-+
-+ delta = abs((int) ah->paprd_target_power - (int) power);
-+ if (delta > scale)
-+ return -1;
-+
-+ if (delta < 4)
-+ power -= 4 - delta;
-+
-+ return power;
-+}
-+
-+static int get_streams(int mask)
-+{
-+ return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2));
-+}
-+
-+static int ar9003_get_training_power_5g(struct ath_hw *ah)
-+{
-+ struct ath_common *common = ath9k_hw_common(ah);
-+ struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
-+ struct ar9300_modal_eep_header *hdr = &eep->modalHeader5G;
-+ struct ath9k_channel *chan = ah->curchan;
-+ unsigned int power, scale, delta;
-+
-+ if (chan->channel >= 5700)
-+ scale = MS(le32_to_cpu(hdr->papdRateMaskHt20),
-+ AR9300_PAPRD_SCALE_1);
-+ else if (chan->channel >= 5400)
-+ scale = MS(le32_to_cpu(hdr->papdRateMaskHt40),
-+ AR9300_PAPRD_SCALE_2);
-+ else
-+ scale = MS(le32_to_cpu(hdr->papdRateMaskHt40),
-+ AR9300_PAPRD_SCALE_1);
-+
-+ if (IS_CHAN_HT40(chan))
-+ power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE8,
-+ AR_PHY_POWERTX_RATE8_POWERTXHT40_5);
-+ else
-+ power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE6,
-+ AR_PHY_POWERTX_RATE6_POWERTXHT20_5);
-+
-+ power += scale;
-+ delta = abs((int) ah->paprd_target_power - (int) power);
-+ if (delta > scale)
-+ return -1;
-+
-+ power += 2 * get_streams(common->tx_chainmask);
-+ return power;
-+}
-+
-+static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
-+{
-+ struct ath_common *common = ath9k_hw_common(ah);
-+ struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
- struct ar9300_modal_eep_header *hdr;
- static const u32 ctrl0[3] = {
- AR_PHY_PAPRD_CTRL0_B0,
-@@ -45,6 +105,7 @@ static void ar9003_paprd_setup_single_ta
- AR_PHY_PAPRD_CTRL1_B2
- };
- u32 am_mask, ht40_mask;
-+ int training_power;
- int i;
-
- if (ah->curchan && IS_CHAN_5GHZ(ah->curchan))
-@@ -55,11 +116,25 @@ static void ar9003_paprd_setup_single_ta
- am_mask = le32_to_cpu(hdr->papdRateMaskHt20) & AR9300_PAPRD_RATE_MASK;
- ht40_mask = le32_to_cpu(hdr->papdRateMaskHt40) & AR9300_PAPRD_RATE_MASK;
-
-+ if (IS_CHAN_2GHZ(ah->curchan))
-+ training_power = ar9003_get_training_power_2g(ah);
-+ else
-+ training_power = ar9003_get_training_power_5g(ah);
-+
-+ if (training_power < 0) {
-+ ath_dbg(common, ATH_DBG_CALIBRATE,
-+ "PAPRD target power delta out of range");
-+ return -ERANGE;
-+ }
-+ ah->paprd_training_power = training_power;
-+ ath_dbg(common, ATH_DBG_CALIBRATE,
-+ "Training power: %d, Target power: %d\n",
-+ ah->paprd_training_power, ah->paprd_target_power);
-+
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, am_mask);
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, am_mask);
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, ht40_mask);
-
--
- for (i = 0; i < ah->caps.max_txchains; i++) {
- REG_RMW_FIELD(ah, ctrl0[i],
- AR_PHY_PAPRD_CTRL0_USE_SINGLE_TABLE_MASK, 1);
-@@ -141,6 +216,7 @@ static void ar9003_paprd_setup_single_ta
- AR_PHY_PAPRD_PRE_POST_SCALING, 185706);
- REG_RMW_FIELD(ah, AR_PHY_PAPRD_PRE_POST_SCALE_7_B0,
- AR_PHY_PAPRD_PRE_POST_SCALING, 175487);
-+ return 0;
- }
-
- static void ar9003_paprd_get_gain_table(struct ath_hw *ah)
-@@ -595,15 +671,10 @@ void ar9003_paprd_populate_single_table(
- {
- u32 *paprd_table_val = caldata->pa_table[chain];
- u32 small_signal_gain = caldata->small_signal_gain[chain];
-- u32 training_power;
-+ u32 training_power = ah->paprd_training_power;
- u32 reg = 0;
- int i;
-
-- training_power =
-- REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5,
-- AR_PHY_POWERTX_RATE5_POWERTXHT20_0);
-- training_power -= 4;
--
- if (chain == 0)
- reg = AR_PHY_PAPRD_MEM_TAB_B0;
- else if (chain == 1)
-@@ -643,14 +714,8 @@ EXPORT_SYMBOL(ar9003_paprd_populate_sing
-
- int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
- {
--
- unsigned int i, desired_gain, gain_index;
-- unsigned int train_power;
--
-- train_power = REG_READ_FIELD(ah, AR_PHY_POWERTX_RATE5,
-- AR_PHY_POWERTX_RATE5_POWERTXHT20_0);
--
-- train_power = train_power - 4;
-+ unsigned int train_power = ah->paprd_training_power;
-
- desired_gain = ar9003_get_desired_gain(ah, chain, train_power);
-
-@@ -716,7 +781,12 @@ EXPORT_SYMBOL(ar9003_paprd_create_curve)
-
- int ar9003_paprd_init_table(struct ath_hw *ah)
- {
-- ar9003_paprd_setup_single_table(ah);
-+ int ret;
-+
-+ ret = ar9003_paprd_setup_single_table(ah);
-+ if (ret < 0)
-+ return ret;
-+
- ar9003_paprd_get_gain_table(ah);
- return 0;
- }
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -835,6 +835,8 @@ struct ath_hw {
- u32 bb_watchdog_last_status;
- u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */
-
-+ unsigned int paprd_target_power;
-+ unsigned int paprd_training_power;
- u32 paprd_gain_table_entries[PAPRD_GAIN_TABLE_ENTRIES];
- u8 paprd_gain_table_index[PAPRD_GAIN_TABLE_ENTRIES];
- /*
---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
-@@ -1090,6 +1090,14 @@
- #define AR_PHY_POWERTX_RATE5_POWERTXHT20_0 0x3F
- #define AR_PHY_POWERTX_RATE5_POWERTXHT20_0_S 0
-
-+#define AR_PHY_POWERTX_RATE6 (AR_SM_BASE + 0x1d4)
-+#define AR_PHY_POWERTX_RATE6_POWERTXHT20_5 0x3F00
-+#define AR_PHY_POWERTX_RATE6_POWERTXHT20_5_S 8
-+
-+#define AR_PHY_POWERTX_RATE8 (AR_SM_BASE + 0x1dc)
-+#define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00
-+#define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8
-+
- void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx);
-
- #endif /* AR9003_PHY_H */
---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-@@ -4798,6 +4798,19 @@ static void ath9k_hw_ar9300_set_txpower(
- /* Write target power array to registers */
- ar9003_hw_tx_power_regwrite(ah, targetPowerValT2);
- ar9003_hw_calibration_apply(ah, chan->channel);
-+
-+ if (IS_CHAN_2GHZ(chan)) {
-+ if (IS_CHAN_HT40(chan))
-+ i = ALL_TARGET_HT40_0_8_16;
-+ else
-+ i = ALL_TARGET_HT20_0_8_16;
-+ } else {
-+ if (IS_CHAN_HT40(chan))
-+ i = ALL_TARGET_HT40_7;
-+ else
-+ i = ALL_TARGET_HT20_7;
-+ }
-+ ah->paprd_target_power = targetPowerValT2[i];
- }
-
- static u16 ath9k_hw_ar9300_get_spur_channel(struct ath_hw *ah,
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -373,6 +373,9 @@ void ath_paprd_calibrate(struct work_str
- if (!caldata)
- return;
-
-+ if (ar9003_paprd_init_table(ah) < 0)
-+ return;
-+
- skb = alloc_skb(len, GFP_KERNEL);
- if (!skb)
- return;
-@@ -388,7 +391,6 @@ void ath_paprd_calibrate(struct work_str
- memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
-
- ath9k_ps_wakeup(sc);
-- ar9003_paprd_init_table(ah);
- for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
- if (!(common->tx_chainmask & BIT(chain)))
- continue;
diff --git a/package/mac80211/patches/533-ar9003_radar_initvals_update.patch b/package/mac80211/patches/533-ar9003_radar_initvals_update.patch
deleted file mode 100644
index 02bd9e458..000000000
--- a/package/mac80211/patches/533-ar9003_radar_initvals_update.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-@@ -638,6 +638,7 @@ static const u32 ar9300_2p2_baseband_pos
- {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
- {0x0000a204, 0x000037c0, 0x000037c4, 0x000037c4, 0x000037c0},
- {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
-+ {0x0000a22c, 0x01026a2f, 0x01026a2f, 0x01026a2f, 0x01026a2f},
- {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b},
- {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
- {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
-@@ -680,7 +681,7 @@ static const u32 ar9300_2p2_baseband_cor
- {0x0000981c, 0x00020028},
- {0x00009834, 0x6400a290},
- {0x00009838, 0x0108ecff},
-- {0x0000983c, 0x14750600},
-+ {0x0000983c, 0x0d000600},
- {0x00009880, 0x201fff00},
- {0x00009884, 0x00001042},
- {0x000098a4, 0x00200400},
-@@ -722,7 +723,6 @@ static const u32 ar9300_2p2_baseband_cor
- {0x0000a220, 0x00000000},
- {0x0000a224, 0x00000000},
- {0x0000a228, 0x10002310},
-- {0x0000a22c, 0x01036a27},
- {0x0000a23c, 0x00000000},
- {0x0000a244, 0x0c000000},
- {0x0000a2a0, 0x00000001},
diff --git a/package/mac80211/patches/534-ar9003_clc_initvals_update.patch b/package/mac80211/patches/534-ar9003_clc_initvals_update.patch
deleted file mode 100644
index a14e4370a..000000000
--- a/package/mac80211/patches/534-ar9003_clc_initvals_update.patch
+++ /dev/null
@@ -1,129 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-@@ -34,9 +34,9 @@ static const u32 ar9300_2p2_radio_postam
-
- static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p2[][5] = {
- /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
-- {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800},
-- {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000},
-- {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000},
-+ {0x0000a2dc, 0x00033800, 0x00033800, 0x00637800, 0x00637800},
-+ {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03838000, 0x03838000},
-+ {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03fc0000, 0x03fc0000},
- {0x0000a2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
- {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-@@ -56,21 +56,21 @@ static const u32 ar9300Modes_lowest_ob_d
- {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
- {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
- {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
-- {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
-- {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
-- {0x0000a54c, 0x5c02486b, 0x5c02486b, 0x47001a83, 0x47001a83},
-- {0x0000a550, 0x61024a6c, 0x61024a6c, 0x4a001c84, 0x4a001c84},
-- {0x0000a554, 0x66026a6c, 0x66026a6c, 0x4e001ce3, 0x4e001ce3},
-- {0x0000a558, 0x6b026e6c, 0x6b026e6c, 0x52001ce5, 0x52001ce5},
-- {0x0000a55c, 0x7002708c, 0x7002708c, 0x56001ce9, 0x56001ce9},
-- {0x0000a560, 0x7302b08a, 0x7302b08a, 0x5a001ceb, 0x5a001ceb},
-- {0x0000a564, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a568, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a56c, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a570, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a574, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a578, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-- {0x0000a57c, 0x7702b08c, 0x7702b08c, 0x5d001eec, 0x5d001eec},
-+ {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
-+ {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
-+ {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
-+ {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84},
-+ {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3},
-+ {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5},
-+ {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9},
-+ {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb},
-+ {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+ {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
- {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
- {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
- {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
-@@ -88,44 +88,44 @@ static const u32 ar9300Modes_lowest_ob_d
- {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24},
- {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640},
- {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660},
-- {0x0000a5c4, 0x5382266c, 0x5382266c, 0x3f801861, 0x3f801861},
-- {0x0000a5c8, 0x5782286c, 0x5782286c, 0x43801a81, 0x43801a81},
-- {0x0000a5cc, 0x5c82486b, 0x5c82486b, 0x47801a83, 0x47801a83},
-- {0x0000a5d0, 0x61824a6c, 0x61824a6c, 0x4a801c84, 0x4a801c84},
-- {0x0000a5d4, 0x66826a6c, 0x66826a6c, 0x4e801ce3, 0x4e801ce3},
-- {0x0000a5d8, 0x6b826e6c, 0x6b826e6c, 0x52801ce5, 0x52801ce5},
-- {0x0000a5dc, 0x7082708c, 0x7082708c, 0x56801ce9, 0x56801ce9},
-- {0x0000a5e0, 0x7382b08a, 0x7382b08a, 0x5a801ceb, 0x5a801ceb},
-- {0x0000a5e4, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5e8, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5ec, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5f0, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5f4, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5f8, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-- {0x0000a5fc, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861},
-+ {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81},
-+ {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83},
-+ {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84},
-+ {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3},
-+ {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5},
-+ {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9},
-+ {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb},
-+ {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+ {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
- {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-- {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
-- {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
-- {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
-- {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
-- {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
-- {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
-- {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
-- {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-- {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-- {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-- {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-- {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800},
-- {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000},
-- {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000},
-+ {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000},
-+ {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501},
-+ {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501},
-+ {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03},
-+ {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04},
-+ {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04},
-+ {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-+ {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-+ {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-+ {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-+ {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
-+ {0x0000b2dc, 0x00033800, 0x00033800, 0x00637800, 0x00637800},
-+ {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03838000, 0x03838000},
-+ {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03fc0000, 0x03fc0000},
- {0x0000b2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-- {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800},
-- {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000},
-- {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000},
-+ {0x0000c2dc, 0x00033800, 0x00033800, 0x00637800, 0x00637800},
-+ {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03838000, 0x03838000},
-+ {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03fc0000, 0x03fc0000},
- {0x0000c2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
- {0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
diff --git a/package/mac80211/patches/540-ath9k_aggr_depth_fix.patch b/package/mac80211/patches/540-ath9k_aggr_depth_fix.patch
deleted file mode 100644
index ad0f2e1e9..000000000
--- a/package/mac80211/patches/540-ath9k_aggr_depth_fix.patch
+++ /dev/null
@@ -1,89 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -838,7 +838,7 @@ static void ath_tx_sched_aggr(struct ath
- ath_tx_txqaddbuf(sc, txq, &bf_q);
- TX_STAT_INC(txq->axq_qnum, a_aggr);
-
-- } while (txq->axq_depth < ATH_AGGR_MIN_QDEPTH &&
-+ } while (txq->axq_ampdu_depth < ATH_AGGR_MIN_QDEPTH &&
- status != ATH_AGGR_BAW_CLOSED);
- }
-
-@@ -999,6 +999,7 @@ struct ath_txq *ath_txq_setup(struct ath
- INIT_LIST_HEAD(&txq->axq_acq);
- spin_lock_init(&txq->axq_lock);
- txq->axq_depth = 0;
-+ txq->axq_ampdu_depth = 0;
- txq->axq_tx_inprogress = false;
- sc->tx.txqsetup |= 1<<qnum;
-
-@@ -1068,6 +1069,12 @@ int ath_cabq_update(struct ath_softc *sc
- return 0;
- }
-
-+static bool bf_is_ampdu_not_probing(struct ath_buf *bf)
-+{
-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu);
-+ return bf_isampdu(bf) && !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE);
-+}
-+
- /*
- * Drain a given TX queue (could be Beacon or Data)
- *
-@@ -1126,7 +1133,8 @@ void ath_draintxq(struct ath_softc *sc,
- }
-
- txq->axq_depth--;
--
-+ if (bf_is_ampdu_not_probing(bf))
-+ txq->axq_ampdu_depth--;
- spin_unlock_bh(&txq->axq_lock);
-
- if (bf_isampdu(bf))
-@@ -1316,6 +1324,8 @@ static void ath_tx_txqaddbuf(struct ath_
- ath9k_hw_txstart(ah, txq->axq_qnum);
- }
- txq->axq_depth++;
-+ if (bf_is_ampdu_not_probing(bf))
-+ txq->axq_ampdu_depth++;
- }
-
- static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid,
-@@ -1336,7 +1346,7 @@ static void ath_tx_send_ampdu(struct ath
- */
- if (!list_empty(&tid->buf_q) || tid->paused ||
- !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
-- txctl->txq->axq_depth >= ATH_AGGR_MIN_QDEPTH) {
-+ txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
- /*
- * Add this frame to software queue for scheduling later
- * for aggregation.
-@@ -2040,6 +2050,9 @@ static void ath_tx_processq(struct ath_s
- txq->axq_tx_inprogress = false;
- if (bf_held)
- list_del(&bf_held->list);
-+
-+ if (bf_is_ampdu_not_probing(bf))
-+ txq->axq_ampdu_depth--;
- spin_unlock_bh(&txq->axq_lock);
-
- if (bf_held)
-@@ -2168,6 +2181,8 @@ void ath_tx_edma_tasklet(struct ath_soft
- INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH);
- txq->axq_depth--;
- txq->axq_tx_inprogress = false;
-+ if (bf_is_ampdu_not_probing(bf))
-+ txq->axq_ampdu_depth--;
- spin_unlock_bh(&txq->axq_lock);
-
- txok = !(txs.ts_status & ATH9K_TXERR_MASK);
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -187,6 +187,7 @@ struct ath_txq {
- struct list_head axq_q;
- spinlock_t axq_lock;
- u32 axq_depth;
-+ u32 axq_ampdu_depth;
- bool stopped;
- bool axq_tx_inprogress;
- struct list_head axq_acq;
diff --git a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
index 28009bce0..037852371 100644
--- a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
+++ b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
-@@ -202,6 +202,7 @@ void rt2x00pci_uninitialize(struct rt2x0
+@@ -209,6 +209,7 @@ void rt2x00pci_uninitialize(struct rt2x0
}
EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
@@ -8,7 +8,7 @@
/*
* PCI driver handlers.
*/
-@@ -381,6 +382,7 @@ int rt2x00pci_resume(struct pci_dev *pci
+@@ -388,6 +389,7 @@ int rt2x00pci_resume(struct pci_dev *pci
}
EXPORT_SYMBOL_GPL(rt2x00pci_resume);
#endif /* CONFIG_PM */
diff --git a/package/mac80211/patches/601-rt2x00-fix-hang-on-ifdown.patch b/package/mac80211/patches/601-rt2x00-fix-hang-on-ifdown.patch
index 50658f145..cb49a8014 100644
--- a/package/mac80211/patches/601-rt2x00-fix-hang-on-ifdown.patch
+++ b/package/mac80211/patches/601-rt2x00-fix-hang-on-ifdown.patch
@@ -16,14 +16,14 @@ Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
-@@ -592,6 +592,10 @@ static void rt2800pci_kill_tx_queue(stru
- return;
- }
+@@ -481,6 +481,10 @@ static void rt2800pci_disable_radio(stru
+
+ rt2800_register_write(rt2x00dev, PBF_SYS_CTRL, 0x00001280);
+ rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG, &reg);
+ rt2x00_set_field32(&reg, WPDMA_GLO_CFG_ENABLE_TX_DMA, 0);
+ rt2800_register_write(rt2x00dev, WPDMA_GLO_CFG, reg);
+
rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, &reg);
- rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX0, (queue->qid == QID_AC_BE));
- rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX1, (queue->qid == QID_AC_BK));
+ rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX0, 1);
+ rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX1, 1);
diff --git a/package/mac80211/patches/610-set_pci_mwi.patch b/package/mac80211/patches/610-set_pci_mwi.patch
index 06933e571..c30ff2d2a 100644
--- a/package/mac80211/patches/610-set_pci_mwi.patch
+++ b/package/mac80211/patches/610-set_pci_mwi.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
-@@ -270,8 +270,10 @@ int rt2x00pci_probe(struct pci_dev *pci_
+@@ -277,8 +277,10 @@ int rt2x00pci_probe(struct pci_dev *pci_
pci_set_master(pci_dev);
diff --git a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch
index ac0b5c24f..86578724d 100644
--- a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch
+++ b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch
@@ -22,7 +22,7 @@
static int modparam_bad_frames_preempt;
module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
MODULE_PARM_DESC(bad_frames_preempt,
-@@ -2540,10 +2545,10 @@ static int b43_gpio_init(struct b43_wlde
+@@ -2536,10 +2541,10 @@ static int b43_gpio_init(struct b43_wlde
& ~B43_MACCTL_GPOUTSMSK);
b43_write16(dev, B43_MMIO_GPIO_MASK, b43_read16(dev, B43_MMIO_GPIO_MASK)
@@ -35,7 +35,7 @@
if (dev->dev->bus->chip_id == 0x4301) {
mask |= 0x0060;
set |= 0x0060;
-@@ -5100,10 +5105,10 @@ static void b43_print_driverinfo(void)
+@@ -5096,10 +5101,10 @@ static void b43_print_driverinfo(void)
feat_sdio = "S";
#endif
printk(KERN_INFO "Broadcom 43xx driver loaded "
diff --git a/package/mac80211/patches/810-b43_no_pio.patch b/package/mac80211/patches/810-b43_no_pio.patch
index 8f7e118de..b30b417d8 100644
--- a/package/mac80211/patches/810-b43_no_pio.patch
+++ b/package/mac80211/patches/810-b43_no_pio.patch
@@ -11,7 +11,7 @@
b43-$(CONFIG_B43_PCMCIA) += pcmcia.o
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
-@@ -1816,9 +1816,11 @@ static void b43_do_interrupt_thread(stru
+@@ -1812,9 +1812,11 @@ static void b43_do_interrupt_thread(stru
dma_reason[4], dma_reason[5]);
b43err(dev->wl, "This device does not support DMA "
"on your system. It will now be switched to PIO.\n");