aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-24 18:54:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-24 18:54:16 +0000
commit9b34dfb5715cceeddb974751bf60c4766cbf700b (patch)
treed76d3bf6a8a28328e24e0c2a3d27aaca20233c9d /package/mac80211
parent18c4d8389eb23d8dc5caaebd6a5bb8e3d130ed2f (diff)
downloadupstream-9b34dfb5715cceeddb974751bf60c4766cbf700b.tar.gz
upstream-9b34dfb5715cceeddb974751bf60c4766cbf700b.tar.bz2
upstream-9b34dfb5715cceeddb974751bf60c4766cbf700b.zip
mac80211: update to wireless-testing 2011-01-24
SVN-Revision: 25093
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/Makefile4
-rw-r--r--package/mac80211/patches/300-ath9k_gpio_settings.patch8
-rw-r--r--package/mac80211/patches/310-ath9k_pending_work.patch122
-rw-r--r--package/mac80211/patches/310-pending_work.patch (renamed from package/mac80211/patches/541-ath9k_remove_virtual_support.patch)1614
-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.patch2
-rw-r--r--package/mac80211/patches/500-ath9k_eeprom_debugfs.patch4
-rw-r--r--package/mac80211/patches/510-ath9k_led_cleanup.patch14
-rw-r--r--package/mac80211/patches/530-ath9k_cleanup_queue_wake.patch118
-rw-r--r--package/mac80211/patches/530-mac80211_fix_beacon_race.patch12
-rw-r--r--package/mac80211/patches/531-ath9k_suppress_bogus_error_message.patch14
-rw-r--r--package/mac80211/patches/540-ath9k_remove_virtual_debugfs.patch172
-rw-r--r--package/mac80211/patches/542-ath9k_remove_bf_aphy.patch170
-rw-r--r--package/mac80211/patches/543-ath9k_remove_ath_wiphy.patch572
-rw-r--r--package/mac80211/patches/550-ath9k_fix_ps_wakeup_issues.patch61
-rw-r--r--package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch2
16 files changed, 1328 insertions, 1567 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index dd24815785..39c56f24c8 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
-PKG_VERSION:=2011-01-19
+PKG_VERSION:=2011-01-24
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=74a76771c142de86e548565cc6888f3f
+PKG_MD5SUM:=c91b57972276b26824d4b18e927a9e5f
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
diff --git a/package/mac80211/patches/300-ath9k_gpio_settings.patch b/package/mac80211/patches/300-ath9k_gpio_settings.patch
index ed564b7b90..e13e1cf727 100644
--- a/package/mac80211/patches/300-ath9k_gpio_settings.patch
+++ b/package/mac80211/patches/300-ath9k_gpio_settings.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -927,6 +927,12 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1200,6 +1200,12 @@ int ath9k_init_debug(struct ath_hw *ah)
sc->debug.debugfs_phy, &ah->config.cwm_ignore_extcca))
goto err;
@@ -15,7 +15,7 @@
err:
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -794,6 +794,8 @@ struct ath_hw {
+@@ -795,6 +795,8 @@ struct ath_hw {
int initPDADC;
int PDADCdelta;
u8 led_pin;
@@ -26,7 +26,7 @@
struct ar5416IniArray iniCommon;
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1172,6 +1172,20 @@ static bool ath9k_hw_channel_change(stru
+@@ -1175,6 +1175,20 @@ static bool ath9k_hw_channel_change(stru
return true;
}
@@ -47,7 +47,7 @@
bool ath9k_hw_check_alive(struct ath_hw *ah)
{
int count = 50;
-@@ -1460,6 +1474,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+@@ -1463,6 +1477,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/310-ath9k_pending_work.patch b/package/mac80211/patches/310-ath9k_pending_work.patch
deleted file mode 100644
index d0c2f39142..0000000000
--- a/package/mac80211/patches/310-ath9k_pending_work.patch
+++ /dev/null
@@ -1,122 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1221,49 +1221,59 @@ void ath_tx_cleanupq(struct ath_softc *s
- sc->tx.txqsetup &= ~(1<<txq->axq_qnum);
- }
-
-+/* For each axq_acq entry, for each tid, try to schedule packets
-+ * for transmit until ampdu_depth has reached min Q depth.
-+ */
- void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
- {
-- struct ath_atx_ac *ac;
-- struct ath_atx_tid *tid, *last;
-+ struct ath_atx_ac *ac, *ac_tmp, *last_ac;
-+ struct ath_atx_tid *tid, *last_tid;
-
- if (list_empty(&txq->axq_acq) ||
- txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
- return;
-
- ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, list);
-- last = list_entry(ac->tid_q.prev, struct ath_atx_tid, list);
-- list_del(&ac->list);
-- ac->sched = false;
-+ last_ac = list_entry(txq->axq_acq.prev, struct ath_atx_ac, list);
-
-- do {
-- if (list_empty(&ac->tid_q))
-- return;
--
-- tid = list_first_entry(&ac->tid_q, struct ath_atx_tid, list);
-- list_del(&tid->list);
-- tid->sched = false;
-+ list_for_each_entry_safe(ac, ac_tmp, &txq->axq_acq, list) {
-+ last_tid = list_entry(ac->tid_q.prev, struct ath_atx_tid, list);
-+ list_del(&ac->list);
-+ ac->sched = false;
-+
-+ while (!list_empty(&ac->tid_q)) {
-+ tid = list_first_entry(&ac->tid_q, struct ath_atx_tid,
-+ list);
-+ list_del(&tid->list);
-+ tid->sched = false;
-
-- if (tid->paused)
-- continue;
-+ if (tid->paused)
-+ continue;
-
-- ath_tx_sched_aggr(sc, txq, tid);
-+ ath_tx_sched_aggr(sc, txq, tid);
-
-- /*
-- * add tid to round-robin queue if more frames
-- * are pending for the tid
-- */
-- if (!list_empty(&tid->buf_q))
-- ath_tx_queue_tid(txq, tid);
-+ /*
-+ * add tid to round-robin queue if more frames
-+ * are pending for the tid
-+ */
-+ if (!list_empty(&tid->buf_q))
-+ ath_tx_queue_tid(txq, tid);
-
-- if (tid == last || txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
-- break;
-- } while (!list_empty(&ac->tid_q));
-+ if (tid == last_tid ||
-+ txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
-+ break;
-+ }
-
-- if (!list_empty(&ac->tid_q)) {
-- if (!ac->sched) {
-- ac->sched = true;
-- list_add_tail(&ac->list, &txq->axq_acq);
-+ if (!list_empty(&ac->tid_q)) {
-+ if (!ac->sched) {
-+ ac->sched = true;
-+ list_add_tail(&ac->list, &txq->axq_acq);
-+ }
- }
-+
-+ if (ac == last_ac ||
-+ txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
-+ return;
- }
- }
-
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -369,6 +369,9 @@ static void ath9k_hw_init_config(struct
- else
- ah->config.ht_enable = 0;
-
-+ /* PAPRD needs some more work to be enabled */
-+ ah->config.paprd_disable = 1;
-+
- ah->config.rx_intr_mitigation = true;
- ah->config.pcieSerDesWrite = true;
-
-@@ -1949,7 +1952,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
- pCap->rx_status_len = sizeof(struct ar9003_rxs);
- pCap->tx_desc_len = sizeof(struct ar9003_txc);
- pCap->txs_len = sizeof(struct ar9003_txs);
-- if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
-+ if (!ah->config.paprd_disable &&
-+ ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
- pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
- } else {
- pCap->tx_desc_len = sizeof(struct ath_desc);
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -228,6 +228,7 @@ struct ath9k_ops_config {
- u32 pcie_waen;
- u8 analog_shiftreg;
- u8 ht_enable;
-+ u8 paprd_disable;
- u32 ofdm_trig_low;
- u32 ofdm_trig_high;
- u32 cck_trig_high;
diff --git a/package/mac80211/patches/541-ath9k_remove_virtual_support.patch b/package/mac80211/patches/310-pending_work.patch
index b93bd5e52a..924f7333aa 100644
--- a/package/mac80211/patches/541-ath9k_remove_virtual_support.patch
+++ b/package/mac80211/patches/310-pending_work.patch
@@ -1,120 +1,576 @@
---- a/drivers/net/wireless/ath/ath9k/recv.c
-+++ b/drivers/net/wireless/ath/ath9k/recv.c
-@@ -34,27 +34,6 @@ static inline bool ath9k_check_auto_slee
- (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
+--- a/drivers/net/wireless/ath/ath9k/Makefile
++++ b/drivers/net/wireless/ath/ath9k/Makefile
+@@ -4,7 +4,6 @@ ath9k-y += beacon.o \
+ main.o \
+ recv.o \
+ xmit.o \
+- virtual.o \
+
+ ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o
+ ath9k-$(CONFIG_PCI) += pci.o
+--- a/drivers/net/wireless/ath/ath9k/ahb.c
++++ b/drivers/net/wireless/ath/ath9k/ahb.c
+@@ -54,7 +54,6 @@ static struct ath_bus_ops ath_ahb_bus_op
+ static int ath_ahb_probe(struct platform_device *pdev)
+ {
+ void __iomem *mem;
+- struct ath_wiphy *aphy;
+ struct ath_softc *sc;
+ struct ieee80211_hw *hw;
+ struct resource *res;
+@@ -92,8 +91,7 @@ static int ath_ahb_probe(struct platform
+
+ irq = res->start;
+
+- hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) +
+- sizeof(struct ath_softc), &ath9k_ops);
++ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
+ if (hw == NULL) {
+ dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
+ ret = -ENOMEM;
+@@ -103,11 +101,7 @@ static int ath_ahb_probe(struct platform
+ SET_IEEE80211_DEV(hw, &pdev->dev);
+ platform_set_drvdata(pdev, hw);
+
+- aphy = hw->priv;
+- sc = (struct ath_softc *) (aphy + 1);
+- aphy->sc = sc;
+- aphy->hw = hw;
+- sc->pri_wiphy = aphy;
++ sc = hw->priv;
+ sc->hw = hw;
+ sc->dev = &pdev->dev;
+ sc->mem = mem;
+@@ -151,8 +145,7 @@ static int ath_ahb_remove(struct platfor
+ struct ieee80211_hw *hw = platform_get_drvdata(pdev);
+
+ if (hw) {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ void __iomem *mem = sc->mem;
+
+ ath9k_deinit_device(sc);
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -234,7 +234,6 @@ struct ath_buf {
+ bool bf_stale;
+ u16 bf_flags;
+ struct ath_buf_state bf_state;
+- struct ath_wiphy *aphy;
+ };
+
+ struct ath_atx_tid {
+@@ -389,7 +388,6 @@ struct ath_beacon {
+ u32 ast_be_xmit;
+ u64 bc_tstamp;
+ struct ieee80211_vif *bslot[ATH_BCBUF];
+- struct ath_wiphy *bslot_aphy[ATH_BCBUF];
+ int slottime;
+ int slotupdate;
+ struct ath9k_tx_queue_info beacon_qi;
+@@ -400,7 +398,7 @@ struct ath_beacon {
+
+ void ath_beacon_tasklet(unsigned long data);
+ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif);
+-int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif);
++int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif);
+ void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
+ int ath_beaconq_config(struct ath_softc *sc);
+
+@@ -565,7 +563,6 @@ struct ath_ant_comb {
+ #define PS_WAIT_FOR_TX_ACK BIT(3)
+ #define PS_BEACON_SYNC BIT(4)
+
+-struct ath_wiphy;
+ struct ath_rate_table;
+
+ struct ath9k_vif_iter_data {
+@@ -586,20 +583,8 @@ struct ath_softc {
+ struct ieee80211_hw *hw;
+ struct device *dev;
+
+- spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */
+- struct ath_wiphy *pri_wiphy;
+- struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may
+- * have NULL entries */
+- int num_sec_wiphy; /* number of sec_wiphy pointers in the array */
+ int chan_idx;
+ int chan_is_ht;
+- struct ath_wiphy *next_wiphy;
+- struct work_struct chan_work;
+- int wiphy_select_failures;
+- unsigned long wiphy_select_first_fail;
+- struct delayed_work wiphy_work;
+- unsigned long wiphy_scheduler_int;
+- int wiphy_scheduler_index;
+ struct survey_info *cur_survey;
+ struct survey_info survey[ATH9K_NUM_CHANNELS];
+
+@@ -643,6 +628,9 @@ struct ath_softc {
+ int led_on_cnt;
+ int led_off_cnt;
+
++ struct ath9k_hw_cal_data caldata;
++ int last_rssi;
++
+ int beacon_interval;
+
+ #ifdef CONFIG_ATH9K_DEBUGFS
+@@ -662,23 +650,6 @@ struct ath_softc {
+ struct pm_qos_request_list pm_qos_req;
+ };
+
+-struct ath_wiphy {
+- struct ath_softc *sc; /* shared for all virtual wiphys */
+- struct ieee80211_hw *hw;
+- struct ath9k_hw_cal_data caldata;
+- enum ath_wiphy_state {
+- ATH_WIPHY_INACTIVE,
+- ATH_WIPHY_ACTIVE,
+- ATH_WIPHY_PAUSING,
+- ATH_WIPHY_PAUSED,
+- ATH_WIPHY_SCAN,
+- } state;
+- bool idle;
+- int chan_idx;
+- int chan_is_ht;
+- int last_rssi;
+-};
+-
+ void ath9k_tasklet(unsigned long data);
+ int ath_reset(struct ath_softc *sc, bool retry_tx);
+ int ath_cabq_update(struct ath_softc *);
+@@ -732,24 +703,6 @@ void ath9k_ps_restore(struct ath_softc *
+ u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate);
+
+ void ath9k_set_bssid_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
+-int ath9k_wiphy_add(struct ath_softc *sc);
+-int ath9k_wiphy_del(struct ath_wiphy *aphy);
+-void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, int ftype);
+-int ath9k_wiphy_pause(struct ath_wiphy *aphy);
+-int ath9k_wiphy_unpause(struct ath_wiphy *aphy);
+-int ath9k_wiphy_select(struct ath_wiphy *aphy);
+-void ath9k_wiphy_set_scheduler(struct ath_softc *sc, unsigned int msec_int);
+-void ath9k_wiphy_chan_work(struct work_struct *work);
+-bool ath9k_wiphy_started(struct ath_softc *sc);
+-void ath9k_wiphy_pause_all_forced(struct ath_softc *sc,
+- struct ath_wiphy *selected);
+-bool ath9k_wiphy_scanning(struct ath_softc *sc);
+-void ath9k_wiphy_work(struct work_struct *work);
+-bool ath9k_all_wiphys_idle(struct ath_softc *sc);
+-void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle);
+-
+-void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue);
+-bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
+
+ void ath_start_rfkill_poll(struct ath_softc *sc);
+ extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_
+
+ static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_tx_control txctl;
+
+@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211
+ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_buf *bf;
+ struct ath_vif *avp;
+@@ -142,9 +140,6 @@ static struct ath_buf *ath_beacon_genera
+ struct ieee80211_tx_info *info;
+ int cabq_depth;
+
+- if (aphy->state != ATH_WIPHY_ACTIVE)
+- return NULL;
+-
+ avp = (void *)vif->drv_priv;
+ cabq = sc->beacon.cabq;
+
+@@ -225,9 +220,8 @@ static struct ath_buf *ath_beacon_genera
+ return bf;
}
--static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
-- struct ieee80211_hdr *hdr)
+-int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
++int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif)
+ {
+- struct ath_softc *sc = aphy->sc;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_vif *avp;
+ struct ath_buf *bf;
+@@ -261,7 +255,6 @@ int ath_beacon_alloc(struct ath_wiphy *a
+ }
+ BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL);
+ sc->beacon.bslot[avp->av_bslot] = vif;
+- sc->beacon.bslot_aphy[avp->av_bslot] = aphy;
+ sc->nbcnvifs++;
+ }
+ }
+@@ -332,7 +325,6 @@ void ath_beacon_return(struct ath_softc
+
+ if (avp->av_bslot != -1) {
+ sc->beacon.bslot[avp->av_bslot] = NULL;
+- sc->beacon.bslot_aphy[avp->av_bslot] = NULL;
+ sc->nbcnvifs--;
+ }
+
+@@ -358,7 +350,6 @@ void ath_beacon_tasklet(unsigned long da
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ath_buf *bf = NULL;
+ struct ieee80211_vif *vif;
+- struct ath_wiphy *aphy;
+ int slot;
+ u32 bfaddr, bc = 0, tsftu;
+ u64 tsf;
+@@ -416,7 +407,6 @@ void ath_beacon_tasklet(unsigned long da
+ */
+ slot = ATH_BCBUF - slot - 1;
+ vif = sc->beacon.bslot[slot];
+- aphy = sc->beacon.bslot_aphy[slot];
+
+ ath_dbg(common, ATH_DBG_BEACON,
+ "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
+@@ -424,7 +414,7 @@ void ath_beacon_tasklet(unsigned long da
+
+ bfaddr = 0;
+ if (vif) {
+- bf = ath_beacon_generate(aphy->hw, vif);
++ bf = ath_beacon_generate(sc->hw, vif);
+ if (bf != NULL) {
+ bfaddr = bf->bf_daddr;
+ bc = 1;
+--- a/drivers/net/wireless/ath/ath9k/debug.c
++++ b/drivers/net/wireless/ath/ath9k/debug.c
+@@ -381,41 +381,21 @@ static const struct file_operations fops
+ .llseek = default_llseek,
+ };
+
+-static const char * ath_wiphy_state_str(enum ath_wiphy_state state)
-{
-- struct ieee80211_hw *hw = sc->pri_wiphy->hw;
-- int i;
+- switch (state) {
+- case ATH_WIPHY_INACTIVE:
+- return "INACTIVE";
+- case ATH_WIPHY_ACTIVE:
+- return "ACTIVE";
+- case ATH_WIPHY_PAUSING:
+- return "PAUSING";
+- case ATH_WIPHY_PAUSED:
+- return "PAUSED";
+- case ATH_WIPHY_SCAN:
+- return "SCAN";
+- }
+- return "?";
+-}
-
-- spin_lock_bh(&sc->wiphy_lock);
+ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+ {
+ struct ath_softc *sc = file->private_data;
+- struct ath_wiphy *aphy = sc->pri_wiphy;
+- struct ieee80211_channel *chan = aphy->hw->conf.channel;
++ struct ieee80211_channel *chan = sc->hw->conf.channel;
+ char buf[512];
+ unsigned int len = 0;
+- int i;
+ u8 addr[ETH_ALEN];
+ u32 tmp;
+
+ len += snprintf(buf + len, sizeof(buf) - len,
+- "primary: %s (%s chan=%d ht=%d)\n",
+- wiphy_name(sc->pri_wiphy->hw->wiphy),
+- ath_wiphy_state_str(sc->pri_wiphy->state),
++ "%s (chan=%d ht=%d)\n",
++ wiphy_name(sc->hw->wiphy),
+ ieee80211_frequency_to_channel(chan->center_freq),
+- aphy->chan_is_ht);
++ conf_is_ht(&sc->hw->conf));
+
+ put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
+ put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4);
+@@ -457,123 +437,14 @@ static ssize_t read_file_wiphy(struct fi
+ else
+ len += snprintf(buf + len, sizeof(buf) - len, "\n");
+
+- /* Put variable-length stuff down here, and check for overflows. */
- for (i = 0; i < sc->num_sec_wiphy; i++) {
-- struct ath_wiphy *aphy = sc->sec_wiphy[i];
-- if (aphy == NULL)
+- struct ath_wiphy *aphy_tmp = sc->sec_wiphy[i];
+- if (aphy_tmp == NULL)
- continue;
-- if (compare_ether_addr(hdr->addr1, aphy->hw->wiphy->perm_addr)
-- == 0) {
-- hw = aphy->hw;
-- break;
-- }
+- chan = aphy_tmp->hw->conf.channel;
+- len += snprintf(buf + len, sizeof(buf) - len,
+- "secondary: %s (%s chan=%d ht=%d)\n",
+- wiphy_name(aphy_tmp->hw->wiphy),
+- ath_wiphy_state_str(aphy_tmp->state),
+- ieee80211_frequency_to_channel(chan->center_freq),
+- aphy_tmp->chan_is_ht);
- }
-- spin_unlock_bh(&sc->wiphy_lock);
-- return hw;
--}
--
- /*
- * Setup and link descriptors.
- *
-@@ -463,8 +442,7 @@ u32 ath_calcrxfilter(struct ath_softc *s
- if (conf_is_ht(&sc->hw->conf))
- rfilt |= ATH9K_RX_FILTER_COMP_BAR;
+ if (len > sizeof(buf))
+ len = sizeof(buf);
-- if (sc->sec_wiphy || (sc->nvifs > 1) ||
-- (sc->rx.rxfilter & FIF_OTHER_BSS)) {
-+ if (sc->nvifs > 1 || (sc->rx.rxfilter & FIF_OTHER_BSS)) {
- /* The following may also be needed for other older chips */
- if (sc->sc_ah->hw_version.macVersion == AR_SREV_VERSION_9160)
- rfilt |= ATH9K_RX_FILTER_PROM;
-@@ -668,37 +646,6 @@ static void ath_rx_ps(struct ath_softc *
- }
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
--static void ath_rx_send_to_mac80211(struct ieee80211_hw *hw,
-- struct ath_softc *sc, struct sk_buff *skb)
+-static struct ath_wiphy * get_wiphy(struct ath_softc *sc, const char *name)
-{
-- struct ieee80211_hdr *hdr;
+- int i;
+- if (strcmp(name, wiphy_name(sc->pri_wiphy->hw->wiphy)) == 0)
+- return sc->pri_wiphy;
+- for (i = 0; i < sc->num_sec_wiphy; i++) {
+- struct ath_wiphy *aphy = sc->sec_wiphy[i];
+- if (aphy && strcmp(name, wiphy_name(aphy->hw->wiphy)) == 0)
+- return aphy;
+- }
+- return NULL;
+-}
-
-- hdr = (struct ieee80211_hdr *)skb->data;
+-static int del_wiphy(struct ath_softc *sc, const char *name)
+-{
+- struct ath_wiphy *aphy = get_wiphy(sc, name);
+- if (!aphy)
+- return -ENOENT;
+- return ath9k_wiphy_del(aphy);
+-}
-
-- /* Send the frame to mac80211 */
-- if (is_multicast_ether_addr(hdr->addr1)) {
-- int i;
-- /*
-- * Deliver broadcast/multicast frames to all suitable
-- * virtual wiphys.
-- */
-- /* TODO: filter based on channel configuration */
-- for (i = 0; i < sc->num_sec_wiphy; i++) {
-- struct ath_wiphy *aphy = sc->sec_wiphy[i];
-- struct sk_buff *nskb;
-- if (aphy == NULL)
-- continue;
-- nskb = skb_copy(skb, GFP_ATOMIC);
-- if (!nskb)
-- continue;
-- ieee80211_rx(aphy->hw, nskb);
-- }
-- ieee80211_rx(sc->hw, skb);
+-static int pause_wiphy(struct ath_softc *sc, const char *name)
+-{
+- struct ath_wiphy *aphy = get_wiphy(sc, name);
+- if (!aphy)
+- return -ENOENT;
+- return ath9k_wiphy_pause(aphy);
+-}
+-
+-static int unpause_wiphy(struct ath_softc *sc, const char *name)
+-{
+- struct ath_wiphy *aphy = get_wiphy(sc, name);
+- if (!aphy)
+- return -ENOENT;
+- return ath9k_wiphy_unpause(aphy);
+-}
+-
+-static int select_wiphy(struct ath_softc *sc, const char *name)
+-{
+- struct ath_wiphy *aphy = get_wiphy(sc, name);
+- if (!aphy)
+- return -ENOENT;
+- return ath9k_wiphy_select(aphy);
+-}
+-
+-static int schedule_wiphy(struct ath_softc *sc, const char *msec)
+-{
+- ath9k_wiphy_set_scheduler(sc, simple_strtoul(msec, NULL, 0));
+- return 0;
+-}
+-
+-static ssize_t write_file_wiphy(struct file *file, const char __user *user_buf,
+- size_t count, loff_t *ppos)
+-{
+- struct ath_softc *sc = file->private_data;
+- char buf[50];
+- size_t len;
+-
+- len = min(count, sizeof(buf) - 1);
+- if (copy_from_user(buf, user_buf, len))
+- return -EFAULT;
+- buf[len] = '\0';
+- if (len > 0 && buf[len - 1] == '\n')
+- buf[len - 1] = '\0';
+-
+- if (strncmp(buf, "add", 3) == 0) {
+- int res = ath9k_wiphy_add(sc);
+- if (res < 0)
+- return res;
+- } else if (strncmp(buf, "del=", 4) == 0) {
+- int res = del_wiphy(sc, buf + 4);
+- if (res < 0)
+- return res;
+- } else if (strncmp(buf, "pause=", 6) == 0) {
+- int res = pause_wiphy(sc, buf + 6);
+- if (res < 0)
+- return res;
+- } else if (strncmp(buf, "unpause=", 8) == 0) {
+- int res = unpause_wiphy(sc, buf + 8);
+- if (res < 0)
+- return res;
+- } else if (strncmp(buf, "select=", 7) == 0) {
+- int res = select_wiphy(sc, buf + 7);
+- if (res < 0)
+- return res;
+- } else if (strncmp(buf, "schedule=", 9) == 0) {
+- int res = schedule_wiphy(sc, buf + 9);
+- if (res < 0)
+- return res;
- } else
-- /* Deliver unicast frames based on receiver address */
-- ieee80211_rx(hw, skb);
+- return -EOPNOTSUPP;
+-
+- return count;
-}
-
- static bool ath_edma_get_buffers(struct ath_softc *sc,
- enum ath9k_rx_qtype qtype)
+ static const struct file_operations fops_wiphy = {
+ .read = read_file_wiphy,
+- .write = write_file_wiphy,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+--- a/drivers/net/wireless/ath/ath9k/gpio.c
++++ b/drivers/net/wireless/ath/ath9k/gpio.c
+@@ -201,8 +201,7 @@ static bool ath_is_rfkill_set(struct ath
+
+ void ath9k_rfkill_poll_state(struct ieee80211_hw *hw)
{
-@@ -1644,7 +1591,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
- * virtual wiphy so to account for that we iterate over the active
- * wiphys and find the appropriate wiphy and therefore hw.
- */
-- struct ieee80211_hw *hw = NULL;
-+ struct ieee80211_hw *hw = sc->hw;
- struct ieee80211_hdr *hdr;
- int retval;
- bool decrypt_error = false;
-@@ -1689,8 +1636,6 @@ int ath_rx_tasklet(struct ath_softc *sc,
- hdr = (struct ieee80211_hdr *) (skb->data + rx_status_len);
- rxs = IEEE80211_SKB_RXCB(skb);
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ bool blocked = !!ath_is_rfkill_set(sc);
-- hw = ath_get_virt_hw(sc, hdr);
--
- ath_debug_stat_rx(sc, &rs);
+ wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
+--- a/drivers/net/wireless/ath/ath9k/init.c
++++ b/drivers/net/wireless/ath/ath9k/init.c
+@@ -254,8 +254,7 @@ static int ath9k_reg_notifier(struct wip
+ struct regulatory_request *request)
+ {
+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah);
- /*
-@@ -1748,7 +1693,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
- bf->bf_mpdu = NULL;
- bf->bf_buf_addr = 0;
- ath_err(common, "dma_mapping_error() on RX\n");
-- ath_rx_send_to_mac80211(hw, sc, skb);
-+ ieee80211_rx(hw, skb);
- break;
- }
+ return ath_reg_notifier_apply(wiphy, request, reg);
+@@ -517,10 +516,8 @@ static void ath9k_init_misc(struct ath_s
-@@ -1775,7 +1720,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
- if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
- ath_ant_comb_scan(sc, &rs);
+ sc->beacon.slottime = ATH9K_SLOT_TIME_9;
-- ath_rx_send_to_mac80211(hw, sc, skb);
-+ ieee80211_rx(hw, skb);
+- for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
++ for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
+ sc->beacon.bslot[i] = NULL;
+- sc->beacon.bslot_aphy[i] = NULL;
+- }
- requeue:
- if (edma) {
+ if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
+ sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
+@@ -556,7 +553,6 @@ static int ath9k_init_softc(u16 devid, s
+ common->btcoex_enabled = ath9k_btcoex_enable == 1;
+ spin_lock_init(&common->cc_lock);
+
+- spin_lock_init(&sc->wiphy_lock);
+ spin_lock_init(&sc->sc_serial_rw);
+ spin_lock_init(&sc->sc_pm_lock);
+ mutex_init(&sc->mutex);
+@@ -707,7 +703,6 @@ int ath9k_init_device(u16 devid, struct
+ const struct ath_bus_ops *bus_ops)
+ {
+ struct ieee80211_hw *hw = sc->hw;
+- struct ath_wiphy *aphy = hw->priv;
+ struct ath_common *common;
+ struct ath_hw *ah;
+ int error = 0;
+@@ -762,10 +757,7 @@ int ath9k_init_device(u16 devid, struct
+
+ INIT_WORK(&sc->hw_check_work, ath_hw_check);
+ INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
+- INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work);
+- INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
+- sc->wiphy_scheduler_int = msecs_to_jiffies(500);
+- aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
++ sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
+
+ ath_init_leds(sc);
+ ath_start_rfkill_poll(sc);
+@@ -823,28 +815,17 @@ static void ath9k_deinit_softc(struct at
+ void ath9k_deinit_device(struct ath_softc *sc)
+ {
+ struct ieee80211_hw *hw = sc->hw;
+- int i = 0;
+
+ ath9k_ps_wakeup(sc);
+
+ wiphy_rfkill_stop_polling(sc->hw->wiphy);
+ ath_deinit_leds(sc);
+
+- for (i = 0; i < sc->num_sec_wiphy; i++) {
+- struct ath_wiphy *aphy = sc->sec_wiphy[i];
+- if (aphy == NULL)
+- continue;
+- sc->sec_wiphy[i] = NULL;
+- ieee80211_unregister_hw(aphy->hw);
+- ieee80211_free_hw(aphy->hw);
+- }
+-
+ ieee80211_unregister_hw(hw);
+ pm_qos_remove_request(&sc->pm_qos_req);
+ ath_rx_cleanup(sc);
+ ath_tx_cleanup(sc);
+ ath9k_deinit_softc(sc);
+- kfree(sc->sec_wiphy);
+ }
+
+ void ath_descdma_cleanup(struct ath_softc *sc,
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1076,29 +1076,7 @@ static int ath9k_start(struct ieee80211_
+@@ -215,7 +215,6 @@ static void ath_update_survey_stats(stru
+ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
+ struct ath9k_channel *hchan)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ieee80211_conf *conf = &common->hw->conf;
+@@ -262,7 +261,7 @@ int ath_set_channel(struct ath_softc *sc
+ fastcc = false;
+
+ if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
+- caldata = &aphy->caldata;
++ caldata = &sc->caldata;
+
+ ath_dbg(common, ATH_DBG_CONFIG,
+ "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n",
+@@ -295,6 +294,8 @@ int ath_set_channel(struct ath_softc *sc
+ }
+
+ ps_restore:
++ ieee80211_wake_queues(hw);
++
+ spin_unlock_bh(&sc->sc_pcu_lock);
+
+ ath9k_ps_restore(sc);
+@@ -850,7 +851,6 @@ static void ath9k_bss_assoc_info(struct
+ struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *bss_conf)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+
+@@ -874,7 +874,7 @@ static void ath9k_bss_assoc_info(struct
+ ath_beacon_config(sc, vif);
+
+ /* Reset rssi stats */
+- aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
++ sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
+ sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
+
+ sc->sc_flags |= SC_OP_ANI_RUN;
+@@ -1073,8 +1073,7 @@ void ath9k_update_ichannel(struct ath_so
+
+ static int ath9k_start(struct ieee80211_hw *hw)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ieee80211_channel *curchan = hw->conf.channel;
+@@ -1087,29 +1086,7 @@ static int ath9k_start(struct ieee80211_
mutex_lock(&sc->mutex);
@@ -144,7 +600,14 @@
sc->chan_idx = curchan->hw_value;
init_channel = ath_get_curchannel(sc, hw);
-@@ -1208,13 +1186,6 @@ static int ath9k_tx(struct ieee80211_hw
+@@ -1213,19 +1190,11 @@ mutex_unlock:
+ static int ath9k_tx(struct ieee80211_hw *hw,
+ struct sk_buff *skb)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_tx_control txctl;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
@@ -158,8 +621,13 @@
if (sc->ps_enabled) {
/*
* mac80211 does not set PM field for normal data frames, so we
-@@ -1277,37 +1248,19 @@ static void ath9k_stop(struct ieee80211_
- struct ath_softc *sc = aphy->sc;
+@@ -1284,16 +1253,12 @@ exit:
+
+ static void ath9k_stop(struct ieee80211_hw *hw)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
- int i;
@@ -168,7 +636,10 @@
- aphy->state = ATH_WIPHY_INACTIVE;
-
- cancel_delayed_work_sync(&sc->tx_complete_work);
+ if (led_blink)
+ cancel_delayed_work_sync(&sc->ath_led_blink_work);
+
+@@ -1301,27 +1266,12 @@ static void ath9k_stop(struct ieee80211_
cancel_work_sync(&sc->paprd_work);
cancel_work_sync(&sc->hw_check_work);
@@ -196,7 +667,7 @@
/* Ensure HW is awake when we try to shut it down. */
ath9k_ps_wakeup(sc);
-@@ -1339,7 +1292,6 @@ static void ath9k_stop(struct ieee80211_
+@@ -1353,7 +1303,6 @@ static void ath9k_stop(struct ieee80211_
ath9k_ps_restore(sc);
sc->ps_idle = true;
@@ -204,15 +675,20 @@
ath_radio_disable(sc, hw);
sc->sc_flags |= SC_OP_INVALID;
-@@ -1429,7 +1381,6 @@ void ath9k_calculate_iter_data(struct ie
- struct ath_softc *sc = aphy->sc;
+@@ -1439,11 +1388,9 @@ void ath9k_calculate_iter_data(struct ie
+ struct ieee80211_vif *vif,
+ struct ath9k_vif_iter_data *iter_data)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
- int i;
/*
* Use the hardware MAC address as reference, the hardware uses it
-@@ -1443,16 +1394,8 @@ void ath9k_calculate_iter_data(struct ie
+@@ -1457,24 +1404,15 @@ void ath9k_calculate_iter_data(struct ie
ath9k_vif_iter(iter_data, vif->addr, vif);
/* Get list of all active MAC addresses */
@@ -229,7 +705,71 @@
}
/* Called with sc->mutex held. */
-@@ -1706,7 +1649,7 @@ static int ath9k_config(struct ieee80211
+ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ath9k_vif_iter_data iter_data;
+@@ -1530,8 +1468,7 @@ static void ath9k_calculate_summary_stat
+ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ ath9k_calculate_summary_state(hw, vif);
+
+@@ -1544,7 +1481,7 @@ static void ath9k_do_vif_add_setup(struc
+ * in the info_changed method and set up beacons properly
+ * there.
+ */
+- error = ath_beacon_alloc(aphy, vif);
++ error = ath_beacon_alloc(sc, vif);
+ if (error)
+ ath9k_reclaim_beacon(sc, vif);
+ else
+@@ -1556,8 +1493,7 @@ static void ath9k_do_vif_add_setup(struc
+ static int ath9k_add_interface(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ath_vif *avp = (void *)vif->drv_priv;
+@@ -1617,8 +1553,7 @@ static int ath9k_change_interface(struct
+ enum nl80211_iftype new_type,
+ bool p2p)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ int ret = 0;
+
+@@ -1660,8 +1595,7 @@ out:
+ static void ath9k_remove_interface(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+
+ ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
+@@ -1715,12 +1649,11 @@ static void ath9k_disable_ps(struct ath_
+
+ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_conf *conf = &hw->conf;
@@ -238,7 +778,7 @@
mutex_lock(&sc->mutex);
-@@ -1717,29 +1660,13 @@ static int ath9k_config(struct ieee80211
+@@ -1731,29 +1664,13 @@ static int ath9k_config(struct ieee80211
* the end.
*/
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
@@ -272,7 +812,7 @@
}
}
-@@ -1780,24 +1707,11 @@ static int ath9k_config(struct ieee80211
+@@ -1794,24 +1711,11 @@ static int ath9k_config(struct ieee80211
if (ah->curchan)
old_pos = ah->curchan - &ah->channels[0];
@@ -297,14 +837,16 @@
ath_dbg(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
curchan->center_freq);
-@@ -1844,19 +1758,13 @@ static int ath9k_config(struct ieee80211
+@@ -1858,7 +1762,6 @@ static int ath9k_config(struct ieee80211
ath_update_survey_nf(sc, old_pos);
}
-skip_chan_change:
if (changed & IEEE80211_CONF_CHANGE_POWER) {
sc->config.txpowlimit = 2 * conf->power_level;
- ath_update_txpow(sc);
+ ath9k_ps_wakeup(sc);
+@@ -1866,13 +1769,8 @@ skip_chan_change:
+ ath9k_ps_restore(sc);
}
- spin_lock_bh(&sc->wiphy_lock);
@@ -317,7 +859,136 @@
ath_radio_disable(sc, hw);
}
-@@ -2247,43 +2155,6 @@ static int ath9k_get_survey(struct ieee8
+@@ -1897,8 +1795,7 @@ static void ath9k_configure_filter(struc
+ unsigned int *total_flags,
+ u64 multicast)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ u32 rfilt;
+
+ changed_flags &= SUPPORTED_FILTERS;
+@@ -1918,8 +1815,7 @@ static int ath9k_sta_add(struct ieee8021
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ ath_node_attach(sc, sta);
+
+@@ -1930,8 +1826,7 @@ static int ath9k_sta_remove(struct ieee8
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ ath_node_detach(sc, sta);
+
+@@ -1941,8 +1836,7 @@ static int ath9k_sta_remove(struct ieee8
+ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
+ const struct ieee80211_tx_queue_params *params)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_txq *txq;
+ struct ath9k_tx_queue_info qi;
+@@ -1986,8 +1880,7 @@ static int ath9k_set_key(struct ieee8021
+ struct ieee80211_sta *sta,
+ struct ieee80211_key_conf *key)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ int ret = 0;
+
+@@ -2031,8 +1924,7 @@ static void ath9k_bss_info_changed(struc
+ struct ieee80211_bss_conf *bss_conf,
+ u32 changed)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+ struct ath_vif *avp = (void *)vif->drv_priv;
+@@ -2062,7 +1954,7 @@ static void ath9k_bss_info_changed(struc
+ if ((changed & BSS_CHANGED_BEACON) ||
+ ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
+ ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
+- error = ath_beacon_alloc(aphy, vif);
++ error = ath_beacon_alloc(sc, vif);
+ if (!error)
+ ath_beacon_config(sc, vif);
+ }
+@@ -2099,7 +1991,7 @@ static void ath9k_bss_info_changed(struc
+ if (vif->type == NL80211_IFTYPE_AP) {
+ sc->sc_flags |= SC_OP_TSF_RESET;
+ ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
+- error = ath_beacon_alloc(aphy, vif);
++ error = ath_beacon_alloc(sc, vif);
+ if (!error)
+ ath_beacon_config(sc, vif);
+ } else {
+@@ -2137,9 +2029,8 @@ static void ath9k_bss_info_changed(struc
+
+ static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
+ {
++ struct ath_softc *sc = hw->priv;
+ u64 tsf;
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
+
+ mutex_lock(&sc->mutex);
+ ath9k_ps_wakeup(sc);
+@@ -2152,8 +2043,7 @@ static u64 ath9k_get_tsf(struct ieee8021
+
+ static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ mutex_lock(&sc->mutex);
+ ath9k_ps_wakeup(sc);
+@@ -2164,8 +2054,7 @@ static void ath9k_set_tsf(struct ieee802
+
+ static void ath9k_reset_tsf(struct ieee80211_hw *hw)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ mutex_lock(&sc->mutex);
+
+@@ -2182,8 +2071,7 @@ static int ath9k_ampdu_action(struct iee
+ struct ieee80211_sta *sta,
+ u16 tid, u16 *ssn, u8 buf_size)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ int ret = 0;
+
+ local_bh_disable();
+@@ -2228,8 +2116,7 @@ static int ath9k_ampdu_action(struct iee
+ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
+ struct survey_info *survey)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ieee80211_supported_band *sband;
+ struct ieee80211_channel *chan;
+@@ -2263,47 +2150,9 @@ static int ath9k_get_survey(struct ieee8
return 0;
}
@@ -360,8 +1031,13 @@
-
static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
{
- struct ath_wiphy *aphy = hw->priv;
-@@ -2315,8 +2186,6 @@ struct ieee80211_ops ath9k_ops = {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+
+ mutex_lock(&sc->mutex);
+@@ -2331,8 +2180,6 @@ struct ieee80211_ops ath9k_ops = {
.reset_tsf = ath9k_reset_tsf,
.ampdu_action = ath9k_ampdu_action,
.get_survey = ath9k_get_survey,
@@ -370,79 +1046,224 @@
.rfkill_poll = ath9k_rfkill_poll_state,
.set_coverage_class = ath9k_set_coverage_class,
};
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -381,7 +381,6 @@ struct ath_beacon {
- u32 ast_be_xmit;
- u64 bc_tstamp;
- struct ieee80211_vif *bslot[ATH_BCBUF];
-- struct ath_wiphy *bslot_aphy[ATH_BCBUF];
- int slottime;
- int slotupdate;
- struct ath9k_tx_queue_info beacon_qi;
-@@ -572,20 +571,8 @@ struct ath_softc {
+--- a/drivers/net/wireless/ath/ath9k/pci.c
++++ b/drivers/net/wireless/ath/ath9k/pci.c
+@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_
+ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ {
+ void __iomem *mem;
+- struct ath_wiphy *aphy;
+ struct ath_softc *sc;
struct ieee80211_hw *hw;
- struct device *dev;
+ u8 csz;
+@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev
+ goto err_iomap;
+ }
-- spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */
-- struct ath_wiphy *pri_wiphy;
-- struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may
-- * have NULL entries */
-- int num_sec_wiphy; /* number of sec_wiphy pointers in the array */
- int chan_idx;
- int chan_is_ht;
-- struct ath_wiphy *next_wiphy;
-- struct work_struct chan_work;
-- int wiphy_select_failures;
-- unsigned long wiphy_select_first_fail;
-- struct delayed_work wiphy_work;
-- unsigned long wiphy_scheduler_int;
-- int wiphy_scheduler_index;
- struct survey_info *cur_survey;
- struct survey_info survey[ATH9K_NUM_CHANNELS];
+- hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) +
+- sizeof(struct ath_softc), &ath9k_ops);
++ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
+ if (!hw) {
+ dev_err(&pdev->dev, "No memory for ieee80211_hw\n");
+ ret = -ENOMEM;
+@@ -209,11 +207,7 @@ static int ath_pci_probe(struct pci_dev
+ SET_IEEE80211_DEV(hw, &pdev->dev);
+ pci_set_drvdata(pdev, hw);
-@@ -645,16 +632,6 @@ struct ath_wiphy {
- struct ath_softc *sc; /* shared for all virtual wiphys */
- struct ieee80211_hw *hw;
- struct ath9k_hw_cal_data caldata;
-- enum ath_wiphy_state {
-- ATH_WIPHY_INACTIVE,
-- ATH_WIPHY_ACTIVE,
-- ATH_WIPHY_PAUSING,
-- ATH_WIPHY_PAUSED,
-- ATH_WIPHY_SCAN,
-- } state;
-- bool idle;
-- int chan_idx;
-- int chan_is_ht;
+- aphy = hw->priv;
+- sc = (struct ath_softc *) (aphy + 1);
+- aphy->sc = sc;
+- aphy->hw = hw;
+- sc->pri_wiphy = aphy;
++ sc = hw->priv;
+ sc->hw = hw;
+ sc->dev = &pdev->dev;
+ sc->mem = mem;
+@@ -260,8 +254,7 @@ err_dma:
+ static void ath_pci_remove(struct pci_dev *pdev)
+ {
+ struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ void __iomem *mem = sc->mem;
+
+ if (!is_ath9k_unloaded)
+@@ -281,8 +274,7 @@ static int ath_pci_suspend(struct device
+ {
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
+
+@@ -293,8 +285,7 @@ static int ath_pci_resume(struct device
+ {
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ u32 val;
+
+ /*
+@@ -320,7 +311,6 @@ static int ath_pci_resume(struct device
+ ath9k_ps_restore(sc);
+
+ sc->ps_idle = true;
+- ath9k_set_wiphy_idle(aphy, true);
+ ath_radio_disable(sc, hw);
+
+ return 0;
+--- a/drivers/net/wireless/ath/ath9k/rc.c
++++ b/drivers/net/wireless/ath/ath9k/rc.c
+@@ -1560,8 +1560,7 @@ static void ath_rate_add_sta_debugfs(voi
+
+ static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- return aphy->sc;
++ return hw->priv;
+ }
+
+ static void ath_rate_free(void *priv)
+--- a/drivers/net/wireless/ath/ath9k/recv.c
++++ b/drivers/net/wireless/ath/ath9k/recv.c
+@@ -34,27 +34,6 @@ static inline bool ath9k_check_auto_slee
+ (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
+ }
+
+-static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
+- struct ieee80211_hdr *hdr)
+-{
+- struct ieee80211_hw *hw = sc->pri_wiphy->hw;
+- int i;
+-
+- spin_lock_bh(&sc->wiphy_lock);
+- for (i = 0; i < sc->num_sec_wiphy; i++) {
+- struct ath_wiphy *aphy = sc->sec_wiphy[i];
+- if (aphy == NULL)
+- continue;
+- if (compare_ether_addr(hdr->addr1, aphy->hw->wiphy->perm_addr)
+- == 0) {
+- hw = aphy->hw;
+- break;
+- }
+- }
+- spin_unlock_bh(&sc->wiphy_lock);
+- return hw;
+-}
+-
+ /*
+ * Setup and link descriptors.
+ *
+@@ -463,8 +442,7 @@ u32 ath_calcrxfilter(struct ath_softc *s
+ if (conf_is_ht(&sc->hw->conf))
+ rfilt |= ATH9K_RX_FILTER_COMP_BAR;
+
+- if (sc->sec_wiphy || (sc->nvifs > 1) ||
+- (sc->rx.rxfilter & FIF_OTHER_BSS)) {
++ if (sc->nvifs > 1 || (sc->rx.rxfilter & FIF_OTHER_BSS)) {
+ /* The following may also be needed for other older chips */
+ if (sc->sc_ah->hw_version.macVersion == AR_SREV_VERSION_9160)
+ rfilt |= ATH9K_RX_FILTER_PROM;
+@@ -668,37 +646,6 @@ static void ath_rx_ps(struct ath_softc *
+ }
+ }
+
+-static void ath_rx_send_to_mac80211(struct ieee80211_hw *hw,
+- struct ath_softc *sc, struct sk_buff *skb)
+-{
+- struct ieee80211_hdr *hdr;
+-
+- hdr = (struct ieee80211_hdr *)skb->data;
+-
+- /* Send the frame to mac80211 */
+- if (is_multicast_ether_addr(hdr->addr1)) {
+- int i;
+- /*
+- * Deliver broadcast/multicast frames to all suitable
+- * virtual wiphys.
+- */
+- /* TODO: filter based on channel configuration */
+- for (i = 0; i < sc->num_sec_wiphy; i++) {
+- struct ath_wiphy *aphy = sc->sec_wiphy[i];
+- struct sk_buff *nskb;
+- if (aphy == NULL)
+- continue;
+- nskb = skb_copy(skb, GFP_ATOMIC);
+- if (!nskb)
+- continue;
+- ieee80211_rx(aphy->hw, nskb);
+- }
+- ieee80211_rx(sc->hw, skb);
+- } else
+- /* Deliver unicast frames based on receiver address */
+- ieee80211_rx(hw, skb);
+-}
+-
+ static bool ath_edma_get_buffers(struct ath_softc *sc,
+ enum ath9k_rx_qtype qtype)
+ {
+@@ -980,7 +927,7 @@ static void ath9k_process_rssi(struct at
+ struct ieee80211_hdr *hdr,
+ struct ath_rx_status *rx_stats)
+ {
+- struct ath_wiphy *aphy = hw->priv;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = common->ah;
int last_rssi;
- };
+ __le16 fc;
+@@ -1000,9 +947,9 @@ static void ath9k_process_rssi(struct at
+ }
-@@ -711,24 +688,6 @@ void ath9k_ps_restore(struct ath_softc *
- u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate);
+ if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
+- ATH_RSSI_LPF(aphy->last_rssi, rx_stats->rs_rssi);
++ ATH_RSSI_LPF(sc->last_rssi, rx_stats->rs_rssi);
- void ath9k_set_bssid_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
--int ath9k_wiphy_add(struct ath_softc *sc);
--int ath9k_wiphy_del(struct ath_wiphy *aphy);
--void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, int ftype);
--int ath9k_wiphy_pause(struct ath_wiphy *aphy);
--int ath9k_wiphy_unpause(struct ath_wiphy *aphy);
--int ath9k_wiphy_select(struct ath_wiphy *aphy);
--void ath9k_wiphy_set_scheduler(struct ath_softc *sc, unsigned int msec_int);
--void ath9k_wiphy_chan_work(struct work_struct *work);
--bool ath9k_wiphy_started(struct ath_softc *sc);
--void ath9k_wiphy_pause_all_forced(struct ath_softc *sc,
-- struct ath_wiphy *selected);
--bool ath9k_wiphy_scanning(struct ath_softc *sc);
--void ath9k_wiphy_work(struct work_struct *work);
--bool ath9k_all_wiphys_idle(struct ath_softc *sc);
--void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle);
+- last_rssi = aphy->last_rssi;
++ last_rssi = sc->last_rssi;
+ if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
+ rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
+ ATH_RSSI_EP_MULTIPLIER);
+@@ -1644,7 +1591,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
+ * virtual wiphy so to account for that we iterate over the active
+ * wiphys and find the appropriate wiphy and therefore hw.
+ */
+- struct ieee80211_hw *hw = NULL;
++ struct ieee80211_hw *hw = sc->hw;
+ struct ieee80211_hdr *hdr;
+ int retval;
+ bool decrypt_error = false;
+@@ -1689,8 +1636,6 @@ int ath_rx_tasklet(struct ath_softc *sc,
+ hdr = (struct ieee80211_hdr *) (skb->data + rx_status_len);
+ rxs = IEEE80211_SKB_RXCB(skb);
+
+- hw = ath_get_virt_hw(sc, hdr);
-
--void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue);
--bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
+ ath_debug_stat_rx(sc, &rs);
- void ath_start_rfkill_poll(struct ath_softc *sc);
- extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);
+ /*
+@@ -1748,7 +1693,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
+ bf->bf_mpdu = NULL;
+ bf->bf_buf_addr = 0;
+ ath_err(common, "dma_mapping_error() on RX\n");
+- ath_rx_send_to_mac80211(hw, sc, skb);
++ ieee80211_rx(hw, skb);
+ break;
+ }
+
+@@ -1775,7 +1720,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
+ if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
+ ath_ant_comb_scan(sc, &rs);
+
+- ath_rx_send_to_mac80211(hw, sc, skb);
++ ieee80211_rx(hw, skb);
+
+ requeue:
+ if (edma) {
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ /dev/null
@@ -1,669 +0,0 @@
@@ -1117,7 +1938,157 @@
-}
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1816,7 +1816,7 @@ int ath_tx_start(struct ieee80211_hw *hw
+@@ -57,8 +57,9 @@ static void ath_tx_complete_buf(struct a
+ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
+ struct list_head *head);
+ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len);
+-static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
+- int nframes, int nbad, int txok, bool update_rc);
++static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
++ struct ath_tx_status *ts, int nframes, int nbad,
++ int txok, bool update_rc);
+ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
+ int seqno);
+
+@@ -297,7 +298,6 @@ static struct ath_buf* ath_clone_txbuf(s
+
+ ATH_TXBUF_RESET(tbf);
+
+- tbf->aphy = bf->aphy;
+ tbf->bf_mpdu = bf->bf_mpdu;
+ tbf->bf_buf_addr = bf->bf_buf_addr;
+ memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
+@@ -345,7 +345,7 @@ static void ath_tx_complete_aggr(struct
+ struct ath_node *an = NULL;
+ struct sk_buff *skb;
+ struct ieee80211_sta *sta;
+- struct ieee80211_hw *hw;
++ struct ieee80211_hw *hw = sc->hw;
+ struct ieee80211_hdr *hdr;
+ struct ieee80211_tx_info *tx_info;
+ struct ath_atx_tid *tid = NULL;
+@@ -364,7 +364,6 @@ static void ath_tx_complete_aggr(struct
+ hdr = (struct ieee80211_hdr *)skb->data;
+
+ tx_info = IEEE80211_SKB_CB(skb);
+- hw = bf->aphy->hw;
+
+ memcpy(rates, tx_info->control.rates, sizeof(rates));
+
+@@ -383,7 +382,7 @@ static void ath_tx_complete_aggr(struct
+ !bf->bf_stale || bf_next != NULL)
+ list_move_tail(&bf->list, &bf_head);
+
+- ath_tx_rc_status(bf, ts, 1, 1, 0, false);
++ ath_tx_rc_status(sc, bf, ts, 1, 1, 0, false);
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
+ 0, 0);
+
+@@ -489,10 +488,10 @@ static void ath_tx_complete_aggr(struct
+
+ if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
+ memcpy(tx_info->control.rates, rates, sizeof(rates));
+- ath_tx_rc_status(bf, ts, nframes, nbad, txok, true);
++ ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, true);
+ rc_update = false;
+ } else {
+- ath_tx_rc_status(bf, ts, nframes, nbad, txok, false);
++ ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, false);
+ }
+
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
+@@ -516,7 +515,7 @@ static void ath_tx_complete_aggr(struct
+
+ bf->bf_state.bf_type |=
+ BUF_XRETRY;
+- ath_tx_rc_status(bf, ts, nframes,
++ ath_tx_rc_status(sc, bf, ts, nframes,
+ nbad, 0, false);
+ ath_tx_complete_buf(sc, bf, txq,
+ &bf_head,
+@@ -1209,8 +1208,17 @@ bool ath_drain_all_txq(struct ath_softc
+ ath_err(common, "Failed to stop TX DMA!\n");
+
+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
+- if (ATH_TXQ_SETUP(sc, i))
+- ath_draintxq(sc, &sc->tx.txq[i], retry_tx);
++ if (!ATH_TXQ_SETUP(sc, i))
++ continue;
++
++ /*
++ * The caller will resume queues with ieee80211_wake_queues.
++ * Mark the queue as not stopped to prevent ath_tx_complete
++ * from waking the queue too early.
++ */
++ txq = &sc->tx.txq[i];
++ txq->stopped = false;
++ ath_draintxq(sc, txq, retry_tx);
+ }
+
+ return !npend;
+@@ -1318,6 +1326,7 @@ static void ath_tx_txqaddbuf(struct ath_
+ INIT_LIST_HEAD(&txq->txq_fifo[txq->txq_headidx]);
+ list_splice_init(head, &txq->txq_fifo[txq->txq_headidx]);
+ INCR(txq->txq_headidx, ATH_TXFIFO_DEPTH);
++ TX_STAT_INC(txq->axq_qnum, puttxbuf);
+ ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
+ ath_dbg(common, ATH_DBG_XMIT, "TXDP[%u] = %llx (%p)\n",
+ txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc);
+@@ -1325,6 +1334,7 @@ static void ath_tx_txqaddbuf(struct ath_
+ list_splice_tail_init(head, &txq->axq_q);
+
+ if (txq->axq_link == NULL) {
++ TX_STAT_INC(txq->axq_qnum, puttxbuf);
+ ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
+ ath_dbg(common, ATH_DBG_XMIT, "TXDP[%u] = %llx (%p)\n",
+ txq->axq_qnum, ito64(bf->bf_daddr),
+@@ -1338,6 +1348,7 @@ static void ath_tx_txqaddbuf(struct ath_
+ }
+ ath9k_hw_get_desc_link(ah, bf->bf_lastbf->bf_desc,
+ &txq->axq_link);
++ TX_STAT_INC(txq->axq_qnum, txstart);
+ ath9k_hw_txstart(ah, txq->axq_qnum);
+ }
+ txq->axq_depth++;
+@@ -1434,8 +1445,7 @@ static enum ath9k_pkt_type get_hw_packet
+ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
+ int framelen)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_sta *sta = tx_info->control.sta;
+ struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
+@@ -1653,8 +1663,7 @@ static struct ath_buf *ath_tx_setup_buff
+ struct ath_txq *txq,
+ struct sk_buff *skb)
+ {
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_frame_info *fi = get_frame_info(skb);
+@@ -1670,7 +1679,6 @@ static struct ath_buf *ath_tx_setup_buff
+
+ ATH_TXBUF_RESET(bf);
+
+- bf->aphy = aphy;
+ bf->bf_flags = setup_tx_flags(skb);
+ bf->bf_mpdu = skb;
+
+@@ -1756,8 +1764,7 @@ int ath_tx_start(struct ieee80211_hw *hw
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_sta *sta = info->control.sta;
+- struct ath_wiphy *aphy = hw->priv;
+- struct ath_softc *sc = aphy->sc;
++ struct ath_softc *sc = hw->priv;
+ struct ath_txq *txq = txctl->txq;
+ struct ath_buf *bf;
+ int padpos, padsize;
+@@ -1809,7 +1816,7 @@ int ath_tx_start(struct ieee80211_hw *hw
spin_lock_bh(&txq->axq_lock);
if (txq == sc->tx.txq_map[q] &&
++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
@@ -1126,7 +2097,27 @@
txq->stopped = 1;
}
spin_unlock_bh(&txq->axq_lock);
-@@ -1874,24 +1874,20 @@ static void ath_tx_complete(struct ath_s
+@@ -1824,8 +1831,7 @@ int ath_tx_start(struct ieee80211_hw *hw
+ /*****************/
+
+ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
+- struct ath_wiphy *aphy, int tx_flags, int ftype,
+- struct ath_txq *txq)
++ int tx_flags, int ftype, struct ath_txq *txq)
+ {
+ struct ieee80211_hw *hw = sc->hw;
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+@@ -1835,9 +1841,6 @@ static void ath_tx_complete(struct ath_s
+
+ ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
+
+- if (aphy)
+- hw = aphy->hw;
+-
+ if (tx_flags & ATH_TX_BAR)
+ tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
+
+@@ -1867,19 +1870,20 @@ static void ath_tx_complete(struct ath_s
PS_WAIT_FOR_TX_ACK));
}
@@ -1138,23 +2129,19 @@
- spin_lock_bh(&txq->axq_lock);
- if (WARN_ON(--txq->pending_frames < 0))
- txq->pending_frames = 0;
+- spin_unlock_bh(&txq->axq_lock);
+- }
+ q = skb_get_queue_mapping(skb);
+ if (txq == sc->tx.txq_map[q]) {
+ spin_lock_bh(&txq->axq_lock);
+ if (WARN_ON(--txq->pending_frames < 0))
+ txq->pending_frames = 0;
-- if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
-- if (ath_mac80211_start_queue(sc, q))
-- txq->stopped = 0;
-- }
-- spin_unlock_bh(&txq->axq_lock);
+- ieee80211_tx_status(hw, skb);
+ if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
+ ieee80211_wake_queue(sc->hw, q);
+ txq->stopped = 0;
- }
--
-- ieee80211_tx_status(hw, skb);
++ }
+ spin_unlock_bh(&txq->axq_lock);
}
+
@@ -1162,155 +2149,146 @@
}
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
---- a/drivers/net/wireless/ath/ath9k/Makefile
-+++ b/drivers/net/wireless/ath/ath9k/Makefile
-@@ -4,7 +4,6 @@ ath9k-y += beacon.o \
- main.o \
- recv.o \
- xmit.o \
-- virtual.o \
+@@ -1910,7 +1914,7 @@ static void ath_tx_complete_buf(struct a
+ complete(&sc->paprd_complete);
+ } else {
+ ath_debug_stat_tx(sc, bf, ts);
+- ath_tx_complete(sc, skb, bf->aphy, tx_flags,
++ ath_tx_complete(sc, skb, tx_flags,
+ bf->bf_state.bfs_ftype, txq);
+ }
+ /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
+@@ -1926,14 +1930,14 @@ static void ath_tx_complete_buf(struct a
+ spin_unlock_irqrestore(&sc->tx.txbuflock, flags);
+ }
- ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o
- ath9k-$(CONFIG_PCI) += pci.o
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -532,10 +532,8 @@ static void ath9k_init_misc(struct ath_s
+-static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
+- int nframes, int nbad, int txok, bool update_rc)
++static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
++ struct ath_tx_status *ts, int nframes, int nbad,
++ int txok, bool update_rc)
+ {
+ struct sk_buff *skb = bf->bf_mpdu;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+- struct ieee80211_hw *hw = bf->aphy->hw;
+- struct ath_softc *sc = bf->aphy->sc;
++ struct ieee80211_hw *hw = sc->hw;
+ struct ath_hw *ah = sc->sc_ah;
+ u8 i, tx_rateindex;
- sc->beacon.slottime = ATH9K_SLOT_TIME_9;
+@@ -1984,18 +1988,6 @@ static void ath_tx_rc_status(struct ath_
+ tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
+ }
-- for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
-+ for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
- sc->beacon.bslot[i] = NULL;
-- sc->beacon.bslot_aphy[i] = NULL;
+-/* Has no locking. Must hold spin_lock_bh(&txq->axq_lock)
+- * before calling this.
+- */
+-static void __ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq)
+-{
+- if (txq->mac80211_qnum >= 0 &&
+- txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
+- if (ath_mac80211_start_queue(sc, txq->mac80211_qnum))
+- txq->stopped = 0;
- }
-
- if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
- sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
-@@ -577,7 +575,6 @@ static int ath9k_init_softc(u16 devid, s
- common->btcoex_enabled = ath9k_btcoex_enable == 1;
- spin_lock_init(&common->cc_lock);
-
-- spin_lock_init(&sc->wiphy_lock);
- spin_lock_init(&sc->sc_serial_rw);
- spin_lock_init(&sc->sc_pm_lock);
- mutex_init(&sc->mutex);
-@@ -789,9 +786,6 @@ int ath9k_init_device(u16 devid, struct
-
- INIT_WORK(&sc->hw_check_work, ath_hw_check);
- INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
-- INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work);
-- INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
-- sc->wiphy_scheduler_int = msecs_to_jiffies(500);
- aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
-
- ath_init_leds(sc);
-@@ -850,28 +844,17 @@ static void ath9k_deinit_softc(struct at
- void ath9k_deinit_device(struct ath_softc *sc)
+-}
+-
+ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
{
- struct ieee80211_hw *hw = sc->hw;
-- int i = 0;
-
- ath9k_ps_wakeup(sc);
+ struct ath_hw *ah = sc->sc_ah;
+@@ -2006,7 +1998,6 @@ static void ath_tx_processq(struct ath_s
+ struct ath_tx_status ts;
+ int txok;
+ int status;
+- int qnum;
- wiphy_rfkill_stop_polling(sc->hw->wiphy);
- ath_deinit_leds(sc);
+ ath_dbg(common, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n",
+ txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
+@@ -2085,11 +2076,9 @@ static void ath_tx_processq(struct ath_s
+ */
+ if (ts.ts_status & ATH9K_TXERR_XRETRY)
+ bf->bf_state.bf_type |= BUF_XRETRY;
+- ath_tx_rc_status(bf, &ts, 1, txok ? 0 : 1, txok, true);
++ ath_tx_rc_status(sc, bf, &ts, 1, txok ? 0 : 1, txok, true);
+ }
-- for (i = 0; i < sc->num_sec_wiphy; i++) {
-- struct ath_wiphy *aphy = sc->sec_wiphy[i];
-- if (aphy == NULL)
-- continue;
-- sc->sec_wiphy[i] = NULL;
-- ieee80211_unregister_hw(aphy->hw);
-- ieee80211_free_hw(aphy->hw);
-- }
+- qnum = skb_get_queue_mapping(bf->bf_mpdu);
-
- ieee80211_unregister_hw(hw);
- pm_qos_remove_request(&sc->pm_qos_req);
- ath_rx_cleanup(sc);
- ath_tx_cleanup(sc);
- ath9k_deinit_softc(sc);
-- kfree(sc->sec_wiphy);
- }
+ if (bf_isampdu(bf))
+ ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, txok,
+ true);
+@@ -2097,7 +2086,6 @@ static void ath_tx_processq(struct ath_s
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, txok, 0);
- void ath_descdma_cleanup(struct ath_softc *sc,
---- a/drivers/net/wireless/ath/ath9k/pci.c
-+++ b/drivers/net/wireless/ath/ath9k/pci.c
-@@ -213,7 +213,6 @@ static int ath_pci_probe(struct pci_dev
- sc = (struct ath_softc *) (aphy + 1);
- aphy->sc = sc;
- aphy->hw = hw;
-- sc->pri_wiphy = aphy;
- sc->hw = hw;
- sc->dev = &pdev->dev;
- sc->mem = mem;
-@@ -320,7 +319,6 @@ static int ath_pci_resume(struct device
- ath9k_ps_restore(sc);
+ spin_lock_bh(&txq->axq_lock);
+- __ath_wake_mac80211_queue(sc, txq);
- sc->ps_idle = true;
-- ath9k_set_wiphy_idle(aphy, true);
- ath_radio_disable(sc, hw);
+ if (sc->sc_flags & SC_OP_TXAGGR)
+ ath_txq_schedule(sc, txq);
+@@ -2153,7 +2141,6 @@ static void ath_tx_complete_poll_work(st
+ txq->pending_frames,
+ list_empty(&txq->axq_acq),
+ txq->stopped);
+- __ath_wake_mac80211_queue(sc, txq);
+ ath_txq_schedule(sc, txq);
+ }
+ }
+@@ -2195,7 +2182,6 @@ void ath_tx_edma_tasklet(struct ath_soft
+ struct list_head bf_head;
+ int status;
+ int txok;
+- int qnum;
- return 0;
---- a/drivers/net/wireless/ath/ath9k/ahb.c
-+++ b/drivers/net/wireless/ath/ath9k/ahb.c
-@@ -107,7 +107,6 @@ static int ath_ahb_probe(struct platform
- sc = (struct ath_softc *) (aphy + 1);
- aphy->sc = sc;
- aphy->hw = hw;
-- sc->pri_wiphy = aphy;
- sc->hw = hw;
- sc->dev = &pdev->dev;
- sc->mem = mem;
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -142,9 +142,6 @@ static struct ath_buf *ath_beacon_genera
- struct ieee80211_tx_info *info;
- int cabq_depth;
+ for (;;) {
+ status = ath9k_hw_txprocdesc(ah, NULL, (void *)&txs);
+@@ -2238,11 +2224,9 @@ void ath_tx_edma_tasklet(struct ath_soft
+ if (!bf_isampdu(bf)) {
+ if (txs.ts_status & ATH9K_TXERR_XRETRY)
+ bf->bf_state.bf_type |= BUF_XRETRY;
+- ath_tx_rc_status(bf, &txs, 1, txok ? 0 : 1, txok, true);
++ ath_tx_rc_status(sc, bf, &txs, 1, txok ? 0 : 1, txok, true);
+ }
-- if (aphy->state != ATH_WIPHY_ACTIVE)
-- return NULL;
+- qnum = skb_get_queue_mapping(bf->bf_mpdu);
-
- avp = (void *)vif->drv_priv;
- cabq = sc->beacon.cabq;
+ if (bf_isampdu(bf))
+ ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs,
+ txok, true);
+@@ -2251,7 +2235,6 @@ void ath_tx_edma_tasklet(struct ath_soft
+ &txs, txok, 0);
-@@ -261,7 +258,6 @@ int ath_beacon_alloc(struct ath_wiphy *a
- }
- BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL);
- sc->beacon.bslot[avp->av_bslot] = vif;
-- sc->beacon.bslot_aphy[avp->av_bslot] = aphy;
- sc->nbcnvifs++;
- }
- }
-@@ -332,7 +328,6 @@ void ath_beacon_return(struct ath_softc
+ spin_lock_bh(&txq->axq_lock);
+- __ath_wake_mac80211_queue(sc, txq);
- if (avp->av_bslot != -1) {
- sc->beacon.bslot[avp->av_bslot] = NULL;
-- sc->beacon.bslot_aphy[avp->av_bslot] = NULL;
- sc->nbcnvifs--;
- }
+ if (!list_empty(&txq->txq_fifo_pending)) {
+ INIT_LIST_HEAD(&bf_head);
+--- a/drivers/net/wireless/ath/ath9k/mac.c
++++ b/drivers/net/wireless/ath/ath9k/mac.c
+@@ -16,8 +16,6 @@
-@@ -358,7 +353,6 @@ void ath_beacon_tasklet(unsigned long da
- struct ath_common *common = ath9k_hw_common(ah);
- struct ath_buf *bf = NULL;
- struct ieee80211_vif *vif;
-- struct ath_wiphy *aphy;
- int slot;
- u32 bfaddr, bc = 0, tsftu;
- u64 tsf;
-@@ -416,7 +410,6 @@ void ath_beacon_tasklet(unsigned long da
- */
- slot = ATH_BCBUF - slot - 1;
- vif = sc->beacon.bslot[slot];
-- aphy = sc->beacon.bslot_aphy[slot];
+ #include "hw.h"
+ #include "hw-ops.h"
+-#include "debug.h"
+-#include "ath9k.h"
- ath_dbg(common, ATH_DBG_BEACON,
- "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
-@@ -424,7 +417,7 @@ void ath_beacon_tasklet(unsigned long da
+ static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
+ struct ath9k_tx_queue_info *qi)
+@@ -52,18 +50,12 @@ EXPORT_SYMBOL(ath9k_hw_gettxbuf);
- bfaddr = 0;
- if (vif) {
-- bf = ath_beacon_generate(aphy->hw, vif);
-+ bf = ath_beacon_generate(sc->hw, vif);
- if (bf != NULL) {
- bfaddr = bf->bf_daddr;
- bc = 1;
+ void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp)
+ {
+- struct ath_wiphy *aphy = ah->hw->priv;
+- struct ath_softc *sc = aphy->sc;
+- TX_STAT_INC(q, puttxbuf);
+ REG_WRITE(ah, AR_QTXDP(q), txdp);
+ }
+ EXPORT_SYMBOL(ath9k_hw_puttxbuf);
+
+ void ath9k_hw_txstart(struct ath_hw *ah, u32 q)
+ {
+- struct ath_wiphy *aphy = ah->hw->priv;
+- struct ath_softc *sc = aphy->sc;
+- TX_STAT_INC(q, txstart);
+ ath_dbg(ath9k_hw_common(ah), ATH_DBG_QUEUE,
+ "Enable TXE on queue: %u\n", q);
+ REG_WRITE(ah, AR_Q_TXE, 1 << q);
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 d0c22b3d5c..44b457707a 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"
-@@ -528,6 +529,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;
-@@ -541,7 +543,7 @@ static int ath9k_init_softc(u16 devid, s
+@@ -540,7 +542,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);
-@@ -574,6 +576,9 @@ static int ath9k_init_softc(u16 devid, s
+@@ -576,6 +578,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 ba3479b581..38a1b3fe95 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
-@@ -543,8 +543,14 @@ static int ath9k_init_softc(u16 devid, s
+@@ -542,8 +542,14 @@ static int ath9k_init_softc(u16 devid, s
ah->hw_version.subsysid = subsysid;
sc->sc_ah = ah;
diff --git a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
index 457dfc6a30..674cfcff15 100644
--- a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
+++ b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -871,6 +871,53 @@ static const struct file_operations fops
+@@ -1007,6 +1007,53 @@ static const struct file_operations fops
.llseek = default_llseek,
};
@@ -54,7 +54,7 @@
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
-@@ -933,6 +980,10 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1077,6 +1124,10 @@ int ath9k_init_debug(struct ath_hw *ah)
debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
diff --git a/package/mac80211/patches/510-ath9k_led_cleanup.patch b/package/mac80211/patches/510-ath9k_led_cleanup.patch
index 570639d214..ad54338c85 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
-@@ -441,26 +441,20 @@ void ath9k_btcoex_timer_pause(struct ath
+@@ -447,26 +447,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
-@@ -625,15 +619,11 @@ struct ath_softc {
+@@ -618,15 +612,11 @@ struct ath_softc {
struct ath_beacon beacon;
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
@@ -57,8 +57,8 @@
+ struct led_classdev led_cdev;
+#endif
- int beacon_interval;
-
+ struct ath9k_hw_cal_data caldata;
+ int last_rssi;
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -20,120 +20,25 @@
@@ -253,9 +253,9 @@
/* Rfkill */
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1281,9 +1281,6 @@ static void ath9k_stop(struct ieee80211_
+@@ -1259,9 +1259,6 @@ static void ath9k_stop(struct ieee80211_
- aphy->state = ATH_WIPHY_INACTIVE;
+ mutex_lock(&sc->mutex);
- if (led_blink)
- cancel_delayed_work_sync(&sc->ath_led_blink_work);
@@ -287,7 +287,7 @@
static void ath9k_deinit_softc(struct ath_softc *sc);
/*
-@@ -747,6 +762,13 @@ int ath9k_init_device(u16 devid, struct
+@@ -748,6 +763,13 @@ int ath9k_init_device(u16 devid, struct
ath9k_init_txpower_limits(sc);
diff --git a/package/mac80211/patches/530-ath9k_cleanup_queue_wake.patch b/package/mac80211/patches/530-ath9k_cleanup_queue_wake.patch
deleted file mode 100644
index 0d9511f095..0000000000
--- a/package/mac80211/patches/530-ath9k_cleanup_queue_wake.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1208,8 +1208,17 @@ bool ath_drain_all_txq(struct ath_softc
- ath_err(common, "Failed to stop TX DMA!\n");
-
- for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
-- if (ATH_TXQ_SETUP(sc, i))
-- ath_draintxq(sc, &sc->tx.txq[i], retry_tx);
-+ if (!ATH_TXQ_SETUP(sc, i))
-+ continue;
-+
-+ /*
-+ * The caller will resume queues with ieee80211_wake_queues.
-+ * Mark the queue as not stopped to prevent ath_tx_complete
-+ * from waking the queue too early.
-+ */
-+ txq = &sc->tx.txq[i];
-+ txq->stopped = false;
-+ ath_draintxq(sc, txq, retry_tx);
- }
-
- return !npend;
-@@ -1873,6 +1882,11 @@ static void ath_tx_complete(struct ath_s
- spin_lock_bh(&txq->axq_lock);
- if (WARN_ON(--txq->pending_frames < 0))
- txq->pending_frames = 0;
-+
-+ if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
-+ if (ath_mac80211_start_queue(sc, q))
-+ txq->stopped = 0;
-+ }
- spin_unlock_bh(&txq->axq_lock);
- }
-
-@@ -1982,19 +1996,6 @@ static void ath_tx_rc_status(struct ath_
- tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
- }
-
--static void ath_wake_mac80211_queue(struct ath_softc *sc, int qnum)
--{
-- struct ath_txq *txq;
--
-- txq = sc->tx.txq_map[qnum];
-- spin_lock_bh(&txq->axq_lock);
-- if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
-- if (ath_mac80211_start_queue(sc, qnum))
-- txq->stopped = 0;
-- }
-- spin_unlock_bh(&txq->axq_lock);
--}
--
- static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
- {
- struct ath_hw *ah = sc->sc_ah;
-@@ -2005,7 +2006,6 @@ static void ath_tx_processq(struct ath_s
- struct ath_tx_status ts;
- int txok;
- int status;
-- int qnum;
-
- ath_dbg(common, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n",
- txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
-@@ -2084,17 +2084,12 @@ static void ath_tx_processq(struct ath_s
- ath_tx_rc_status(bf, &ts, 1, txok ? 0 : 1, txok, true);
- }
-
-- qnum = skb_get_queue_mapping(bf->bf_mpdu);
--
- if (bf_isampdu(bf))
- ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, txok,
- true);
- else
- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, txok, 0);
-
-- if (txq == sc->tx.txq_map[qnum])
-- ath_wake_mac80211_queue(sc, qnum);
--
- spin_lock_bh(&txq->axq_lock);
- if (sc->sc_flags & SC_OP_TXAGGR)
- ath_txq_schedule(sc, txq);
-@@ -2163,7 +2158,6 @@ void ath_tx_edma_tasklet(struct ath_soft
- struct list_head bf_head;
- int status;
- int txok;
-- int qnum;
-
- for (;;) {
- status = ath9k_hw_txprocdesc(ah, NULL, (void *)&txs);
-@@ -2209,8 +2203,6 @@ void ath_tx_edma_tasklet(struct ath_soft
- ath_tx_rc_status(bf, &txs, 1, txok ? 0 : 1, txok, true);
- }
-
-- qnum = skb_get_queue_mapping(bf->bf_mpdu);
--
- if (bf_isampdu(bf))
- ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs,
- txok, true);
-@@ -2218,9 +2210,6 @@ void ath_tx_edma_tasklet(struct ath_soft
- ath_tx_complete_buf(sc, bf, txq, &bf_head,
- &txs, txok, 0);
-
-- if (txq == sc->tx.txq_map[qnum])
-- ath_wake_mac80211_queue(sc, qnum);
--
- spin_lock_bh(&txq->axq_lock);
- if (!list_empty(&txq->txq_fifo_pending)) {
- INIT_LIST_HEAD(&bf_head);
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -295,6 +295,8 @@ int ath_set_channel(struct ath_softc *sc
- }
-
- ps_restore:
-+ ieee80211_wake_queues(hw);
-+
- spin_unlock_bh(&sc->sc_pcu_lock);
-
- ath9k_ps_restore(sc);
diff --git a/package/mac80211/patches/530-mac80211_fix_beacon_race.patch b/package/mac80211/patches/530-mac80211_fix_beacon_race.patch
new file mode 100644
index 0000000000..36c09169bc
--- /dev/null
+++ b/package/mac80211/patches/530-mac80211_fix_beacon_race.patch
@@ -0,0 +1,12 @@
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -2241,6 +2241,9 @@ struct sk_buff *ieee80211_beacon_get_tim
+
+ sdata = vif_to_sdata(vif);
+
++ if (!ieee80211_sdata_running(sdata))
++ goto out;
++
+ if (tim_offset)
+ *tim_offset = 0;
+ if (tim_length)
diff --git a/package/mac80211/patches/531-ath9k_suppress_bogus_error_message.patch b/package/mac80211/patches/531-ath9k_suppress_bogus_error_message.patch
deleted file mode 100644
index 6200602907..0000000000
--- a/package/mac80211/patches/531-ath9k_suppress_bogus_error_message.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -279,10 +279,8 @@ int ath_beacon_alloc(struct ath_wiphy *a
-
- /* NB: the beacon data buffer must be 32-bit aligned. */
- skb = ieee80211_beacon_get(sc->hw, vif);
-- if (skb == NULL) {
-- ath_err(common, "ieee80211_beacon_get failed\n");
-+ if (skb == NULL)
- return -ENOMEM;
-- }
-
- tstamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
- sc->beacon.bc_tstamp = le64_to_cpu(tstamp);
diff --git a/package/mac80211/patches/540-ath9k_remove_virtual_debugfs.patch b/package/mac80211/patches/540-ath9k_remove_virtual_debugfs.patch
deleted file mode 100644
index ed835417e5..0000000000
--- a/package/mac80211/patches/540-ath9k_remove_virtual_debugfs.patch
+++ /dev/null
@@ -1,172 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/debug.c
-+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -381,41 +381,21 @@ static const struct file_operations fops
- .llseek = default_llseek,
- };
-
--static const char * ath_wiphy_state_str(enum ath_wiphy_state state)
--{
-- switch (state) {
-- case ATH_WIPHY_INACTIVE:
-- return "INACTIVE";
-- case ATH_WIPHY_ACTIVE:
-- return "ACTIVE";
-- case ATH_WIPHY_PAUSING:
-- return "PAUSING";
-- case ATH_WIPHY_PAUSED:
-- return "PAUSED";
-- case ATH_WIPHY_SCAN:
-- return "SCAN";
-- }
-- return "?";
--}
--
- static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos)
- {
- struct ath_softc *sc = file->private_data;
-- struct ath_wiphy *aphy = sc->pri_wiphy;
-- struct ieee80211_channel *chan = aphy->hw->conf.channel;
-+ struct ieee80211_channel *chan = sc->hw->conf.channel;
- char buf[512];
- unsigned int len = 0;
-- int i;
- u8 addr[ETH_ALEN];
- u32 tmp;
-
- len += snprintf(buf + len, sizeof(buf) - len,
-- "primary: %s (%s chan=%d ht=%d)\n",
-- wiphy_name(sc->pri_wiphy->hw->wiphy),
-- ath_wiphy_state_str(sc->pri_wiphy->state),
-+ "%s (chan=%d ht=%d)\n",
-+ wiphy_name(sc->hw->wiphy),
- ieee80211_frequency_to_channel(chan->center_freq),
-- aphy->chan_is_ht);
-+ conf_is_ht(&sc->hw->conf));
-
- put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
- put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4);
-@@ -457,123 +437,14 @@ static ssize_t read_file_wiphy(struct fi
- else
- len += snprintf(buf + len, sizeof(buf) - len, "\n");
-
-- /* Put variable-length stuff down here, and check for overflows. */
-- for (i = 0; i < sc->num_sec_wiphy; i++) {
-- struct ath_wiphy *aphy_tmp = sc->sec_wiphy[i];
-- if (aphy_tmp == NULL)
-- continue;
-- chan = aphy_tmp->hw->conf.channel;
-- len += snprintf(buf + len, sizeof(buf) - len,
-- "secondary: %s (%s chan=%d ht=%d)\n",
-- wiphy_name(aphy_tmp->hw->wiphy),
-- ath_wiphy_state_str(aphy_tmp->state),
-- ieee80211_frequency_to_channel(chan->center_freq),
-- aphy_tmp->chan_is_ht);
-- }
- if (len > sizeof(buf))
- len = sizeof(buf);
-
- return simple_read_from_buffer(user_buf, count, ppos, buf, len);
- }
-
--static struct ath_wiphy * get_wiphy(struct ath_softc *sc, const char *name)
--{
-- int i;
-- if (strcmp(name, wiphy_name(sc->pri_wiphy->hw->wiphy)) == 0)
-- return sc->pri_wiphy;
-- for (i = 0; i < sc->num_sec_wiphy; i++) {
-- struct ath_wiphy *aphy = sc->sec_wiphy[i];
-- if (aphy && strcmp(name, wiphy_name(aphy->hw->wiphy)) == 0)
-- return aphy;
-- }
-- return NULL;
--}
--
--static int del_wiphy(struct ath_softc *sc, const char *name)
--{
-- struct ath_wiphy *aphy = get_wiphy(sc, name);
-- if (!aphy)
-- return -ENOENT;
-- return ath9k_wiphy_del(aphy);
--}
--
--static int pause_wiphy(struct ath_softc *sc, const char *name)
--{
-- struct ath_wiphy *aphy = get_wiphy(sc, name);
-- if (!aphy)
-- return -ENOENT;
-- return ath9k_wiphy_pause(aphy);
--}
--
--static int unpause_wiphy(struct ath_softc *sc, const char *name)
--{
-- struct ath_wiphy *aphy = get_wiphy(sc, name);
-- if (!aphy)
-- return -ENOENT;
-- return ath9k_wiphy_unpause(aphy);
--}
--
--static int select_wiphy(struct ath_softc *sc, const char *name)
--{
-- struct ath_wiphy *aphy = get_wiphy(sc, name);
-- if (!aphy)
-- return -ENOENT;
-- return ath9k_wiphy_select(aphy);
--}
--
--static int schedule_wiphy(struct ath_softc *sc, const char *msec)
--{
-- ath9k_wiphy_set_scheduler(sc, simple_strtoul(msec, NULL, 0));
-- return 0;
--}
--
--static ssize_t write_file_wiphy(struct file *file, const char __user *user_buf,
-- size_t count, loff_t *ppos)
--{
-- struct ath_softc *sc = file->private_data;
-- char buf[50];
-- size_t len;
--
-- len = min(count, sizeof(buf) - 1);
-- if (copy_from_user(buf, user_buf, len))
-- return -EFAULT;
-- buf[len] = '\0';
-- if (len > 0 && buf[len - 1] == '\n')
-- buf[len - 1] = '\0';
--
-- if (strncmp(buf, "add", 3) == 0) {
-- int res = ath9k_wiphy_add(sc);
-- if (res < 0)
-- return res;
-- } else if (strncmp(buf, "del=", 4) == 0) {
-- int res = del_wiphy(sc, buf + 4);
-- if (res < 0)
-- return res;
-- } else if (strncmp(buf, "pause=", 6) == 0) {
-- int res = pause_wiphy(sc, buf + 6);
-- if (res < 0)
-- return res;
-- } else if (strncmp(buf, "unpause=", 8) == 0) {
-- int res = unpause_wiphy(sc, buf + 8);
-- if (res < 0)
-- return res;
-- } else if (strncmp(buf, "select=", 7) == 0) {
-- int res = select_wiphy(sc, buf + 7);
-- if (res < 0)
-- return res;
-- } else if (strncmp(buf, "schedule=", 9) == 0) {
-- int res = schedule_wiphy(sc, buf + 9);
-- if (res < 0)
-- return res;
-- } else
-- return -EOPNOTSUPP;
--
-- return count;
--}
--
- static const struct file_operations fops_wiphy = {
- .read = read_file_wiphy,
-- .write = write_file_wiphy,
- .open = ath9k_debugfs_open,
- .owner = THIS_MODULE,
- .llseek = default_llseek,
diff --git a/package/mac80211/patches/542-ath9k_remove_bf_aphy.patch b/package/mac80211/patches/542-ath9k_remove_bf_aphy.patch
deleted file mode 100644
index 0238fab253..0000000000
--- a/package/mac80211/patches/542-ath9k_remove_bf_aphy.patch
+++ /dev/null
@@ -1,170 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -57,8 +57,9 @@ static void ath_tx_complete_buf(struct a
- static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
- struct list_head *head);
- static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len);
--static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
-- int nframes, int nbad, int txok, bool update_rc);
-+static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
-+ struct ath_tx_status *ts, int nframes, int nbad,
-+ int txok, bool update_rc);
- static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
- int seqno);
-
-@@ -297,7 +298,6 @@ static struct ath_buf* ath_clone_txbuf(s
-
- ATH_TXBUF_RESET(tbf);
-
-- tbf->aphy = bf->aphy;
- tbf->bf_mpdu = bf->bf_mpdu;
- tbf->bf_buf_addr = bf->bf_buf_addr;
- memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
-@@ -345,7 +345,7 @@ static void ath_tx_complete_aggr(struct
- struct ath_node *an = NULL;
- struct sk_buff *skb;
- struct ieee80211_sta *sta;
-- struct ieee80211_hw *hw;
-+ struct ieee80211_hw *hw = sc->hw;
- struct ieee80211_hdr *hdr;
- struct ieee80211_tx_info *tx_info;
- struct ath_atx_tid *tid = NULL;
-@@ -364,7 +364,6 @@ static void ath_tx_complete_aggr(struct
- hdr = (struct ieee80211_hdr *)skb->data;
-
- tx_info = IEEE80211_SKB_CB(skb);
-- hw = bf->aphy->hw;
-
- memcpy(rates, tx_info->control.rates, sizeof(rates));
-
-@@ -383,7 +382,7 @@ static void ath_tx_complete_aggr(struct
- !bf->bf_stale || bf_next != NULL)
- list_move_tail(&bf->list, &bf_head);
-
-- ath_tx_rc_status(bf, ts, 1, 1, 0, false);
-+ ath_tx_rc_status(sc, bf, ts, 1, 1, 0, false);
- ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
- 0, 0);
-
-@@ -489,10 +488,10 @@ static void ath_tx_complete_aggr(struct
-
- if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
- memcpy(tx_info->control.rates, rates, sizeof(rates));
-- ath_tx_rc_status(bf, ts, nframes, nbad, txok, true);
-+ ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, true);
- rc_update = false;
- } else {
-- ath_tx_rc_status(bf, ts, nframes, nbad, txok, false);
-+ ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, false);
- }
-
- ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
-@@ -516,7 +515,7 @@ static void ath_tx_complete_aggr(struct
-
- bf->bf_state.bf_type |=
- BUF_XRETRY;
-- ath_tx_rc_status(bf, ts, nframes,
-+ ath_tx_rc_status(sc, bf, ts, nframes,
- nbad, 0, false);
- ath_tx_complete_buf(sc, bf, txq,
- &bf_head,
-@@ -1677,7 +1676,6 @@ static struct ath_buf *ath_tx_setup_buff
-
- ATH_TXBUF_RESET(bf);
-
-- bf->aphy = aphy;
- bf->bf_flags = setup_tx_flags(skb);
- bf->bf_mpdu = skb;
-
-@@ -1831,8 +1829,7 @@ int ath_tx_start(struct ieee80211_hw *hw
- /*****************/
-
- static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
-- struct ath_wiphy *aphy, int tx_flags, int ftype,
-- struct ath_txq *txq)
-+ int tx_flags, int ftype, struct ath_txq *txq)
- {
- struct ieee80211_hw *hw = sc->hw;
- struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
-@@ -1842,9 +1839,6 @@ static void ath_tx_complete(struct ath_s
-
- ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
-
-- if (aphy)
-- hw = aphy->hw;
--
- if (tx_flags & ATH_TX_BAR)
- tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
-
-@@ -1918,7 +1912,7 @@ static void ath_tx_complete_buf(struct a
- complete(&sc->paprd_complete);
- } else {
- ath_debug_stat_tx(sc, bf, ts);
-- ath_tx_complete(sc, skb, bf->aphy, tx_flags,
-+ ath_tx_complete(sc, skb, tx_flags,
- bf->bf_state.bfs_ftype, txq);
- }
- /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
-@@ -1934,14 +1928,14 @@ static void ath_tx_complete_buf(struct a
- spin_unlock_irqrestore(&sc->tx.txbuflock, flags);
- }
-
--static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
-- int nframes, int nbad, int txok, bool update_rc)
-+static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
-+ struct ath_tx_status *ts, int nframes, int nbad,
-+ int txok, bool update_rc)
- {
- struct sk_buff *skb = bf->bf_mpdu;
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
-- struct ieee80211_hw *hw = bf->aphy->hw;
-- struct ath_softc *sc = bf->aphy->sc;
-+ struct ieee80211_hw *hw = sc->hw;
- struct ath_hw *ah = sc->sc_ah;
- u8 i, tx_rateindex;
-
-@@ -2077,7 +2071,7 @@ static void ath_tx_processq(struct ath_s
- */
- if (ts.ts_status & ATH9K_TXERR_XRETRY)
- bf->bf_state.bf_type |= BUF_XRETRY;
-- ath_tx_rc_status(bf, &ts, 1, txok ? 0 : 1, txok, true);
-+ ath_tx_rc_status(sc, bf, &ts, 1, txok ? 0 : 1, txok, true);
- }
-
- if (bf_isampdu(bf))
-@@ -2196,7 +2190,7 @@ void ath_tx_edma_tasklet(struct ath_soft
- if (!bf_isampdu(bf)) {
- if (txs.ts_status & ATH9K_TXERR_XRETRY)
- bf->bf_state.bf_type |= BUF_XRETRY;
-- ath_tx_rc_status(bf, &txs, 1, txok ? 0 : 1, txok, true);
-+ ath_tx_rc_status(sc, bf, &txs, 1, txok ? 0 : 1, txok, true);
- }
-
- if (bf_isampdu(bf))
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -32,6 +32,7 @@
- */
-
- struct ath_node;
-+struct ath_wiphy;
-
- /* Macro to expand scalars to 64-bit objects */
-
-@@ -233,7 +234,6 @@ struct ath_buf {
- bool bf_stale;
- u16 bf_flags;
- struct ath_buf_state bf_state;
-- struct ath_wiphy *aphy;
- };
-
- struct ath_atx_tid {
-@@ -550,7 +550,6 @@ struct ath_ant_comb {
- #define PS_WAIT_FOR_TX_ACK BIT(3)
- #define PS_BEACON_SYNC BIT(4)
-
--struct ath_wiphy;
- struct ath_rate_table;
-
- struct ath9k_vif_iter_data {
diff --git a/package/mac80211/patches/543-ath9k_remove_ath_wiphy.patch b/package/mac80211/patches/543-ath9k_remove_ath_wiphy.patch
deleted file mode 100644
index 251051dd53..0000000000
--- a/package/mac80211/patches/543-ath9k_remove_ath_wiphy.patch
+++ /dev/null
@@ -1,572 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -32,7 +32,6 @@
- */
-
- struct ath_node;
--struct ath_wiphy;
-
- /* Macro to expand scalars to 64-bit objects */
-
-@@ -391,7 +390,7 @@ struct ath_beacon {
-
- void ath_beacon_tasklet(unsigned long data);
- void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif);
--int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif);
-+int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif);
- void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
- int ath_beaconq_config(struct ath_softc *sc);
-
-@@ -611,6 +610,9 @@ struct ath_softc {
- struct led_classdev led_cdev;
- #endif
-
-+ struct ath9k_hw_cal_data caldata;
-+ int last_rssi;
-+
- int beacon_interval;
-
- #ifdef CONFIG_ATH9K_DEBUGFS
-@@ -627,13 +629,6 @@ struct ath_softc {
- struct pm_qos_request_list pm_qos_req;
- };
-
--struct ath_wiphy {
-- struct ath_softc *sc; /* shared for all virtual wiphys */
-- struct ieee80211_hw *hw;
-- struct ath9k_hw_cal_data caldata;
-- int last_rssi;
--};
--
- void ath9k_tasklet(unsigned long data);
- int ath_reset(struct ath_softc *sc, bool retry_tx);
- int ath_cabq_update(struct ath_softc *);
---- a/drivers/net/wireless/ath/ath9k/ahb.c
-+++ b/drivers/net/wireless/ath/ath9k/ahb.c
-@@ -54,7 +54,6 @@ static struct ath_bus_ops ath_ahb_bus_op
- static int ath_ahb_probe(struct platform_device *pdev)
- {
- void __iomem *mem;
-- struct ath_wiphy *aphy;
- struct ath_softc *sc;
- struct ieee80211_hw *hw;
- struct resource *res;
-@@ -92,8 +91,7 @@ static int ath_ahb_probe(struct platform
-
- irq = res->start;
-
-- hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) +
-- sizeof(struct ath_softc), &ath9k_ops);
-+ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
- if (hw == NULL) {
- dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
- ret = -ENOMEM;
-@@ -103,10 +101,7 @@ static int ath_ahb_probe(struct platform
- SET_IEEE80211_DEV(hw, &pdev->dev);
- platform_set_drvdata(pdev, hw);
-
-- aphy = hw->priv;
-- sc = (struct ath_softc *) (aphy + 1);
-- aphy->sc = sc;
-- aphy->hw = hw;
-+ sc = hw->priv;
- sc->hw = hw;
- sc->dev = &pdev->dev;
- sc->mem = mem;
-@@ -150,8 +145,7 @@ static int ath_ahb_remove(struct platfor
- struct ieee80211_hw *hw = platform_get_drvdata(pdev);
-
- if (hw) {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- void __iomem *mem = sc->mem;
-
- ath9k_deinit_device(sc);
---- a/drivers/net/wireless/ath/ath9k/pci.c
-+++ b/drivers/net/wireless/ath/ath9k/pci.c
-@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_
- static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- {
- void __iomem *mem;
-- struct ath_wiphy *aphy;
- struct ath_softc *sc;
- struct ieee80211_hw *hw;
- u8 csz;
-@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev
- goto err_iomap;
- }
-
-- hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) +
-- sizeof(struct ath_softc), &ath9k_ops);
-+ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
- if (!hw) {
- dev_err(&pdev->dev, "No memory for ieee80211_hw\n");
- ret = -ENOMEM;
-@@ -209,10 +207,7 @@ static int ath_pci_probe(struct pci_dev
- SET_IEEE80211_DEV(hw, &pdev->dev);
- pci_set_drvdata(pdev, hw);
-
-- aphy = hw->priv;
-- sc = (struct ath_softc *) (aphy + 1);
-- aphy->sc = sc;
-- aphy->hw = hw;
-+ sc = hw->priv;
- sc->hw = hw;
- sc->dev = &pdev->dev;
- sc->mem = mem;
-@@ -259,8 +254,7 @@ err_dma:
- static void ath_pci_remove(struct pci_dev *pdev)
- {
- struct ieee80211_hw *hw = pci_get_drvdata(pdev);
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- void __iomem *mem = sc->mem;
-
- if (!is_ath9k_unloaded)
-@@ -280,8 +274,7 @@ static int ath_pci_suspend(struct device
- {
- struct pci_dev *pdev = to_pci_dev(device);
- struct ieee80211_hw *hw = pci_get_drvdata(pdev);
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
-
-@@ -292,8 +285,7 @@ static int ath_pci_resume(struct device
- {
- struct pci_dev *pdev = to_pci_dev(device);
- struct ieee80211_hw *hw = pci_get_drvdata(pdev);
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- u32 val;
-
- /*
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_
-
- static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_tx_control txctl;
-
-@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211
- static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_buf *bf;
- struct ath_vif *avp;
-@@ -222,9 +220,8 @@ static struct ath_buf *ath_beacon_genera
- return bf;
- }
-
--int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
-+int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif)
- {
-- struct ath_softc *sc = aphy->sc;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_vif *avp;
- struct ath_buf *bf;
---- a/drivers/net/wireless/ath/ath9k/gpio.c
-+++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -88,8 +88,7 @@ static bool ath_is_rfkill_set(struct ath
-
- void ath9k_rfkill_poll_state(struct ieee80211_hw *hw)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- bool blocked = !!ath_is_rfkill_set(sc);
-
- wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -270,8 +270,7 @@ static int ath9k_reg_notifier(struct wip
- struct regulatory_request *request)
- {
- struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah);
-
- return ath_reg_notifier_apply(wiphy, request, reg);
-@@ -724,7 +723,6 @@ int ath9k_init_device(u16 devid, struct
- const struct ath_bus_ops *bus_ops)
- {
- struct ieee80211_hw *hw = sc->hw;
-- struct ath_wiphy *aphy = hw->priv;
- struct ath_common *common;
- struct ath_hw *ah;
- int error = 0;
-@@ -786,7 +784,7 @@ int ath9k_init_device(u16 devid, struct
-
- INIT_WORK(&sc->hw_check_work, ath_hw_check);
- INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
-- aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
-+ sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
-
- ath_init_leds(sc);
- ath_start_rfkill_poll(sc);
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -215,7 +215,6 @@ static void ath_update_survey_stats(stru
- int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
- struct ath9k_channel *hchan)
- {
-- struct ath_wiphy *aphy = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ieee80211_conf *conf = &common->hw->conf;
-@@ -262,7 +261,7 @@ int ath_set_channel(struct ath_softc *sc
- fastcc = false;
-
- if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
-- caldata = &aphy->caldata;
-+ caldata = &sc->caldata;
-
- ath_dbg(common, ATH_DBG_CONFIG,
- "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n",
-@@ -841,7 +840,6 @@ static void ath9k_bss_assoc_info(struct
- struct ieee80211_vif *vif,
- struct ieee80211_bss_conf *bss_conf)
- {
-- struct ath_wiphy *aphy = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
-
-@@ -865,7 +863,7 @@ static void ath9k_bss_assoc_info(struct
- ath_beacon_config(sc, vif);
-
- /* Reset rssi stats */
-- aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
-+ sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
- sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
-
- sc->sc_flags |= SC_OP_ANI_RUN;
-@@ -1062,8 +1060,7 @@ void ath9k_update_ichannel(struct ath_so
-
- static int ath9k_start(struct ieee80211_hw *hw)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ieee80211_channel *curchan = hw->conf.channel;
-@@ -1180,8 +1177,7 @@ mutex_unlock:
- static int ath9k_tx(struct ieee80211_hw *hw,
- struct sk_buff *skb)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_tx_control txctl;
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
-@@ -1244,8 +1240,7 @@ exit:
-
- static void ath9k_stop(struct ieee80211_hw *hw)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
-
-@@ -1377,8 +1372,7 @@ void ath9k_calculate_iter_data(struct ie
- struct ieee80211_vif *vif,
- struct ath9k_vif_iter_data *iter_data)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
-
-@@ -1402,8 +1396,7 @@ void ath9k_calculate_iter_data(struct ie
- static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ath9k_vif_iter_data iter_data;
-@@ -1459,8 +1452,7 @@ static void ath9k_calculate_summary_stat
- static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- ath9k_calculate_summary_state(hw, vif);
-
-@@ -1473,7 +1465,7 @@ static void ath9k_do_vif_add_setup(struc
- * in the info_changed method and set up beacons properly
- * there.
- */
-- error = ath_beacon_alloc(aphy, vif);
-+ error = ath_beacon_alloc(sc, vif);
- if (error)
- ath9k_reclaim_beacon(sc, vif);
- else
-@@ -1485,8 +1477,7 @@ static void ath9k_do_vif_add_setup(struc
- static int ath9k_add_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ath_vif *avp = (void *)vif->drv_priv;
-@@ -1546,8 +1537,7 @@ static int ath9k_change_interface(struct
- enum nl80211_iftype new_type,
- bool p2p)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- int ret = 0;
-
-@@ -1589,8 +1579,7 @@ out:
- static void ath9k_remove_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-
- ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
-@@ -1644,8 +1633,7 @@ static void ath9k_disable_ps(struct ath_
-
- static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ieee80211_conf *conf = &hw->conf;
-@@ -1789,8 +1777,7 @@ static void ath9k_configure_filter(struc
- unsigned int *total_flags,
- u64 multicast)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- u32 rfilt;
-
- changed_flags &= SUPPORTED_FILTERS;
-@@ -1810,8 +1797,7 @@ static int ath9k_sta_add(struct ieee8021
- struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- ath_node_attach(sc, sta);
-
-@@ -1822,8 +1808,7 @@ static int ath9k_sta_remove(struct ieee8
- struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- ath_node_detach(sc, sta);
-
-@@ -1833,8 +1818,7 @@ static int ath9k_sta_remove(struct ieee8
- static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
- const struct ieee80211_tx_queue_params *params)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_txq *txq;
- struct ath9k_tx_queue_info qi;
-@@ -1878,8 +1862,7 @@ static int ath9k_set_key(struct ieee8021
- struct ieee80211_sta *sta,
- struct ieee80211_key_conf *key)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- int ret = 0;
-
-@@ -1923,8 +1906,7 @@ static void ath9k_bss_info_changed(struc
- struct ieee80211_bss_conf *bss_conf,
- u32 changed)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
- struct ath_vif *avp = (void *)vif->drv_priv;
-@@ -1954,7 +1936,7 @@ static void ath9k_bss_info_changed(struc
- if ((changed & BSS_CHANGED_BEACON) ||
- ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
- ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
-- error = ath_beacon_alloc(aphy, vif);
-+ error = ath_beacon_alloc(sc, vif);
- if (!error)
- ath_beacon_config(sc, vif);
- }
-@@ -1991,7 +1973,7 @@ static void ath9k_bss_info_changed(struc
- if (vif->type == NL80211_IFTYPE_AP) {
- sc->sc_flags |= SC_OP_TSF_RESET;
- ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
-- error = ath_beacon_alloc(aphy, vif);
-+ error = ath_beacon_alloc(sc, vif);
- if (!error)
- ath_beacon_config(sc, vif);
- } else {
-@@ -2029,9 +2011,8 @@ static void ath9k_bss_info_changed(struc
-
- static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
- {
-+ struct ath_softc *sc = hw->priv;
- u64 tsf;
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-
- mutex_lock(&sc->mutex);
- ath9k_ps_wakeup(sc);
-@@ -2044,8 +2025,7 @@ static u64 ath9k_get_tsf(struct ieee8021
-
- static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- mutex_lock(&sc->mutex);
- ath9k_ps_wakeup(sc);
-@@ -2056,8 +2036,7 @@ static void ath9k_set_tsf(struct ieee802
-
- static void ath9k_reset_tsf(struct ieee80211_hw *hw)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
-
- mutex_lock(&sc->mutex);
-
-@@ -2074,8 +2053,7 @@ static int ath9k_ampdu_action(struct iee
- struct ieee80211_sta *sta,
- u16 tid, u16 *ssn, u8 buf_size)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- int ret = 0;
-
- local_bh_disable();
-@@ -2120,8 +2098,7 @@ static int ath9k_ampdu_action(struct iee
- static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
- struct survey_info *survey)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ieee80211_supported_band *sband;
- struct ieee80211_channel *chan;
-@@ -2157,8 +2134,7 @@ static int ath9k_get_survey(struct ieee8
-
- static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
-
- mutex_lock(&sc->mutex);
---- a/drivers/net/wireless/ath/ath9k/rc.c
-+++ b/drivers/net/wireless/ath/ath9k/rc.c
-@@ -1560,8 +1560,7 @@ static void ath_rate_add_sta_debugfs(voi
-
- static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- return aphy->sc;
-+ return hw->priv;
- }
-
- static void ath_rate_free(void *priv)
---- a/drivers/net/wireless/ath/ath9k/recv.c
-+++ b/drivers/net/wireless/ath/ath9k/recv.c
-@@ -927,7 +927,7 @@ static void ath9k_process_rssi(struct at
- struct ieee80211_hdr *hdr,
- struct ath_rx_status *rx_stats)
- {
-- struct ath_wiphy *aphy = hw->priv;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = common->ah;
- int last_rssi;
- __le16 fc;
-@@ -947,9 +947,9 @@ static void ath9k_process_rssi(struct at
- }
-
- if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
-- ATH_RSSI_LPF(aphy->last_rssi, rx_stats->rs_rssi);
-+ ATH_RSSI_LPF(sc->last_rssi, rx_stats->rs_rssi);
-
-- last_rssi = aphy->last_rssi;
-+ last_rssi = sc->last_rssi;
- if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
- rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
- ATH_RSSI_EP_MULTIPLIER);
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1440,8 +1440,7 @@ static enum ath9k_pkt_type get_hw_packet
- static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
- int framelen)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
- struct ieee80211_sta *sta = tx_info->control.sta;
- struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
-@@ -1659,8 +1658,7 @@ static struct ath_buf *ath_tx_setup_buff
- struct ath_txq *txq,
- struct sk_buff *skb)
- {
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- struct ath_frame_info *fi = get_frame_info(skb);
-@@ -1761,8 +1759,7 @@ int ath_tx_start(struct ieee80211_hw *hw
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- struct ieee80211_sta *sta = info->control.sta;
-- struct ath_wiphy *aphy = hw->priv;
-- struct ath_softc *sc = aphy->sc;
-+ struct ath_softc *sc = hw->priv;
- struct ath_txq *txq = txctl->txq;
- struct ath_buf *bf;
- int padpos, padsize;
diff --git a/package/mac80211/patches/550-ath9k_fix_ps_wakeup_issues.patch b/package/mac80211/patches/550-ath9k_fix_ps_wakeup_issues.patch
deleted file mode 100644
index 29c4f9ffd5..0000000000
--- a/package/mac80211/patches/550-ath9k_fix_ps_wakeup_issues.patch
+++ /dev/null
@@ -1,61 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -2111,9 +2111,7 @@ static void ath_tx_complete_poll_work(st
- if (needreset) {
- ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
- "tx hung, resetting the chip\n");
-- ath9k_ps_wakeup(sc);
- ath_reset(sc, true);
-- ath9k_ps_restore(sc);
- }
-
- ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -592,19 +592,16 @@ void ath9k_tasklet(unsigned long data)
- struct ath_softc *sc = (struct ath_softc *)data;
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
--
- u32 status = sc->intrstatus;
- u32 rxmask;
-
-- ath9k_ps_wakeup(sc);
--
- if (status & ATH9K_INT_FATAL) {
- ath_reset(sc, true);
-- ath9k_ps_restore(sc);
- return;
- }
-
- spin_lock(&sc->sc_pcu_lock);
-+ ath9k_ps_wakeup(sc);
-
- /*
- * Only run the baseband hang check if beacons stop working in AP or
-@@ -980,6 +977,7 @@ int ath_reset(struct ath_softc *sc, bool
- /* Stop ANI */
- del_timer_sync(&common->ani.timer);
-
-+ ath9k_ps_wakeup(sc);
- spin_lock_bh(&sc->sc_pcu_lock);
-
- ieee80211_stop_queues(hw);
-@@ -1026,6 +1024,7 @@ int ath_reset(struct ath_softc *sc, bool
-
- /* Start ANI */
- ath_start_ani(common);
-+ ath9k_ps_restore(sc);
-
- return r;
- }
-@@ -1748,7 +1747,9 @@ static int ath9k_config(struct ieee80211
-
- if (changed & IEEE80211_CONF_CHANGE_POWER) {
- sc->config.txpowlimit = 2 * conf->power_level;
-+ ath9k_ps_wakeup(sc);
- ath_update_txpow(sc);
-+ ath9k_ps_restore(sc);
- }
-
- if (disable_radio) {
diff --git a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
index 8fa92bf84b..7d620e41a2 100644
--- a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
-@@ -4482,6 +4482,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -4484,6 +4484,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {