AA: mac80211: merge ath9k fixes from bb
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 300-pending_work.patch
index 0c0846df8e159fea44dfe396ffe3dac5b9c84675..fc1ff107445c7eff4fc6e73ec9074b28c5356249 100644 (file)
---- a/drivers/net/wireless/ath/ath.h
-+++ b/drivers/net/wireless/ath/ath.h
-@@ -71,9 +71,7 @@ struct ath_regulatory {
-       char alpha2[2];
-       u16 country_code;
-       u16 max_power_level;
--      u32 tp_scale;
-       u16 current_rd;
--      u16 current_rd_ext;
-       int16_t power_limit;
-       struct reg_dmn_pair_mapping *regpair;
- };
---- a/drivers/net/wireless/ath/ath9k/Makefile
-+++ b/drivers/net/wireless/ath/ath9k/Makefile
-@@ -21,6 +21,7 @@ ath9k_hw-y:= \
-               ar5008_phy.o \
-               ar9002_calib.o \
-               ar9003_calib.o \
-+              ar9003_rtt.o \
-               calib.o \
-               eeprom.o \
-               eeprom_def.o \
---- a/drivers/net/wireless/ath/ath9k/ani.c
-+++ b/drivers/net/wireless/ath/ath9k/ani.c
-@@ -504,9 +504,6 @@ static void ath9k_ani_reset_old(struct a
-               ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
-                                    ATH9K_ANI_CCK_WEAK_SIG_THR);
--              ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) |
--                                   ATH9K_RX_FILTER_PHYERR);
--
-               ath9k_ani_restart(ah);
-               return;
-       }
-@@ -527,8 +524,6 @@ static void ath9k_ani_reset_old(struct a
-               ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL,
-                                    aniState->firstepLevel);
--      ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) &
--                           ~ATH9K_RX_FILTER_PHYERR);
-       ath9k_ani_restart(ah);
-       ENABLE_REGWRITE_BUFFER(ah);
---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -763,10 +763,8 @@ static void ar5008_hw_set_channel_regs(s
- static int ar5008_hw_process_ini(struct ath_hw *ah,
-                                struct ath9k_channel *chan)
+commit 11f17631d9bf2a9e910dac7d09ba4581f5693831
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Tue Sep 9 09:48:30 2014 +0200
+
+    ath9k_hw: fix PLL clock initialization for newer SoC
+    
+    On AR934x and newer SoC devices, the layout of the AR_RTC_PLL_CONTROL
+    register changed. This currently breaks at least 5/10 MHz operation.
+    AR933x uses the old layout.
+    
+    It might also have been causing other stability issues because of the
+    different location of the PLL_BYPASS bit which needs to be set during
+    PLL clock initialization.
+    
+    This patch also removes more instances of hardcoded register values in
+    favor of properly computed ones with the PLL_BYPASS bit added.
+    
+    Reported-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 0fecedddd4a0945873db1bd230ec6a168b3cc4fe
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Mon Sep 8 18:35:08 2014 +0200
+
+    ath9k_hw: reduce ANI spur immunity setting on HT40 extension channel
+    
+    The cycpwr_thr1 value needs to be lower on the extension channel than on
+    the control channel, similar to how the register settings are programmed
+    in the initvals.
+    
+    Also drop the unnecessary check for HT40 - this register can always be
+    written. This patch has been reported to improve HT40 stability and
+    throughput in some environments.
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 30d7434ccb853b96de698a040888fa4dacd0cc19
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Mon Sep 8 18:31:26 2014 +0200
+
+    Revert "ath9k_hw: reduce ANI firstep range for older chips"
+    
+    This reverts commit 09efc56345be4146ab9fc87a55c837ed5d6ea1ab
+    
+    I've received reports that this change is decreasing throughput in some
+    rare conditions on an AR9280 based device
+    
+    Cc: stable@vger.kernel.org
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 15ed54948f508ad1baad79c30050e2d29a21696d
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Fri Jul 25 16:18:03 2014 +0200
+
+    mac80211: fix smps mode check for AP_VLAN
+    
+    In ieee80211_sta_ps_deliver_wakeup, sdata->smps_mode is checked. This is
+    initialized only for the base AP interface, not the individual VLANs.
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit bc74ad816bba291359ae46301173ea744bdda9d2
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Fri Jul 25 16:15:44 2014 +0200
+
+    mac80211: ignore AP_VLAN in ieee80211_recalc_chanctx_chantype
+    
+    When bringing down the AP, a WARN_ON is hit because the bss config chandef
+    is empty here.
+    Since AP_VLAN channel settings do not matter for anything chanctx related
+    (always inherits the settings from the AP interface), let's just ignore
+    it here.
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit ff354dbdd743e5fe186df8cd17982db19f78231a
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Wed Jul 23 15:33:26 2014 +0200
+
+    ath9k: fix aggregation session lockup
+    
+    If an aggregation session fails, frames still end up in the driver queue
+    with IEEE80211_TX_CTL_AMPDU set.
+    This causes tx for the affected station/tid to stall, since
+    ath_tx_get_tid_subframe returning packets to send.
+    
+    Fix this by clearing IEEE80211_TX_CTL_AMPDU as long as no aggregation
+    session is running.
+    
+    Cc: stable@vger.kernel.org
+    Reported-by: Antonio Quartulli <antonio@open-mesh.com>
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 38695a6e5a940e6a524523b88a33916b016fb2a1
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Fri Jul 11 12:06:18 2014 +0200
+
+    mac80211: fix crash on getting sta info with uninitialized rate control
+    
+    If the expected throughput is queried before rate control has been
+    initialized, the minstrel op for it will crash while trying to access
+    the rate table.
+    Check for WLAN_STA_RATE_CONTROL before attempting to use the rate
+    control op.
+    
+    Reported-by: Jean-Pierre Tosoni <jp.tosoni@acksys.fr>
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit c0ee7fa4c0da824ccccc172bf175fb1f86540921
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Wed Jul 16 18:00:31 2014 +0200
+
+    ath9k: fix pending tx frames accounting
+    
+    Packets originally buffered for the regular hardware tx queues can end
+    up being transmitted through the U-APSD queue (via PS-Poll or U-APSD).
+    When packets are dropped due to retransmit failures, the pending frames
+    counter is not always updated properly.
+    Fix this by keeping track of the queue that a frame was accounted for in
+    the ath_frame_info struct, and using that on completion to decide
+    whether the counter should be updated.
+    This fixes some spurious transmit queue hangs.
+    
+    Cc: stable@vger.kernel.org
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit edcdf0989410a05a6a4b8438df4010447eaa7d9a
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Sun Jun 22 13:36:20 2014 +0200
+
+    Revert "cfg80211: Use 5MHz bandwidth by default when checking usable channels"
+    
+    It enables channels that are not supposed to be enabled according to the
+    regulatory rules.
+    
+    This reverts commit 8eca1fb692cc9557f386eddce75c300a3855d11a.
+
+commit 6e7341074823d2a45b81f2742cbf75f1da790031
+Author: Rafał Miłecki <zajec5@gmail.com>
+Date:   Sat May 31 19:40:45 2014 +0200
+
+    b43: disable 5 GHz on G-PHY
+    
+    This fixes regression introduced by adding some G-PHY devices to the
+    list of dual band devices. There is simply no support for 5 GHz on
+    G-PHY devices in b43. It results in:
+    WARNING: CPU: 0 PID: 79 at drivers/net/wireless/b43/phy_g.c:75 b43_gphy_channel_switch+0x125/0x130 [b43]()
+    b43-phy1 ERROR: PHY init: Channel switch to default failed
+    
+    Regression was introduced by the following commit:
+    
+    commit 773cfc508f4d64c14547ff8751b5cbd473124364
+    Author: Rafał Miłecki <zajec5@gmail.com>
+    Date:   Mon May 19 23:18:55 2014 +0200
+    
+        b43: add more devices to the bands database
+    
+    Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+    Signed-off-by: John W. Linville <linville@tuxdriver.com>
+
+commit 1186edbef91f15722e5bdf56326ce0abc2935ce7
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Tue Jun 10 12:51:06 2014 +0200
+
+    rt2x00: disable TKIP on USB
+    
+    On USB we can not get atomically TKIP key. We have to disable support
+    for TKIP acceleration on USB hardware to avoid bug as showed bellow.
+    
+    [  860.827243] BUG: scheduling while atomic: hostapd/3397/0x00000002
+    <snip>
+    [  860.827280] Call Trace:
+    [  860.827282]  [<ffffffff81682ea6>] dump_stack+0x4d/0x66
+    [  860.827284]  [<ffffffff8167eb9b>] __schedule_bug+0x47/0x55
+    [  860.827285]  [<ffffffff81685bb3>] __schedule+0x733/0x7b0
+    [  860.827287]  [<ffffffff81685c59>] schedule+0x29/0x70
+    [  860.827289]  [<ffffffff81684f8a>] schedule_timeout+0x15a/0x2b0
+    [  860.827291]  [<ffffffff8105ac50>] ? ftrace_raw_event_tick_stop+0xc0/0xc0
+    [  860.827294]  [<ffffffff810c13c2>] ? __module_text_address+0x12/0x70
+    [  860.827296]  [<ffffffff81686823>] wait_for_completion_timeout+0xb3/0x140
+    [  860.827298]  [<ffffffff81080fc0>] ? wake_up_state+0x20/0x20
+    [  860.827301]  [<ffffffff814d5b3d>] usb_start_wait_urb+0x7d/0x150
+    [  860.827303]  [<ffffffff814d5cd5>] usb_control_msg+0xc5/0x110
+    [  860.827305]  [<ffffffffa02fb0c6>] rt2x00usb_vendor_request+0xc6/0x160  [rt2x00usb]
+    [  860.827307]  [<ffffffffa02fb215>] rt2x00usb_vendor_req_buff_lock+0x75/0x150 [rt2x00usb]
+    [  860.827309]  [<ffffffffa02fb393>] rt2x00usb_vendor_request_buff+0xa3/0xe0 [rt2x00usb]
+    [  860.827311]  [<ffffffffa023d1a3>] rt2x00usb_register_multiread+0x33/0x40 [rt2800usb]
+    [  860.827314]  [<ffffffffa05805f9>] rt2800_get_tkip_seq+0x39/0x50  [rt2800lib]
+    [  860.827321]  [<ffffffffa0480f88>] ieee80211_get_key+0x218/0x2a0  [mac80211]
+    [  860.827322]  [<ffffffff815cc68c>] ? __nlmsg_put+0x6c/0x80
+    [  860.827329]  [<ffffffffa051b02e>] nl80211_get_key+0x22e/0x360 [cfg80211]
+    
+    Cc: stable@vger.kernel.org
+    Reported-and-tested-by: Peter Wu <lekensteyn@gmail.com>
+    Reported-and-tested-by: Pontus Fuchs <pontus.fuchs@gmail.com>
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+    Signed-off-by: John W. Linville <linville@tuxdriver.com>
+
+commit 5f313a15da92dda80ac4c9a137bc42d7d0b49adf
+Author: Rafał Miłecki <zajec5@gmail.com>
+Date:   Thu Jun 12 09:28:38 2014 +0200
+
+    b43: fix frequency reported on G-PHY with /new/ firmware
+
+commit d3a58df87a2e4c2301ac843604202d290a48440b
+Author: Avraham Stern <avraham.stern@intel.com>
+Date:   Thu May 22 12:17:47 2014 +0300
+
+    mac80211: set new interfaces as idle upon init
+    
+    Mark new interfaces as idle to allow operations that require that
+    interfaces are idle to take place. Interface types that are always
+    not idle (like AP interfaces) will be set as not idle when they are
+    assigned a channel context.
+    
+    Signed-off-by: Avraham Stern <avraham.stern@intel.com>
+    Signed-off-by: Emmanuel Grumbach<emmanuel.grumbach@intel.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 923eaf367206e01f22c97aee22300e332d071916
+Author: Arik Nemtsov <arik@wizery.com>
+Date:   Mon May 26 14:40:51 2014 +0300
+
+    mac80211: don't check netdev state for debugfs read/write
+    
+    Doing so will lead to an oops for a p2p-dev interface, since it has
+    no netdev.
+    
+    Cc: stable@vger.kernel.org
+    Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
+    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit a9fb54169b197f31aff24c8d6270dd1e56cde395
+Author: chaitanya.mgit@gmail.com <chaitanya.mgit@gmail.com>
+Date:   Mon May 26 18:01:44 2014 +0530
+
+    regdb: Generalize the mW to dBm power conversion
+    
+    Generalize the power conversion from mW to dBm
+    using log. This should fix the below compilation
+    error for country NO which adds a new power value
+    2000mW which is not handled earlier.
+    
+     CC [M]  net/wireless/wext-sme.o
+     CC [M]  net/wireless/regdb.o
+    net/wireless/regdb.c:1130:1: error: Unknown undeclared here (not in
+    a function)
+    net/wireless/regdb.c:1130:9: error: expected } before power
+    make[2]: *** [net/wireless/regdb.o] Error 1
+    make[1]: *** [net/wireless] Error 2
+    make: *** [net] Error 2
+    
+    Reported-By:  John Walker <john@x109.net>
+    Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
+    Acked-by: John W. Linville <linville@tuxdriver.com>
+    [remove unneeded parentheses, fix rounding by using %.0f]
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit c7d37a66e345df2fdf1aa7b2c9a6d3d53846ca5b
+Author: Krzysztof Hałasa <khalasa@piap.pl>
+Date:   Mon May 26 14:14:46 2014 +0200
+
+    mac80211: fix IBSS join by initializing last_scan_completed
+    
+    Without this fix, freshly rebooted Linux creates a new IBSS
+    instead of joining an existing one. Only when jiffies counter
+    overflows after 5 minutes the IBSS can be successfully joined.
+    
+    Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
+    [edit commit message slightly]
+    Cc: stable@vger.kernel.org
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 34171dc0d623be2c1032416bf7d3819f388ed70d
+Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Date:   Sun May 25 15:35:41 2014 +0300
+
+    mac80211: fix virtual monitor interface addition
+    
+    Since the commit below, cfg80211_chandef_dfs_required()
+    will warn if it gets a an NL80211_IFTYPE_UNSPECIFIED iftype
+    as explicitely written in the commit log.
+    When an virtual monitor interface is added, its type is set
+    in ieee80211_sub_if_data.vif.type, but not in
+    ieee80211_sub_if_data.wdev.iftype which is passed to
+    cfg80211_chandef_dfs_required() hence resulting in the
+    following warning:
+    
+    WARNING: CPU: 1 PID: 21265 at net/wireless/chan.c:376 cfg80211_chandef_dfs_required+0xbc/0x130 [cfg80211]()
+    Modules linked in: [...]
+    CPU: 1 PID: 21265 Comm: ifconfig Tainted: G        W  O 3.13.11+ #12
+    Hardware name: Dell Inc. Latitude E6410/0667CC, BIOS A01 03/05/2010
+     0000000000000009 ffff88008f5fdb08 ffffffff817d4219 ffff88008f5fdb50
+     ffff88008f5fdb40 ffffffff8106f57d 0000000000000000 0000000000000000
+     ffff880081062fb8 ffff8800810604e0 0000000000000001 ffff88008f5fdba0
+    Call Trace:
+     [<ffffffff817d4219>] dump_stack+0x4d/0x66
+     [<ffffffff8106f57d>] warn_slowpath_common+0x7d/0xa0
+     [<ffffffff8106f5ec>] warn_slowpath_fmt+0x4c/0x50
+     [<ffffffffa04ea4ec>] cfg80211_chandef_dfs_required+0xbc/0x130 [cfg80211]
+     [<ffffffffa06b1024>] ieee80211_vif_use_channel+0x94/0x500 [mac80211]
+     [<ffffffffa0684e6b>] ieee80211_add_virtual_monitor+0x1ab/0x5c0 [mac80211]
+     [<ffffffffa0686ae5>] ieee80211_do_open+0xe75/0x1580 [mac80211]
+     [<ffffffffa0687259>] ieee80211_open+0x69/0x70 [mac80211]
+    [snip]
+    
+    Fixes: 00ec75fc5a64 ("cfg80211: pass the actual iftype when calling cfg80211_chandef_dfs_required()")
+    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+    Acked-by: Luciano Coelho <luciano.coelho@intel.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit d93cc72b37b4e2c314e1c499e80e8801907c2fea
+Author: Michal Kazior <michal.kazior@tieto.com>
+Date:   Thu Jun 5 14:21:37 2014 +0200
+
+    mac80211: use csa counter offsets instead of csa_active
+    
+    vif->csa_active is protected by mutexes only. This
+    means it is unreliable to depend on it on codeflow
+    in non-sleepable beacon and CSA code. There was no
+    guarantee to have vif->csa_active update be
+    visible before beacons are updated on SMP systems.
+    
+    Using csa counter offsets which are embedded in
+    beacon struct (and thus are protected with single
+    RCU assignment) is much safer.
+    
+    Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit d2746694fcdef24e0a7a1947d8c70082cde81a26
+Author: Michal Kazior <michal.kazior@tieto.com>
+Date:   Thu Jun 5 14:21:36 2014 +0200
+
+    mac80211: move csa counters from sdata to beacon/presp
+    
+    Having csa counters part of beacon and probe_resp
+    structures makes it easier to get rid of possible
+    races between setting a beacon and updating
+    counters on SMP systems by guaranteeing counters
+    are always consistent against given beacon struct.
+    
+    While at it relax WARN_ON into WARN_ON_ONCE to
+    prevent spamming logs and racing.
+    
+    Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 5dcb54f3a1a8cd7e0331e773487574f9743615db
+Author: Janusz Dziedzic <janusz.dziedzic@tieto.com>
+Date:   Thu Jun 5 08:12:57 2014 +0200
+
+    mac80211: allow tx via monitor iface when DFS
+    
+    Allow send frames using monitor interface
+    when DFS chandef and we pass CAC (beaconing
+    allowed).
+    
+    This fix problem when old kernel and new backports used,
+    in such case hostapd create/use also monitor interface.
+    Before this patch all frames hostapd send using monitor
+    iface were dropped when AP was configured on DFS channel.
+    
+    Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 6f09a1beb0d2007572248c986780562219bd206f
+Author: Johannes Berg <johannes.berg@intel.com>
+Date:   Wed Jun 4 17:31:56 2014 +0200
+
+    cfg80211: make ethtool the driver's responsibility
+    
+    Currently, cfg80211 tries to implement ethtool, but that doesn't
+    really scale well, with all the different operations. Make the
+    lower-level driver responsible for it, which currently only has
+    an effect on mac80211. It will similarly not scale well at that
+    level though, since mac80211 also has many drivers.
+    
+    To cleanly implement this in mac80211, introduce a new file and
+    move some code to appropriate places.
+    
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 6b0c6f133de8f90caeb1c4a902e6140567c5bf96
+Author: Johannes Berg <johannes.berg@intel.com>
+Date:   Wed Jun 4 17:06:23 2014 +0200
+
+    mac80211: remove weak WEP IV accounting
+    
+    Since WEP is practically dead, there seems very little
+    point in keeping WEP weak IV accounting.
+    
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit aecdc89fb4664c76baa4bbd46008f220532309ff
+Author: Luciano Coelho <luciano.coelho@intel.com>
+Date:   Fri May 23 11:04:50 2014 +0300
+
+    ath9k/ath10k: remove unnecessary channel_switch_beacon callbacks
+    
+    The channel_switch_beacon callback is optional, so it doesn't have to
+    be defined if it's not going to do anything useful with it.  Both
+    ath9k and ath10k define the callback and just returns.  This commit
+    removes them.
+    
+    Cc: Michal Kazior <michal.kazior@tieto.com>
+    Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
+    Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
+
+commit 60ccc107c9b9fb732fdee1f76bb2dad44f0e1798
+Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
+Date:   Tue May 27 16:58:02 2014 +0530
+
+    ath9k: Fix deadlock while updating p2p beacon timer
+    
+    pm_lock is taken twice while syncing HW TSF of p2p vif.
+    Fix this by taking the lock at caller side.
+    
+    Cc: Felix Fietkau <nbd@openwrt.org>
+    Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
+    Signed-off-by: John W. Linville <linville@tuxdriver.com>
+
+commit f3831a4e3903dbc1a57d5df56deb6a143fd001bc
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Thu Jun 5 13:52:27 2014 +0200
+
+    rt2x00: do not initialize BCN_OFFSET registers
+    
+    We setup BCN_OFFSET{0,1} registers dynamically, don't have to
+    initialize them.
+    
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit e5c58ca7a48d4c82f282749a978052c47fd95998
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Thu Jun 5 13:52:26 2014 +0200
+
+    rt2x00: change order when stop beaconing
+    
+    When no beaconing is needed, first stop beacon queue (disable beaconing
+    globally) to avoid possible sending of not prepared beacon on short
+    period after clearing beacon and before stop of BCN queue.
+    
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 382c1b9e03f52d0cd741ef1d942cad0f649f0744
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Thu Jun 5 13:52:25 2014 +0200
+
+    rt2x00: change default MAC_BSSID_DW1_BSS_BCN_NUM
+    
+    We setup MAC_BSSID_DW1_BSS_BCN_NUM dynamically when numbers of active
+    beacons increase. Change default to 0 to tell hardware that we want to
+    send only one beacon as default.
+    
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 3b400571dd033e46fa7e76c5bb92a3ce8198afa9
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Thu Jun 5 13:52:24 2014 +0200
+
+    rt2x00: change beaconing setup on RT2800
+    
+    As reported by Matthias, on 5572 chip, even if we clear up TXWI
+    of corresponding beacon, hardware still try to send it or do other
+    action that increase power consumption peak up to 1A.
+    
+    To avoid the issue, setup beaconing dynamically by configuring offsets
+    of currently active beacons and MAC_BSSID_DW1_BSS_BCN_NUM variable,
+    which limit number of beacons that hardware will try to send.
+    
+    Reported-by: Matthias Fend <Matthias.Fend@wolfvision.net>
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 916e591b2cc41f7e572992175ca56d866d7bc958
+Author: Stanislaw Gruszka <sgruszka@redhat.com>
+Date:   Thu Jun 5 13:52:23 2014 +0200
+
+    rt2x00: change beaconing locking
+    
+    This patch is needed for further changes to keep global variables
+    consistent when changing beaconing on diffrent vif's.
+    
+    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 930b0dffd1731f3f418f9132faea720a23b7af61
+Author: Johannes Berg <johannes.berg@intel.com>
+Date:   Tue Jun 3 11:18:47 2014 +0200
+
+    mac80211: fix station/driver powersave race
+    
+    It is currently possible to have a race due to the station PS
+    unblock work like this:
+     * station goes to sleep with frames buffered in the driver
+     * driver blocks wakeup
+     * station wakes up again
+     * driver flushes/returns frames, and unblocks, which schedules
+       the unblock work
+     * unblock work starts to run, and checks that the station is
+       awake (i.e. that the WLAN_STA_PS_STA flag isn't set)
+     * we process a received frame with PM=1, setting the flag again
+     * ieee80211_sta_ps_deliver_wakeup() runs, delivering all frames
+       to the driver, and then clearing the WLAN_STA_PS_DRIVER and
+       WLAN_STA_PS_STA flags
+    
+    In this scenario, mac80211 will think that the station is awake,
+    while it really is asleep, and any TX'ed frames should be filtered
+    by the device (it will know that the station is sleeping) but then
+    passed to mac80211 again, which will not buffer it either as it
+    thinks the station is awake, and eventually the packets will be
+    dropped.
+    
+    Fix this by moving the clearing of the flags to exactly where we
+    learn about the situation. This creates a problem of reordering,
+    so introduce another flag indicating that delivery is being done,
+    this new flag also queues frames and is cleared only while the
+    spinlock is held (which the queuing code also holds) so that any
+    concurrent delivery/TX is handled correctly.
+    
+    Reported-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
+    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+
+commit 6df35206bc6c1c6aad1d8077df5786b4a7f77873
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Fri May 23 19:58:14 2014 +0200
+
+    mac80211: reduce packet loss notifications under load
+    
+    During strong signal fluctuations under high throughput, few consecutive
+    failed A-MPDU transmissions can easily trigger packet loss notification,
+    and thus (in AP mode) client disconnection.
+    
+    Reduce the number of false positives by checking the A-MPDU status flag
+    and treating a failed A-MPDU as a single packet.
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 7b7843a36fbcc568834404c7430ff895d8502131
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Fri May 23 19:26:32 2014 +0200
+
+    mac80211: fix a memory leak on sta rate selection table
+    
+    Cc: stable@vger.kernel.org
+    Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+commit 96892d6aa0a153423070addf3070bc79578b3897
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Mon May 19 21:20:49 2014 +0200
+
+    ath9k: avoid passing buffers to the hardware during flush
+    
+    The commit "ath9k: fix possible hang on flush" changed the receive code
+    to always link rx descriptors of processed frames, even when flushing.
+    In some cases, this leads to flushed rx buffers being passed to the
+    hardware while rx is already stopped.
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+--- a/drivers/net/wireless/ath/ath9k/recv.c
++++ b/drivers/net/wireless/ath/ath9k/recv.c
+@@ -34,7 +34,8 @@ static inline bool ath9k_check_auto_slee
+  * buffer (or rx fifo). This can incorrectly acknowledge packets
+  * to a sender if last desc is self-linked.
+  */
+-static void ath_rx_buf_link(struct ath_softc *sc, struct ath_rxbuf *bf)
++static void ath_rx_buf_link(struct ath_softc *sc, struct ath_rxbuf *bf,
++                          bool flush)
  {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
+       struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
-       int i, regWrites = 0;
--      struct ieee80211_channel *channel = chan->chan;
-       u32 modesIndex, freqIndex;
-       switch (chan->chanmode) {
-@@ -903,14 +901,7 @@ static int ar5008_hw_process_ini(struct 
-       ar5008_hw_set_channel_regs(ah, chan);
-       ar5008_hw_init_chain_masks(ah);
-       ath9k_olc_init(ah);
--
--      /* Set TX power */
--      ah->eep_ops->set_txpower(ah, chan,
--                               ath9k_regd_get_ctl(regulatory, chan),
--                               channel->max_antenna_gain * 2,
--                               channel->max_power * 2,
--                               min((u32) MAX_RATE_POWER,
--                               (u32) regulatory->power_limit), false);
-+      ath9k_hw_apply_txpower(ah, chan);
-       /* Write analog registers */
-       if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
---- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
-@@ -24,11 +24,11 @@ static const u32 ar9300_2p2_radio_postam
-       {0x0001609c, 0x0dd08f29, 0x0dd08f29, 0x0b283f31, 0x0b283f31},
-       {0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
-       {0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
--      {0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0001610c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
-       {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
--      {0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0001650c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
-       {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
--      {0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0001690c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
-       {0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
- };
-@@ -190,7 +190,7 @@ static const u32 ar9300_2p2_radio_core[]
-       {0x00016288, 0x05a20408},
-       {0x0001628c, 0x00038c07},
-       {0x00016290, 0x00000004},
--      {0x00016294, 0x458aa14f},
-+      {0x00016294, 0x458a214f},
-       {0x00016380, 0x00000000},
-       {0x00016384, 0x00000000},
-       {0x00016388, 0x00800700},
-@@ -835,107 +835,107 @@ static const u32 ar9300_2p2_baseband_cor
- static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
-       /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
-       {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-       {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-       {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-       {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
-       {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
-       {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
--      {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
--      {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
--      {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
--      {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
--      {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
--      {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
--      {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
--      {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
--      {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
--      {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
--      {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
--      {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
--      {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
--      {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
--      {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84},
--      {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3},
--      {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5},
--      {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9},
--      {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb},
--      {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
--      {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
-+      {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400},
-+      {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
-+      {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
-+      {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
-+      {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
-+      {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
-+      {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
-+      {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22},
-+      {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
-+      {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
-+      {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
-+      {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
-+      {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
-+      {0x0000a54c, 0x5a08442e, 0x5a08442e, 0x47001a83, 0x47001a83},
-+      {0x0000a550, 0x5e0a4431, 0x5e0a4431, 0x4a001c84, 0x4a001c84},
-+      {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
-+      {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
-+      {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
-+      {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
-+      {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-+      {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-       {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
-       {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
-       {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
-       {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
--      {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
--      {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400},
--      {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402},
--      {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404},
--      {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603},
--      {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02},
--      {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04},
--      {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20},
--      {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20},
--      {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22},
--      {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24},
--      {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640},
--      {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660},
--      {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861},
--      {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81},
--      {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83},
--      {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84},
--      {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3},
--      {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5},
--      {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9},
--      {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb},
--      {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
--      {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
-+      {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202},
-+      {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400},
-+      {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402},
-+      {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404},
-+      {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603},
-+      {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02},
-+      {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04},
-+      {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20},
-+      {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20},
-+      {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22},
-+      {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24},
-+      {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640},
-+      {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660},
-+      {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861},
-+      {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81},
-+      {0x0000a5cc, 0x5a88442e, 0x5a88442e, 0x47801a83, 0x47801a83},
-+      {0x0000a5d0, 0x5e8a4431, 0x5e8a4431, 0x4a801c84, 0x4a801c84},
-+      {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3},
-+      {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5},
-+      {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9},
-+      {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb},
-+      {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-+      {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
-       {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-       {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000},
--      {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501},
--      {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
--      {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
--      {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
--      {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
-       {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
--      {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
--      {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
-+      {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
-+      {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
-       {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-       {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
--      {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
-+      {0x00016048, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
-       {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
-       {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
--      {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
-+      {0x00016448, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
-       {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
-       {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
--      {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
-+      {0x00016848, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
-       {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
- };
+@@ -59,18 +60,19 @@ static void ath_rx_buf_link(struct ath_s
+                            common->rx_bufsize,
+                            0);
  
---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-@@ -17,8 +17,9 @@
- #include "hw.h"
- #include "hw-ops.h"
- #include "ar9003_phy.h"
-+#include "ar9003_rtt.h"
--#define MAX_MEASUREMENT       8
-+#define MAX_MEASUREMENT       MAX_IQCAL_MEASUREMENT
- #define MAX_MAG_DELTA 11
- #define MAX_PHS_DELTA 10
-@@ -659,10 +660,12 @@ static void ar9003_hw_detect_outlier(int
- static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
-                                                u8 num_chains,
--                                               struct coeff *coeff)
-+                                               struct coeff *coeff,
-+                                               bool is_reusable)
- {
-       int i, im, nmeasurement;
-       u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS];
-+      struct ath9k_hw_cal_data *caldata = ah->caldata;
-       memset(tx_corr_coeff, 0, sizeof(tx_corr_coeff));
-       for (i = 0; i < MAX_MEASUREMENT / 2; i++) {
-@@ -712,7 +715,13 @@ static void ar9003_hw_tx_iqcal_load_avg_
-                               REG_RMW_FIELD(ah, tx_corr_coeff[im][i],
-                                       AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,
-                                       coeff->iqc_coeff[0]);
-+
-+                      if (caldata)
-+                              caldata->tx_corr_coeff[im][i] =
-+                                      coeff->iqc_coeff[0];
-               }
-+              if (caldata)
-+                      caldata->num_measures[i] = nmeasurement;
-       }
-       REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
-@@ -720,8 +729,10 @@ static void ar9003_hw_tx_iqcal_load_avg_
-       REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
-                     AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x1);
--      return;
-+      if (caldata)
-+              caldata->done_txiqcal_once = is_reusable;
-+      return;
- }
+-      if (sc->rx.rxlink == NULL)
+-              ath9k_hw_putrxbuf(ah, bf->bf_daddr);
+-      else
++      if (sc->rx.rxlink)
+               *sc->rx.rxlink = bf->bf_daddr;
++      else if (!flush)
++              ath9k_hw_putrxbuf(ah, bf->bf_daddr);
  
- static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
-@@ -748,7 +759,7 @@ static bool ar9003_hw_tx_iq_cal_run(stru
-       return true;
+       sc->rx.rxlink = &ds->ds_link;
  }
  
--static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah)
-+static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah, bool is_reusable)
+-static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_rxbuf *bf)
++static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_rxbuf *bf,
++                            bool flush)
  {
-       struct ath_common *common = ath9k_hw_common(ah);
-       const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
-@@ -837,7 +848,8 @@ static void ar9003_hw_tx_iq_cal_post_pro
-                               coeff.phs_coeff[i][im] -= 128;
-               }
-       }
--      ar9003_hw_tx_iqcal_load_avg_2_passes(ah, num_chains, &coeff);
-+      ar9003_hw_tx_iqcal_load_avg_2_passes(ah, num_chains,
-+                                           &coeff, is_reusable);
-       return;
+       if (sc->rx.buf_hold)
+-              ath_rx_buf_link(sc, sc->rx.buf_hold);
++              ath_rx_buf_link(sc, sc->rx.buf_hold, flush);
  
-@@ -845,11 +857,128 @@ tx_iqcal_fail:
-       ath_dbg(common, ATH_DBG_CALIBRATE, "Tx IQ Cal failed\n");
-       return;
+       sc->rx.buf_hold = bf;
  }
-+
-+static void ar9003_hw_tx_iq_cal_reload(struct ath_hw *ah)
-+{
-+      struct ath9k_hw_cal_data *caldata = ah->caldata;
-+      u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS];
-+      int i, im;
-+
-+      memset(tx_corr_coeff, 0, sizeof(tx_corr_coeff));
-+      for (i = 0; i < MAX_MEASUREMENT / 2; i++) {
-+              tx_corr_coeff[i * 2][0] = tx_corr_coeff[(i * 2) + 1][0] =
-+                                      AR_PHY_TX_IQCAL_CORR_COEFF_B0(i);
-+              if (!AR_SREV_9485(ah)) {
-+                      tx_corr_coeff[i * 2][1] =
-+                      tx_corr_coeff[(i * 2) + 1][1] =
-+                                      AR_PHY_TX_IQCAL_CORR_COEFF_B1(i);
-+
-+                      tx_corr_coeff[i * 2][2] =
-+                      tx_corr_coeff[(i * 2) + 1][2] =
-+                                      AR_PHY_TX_IQCAL_CORR_COEFF_B2(i);
-+              }
-+      }
-+
-+      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+              if (!(ah->txchainmask & (1 << i)))
-+                      continue;
-+
-+              for (im = 0; im < caldata->num_measures[i]; im++) {
-+                      if ((im % 2) == 0)
-+                              REG_RMW_FIELD(ah, tx_corr_coeff[im][i],
-+                                   AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE,
-+                                   caldata->tx_corr_coeff[im][i]);
-+                      else
-+                              REG_RMW_FIELD(ah, tx_corr_coeff[im][i],
-+                                   AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,
-+                                   caldata->tx_corr_coeff[im][i]);
-+              }
-+      }
-+
-+      REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
-+                    AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x1);
-+      REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
-+                    AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x1);
-+}
-+
-+static bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan)
-+{
-+      struct ath9k_rtt_hist *hist = &ah->caldata->rtt_hist;
-+      u32 *table;
-+      int i;
-+      bool restore;
-+
-+      if (!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT))
-+              return false;
-+
-+      ar9003_hw_rtt_enable(ah);
-+      ar9003_hw_rtt_set_mask(ah, 0x10);
-+      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+              if (!(ah->rxchainmask & (1 << i)))
-+                      continue;
-+              table = &hist->table[i][hist->num_readings][0];
-+              ar9003_hw_rtt_load_hist(ah, i, table);
-+      }
-+      restore = ar9003_hw_rtt_force_restore(ah);
-+      ar9003_hw_rtt_disable(ah);
-+
-+      return restore;
-+}
-+
- static bool ar9003_hw_init_cal(struct ath_hw *ah,
-                              struct ath9k_channel *chan)
- {
-       struct ath_common *common = ath9k_hw_common(ah);
--      bool txiqcal_done = false;
-+      struct ath9k_hw_cal_data *caldata = ah->caldata;
-+      bool txiqcal_done = false, txclcal_done = false;
-+      bool is_reusable = true, status = true;
-+      bool run_rtt_cal = false, run_agc_cal;
-+      bool rtt = !!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT);
-+      u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
-+                                        AR_PHY_AGC_CONTROL_FLTR_CAL   |
-+                                        AR_PHY_AGC_CONTROL_PKDET_CAL;
-+      int i, j;
-+      u32 cl_idx[AR9300_MAX_CHAINS] = { AR_PHY_CL_TAB_0,
-+                                        AR_PHY_CL_TAB_1,
-+                                        AR_PHY_CL_TAB_2 };
-+
-+      if (rtt) {
-+              if (!ar9003_hw_rtt_restore(ah, chan))
-+                      run_rtt_cal = true;
-+
-+              ath_dbg(common, ATH_DBG_CALIBRATE, "RTT restore %s\n",
-+                      run_rtt_cal ? "failed" : "succeed");
-+      }
-+      run_agc_cal = run_rtt_cal;
-+
-+      if (run_rtt_cal) {
-+              ar9003_hw_rtt_enable(ah);
-+              ar9003_hw_rtt_set_mask(ah, 0x00);
-+              ar9003_hw_rtt_clear_hist(ah);
-+      }
-+
-+      if (rtt && !run_rtt_cal) {
-+              agc_ctrl = REG_READ(ah, AR_PHY_AGC_CONTROL);
-+              agc_supp_cals &= agc_ctrl;
-+              agc_ctrl &= ~(AR_PHY_AGC_CONTROL_OFFSET_CAL |
-+                           AR_PHY_AGC_CONTROL_FLTR_CAL |
-+                           AR_PHY_AGC_CONTROL_PKDET_CAL);
-+              REG_WRITE(ah, AR_PHY_AGC_CONTROL, agc_ctrl);
-+      }
-+
-+      if (ah->enabled_cals & TX_CL_CAL) {
-+              if (caldata && caldata->done_txclcal_once)
-+                      REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL,
-+                                  AR_PHY_CL_CAL_ENABLE);
-+              else {
-+                      REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL,
-+                                  AR_PHY_CL_CAL_ENABLE);
-+                      run_agc_cal = true;
-+              }
-+      }
-+
-+      if (!(ah->enabled_cals & TX_IQ_CAL))
-+              goto skip_tx_iqcal;
-       /* Do Tx IQ Calibration */
-       REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
-@@ -860,30 +989,96 @@ static bool ar9003_hw_init_cal(struct at
-        * For AR9485 or later chips, TxIQ cal runs as part of
-        * AGC calibration
-        */
--      if (AR_SREV_9485_OR_LATER(ah))
--              txiqcal_done = true;
--      else {
--              txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
--              REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
--              udelay(5);
--              REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
--      }
--
--      /* Calibrate the AGC */
--      REG_WRITE(ah, AR_PHY_AGC_CONTROL,
--                REG_READ(ah, AR_PHY_AGC_CONTROL) |
--                AR_PHY_AGC_CONTROL_CAL);
--
--      /* Poll for offset calibration complete */
--      if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
--                         0, AH_WAIT_TIMEOUT)) {
-+      if (ah->enabled_cals & TX_IQ_ON_AGC_CAL) {
-+              if (caldata && !caldata->done_txiqcal_once)
-+                      REG_SET_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
-+                                  AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
-+              else
-+                      REG_CLR_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
-+                                  AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
-+              txiqcal_done = run_agc_cal = true;
-+              goto skip_tx_iqcal;
-+      } else if (caldata && !caldata->done_txiqcal_once)
-+              run_agc_cal = true;
-+
-+      txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
-+      REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
-+      udelay(5);
-+      REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
-+
-+skip_tx_iqcal:
-+      if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
-+              /* Calibrate the AGC */
-+              REG_WRITE(ah, AR_PHY_AGC_CONTROL,
-+                        REG_READ(ah, AR_PHY_AGC_CONTROL) |
-+                        AR_PHY_AGC_CONTROL_CAL);
-+
-+              /* Poll for offset calibration complete */
-+              status = ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
-+                                     AR_PHY_AGC_CONTROL_CAL,
-+                                     0, AH_WAIT_TIMEOUT);
-+      }
-+      if (rtt && !run_rtt_cal) {
-+              agc_ctrl |= agc_supp_cals;
-+              REG_WRITE(ah, AR_PHY_AGC_CONTROL, agc_ctrl);
-+      }
-+
-+      if (!status) {
-+              if (run_rtt_cal)
-+                      ar9003_hw_rtt_disable(ah);
-+
-               ath_dbg(common, ATH_DBG_CALIBRATE,
--                      "offset calibration failed to complete in 1ms; noisy environment?\n");
-+                      "offset calibration failed to complete in 1ms;"
-+                      "noisy environment?\n");
-               return false;
+@@ -442,7 +444,7 @@ int ath_startrecv(struct ath_softc *sc)
+       sc->rx.buf_hold = NULL;
+       sc->rx.rxlink = NULL;
+       list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) {
+-              ath_rx_buf_link(sc, bf);
++              ath_rx_buf_link(sc, bf, false);
        }
  
-       if (txiqcal_done)
--              ar9003_hw_tx_iq_cal_post_proc(ah);
-+              ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
-+      else if (caldata && caldata->done_txiqcal_once)
-+              ar9003_hw_tx_iq_cal_reload(ah);
-+
-+#define CL_TAB_ENTRY(reg_base)        (reg_base + (4 * j))
-+      if (caldata && (ah->enabled_cals & TX_CL_CAL)) {
-+              txclcal_done = !!(REG_READ(ah, AR_PHY_AGC_CONTROL) &
-+                                         AR_PHY_AGC_CONTROL_CLC_SUCCESS);
-+              if (caldata->done_txclcal_once) {
-+                      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+                              if (!(ah->txchainmask & (1 << i)))
-+                                      continue;
-+                              for (j = 0; j < MAX_CL_TAB_ENTRY; j++)
-+                                      REG_WRITE(ah, CL_TAB_ENTRY(cl_idx[i]),
-+                                                caldata->tx_clcal[i][j]);
-+                      }
-+              } else if (is_reusable && txclcal_done) {
-+                      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+                              if (!(ah->txchainmask & (1 << i)))
-+                                      continue;
-+                              for (j = 0; j < MAX_CL_TAB_ENTRY; j++)
-+                                      caldata->tx_clcal[i][j] =
-+                                              REG_READ(ah,
-+                                                CL_TAB_ENTRY(cl_idx[i]));
-+                      }
-+                      caldata->done_txclcal_once = true;
-+              }
-+      }
-+#undef CL_TAB_ENTRY
-+
-+      if (run_rtt_cal) {
-+              struct ath9k_rtt_hist *hist = &ah->caldata->rtt_hist;
-+              if (is_reusable && (hist->num_readings < RTT_HIST_MAX)) {
-+                      u32 *table;
-+
-+                      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+                              if (!(ah->rxchainmask & (1 << i)))
-+                                      continue;
-+                              table = &hist->table[i][hist->num_readings][0];
-+                              ar9003_hw_rtt_fill_hist(ah, i, table);
-+                      }
-+              }
-+
-+              ar9003_hw_rtt_disable(ah);
-+      }
-       ath9k_hw_loadnf(ah, chan);
-       ath9k_hw_start_nfcal(ah, true);
-@@ -912,8 +1107,8 @@ static bool ar9003_hw_init_cal(struct at
-       if (ah->cal_list_curr)
-               ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
+       /* We could have deleted elements so the list may be empty now */
+@@ -1118,12 +1120,12 @@ requeue_drop_frag:
+ requeue:
+               list_add_tail(&bf->list, &sc->rx.rxbuf);
  
--      if (ah->caldata)
--              ah->caldata->CalValid = 0;
-+      if (caldata)
-+              caldata->CalValid = 0;
-       return true;
- }
---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
-@@ -2995,8 +2995,6 @@ static u32 ath9k_hw_ar9300_get_eeprom(st
-               return get_unaligned_be16(eep->macAddr + 4);
-       case EEP_REG_0:
-               return le16_to_cpu(pBase->regDmn[0]);
--      case EEP_REG_1:
--              return le16_to_cpu(pBase->regDmn[1]);
-       case EEP_OP_CAP:
-               return pBase->deviceCap;
-       case EEP_OP_MODE:
-@@ -3021,6 +3019,10 @@ static u32 ath9k_hw_ar9300_get_eeprom(st
-               return (pBase->miscConfiguration >> 0x3) & 0x1;
-       case EEP_ANT_DIV_CTL1:
-               return eep->base_ext1.ant_div_control;
-+      case EEP_ANTENNA_GAIN_5G:
-+              return eep->modalHeader5G.antennaGain;
-+      case EEP_ANTENNA_GAIN_2G:
-+              return eep->modalHeader2G.antennaGain;
-       default:
-               return 0;
-       }
-@@ -3554,7 +3556,7 @@ static void ar9003_hw_xpa_bias_level_app
-       if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah))
-               REG_RMW_FIELD(ah, AR_CH0_TOP2, AR_CH0_TOP2_XPABIASLVL, bias);
--      else if (AR_SREV_9480(ah))
-+      else if (AR_SREV_9462(ah))
-               REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias);
-       else {
-               REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias);
-@@ -3633,20 +3635,20 @@ static void ar9003_hw_ant_ctrl_apply(str
-       u32 value = ar9003_hw_ant_ctrl_common_get(ah, is2ghz);
--      if (AR_SREV_9480(ah)) {
--              if (AR_SREV_9480_10(ah)) {
-+      if (AR_SREV_9462(ah)) {
-+              if (AR_SREV_9462_10(ah)) {
-                       value &= ~AR_SWITCH_TABLE_COM_SPDT;
-                       value |= 0x00100000;
+-              if (edma) {
+-                      ath_rx_edma_buf_link(sc, qtype);
+-              } else {
+-                      ath_rx_buf_relink(sc, bf);
++              if (!edma) {
++                      ath_rx_buf_relink(sc, bf, flush);
+                       if (!flush)
+                               ath9k_hw_rxena(ah);
++              } else if (!flush) {
++                      ath_rx_edma_buf_link(sc, qtype);
                }
-               REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM,
--                              AR_SWITCH_TABLE_COM_AR9480_ALL, value);
-+                              AR_SWITCH_TABLE_COM_AR9462_ALL, value);
-       } else
-               REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM,
-                             AR_SWITCH_TABLE_COM_ALL, value);
  
+               if (!budget--)
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -100,7 +100,8 @@ static void __cleanup_single_sta(struct 
+       struct ps_data *ps;
+       if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
+-          test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
++          test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
++          test_sta_flag(sta, WLAN_STA_PS_DELIVER)) {
+               if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
+                   sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+                       ps = &sdata->bss->ps;
+@@ -111,6 +112,7 @@ static void __cleanup_single_sta(struct 
+               clear_sta_flag(sta, WLAN_STA_PS_STA);
+               clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
++              clear_sta_flag(sta, WLAN_STA_PS_DELIVER);
+               atomic_dec(&ps->num_sta_ps);
+               sta_info_recalc_tim(sta);
+@@ -125,7 +127,7 @@ static void __cleanup_single_sta(struct 
+       if (ieee80211_vif_is_mesh(&sdata->vif))
+               mesh_sta_cleanup(sta);
+-      cancel_work_sync(&sta->drv_unblock_wk);
++      cancel_work_sync(&sta->drv_deliver_wk);
  
        /*
--       *   AR9480 defines new switch table for BT/WLAN,
-+       *   AR9462 defines new switch table for BT/WLAN,
-        *       here's new field name in XXX.ref for both 2G and 5G.
-        *   Register: [GLB_CONTROL] GLB_CONTROL (@0x20044)
-        *   15:12   R/W     SWITCH_TABLE_COM_SPDT_WLAN_RX
-@@ -3658,7 +3660,7 @@ static void ar9003_hw_ant_ctrl_apply(str
-        *   7:4 R/W  SWITCH_TABLE_COM_SPDT_WLAN_IDLE
-        * SWITCH_TABLE_COM_SPDT_WLAN_IDLE
-        */
--      if (AR_SREV_9480_20_OR_LATER(ah)) {
-+      if (AR_SREV_9462_20_OR_LATER(ah)) {
-               value = ar9003_switch_com_spdt_get(ah, is2ghz);
-               REG_RMW_FIELD(ah, AR_PHY_GLB_CONTROL,
-                               AR_SWITCH_TABLE_COM_SPDT_ALL, value);
-@@ -3907,7 +3909,7 @@ static void ar9003_hw_internal_regulator
-                       REG_WRITE(ah, AR_PHY_PMU2, reg_pmu_set);
-                       if (!is_pmu_set(ah, AR_PHY_PMU2, reg_pmu_set))
-                               return;
--              } else if (AR_SREV_9480(ah)) {
-+              } else if (AR_SREV_9462(ah)) {
-                       reg_val = ath9k_hw_ar9300_get_eeprom(ah, EEP_SWREG);
-                       REG_WRITE(ah, AR_PHY_PMU1, reg_val);
-               } else {
-@@ -3938,7 +3940,7 @@ static void ar9003_hw_internal_regulator
-                       while (!REG_READ_FIELD(ah, AR_PHY_PMU2,
-                                               AR_PHY_PMU2_PGM))
-                               udelay(10);
--              } else if (AR_SREV_9480(ah))
-+              } else if (AR_SREV_9462(ah))
-                       REG_RMW_FIELD(ah, AR_PHY_PMU1, AR_PHY_PMU1_PWD, 0x1);
-               else {
-                       reg_val = REG_READ(ah, AR_RTC_SLEEP_CLK) |
-@@ -4525,7 +4527,7 @@ static int ar9003_hw_power_control_overr
-       REG_RMW_FIELD(ah, AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM, tempSlope);
--      if (AR_SREV_9480_20(ah))
-+      if (AR_SREV_9462_20(ah))
-               REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
-                             AR_PHY_TPC_19_B1_ALPHA_THERM, tempSlope);
-@@ -4764,20 +4766,14 @@ static u16 ar9003_hw_get_max_edge_power(
- static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah,
-                                              struct ath9k_channel *chan,
-                                              u8 *pPwrArray, u16 cfgCtl,
--                                             u8 twiceAntennaReduction,
--                                             u8 twiceMaxRegulatoryPower,
-+                                             u8 antenna_reduction,
-                                              u16 powerLimit)
+        * Destroy aggregation state here. It would be nice to wait for the
+@@ -227,6 +229,7 @@ struct sta_info *sta_info_get_by_idx(str
+  */
+ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
  {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       struct ath_common *common = ath9k_hw_common(ah);
-       struct ar9300_eeprom *pEepData = &ah->eeprom.ar9300_eep;
-       u16 twiceMaxEdgePower = MAX_RATE_POWER;
--      static const u16 tpScaleReductionTable[5] = {
--              0, 3, 6, 9, MAX_RATE_POWER
--      };
++      struct ieee80211_sta_rates *rates;
        int i;
--      int16_t  twiceLargestAntenna;
--      u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-+      u16 scaledPower = 0, minCtlPower;
-       static const u16 ctlModesFor11a[] = {
-               CTL_11A, CTL_5GHT20, CTL_11A_EXT, CTL_5GHT40
-       };
-@@ -4795,28 +4791,7 @@ static void ar9003_hw_set_power_per_rate
-       bool is2ghz = IS_CHAN_2GHZ(chan);
-       ath9k_hw_get_channel_centers(ah, chan, &centers);
--
--      /* Compute TxPower reduction due to Antenna Gain */
--      if (is2ghz)
--              twiceLargestAntenna = pEepData->modalHeader2G.antennaGain;
--      else
--              twiceLargestAntenna = pEepData->modalHeader5G.antennaGain;
--
--      twiceLargestAntenna = (int16_t)min((twiceAntennaReduction) -
--                              twiceLargestAntenna, 0);
--
--      /*
--       * scaledPower is the minimum of the user input power level
--       * and the regulatory allowed power level
--       */
--      maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna;
--
--      if (regulatory->tp_scale != ATH9K_TP_SCALE_MAX) {
--              maxRegAllowedPower -=
--                      (tpScaleReductionTable[(regulatory->tp_scale)] * 2);
--      }
--
--      scaledPower = min(powerLimit, maxRegAllowedPower);
-+      scaledPower = powerLimit - antenna_reduction;
  
-       /*
-        * Reduce scaled Power by number of chains active to get
-@@ -5003,7 +4978,6 @@ static inline u8 mcsidx_to_tgtpwridx(uns
- static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
-                                       struct ath9k_channel *chan, u16 cfgCtl,
-                                       u8 twiceAntennaReduction,
--                                      u8 twiceMaxRegulatoryPower,
-                                       u8 powerLimit, bool test)
- {
-       struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-@@ -5056,7 +5030,6 @@ static void ath9k_hw_ar9300_set_txpower(
-       ar9003_hw_set_power_per_rate_table(ah, chan,
-                                          targetPowerValT2, cfgCtl,
-                                          twiceAntennaReduction,
--                                         twiceMaxRegulatoryPower,
-                                          powerLimit);
-       if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) {
---- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
-@@ -22,8 +22,8 @@
- #include "ar9330_1p1_initvals.h"
- #include "ar9330_1p2_initvals.h"
- #include "ar9580_1p0_initvals.h"
--#include "ar9480_1p0_initvals.h"
--#include "ar9480_2p0_initvals.h"
-+#include "ar9462_1p0_initvals.h"
-+#include "ar9462_2p0_initvals.h"
- /* General hardware code for the AR9003 hadware family */
-@@ -35,13 +35,13 @@
- static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
- {
- #define PCIE_PLL_ON_CREQ_DIS_L1_2P0 \
--              ar9480_pciephy_pll_on_clkreq_disable_L1_2p0
-+              ar9462_pciephy_pll_on_clkreq_disable_L1_2p0
--#define AR9480_BB_CTX_COEFJ(x)        \
--              ar9480_##x##_baseband_core_txfir_coeff_japan_2484
-+#define AR9462_BB_CTX_COEFJ(x)        \
-+              ar9462_##x##_baseband_core_txfir_coeff_japan_2484
--#define AR9480_BBC_TXIFR_COEFFJ \
--              ar9480_2p0_baseband_core_txfir_coeff_japan_2484
-+#define AR9462_BBC_TXIFR_COEFFJ \
-+              ar9462_2p0_baseband_core_txfir_coeff_japan_2484
-       if (AR_SREV_9330_11(ah)) {
-               /* mac */
-               INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0);
-@@ -264,107 +264,107 @@ static void ar9003_hw_init_mode_regs(str
-                               ar9485_1_1_pcie_phy_clkreq_disable_L1,
-                               ARRAY_SIZE(ar9485_1_1_pcie_phy_clkreq_disable_L1),
-                               2);
--      } else if (AR_SREV_9480_10(ah)) {
-+      } else if (AR_SREV_9462_10(ah)) {
-               INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0);
--              INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9480_1p0_mac_core,
--                              ARRAY_SIZE(ar9480_1p0_mac_core), 2);
-+              INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9462_1p0_mac_core,
-+                              ARRAY_SIZE(ar9462_1p0_mac_core), 2);
-               INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST],
--                              ar9480_1p0_mac_postamble,
--                              ARRAY_SIZE(ar9480_1p0_mac_postamble),
-+                              ar9462_1p0_mac_postamble,
-+                              ARRAY_SIZE(ar9462_1p0_mac_postamble),
-                               5);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_PRE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE],
--                              ar9480_1p0_baseband_core,
--                              ARRAY_SIZE(ar9480_1p0_baseband_core),
-+                              ar9462_1p0_baseband_core,
-+                              ARRAY_SIZE(ar9462_1p0_baseband_core),
-                               2);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST],
--                              ar9480_1p0_baseband_postamble,
--                              ARRAY_SIZE(ar9480_1p0_baseband_postamble), 5);
-+                              ar9462_1p0_baseband_postamble,
-+                              ARRAY_SIZE(ar9462_1p0_baseband_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_PRE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE],
--                              ar9480_1p0_radio_core,
--                              ARRAY_SIZE(ar9480_1p0_radio_core), 2);
-+                              ar9462_1p0_radio_core,
-+                              ARRAY_SIZE(ar9462_1p0_radio_core), 2);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST],
--                              ar9480_1p0_radio_postamble,
--                              ARRAY_SIZE(ar9480_1p0_radio_postamble), 5);
-+                              ar9462_1p0_radio_postamble,
-+                              ARRAY_SIZE(ar9462_1p0_radio_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE],
--                              ar9480_1p0_soc_preamble,
--                              ARRAY_SIZE(ar9480_1p0_soc_preamble), 2);
-+                              ar9462_1p0_soc_preamble,
-+                              ARRAY_SIZE(ar9462_1p0_soc_preamble), 2);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_CORE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST],
--                              ar9480_1p0_soc_postamble,
--                              ARRAY_SIZE(ar9480_1p0_soc_postamble), 5);
-+                              ar9462_1p0_soc_postamble,
-+                              ARRAY_SIZE(ar9462_1p0_soc_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                              ar9480_common_rx_gain_table_1p0,
--                              ARRAY_SIZE(ar9480_common_rx_gain_table_1p0), 2);
-+                              ar9462_common_rx_gain_table_1p0,
-+                              ARRAY_SIZE(ar9462_common_rx_gain_table_1p0), 2);
-               /* Awake -> Sleep Setting */
-               INIT_INI_ARRAY(&ah->iniPcieSerdes,
--                      ar9480_pcie_phy_clkreq_disable_L1_1p0,
--                      ARRAY_SIZE(ar9480_pcie_phy_clkreq_disable_L1_1p0),
-+                      ar9462_pcie_phy_clkreq_disable_L1_1p0,
-+                      ARRAY_SIZE(ar9462_pcie_phy_clkreq_disable_L1_1p0),
-                       2);
-               /* Sleep -> Awake Setting */
-               INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
--                      ar9480_pcie_phy_clkreq_disable_L1_1p0,
--                      ARRAY_SIZE(ar9480_pcie_phy_clkreq_disable_L1_1p0),
-+                      ar9462_pcie_phy_clkreq_disable_L1_1p0,
-+                      ARRAY_SIZE(ar9462_pcie_phy_clkreq_disable_L1_1p0),
-                       2);
-               INIT_INI_ARRAY(&ah->iniModesAdditional,
--                              ar9480_modes_fast_clock_1p0,
--                              ARRAY_SIZE(ar9480_modes_fast_clock_1p0), 3);
-+                              ar9462_modes_fast_clock_1p0,
-+                              ARRAY_SIZE(ar9462_modes_fast_clock_1p0), 3);
-               INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
--                              AR9480_BB_CTX_COEFJ(1p0),
--                              ARRAY_SIZE(AR9480_BB_CTX_COEFJ(1p0)), 2);
-+                              AR9462_BB_CTX_COEFJ(1p0),
-+                              ARRAY_SIZE(AR9462_BB_CTX_COEFJ(1p0)), 2);
--      } else if (AR_SREV_9480_20(ah)) {
-+      } else if (AR_SREV_9462_20(ah)) {
-               INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0);
--              INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9480_2p0_mac_core,
--                              ARRAY_SIZE(ar9480_2p0_mac_core), 2);
-+              INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9462_2p0_mac_core,
-+                              ARRAY_SIZE(ar9462_2p0_mac_core), 2);
-               INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST],
--                              ar9480_2p0_mac_postamble,
--                              ARRAY_SIZE(ar9480_2p0_mac_postamble), 5);
-+                              ar9462_2p0_mac_postamble,
-+                              ARRAY_SIZE(ar9462_2p0_mac_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_PRE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE],
--                              ar9480_2p0_baseband_core,
--                              ARRAY_SIZE(ar9480_2p0_baseband_core), 2);
-+                              ar9462_2p0_baseband_core,
-+                              ARRAY_SIZE(ar9462_2p0_baseband_core), 2);
-               INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST],
--                              ar9480_2p0_baseband_postamble,
--                              ARRAY_SIZE(ar9480_2p0_baseband_postamble), 5);
-+                              ar9462_2p0_baseband_postamble,
-+                              ARRAY_SIZE(ar9462_2p0_baseband_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_PRE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE],
--                              ar9480_2p0_radio_core,
--                              ARRAY_SIZE(ar9480_2p0_radio_core), 2);
-+                              ar9462_2p0_radio_core,
-+                              ARRAY_SIZE(ar9462_2p0_radio_core), 2);
-               INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST],
--                              ar9480_2p0_radio_postamble,
--                              ARRAY_SIZE(ar9480_2p0_radio_postamble), 5);
-+                              ar9462_2p0_radio_postamble,
-+                              ARRAY_SIZE(ar9462_2p0_radio_postamble), 5);
-               INIT_INI_ARRAY(&ah->ini_radio_post_sys2ant,
--                              ar9480_2p0_radio_postamble_sys2ant,
--                              ARRAY_SIZE(ar9480_2p0_radio_postamble_sys2ant),
-+                              ar9462_2p0_radio_postamble_sys2ant,
-+                              ARRAY_SIZE(ar9462_2p0_radio_postamble_sys2ant),
-                               5);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE],
--                              ar9480_2p0_soc_preamble,
--                              ARRAY_SIZE(ar9480_2p0_soc_preamble), 2);
-+                              ar9462_2p0_soc_preamble,
-+                              ARRAY_SIZE(ar9462_2p0_soc_preamble), 2);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_CORE], NULL, 0, 0);
-               INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST],
--                              ar9480_2p0_soc_postamble,
--                              ARRAY_SIZE(ar9480_2p0_soc_postamble), 5);
-+                              ar9462_2p0_soc_postamble,
-+                              ARRAY_SIZE(ar9462_2p0_soc_postamble), 5);
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                              ar9480_common_rx_gain_table_2p0,
--                              ARRAY_SIZE(ar9480_common_rx_gain_table_2p0), 2);
-+                              ar9462_common_rx_gain_table_2p0,
-+                              ARRAY_SIZE(ar9462_common_rx_gain_table_2p0), 2);
-               INIT_INI_ARRAY(&ah->ini_BTCOEX_MAX_TXPWR,
--                              ar9480_2p0_BTCOEX_MAX_TXPWR_table,
--                              ARRAY_SIZE(ar9480_2p0_BTCOEX_MAX_TXPWR_table),
-+                              ar9462_2p0_BTCOEX_MAX_TXPWR_table,
-+                              ARRAY_SIZE(ar9462_2p0_BTCOEX_MAX_TXPWR_table),
-                               2);
-               /* Awake -> Sleep Setting */
-@@ -380,15 +380,15 @@ static void ar9003_hw_init_mode_regs(str
-               /* Fast clock modal settings */
-               INIT_INI_ARRAY(&ah->iniModesAdditional,
--                              ar9480_modes_fast_clock_2p0,
--                              ARRAY_SIZE(ar9480_modes_fast_clock_2p0), 3);
-+                              ar9462_modes_fast_clock_2p0,
-+                              ARRAY_SIZE(ar9462_modes_fast_clock_2p0), 3);
-               INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
--                              AR9480_BB_CTX_COEFJ(2p0),
--                              ARRAY_SIZE(AR9480_BB_CTX_COEFJ(2p0)), 2);
-+                              AR9462_BB_CTX_COEFJ(2p0),
-+                              ARRAY_SIZE(AR9462_BB_CTX_COEFJ(2p0)), 2);
--              INIT_INI_ARRAY(&ah->ini_japan2484, AR9480_BBC_TXIFR_COEFFJ,
--                              ARRAY_SIZE(AR9480_BBC_TXIFR_COEFFJ), 2);
-+              INIT_INI_ARRAY(&ah->ini_japan2484, AR9462_BBC_TXIFR_COEFFJ,
-+                              ARRAY_SIZE(AR9462_BBC_TXIFR_COEFFJ), 2);
-       } else if (AR_SREV_9580(ah)) {
-               /* mac */
-@@ -537,15 +537,15 @@ static void ar9003_tx_gain_table_mode0(s
-                       ar9580_1p0_lowest_ob_db_tx_gain_table,
-                       ARRAY_SIZE(ar9580_1p0_lowest_ob_db_tx_gain_table),
-                       5);
--      else if (AR_SREV_9480_10(ah))
-+      else if (AR_SREV_9462_10(ah))
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
--                      ar9480_modes_low_ob_db_tx_gain_table_1p0,
--                      ARRAY_SIZE(ar9480_modes_low_ob_db_tx_gain_table_1p0),
-+                      ar9462_modes_low_ob_db_tx_gain_table_1p0,
-+                      ARRAY_SIZE(ar9462_modes_low_ob_db_tx_gain_table_1p0),
-                       5);
--      else if (AR_SREV_9480_20(ah))
-+      else if (AR_SREV_9462_20(ah))
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
--                      ar9480_modes_low_ob_db_tx_gain_table_2p0,
--                      ARRAY_SIZE(ar9480_modes_low_ob_db_tx_gain_table_2p0),
-+                      ar9462_modes_low_ob_db_tx_gain_table_2p0,
-+                      ARRAY_SIZE(ar9462_modes_low_ob_db_tx_gain_table_2p0),
-                       5);
-       else
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
-@@ -581,15 +581,15 @@ static void ar9003_tx_gain_table_mode1(s
-                       ar9580_1p0_high_ob_db_tx_gain_table,
-                       ARRAY_SIZE(ar9580_1p0_high_ob_db_tx_gain_table),
-                       5);
--      else if (AR_SREV_9480_10(ah))
-+      else if (AR_SREV_9462_10(ah))
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
--                      ar9480_modes_high_ob_db_tx_gain_table_1p0,
--                      ARRAY_SIZE(ar9480_modes_high_ob_db_tx_gain_table_1p0),
-+                      ar9462_modes_high_ob_db_tx_gain_table_1p0,
-+                      ARRAY_SIZE(ar9462_modes_high_ob_db_tx_gain_table_1p0),
-                       5);
--      else if (AR_SREV_9480_20(ah))
-+      else if (AR_SREV_9462_20(ah))
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
--                      ar9480_modes_high_ob_db_tx_gain_table_2p0,
--                      ARRAY_SIZE(ar9480_modes_high_ob_db_tx_gain_table_2p0),
-+                      ar9462_modes_high_ob_db_tx_gain_table_2p0,
-+                      ARRAY_SIZE(ar9462_modes_high_ob_db_tx_gain_table_2p0),
-                       5);
-       else
-               INIT_INI_ARRAY(&ah->iniModesTxGain,
-@@ -712,15 +712,15 @@ static void ar9003_rx_gain_table_mode0(s
-                               ar9580_1p0_rx_gain_table,
-                               ARRAY_SIZE(ar9580_1p0_rx_gain_table),
-                               2);
--      else if (AR_SREV_9480_10(ah))
-+      else if (AR_SREV_9462_10(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                              ar9480_common_rx_gain_table_1p0,
--                              ARRAY_SIZE(ar9480_common_rx_gain_table_1p0),
-+                              ar9462_common_rx_gain_table_1p0,
-+                              ARRAY_SIZE(ar9462_common_rx_gain_table_1p0),
-                               2);
--      else if (AR_SREV_9480_20(ah))
-+      else if (AR_SREV_9462_20(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                              ar9480_common_rx_gain_table_2p0,
--                              ARRAY_SIZE(ar9480_common_rx_gain_table_2p0),
-+                              ar9462_common_rx_gain_table_2p0,
-+                              ARRAY_SIZE(ar9462_common_rx_gain_table_2p0),
-                               2);
-       else
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
-@@ -751,15 +751,15 @@ static void ar9003_rx_gain_table_mode1(s
-                       ar9485Common_wo_xlna_rx_gain_1_1,
-                       ARRAY_SIZE(ar9485Common_wo_xlna_rx_gain_1_1),
-                       2);
--      else if (AR_SREV_9480_10(ah))
-+      else if (AR_SREV_9462_10(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                      ar9480_common_wo_xlna_rx_gain_table_1p0,
--                      ARRAY_SIZE(ar9480_common_wo_xlna_rx_gain_table_1p0),
-+                      ar9462_common_wo_xlna_rx_gain_table_1p0,
-+                      ARRAY_SIZE(ar9462_common_wo_xlna_rx_gain_table_1p0),
-                       2);
--      else if (AR_SREV_9480_20(ah))
-+      else if (AR_SREV_9462_20(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                      ar9480_common_wo_xlna_rx_gain_table_2p0,
--                      ARRAY_SIZE(ar9480_common_wo_xlna_rx_gain_table_2p0),
-+                      ar9462_common_wo_xlna_rx_gain_table_2p0,
-+                      ARRAY_SIZE(ar9462_common_wo_xlna_rx_gain_table_2p0),
-                       2);
-       else if (AR_SREV_9580(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
-@@ -775,14 +775,14 @@ static void ar9003_rx_gain_table_mode1(s
- static void ar9003_rx_gain_table_mode2(struct ath_hw *ah)
- {
--      if (AR_SREV_9480_10(ah))
-+      if (AR_SREV_9462_10(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                      ar9480_common_mixed_rx_gain_table_1p0,
--                      ARRAY_SIZE(ar9480_common_mixed_rx_gain_table_1p0), 2);
--      else if (AR_SREV_9480_20(ah))
-+                      ar9462_common_mixed_rx_gain_table_1p0,
-+                      ARRAY_SIZE(ar9462_common_mixed_rx_gain_table_1p0), 2);
-+      else if (AR_SREV_9462_20(ah))
-               INIT_INI_ARRAY(&ah->iniModesRxGain,
--                      ar9480_common_mixed_rx_gain_table_2p0,
--                      ARRAY_SIZE(ar9480_common_mixed_rx_gain_table_2p0), 2);
-+                      ar9462_common_mixed_rx_gain_table_2p0,
-+                      ARRAY_SIZE(ar9462_common_mixed_rx_gain_table_2p0), 2);
- }
- static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-@@ -525,8 +525,8 @@ int ath9k_hw_process_rxdesc_edma(struct 
-                       rxs->rs_status |= ATH9K_RXERR_DECRYPT;
-               else if (rxsp->status11 & AR_MichaelErr)
-                       rxs->rs_status |= ATH9K_RXERR_MIC;
--              else if (rxsp->status11 & AR_KeyMiss)
--                      rxs->rs_status |= ATH9K_RXERR_DECRYPT;
-+              if (rxsp->status11 & AR_KeyMiss)
-+                      rxs->rs_status |= ATH9K_RXERR_KEYMISS;
+       if (sta->rate_ctrl)
+@@ -238,6 +241,10 @@ void sta_info_free(struct ieee80211_loca
+               kfree(sta->tx_lat);
        }
  
-       return 0;
---- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-@@ -19,7 +19,6 @@
++      rates = rcu_dereference_protected(sta->sta.rates, true);
++      if (rates)
++              kfree(rates);
++
+       sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
+       kfree(sta);
+@@ -252,33 +259,23 @@ static void sta_info_hash_add(struct iee
+       rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
+ }
  
- void ar9003_paprd_enable(struct ath_hw *ah, bool val)
+-static void sta_unblock(struct work_struct *wk)
++static void sta_deliver_ps_frames(struct work_struct *wk)
  {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       struct ath9k_channel *chan = ah->curchan;
-       struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
+       struct sta_info *sta;
  
-@@ -54,13 +53,7 @@ void ar9003_paprd_enable(struct ath_hw *
+-      sta = container_of(wk, struct sta_info, drv_unblock_wk);
++      sta = container_of(wk, struct sta_info, drv_deliver_wk);
  
-       if (val) {
-               ah->paprd_table_write_done = true;
--
--              ah->eep_ops->set_txpower(ah, chan,
--                              ath9k_regd_get_ctl(regulatory, chan),
--                              chan->chan->max_antenna_gain * 2,
--                              chan->chan->max_power * 2,
--                              min((u32) MAX_RATE_POWER,
--                              (u32) regulatory->power_limit), false);
-+              ath9k_hw_apply_txpower(ah, chan);
+       if (sta->dead)
+               return;
+-      if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
+-              local_bh_disable();
++      local_bh_disable();
++      if (!test_sta_flag(sta, WLAN_STA_PS_STA))
+               ieee80211_sta_ps_deliver_wakeup(sta);
+-              local_bh_enable();
+-      } else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
+-              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
+-
+-              local_bh_disable();
++      else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL))
+               ieee80211_sta_ps_deliver_poll_response(sta);
+-              local_bh_enable();
+-      } else if (test_and_clear_sta_flag(sta, WLAN_STA_UAPSD)) {
+-              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
+-
+-              local_bh_disable();
++      else if (test_and_clear_sta_flag(sta, WLAN_STA_UAPSD))
+               ieee80211_sta_ps_deliver_uapsd(sta);
+-              local_bh_enable();
+-      } else
+-              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
++      local_bh_enable();
+ }
+ static int sta_prepare_rate_control(struct ieee80211_local *local,
+@@ -340,7 +337,7 @@ struct sta_info *sta_info_alloc(struct i
+       spin_lock_init(&sta->lock);
+       spin_lock_init(&sta->ps_lock);
+-      INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
++      INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
+       INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
+       mutex_init(&sta->ampdu_mlme.mtx);
+ #ifdef CPTCFG_MAC80211_MESH
+@@ -1101,8 +1098,11 @@ void ieee80211_sta_ps_deliver_wakeup(str
+       unsigned long flags;
+       struct ps_data *ps;
+-      if (sdata->vif.type == NL80211_IFTYPE_AP ||
+-          sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++      if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++              sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
++                                   u.ap);
++
++      if (sdata->vif.type == NL80211_IFTYPE_AP)
+               ps = &sdata->bss->ps;
+       else if (ieee80211_vif_is_mesh(&sdata->vif))
+               ps = &sdata->u.mesh.ps;
+@@ -1140,8 +1140,15 @@ void ieee80211_sta_ps_deliver_wakeup(str
        }
  
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0,
-@@ -207,7 +200,7 @@ static int ar9003_paprd_setup_single_tab
-                     AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING, 28);
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL1,
-                     AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE, 1);
--      val = AR_SREV_9480(ah) ? 0x91 : 147;
-+      val = AR_SREV_9462(ah) ? 0x91 : 147;
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL2,
-                     AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN, val);
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
-@@ -218,7 +211,7 @@ static int ar9003_paprd_setup_single_tab
-                     AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES, 7);
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
-                     AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL, 1);
--      if (AR_SREV_9485(ah) || AR_SREV_9480(ah))
-+      if (AR_SREV_9485(ah) || AR_SREV_9462(ah))
-               REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
-                             AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
-                             -3);
-@@ -226,7 +219,7 @@ static int ar9003_paprd_setup_single_tab
-               REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
-                             AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
-                             -6);
--      val = AR_SREV_9480(ah) ? -10 : -15;
-+      val = AR_SREV_9462(ah) ? -10 : -15;
-       REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
-                     AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE,
-                     val);
---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
-@@ -559,7 +559,7 @@ static void ar9003_hw_set_chain_masks(st
-       if ((ah->caps.hw_caps & ATH9K_HW_CAP_APM) && (tx == 0x7))
-               REG_WRITE(ah, AR_SELFGEN_MASK, 0x3);
--      else if (AR_SREV_9480(ah))
-+      else if (AR_SREV_9462(ah))
-               /* xxx only when MCI support is enabled */
-               REG_WRITE(ah, AR_SELFGEN_MASK, 0x3);
-       else
-@@ -631,9 +631,7 @@ static void ar9003_hw_prog_ini(struct at
- static int ar9003_hw_process_ini(struct ath_hw *ah,
-                                struct ath9k_channel *chan)
- {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       unsigned int regWrites = 0, i;
--      struct ieee80211_channel *channel = chan->chan;
-       u32 modesIndex;
-       switch (chan->chanmode) {
-@@ -664,7 +662,7 @@ static int ar9003_hw_process_ini(struct 
-               ar9003_hw_prog_ini(ah, &ah->iniMac[i], modesIndex);
-               ar9003_hw_prog_ini(ah, &ah->iniBB[i], modesIndex);
-               ar9003_hw_prog_ini(ah, &ah->iniRadio[i], modesIndex);
--              if (i == ATH_INI_POST && AR_SREV_9480_20(ah))
-+              if (i == ATH_INI_POST && AR_SREV_9462_20(ah))
-                       ar9003_hw_prog_ini(ah,
-                                          &ah->ini_radio_post_sys2ant,
-                                          modesIndex);
-@@ -687,20 +685,27 @@ static int ar9003_hw_process_ini(struct 
-       if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
-               REG_WRITE_ARRAY(&ah->iniModesAdditional_40M, 1, regWrites);
--      if (AR_SREV_9480(ah))
-+      if (AR_SREV_9462(ah))
-               ar9003_hw_prog_ini(ah, &ah->ini_BTCOEX_MAX_TXPWR, 1);
-+      ah->modes_index = modesIndex;
-       ar9003_hw_override_ini(ah);
-       ar9003_hw_set_channel_regs(ah, chan);
-       ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
-+      ath9k_hw_apply_txpower(ah, chan);
--      /* Set TX power */
--      ah->eep_ops->set_txpower(ah, chan,
--                               ath9k_regd_get_ctl(regulatory, chan),
--                               channel->max_antenna_gain * 2,
--                               channel->max_power * 2,
--                               min((u32) MAX_RATE_POWER,
--                               (u32) regulatory->power_limit), false);
-+      if (AR_SREV_9462(ah)) {
-+              if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0,
-+                              AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL))
-+                      ah->enabled_cals |= TX_IQ_CAL;
-+              else
-+                      ah->enabled_cals &= ~TX_IQ_CAL;
+       ieee80211_add_pending_skbs(local, &pending);
+-      clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
+-      clear_sta_flag(sta, WLAN_STA_PS_STA);
 +
-+              if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE)
-+                      ah->enabled_cals |= TX_CL_CAL;
-+              else
-+                      ah->enabled_cals &= ~TX_CL_CAL;
-+      }
++      /* now we're no longer in the deliver code */
++      clear_sta_flag(sta, WLAN_STA_PS_DELIVER);
++
++      /* The station might have polled and then woken up before we responded,
++       * so clear these flags now to avoid them sticking around.
++       */
++      clear_sta_flag(sta, WLAN_STA_PSPOLL);
++      clear_sta_flag(sta, WLAN_STA_UAPSD);
+       spin_unlock(&sta->ps_lock);
  
-       return 0;
- }
-@@ -1256,6 +1261,73 @@ static void ar9003_hw_antdiv_comb_conf_s
-       REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval);
- }
+       atomic_dec(&ps->num_sta_ps);
+@@ -1542,10 +1549,26 @@ void ieee80211_sta_block_awake(struct ie
  
-+static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
-+                                    struct ath9k_channel *chan,
-+                                    u8 *ini_reloaded)
-+{
-+      unsigned int regWrites = 0;
-+      u32 modesIndex;
+       trace_api_sta_block_awake(sta->local, pubsta, block);
+-      if (block)
++      if (block) {
+               set_sta_flag(sta, WLAN_STA_PS_DRIVER);
+-      else if (test_sta_flag(sta, WLAN_STA_PS_DRIVER))
+-              ieee80211_queue_work(hw, &sta->drv_unblock_wk);
++              return;
++      }
 +
-+      switch (chan->chanmode) {
-+      case CHANNEL_A:
-+      case CHANNEL_A_HT20:
-+              modesIndex = 1;
-+              break;
-+      case CHANNEL_A_HT40PLUS:
-+      case CHANNEL_A_HT40MINUS:
-+              modesIndex = 2;
-+              break;
-+      case CHANNEL_G:
-+      case CHANNEL_G_HT20:
-+      case CHANNEL_B:
-+              modesIndex = 4;
-+              break;
-+      case CHANNEL_G_HT40PLUS:
-+      case CHANNEL_G_HT40MINUS:
-+              modesIndex = 3;
-+              break;
++      if (!test_sta_flag(sta, WLAN_STA_PS_DRIVER))
++              return;
 +
-+      default:
-+              return -EINVAL;
++      if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
++              set_sta_flag(sta, WLAN_STA_PS_DELIVER);
++              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
++              ieee80211_queue_work(hw, &sta->drv_deliver_wk);
++      } else if (test_sta_flag(sta, WLAN_STA_PSPOLL) ||
++                 test_sta_flag(sta, WLAN_STA_UAPSD)) {
++              /* must be asleep in this case */
++              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
++              ieee80211_queue_work(hw, &sta->drv_deliver_wk);
++      } else {
++              clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
 +      }
+ }
+ EXPORT_SYMBOL(ieee80211_sta_block_awake);
+@@ -1703,3 +1726,140 @@ u8 sta_info_tx_streams(struct sta_info *
+       return ((ht_cap->mcs.tx_params & IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK)
+                       >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT) + 1;
+ }
 +
-+      if (modesIndex == ah->modes_index) {
-+              *ini_reloaded = false;
-+              goto set_rfmode;
++void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
++{
++      struct ieee80211_sub_if_data *sdata = sta->sdata;
++      struct ieee80211_local *local = sdata->local;
++      struct rate_control_ref *ref = NULL;
++      struct timespec uptime;
++      u64 packets = 0;
++      u32 thr = 0;
++      int i, ac;
++
++      if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
++              ref = local->rate_ctrl;
++
++      sinfo->generation = sdata->local->sta_generation;
++
++      sinfo->filled = STATION_INFO_INACTIVE_TIME |
++                      STATION_INFO_RX_BYTES64 |
++                      STATION_INFO_TX_BYTES64 |
++                      STATION_INFO_RX_PACKETS |
++                      STATION_INFO_TX_PACKETS |
++                      STATION_INFO_TX_RETRIES |
++                      STATION_INFO_TX_FAILED |
++                      STATION_INFO_TX_BITRATE |
++                      STATION_INFO_RX_BITRATE |
++                      STATION_INFO_RX_DROP_MISC |
++                      STATION_INFO_BSS_PARAM |
++                      STATION_INFO_CONNECTED_TIME |
++                      STATION_INFO_STA_FLAGS |
++                      STATION_INFO_BEACON_LOSS_COUNT;
++
++      do_posix_clock_monotonic_gettime(&uptime);
++      sinfo->connected_time = uptime.tv_sec - sta->last_connected;
++
++      sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
++      sinfo->tx_bytes = 0;
++      for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
++              sinfo->tx_bytes += sta->tx_bytes[ac];
++              packets += sta->tx_packets[ac];
++      }
++      sinfo->tx_packets = packets;
++      sinfo->rx_bytes = sta->rx_bytes;
++      sinfo->rx_packets = sta->rx_packets;
++      sinfo->tx_retries = sta->tx_retry_count;
++      sinfo->tx_failed = sta->tx_retry_failed;
++      sinfo->rx_dropped_misc = sta->rx_dropped;
++      sinfo->beacon_loss_count = sta->beacon_loss_count;
++
++      if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
++          (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
++              sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG;
++              if (!local->ops->get_rssi ||
++                  drv_get_rssi(local, sdata, &sta->sta, &sinfo->signal))
++                      sinfo->signal = (s8)sta->last_signal;
++              sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
++      }
++      if (sta->chains) {
++              sinfo->filled |= STATION_INFO_CHAIN_SIGNAL |
++                               STATION_INFO_CHAIN_SIGNAL_AVG;
++
++              sinfo->chains = sta->chains;
++              for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
++                      sinfo->chain_signal[i] = sta->chain_signal_last[i];
++                      sinfo->chain_signal_avg[i] =
++                              (s8) -ewma_read(&sta->chain_signal_avg[i]);
++              }
 +      }
 +
-+      ar9003_hw_prog_ini(ah, &ah->iniSOC[ATH_INI_POST], modesIndex);
-+      ar9003_hw_prog_ini(ah, &ah->iniMac[ATH_INI_POST], modesIndex);
-+      ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex);
-+      ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex);
-+      if (AR_SREV_9462_20(ah))
-+              ar9003_hw_prog_ini(ah,
-+                              &ah->ini_radio_post_sys2ant,
-+                              modesIndex);
-+
-+      REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites);
-+
-+      /*
-+       * For 5GHz channels requiring Fast Clock, apply
-+       * different modal values.
-+       */
-+      if (IS_CHAN_A_FAST_CLOCK(ah, chan))
-+              REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, regWrites);
-+
-+      if (AR_SREV_9330(ah))
-+              REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);
-+
-+      if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
-+              REG_WRITE_ARRAY(&ah->iniModesAdditional_40M, 1, regWrites);
++      sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
++      sta_set_rate_info_rx(sta, &sinfo->rxrate);
++
++      if (ieee80211_vif_is_mesh(&sdata->vif)) {
++#ifdef CPTCFG_MAC80211_MESH
++              sinfo->filled |= STATION_INFO_LLID |
++                               STATION_INFO_PLID |
++                               STATION_INFO_PLINK_STATE |
++                               STATION_INFO_LOCAL_PM |
++                               STATION_INFO_PEER_PM |
++                               STATION_INFO_NONPEER_PM;
++
++              sinfo->llid = sta->llid;
++              sinfo->plid = sta->plid;
++              sinfo->plink_state = sta->plink_state;
++              if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
++                      sinfo->filled |= STATION_INFO_T_OFFSET;
++                      sinfo->t_offset = sta->t_offset;
++              }
++              sinfo->local_pm = sta->local_pm;
++              sinfo->peer_pm = sta->peer_pm;
++              sinfo->nonpeer_pm = sta->nonpeer_pm;
++#endif
++      }
 +
-+      ah->modes_index = modesIndex;
-+      *ini_reloaded = true;
++      sinfo->bss_param.flags = 0;
++      if (sdata->vif.bss_conf.use_cts_prot)
++              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT;
++      if (sdata->vif.bss_conf.use_short_preamble)
++              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
++      if (sdata->vif.bss_conf.use_short_slot)
++              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
++      sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
++      sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
++
++      sinfo->sta_flags.set = 0;
++      sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
++                              BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
++                              BIT(NL80211_STA_FLAG_WME) |
++                              BIT(NL80211_STA_FLAG_MFP) |
++                              BIT(NL80211_STA_FLAG_AUTHENTICATED) |
++                              BIT(NL80211_STA_FLAG_ASSOCIATED) |
++                              BIT(NL80211_STA_FLAG_TDLS_PEER);
++      if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
++      if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
++      if (test_sta_flag(sta, WLAN_STA_WME))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
++      if (test_sta_flag(sta, WLAN_STA_MFP))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
++      if (test_sta_flag(sta, WLAN_STA_AUTH))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
++      if (test_sta_flag(sta, WLAN_STA_ASSOC))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_ASSOCIATED);
++      if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
++              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER);
++
++      /* check if the driver has a SW RC implementation */
++      if (ref && ref->ops->get_expected_throughput)
++              thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv);
++      else
++              thr = drv_get_expected_throughput(local, &sta->sta);
 +
-+set_rfmode:
-+      ar9003_hw_set_rfmode(ah, chan);
-+      return 0;
++      if (thr != 0) {
++              sinfo->filled |= STATION_INFO_EXPECTED_THROUGHPUT;
++              sinfo->expected_throughput = thr;
++      }
 +}
-+
- void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
- {
-       struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
-@@ -1284,6 +1356,7 @@ void ar9003_hw_attach_phy_ops(struct ath
-       priv_ops->do_getnf = ar9003_hw_do_getnf;
-       priv_ops->ani_cache_ini_regs = ar9003_hw_ani_cache_ini_regs;
-       priv_ops->set_radar_params = ar9003_hw_set_radar_params;
-+      priv_ops->fast_chan_change = ar9003_hw_fast_chan_change;
-       ops->antdiv_comb_conf_get = ar9003_hw_antdiv_comb_conf_get;
-       ops->antdiv_comb_conf_set = ar9003_hw_antdiv_comb_conf_set;
---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
-@@ -325,10 +325,10 @@
- #define AR_PHY_RX_OCGAIN        (AR_AGC_BASE + 0x200)
--#define AR_PHY_CCA_NOM_VAL_9300_2GHZ          -110
--#define AR_PHY_CCA_NOM_VAL_9300_5GHZ          -115
--#define AR_PHY_CCA_MIN_GOOD_VAL_9300_2GHZ     -125
--#define AR_PHY_CCA_MIN_GOOD_VAL_9300_5GHZ     -125
-+#define AR_PHY_CCA_NOM_VAL_9300_2GHZ          (AR_SREV_9462(ah) ? -127 : -110)
-+#define AR_PHY_CCA_NOM_VAL_9300_5GHZ          (AR_SREV_9462(ah) ? -127 : -115)
-+#define AR_PHY_CCA_MIN_GOOD_VAL_9300_2GHZ     (AR_SREV_9462(ah) ? -127 : -125)
-+#define AR_PHY_CCA_MIN_GOOD_VAL_9300_5GHZ     (AR_SREV_9462(ah) ? -127 : -125)
- #define AR_PHY_CCA_MAX_GOOD_VAL_9300_2GHZ     -95
- #define AR_PHY_CCA_MAX_GOOD_VAL_9300_5GHZ     -100
-@@ -572,6 +572,8 @@
- #define AR_PHY_TXGAIN_TABLE      (AR_SM_BASE + 0x300)
-+#define AR_PHY_TX_IQCAL_CONTROL_0   (AR_SM_BASE + AR_SREV_9485(ah) ? \
-+                                               0x3c4 : 0x444)
- #define AR_PHY_TX_IQCAL_CONTROL_1   (AR_SM_BASE + AR_SREV_9485(ah) ? \
-                                                0x3c8 : 0x448)
- #define AR_PHY_TX_IQCAL_START       (AR_SM_BASE + AR_SREV_9485(ah) ? \
-@@ -582,8 +584,6 @@
-                                            (AR_SREV_9485(ah) ? \
-                                             0x3d0 : 0x450) + ((_i) << 2))
- #define AR_PHY_RTT_CTRL                       (AR_SM_BASE + 0x380)
--#define AR_PHY_RTT_TABLE_SW_INTF_B    (AR_SM_BASE + 0x384)
--#define AR_PHY_RTT_TABLE_SW_INTF_1_B0 (AR_SM_BASE + 0x388)
- #define AR_PHY_WATCHDOG_STATUS      (AR_SM_BASE + 0x5c0)
- #define AR_PHY_WATCHDOG_CTL_1       (AR_SM_BASE + 0x5c4)
-@@ -608,9 +608,9 @@
- #define AR_PHY_AIC_CTRL_1_B0  (AR_SM_BASE + 0x4b4)
- #define AR_PHY_AIC_CTRL_2_B0  (AR_SM_BASE + 0x4b8)
- #define AR_PHY_AIC_CTRL_3_B0  (AR_SM_BASE + 0x4bc)
--#define AR_PHY_AIC_STAT_0_B0  (AR_SM_BASE + (AR_SREV_9480_10(ah) ? \
-+#define AR_PHY_AIC_STAT_0_B0  (AR_SM_BASE + (AR_SREV_9462_10(ah) ? \
-                                       0x4c0 : 0x4c4))
--#define AR_PHY_AIC_STAT_1_B0  (AR_SM_BASE + (AR_SREV_9480_10(ah) ? \
-+#define AR_PHY_AIC_STAT_1_B0  (AR_SM_BASE + (AR_SREV_9462_10(ah) ? \
-                                       0x4c4 : 0x4c8))
- #define AR_PHY_AIC_CTRL_4_B0  (AR_SM_BASE + 0x4c0)
- #define AR_PHY_AIC_STAT_2_B0  (AR_SM_BASE + 0x4cc)
-@@ -625,7 +625,7 @@
- #define AR_PHY_65NM_CH0_RXTX4       0x1610c
- #define AR_CH0_TOP    (AR_SREV_9300(ah) ? 0x16288 : \
--                              ((AR_SREV_9480(ah) ? 0x1628c : 0x16280)))
-+                              ((AR_SREV_9462(ah) ? 0x1628c : 0x16280)))
- #define AR_CH0_TOP_XPABIASLVL (0x300)
- #define AR_CH0_TOP_XPABIASLVL_S (8)
-@@ -638,8 +638,8 @@
- #define AR_SWITCH_TABLE_COM_ALL (0xffff)
- #define AR_SWITCH_TABLE_COM_ALL_S (0)
--#define AR_SWITCH_TABLE_COM_AR9480_ALL (0xffffff)
--#define AR_SWITCH_TABLE_COM_AR9480_ALL_S (0)
-+#define AR_SWITCH_TABLE_COM_AR9462_ALL (0xffffff)
-+#define AR_SWITCH_TABLE_COM_AR9462_ALL_S (0)
- #define AR_SWITCH_TABLE_COM_SPDT (0x00f00000)
- #define AR_SWITCH_TABLE_COM_SPDT_ALL (0x0000fff0)
- #define AR_SWITCH_TABLE_COM_SPDT_ALL_S (4)
-@@ -679,11 +679,11 @@
- #define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000
- #define AR_CH0_XTAL_CAPOUTDAC_S       17
--#define AR_PHY_PMU1           (AR_SREV_9480(ah) ? 0x16340 : 0x16c40)
-+#define AR_PHY_PMU1           (AR_SREV_9462(ah) ? 0x16340 : 0x16c40)
- #define AR_PHY_PMU1_PWD               0x1
- #define AR_PHY_PMU1_PWD_S     0
--#define AR_PHY_PMU2           (AR_SREV_9480(ah) ? 0x16344 : 0x16c44)
-+#define AR_PHY_PMU2           (AR_SREV_9462(ah) ? 0x16344 : 0x16c44)
- #define AR_PHY_PMU2_PGM               0x00200000
- #define AR_PHY_PMU2_PGM_S     21
-@@ -823,6 +823,22 @@
- #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT   0x01000000
- #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 24
- #define AR_PHY_CHANNEL_STATUS_RX_CLEAR      0x00000004
-+#define AR_PHY_RTT_CTRL_ENA_RADIO_RETENTION     0x00000001
-+#define AR_PHY_RTT_CTRL_ENA_RADIO_RETENTION_S   0
-+#define AR_PHY_RTT_CTRL_RESTORE_MASK            0x0000007E
-+#define AR_PHY_RTT_CTRL_RESTORE_MASK_S          1
-+#define AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE     0x00000080
-+#define AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE_S   7
-+#define AR_PHY_RTT_SW_RTT_TABLE_ACCESS          0x00000001
-+#define AR_PHY_RTT_SW_RTT_TABLE_ACCESS_S        0
-+#define AR_PHY_RTT_SW_RTT_TABLE_WRITE           0x00000002
-+#define AR_PHY_RTT_SW_RTT_TABLE_WRITE_S         1
-+#define AR_PHY_RTT_SW_RTT_TABLE_ADDR            0x0000001C
-+#define AR_PHY_RTT_SW_RTT_TABLE_ADDR_S          2
-+#define AR_PHY_RTT_SW_RTT_TABLE_DATA            0xFFFFFFF0
-+#define AR_PHY_RTT_SW_RTT_TABLE_DATA_S          4
-+#define AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL                   0x80000000
-+#define AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL_S                         31
- #define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT             0x01fc0000
- #define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_S                   18
- #define AR_PHY_TX_IQCAL_START_DO_CAL      0x00000001
-@@ -905,9 +921,9 @@
- #define AR_PHY_AIC_CTRL_0_B1  (AR_SM1_BASE + 0x4b0)
- #define AR_PHY_AIC_CTRL_1_B1  (AR_SM1_BASE + 0x4b4)
- #define AR_PHY_AIC_CTRL_2_B1  (AR_SM1_BASE + 0x4b8)
--#define AR_PHY_AIC_STAT_0_B1  (AR_SM1_BASE + (AR_SREV_9480_10(ah) ? \
-+#define AR_PHY_AIC_STAT_0_B1  (AR_SM1_BASE + (AR_SREV_9462_10(ah) ? \
-                                       0x4c0 : 0x4c4))
--#define AR_PHY_AIC_STAT_1_B1  (AR_SM1_BASE + (AR_SREV_9480_10(ah) ? \
-+#define AR_PHY_AIC_STAT_1_B1  (AR_SM1_BASE + (AR_SREV_9462_10(ah) ? \
-                                       0x4c4 : 0x4c8))
- #define AR_PHY_AIC_CTRL_4_B1  (AR_SM1_BASE + 0x4c0)
- #define AR_PHY_AIC_STAT_2_B1  (AR_SM1_BASE + 0x4cc)
-@@ -915,6 +931,10 @@
- #define AR_PHY_AIC_SRAM_ADDR_B1       (AR_SM1_BASE + 0x5f0)
- #define AR_PHY_AIC_SRAM_DATA_B1       (AR_SM1_BASE + 0x5f4)
-+#define AR_PHY_RTT_TABLE_SW_INTF_B(i) (0x384 + (i) ? \
-+                                      AR_SM1_BASE : AR_SM_BASE)
-+#define AR_PHY_RTT_TABLE_SW_INTF_1_B(i)       (0x388 + (i) ? \
-+                                      AR_SM1_BASE : AR_SM_BASE)
- /*
-  * Channel 2 Register Map
+--- a/net/mac80211/status.c
++++ b/net/mac80211/status.c
+@@ -541,6 +541,23 @@ static void ieee80211_tx_latency_end_msr
   */
-@@ -981,7 +1001,7 @@
- #define AR_GLB_BASE   0x20000
- #define AR_PHY_GLB_CONTROL    (AR_GLB_BASE + 0x44)
- #define AR_GLB_SCRATCH(_ah)   (AR_GLB_BASE + \
--                                      (AR_SREV_9480_20(_ah) ? 0x4c : 0x50))
-+                                      (AR_SREV_9462_20(_ah) ? 0x4c : 0x50))
- #define AR_GLB_STATUS         (AR_GLB_BASE + 0x48)
- /*
---- /dev/null
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_rtt.c
-@@ -0,0 +1,153 @@
-+/*
-+ * Copyright (c) 2010-2011 Atheros Communications Inc.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#include "hw.h"
-+#include "ar9003_phy.h"
-+
-+#define RTT_RESTORE_TIMEOUT          1000
-+#define RTT_ACCESS_TIMEOUT           100
-+#define RTT_BAD_VALUE                0x0bad0bad
-+
-+/*
-+ * RTT (Radio Retention Table) hardware implementation information
-+ *
-+ * There is an internal table (i.e. the rtt) for each chain (or bank).
-+ * Each table contains 6 entries and each entry is corresponding to
-+ * a specific calibration parameter as depicted below.
-+ *  0~2 - DC offset DAC calibration: loop, low, high (offsetI/Q_...)
-+ *  3   - Filter cal (filterfc)
-+ *  4   - RX gain settings
-+ *  5   - Peak detector offset calibration (agc_caldac)
-+ */
-+
-+void ar9003_hw_rtt_enable(struct ath_hw *ah)
-+{
-+      REG_WRITE(ah, AR_PHY_RTT_CTRL, 1);
-+}
-+
-+void ar9003_hw_rtt_disable(struct ath_hw *ah)
-+{
-+      REG_WRITE(ah, AR_PHY_RTT_CTRL, 0);
-+}
-+
-+void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask)
-+{
-+      REG_RMW_FIELD(ah, AR_PHY_RTT_CTRL,
-+                    AR_PHY_RTT_CTRL_RESTORE_MASK, rtt_mask);
-+}
-+
-+bool ar9003_hw_rtt_force_restore(struct ath_hw *ah)
-+{
-+      if (!ath9k_hw_wait(ah, AR_PHY_RTT_CTRL,
-+                         AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE,
-+                         0, RTT_RESTORE_TIMEOUT))
-+              return false;
-+
-+      REG_RMW_FIELD(ah, AR_PHY_RTT_CTRL,
-+                    AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE, 1);
-+
-+      if (!ath9k_hw_wait(ah, AR_PHY_RTT_CTRL,
-+                         AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE,
-+                         0, RTT_RESTORE_TIMEOUT))
-+              return false;
-+
-+      return true;
-+}
-+
-+static void ar9003_hw_rtt_load_hist_entry(struct ath_hw *ah, u8 chain,
-+              u32 index, u32 data28)
+ #define STA_LOST_PKT_THRESHOLD        50
++static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb)
 +{
-+      u32 val;
-+
-+      val = SM(data28, AR_PHY_RTT_SW_RTT_TABLE_DATA);
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_1_B(chain), val);
++      struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 +
-+      val = SM(0, AR_PHY_RTT_SW_RTT_TABLE_ACCESS) |
-+            SM(1, AR_PHY_RTT_SW_RTT_TABLE_WRITE) |
-+            SM(index, AR_PHY_RTT_SW_RTT_TABLE_ADDR);
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
-+      udelay(1);
-+
-+      val |= SM(1, AR_PHY_RTT_SW_RTT_TABLE_ACCESS);
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
-+      udelay(1);
-+
-+      if (!ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
-+                         AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
-+                         RTT_ACCESS_TIMEOUT))
++      /* This packet was aggregated but doesn't carry status info */
++      if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
++          !(info->flags & IEEE80211_TX_STAT_AMPDU))
 +              return;
 +
-+      val &= ~SM(1, AR_PHY_RTT_SW_RTT_TABLE_WRITE);
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
-+      udelay(1);
-+
-+      ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
-+                    AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
-+                    RTT_ACCESS_TIMEOUT);
-+}
-+
-+void ar9003_hw_rtt_load_hist(struct ath_hw *ah, u8 chain, u32 *table)
-+{
-+      int i;
-+
-+      for (i = 0; i < MAX_RTT_TABLE_ENTRY; i++)
-+              ar9003_hw_rtt_load_hist_entry(ah, chain, i, table[i]);
-+}
-+
-+static int ar9003_hw_rtt_fill_hist_entry(struct ath_hw *ah, u8 chain, u32 index)
-+{
-+      u32 val;
-+
-+      val = SM(0, AR_PHY_RTT_SW_RTT_TABLE_ACCESS) |
-+            SM(0, AR_PHY_RTT_SW_RTT_TABLE_WRITE) |
-+            SM(index, AR_PHY_RTT_SW_RTT_TABLE_ADDR);
-+
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
-+      udelay(1);
-+
-+      val |= SM(1, AR_PHY_RTT_SW_RTT_TABLE_ACCESS);
-+      REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
-+      udelay(1);
-+
-+      if (!ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
-+                         AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
-+                         RTT_ACCESS_TIMEOUT))
-+              return RTT_BAD_VALUE;
-+
-+      val = REG_READ(ah, AR_PHY_RTT_TABLE_SW_INTF_1_B(chain));
-+
-+      return val;
-+}
-+
-+void ar9003_hw_rtt_fill_hist(struct ath_hw *ah, u8 chain, u32 *table)
-+{
-+      int i;
-+
-+      for (i = 0; i < MAX_RTT_TABLE_ENTRY; i++)
-+              table[i] = ar9003_hw_rtt_fill_hist_entry(ah, chain, i);
-+}
-+
-+void ar9003_hw_rtt_clear_hist(struct ath_hw *ah)
-+{
-+      int i, j;
++      if (++sta->lost_packets < STA_LOST_PKT_THRESHOLD)
++              return;
 +
-+      for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-+              if (!(ah->rxchainmask & (1 << i)))
-+                      continue;
-+              for (j = 0; j < MAX_RTT_TABLE_ENTRY; j++)
-+                      ar9003_hw_rtt_load_hist_entry(ah, i, j, 0);
-+      }
++      cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr,
++                                  sta->lost_packets, GFP_ATOMIC);
++      sta->lost_packets = 0;
 +}
---- /dev/null
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_rtt.h
-@@ -0,0 +1,28 @@
-+/*
-+ * Copyright (c) 2010-2011 Atheros Communications Inc.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#ifndef AR9003_RTT_H
-+#define AR9003_RTT_H
-+
-+void ar9003_hw_rtt_enable(struct ath_hw *ah);
-+void ar9003_hw_rtt_disable(struct ath_hw *ah);
-+void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask);
-+bool ar9003_hw_rtt_force_restore(struct ath_hw *ah);
-+void ar9003_hw_rtt_load_hist(struct ath_hw *ah, u8 chain, u32 *table);
-+void ar9003_hw_rtt_fill_hist(struct ath_hw *ah, u8 chain, u32 *table);
-+void ar9003_hw_rtt_clear_hist(struct ath_hw *ah);
-+
-+#endif
---- /dev/null
-+++ b/drivers/net/wireless/ath/ath9k/ar9462_1p0_initvals.h
-@@ -0,0 +1,1833 @@
-+/*
-+ * Copyright (c) 2010 Atheros Communications Inc.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#ifndef INITVALS_9462_1P0_H
-+#define INITVALS_9462_1P0_H
-+
-+/* AR9462 1.0 */
-+
-+static const u32 ar9462_1p0_mac_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00000008, 0x00000000},
-+      {0x00000030, 0x00060085},
-+      {0x00000034, 0x00000005},
-+      {0x00000040, 0x00000000},
-+      {0x00000044, 0x00000000},
-+      {0x00000048, 0x00000008},
-+      {0x0000004c, 0x00000010},
-+      {0x00000050, 0x00000000},
-+      {0x00001040, 0x002ffc0f},
-+      {0x00001044, 0x002ffc0f},
-+      {0x00001048, 0x002ffc0f},
-+      {0x0000104c, 0x002ffc0f},
-+      {0x00001050, 0x002ffc0f},
-+      {0x00001054, 0x002ffc0f},
-+      {0x00001058, 0x002ffc0f},
-+      {0x0000105c, 0x002ffc0f},
-+      {0x00001060, 0x002ffc0f},
-+      {0x00001064, 0x002ffc0f},
-+      {0x000010f0, 0x00000100},
-+      {0x00001270, 0x00000000},
-+      {0x000012b0, 0x00000000},
-+      {0x000012f0, 0x00000000},
-+      {0x0000143c, 0x00000000},
-+      {0x0000147c, 0x00000000},
-+      {0x00001810, 0x0f000003},
-+      {0x00008000, 0x00000000},
-+      {0x00008004, 0x00000000},
-+      {0x00008008, 0x00000000},
-+      {0x0000800c, 0x00000000},
-+      {0x00008018, 0x00000000},
-+      {0x00008020, 0x00000000},
-+      {0x00008038, 0x00000000},
-+      {0x0000803c, 0x00080000},
-+      {0x00008040, 0x00000000},
-+      {0x00008044, 0x00000000},
-+      {0x00008048, 0x00000000},
-+      {0x0000804c, 0xffffffff},
-+      {0x00008050, 0xffffffff},
-+      {0x00008054, 0x00000000},
-+      {0x00008058, 0x00000000},
-+      {0x0000805c, 0x000fc78f},
-+      {0x00008060, 0x0000000f},
-+      {0x00008064, 0x00000000},
-+      {0x00008070, 0x00000310},
-+      {0x00008074, 0x00000020},
-+      {0x00008078, 0x00000000},
-+      {0x0000809c, 0x0000000f},
-+      {0x000080a0, 0x00000000},
-+      {0x000080a4, 0x02ff0000},
-+      {0x000080a8, 0x0e070605},
-+      {0x000080ac, 0x0000000d},
-+      {0x000080b0, 0x00000000},
-+      {0x000080b4, 0x00000000},
-+      {0x000080b8, 0x00000000},
-+      {0x000080bc, 0x00000000},
-+      {0x000080c0, 0x2a800000},
-+      {0x000080c4, 0x06900168},
-+      {0x000080c8, 0x13881c20},
-+      {0x000080cc, 0x01f40000},
-+      {0x000080d0, 0x00252500},
-+      {0x000080d4, 0x00a00005},
-+      {0x000080d8, 0x00400002},
-+      {0x000080dc, 0x00000000},
-+      {0x000080e0, 0xffffffff},
-+      {0x000080e4, 0x0000ffff},
-+      {0x000080e8, 0x3f3f3f3f},
-+      {0x000080ec, 0x00000000},
-+      {0x000080f0, 0x00000000},
-+      {0x000080f4, 0x00000000},
-+      {0x000080fc, 0x00020000},
-+      {0x00008100, 0x00000000},
-+      {0x00008108, 0x00000052},
-+      {0x0000810c, 0x00000000},
-+      {0x00008110, 0x00000000},
-+      {0x00008114, 0x000007ff},
-+      {0x00008118, 0x000000aa},
-+      {0x0000811c, 0x00003210},
-+      {0x00008124, 0x00000000},
-+      {0x00008128, 0x00000000},
-+      {0x0000812c, 0x00000000},
-+      {0x00008130, 0x00000000},
-+      {0x00008134, 0x00000000},
-+      {0x00008138, 0x00000000},
-+      {0x0000813c, 0x0000ffff},
-+      {0x00008144, 0xffffffff},
-+      {0x00008168, 0x00000000},
-+      {0x0000816c, 0x00000000},
-+      {0x00008170, 0x18486e00},
-+      {0x00008174, 0x33332210},
-+      {0x00008178, 0x00000000},
-+      {0x0000817c, 0x00020000},
-+      {0x000081c4, 0x33332210},
-+      {0x000081c8, 0x00000000},
-+      {0x000081cc, 0x00000000},
-+      {0x000081d4, 0x00000000},
-+      {0x000081ec, 0x00000000},
-+      {0x000081f0, 0x00000000},
-+      {0x000081f4, 0x00000000},
-+      {0x000081f8, 0x00000000},
-+      {0x000081fc, 0x00000000},
-+      {0x00008240, 0x00100000},
-+      {0x00008244, 0x0010f400},
-+      {0x00008248, 0x00000800},
-+      {0x0000824c, 0x0001e800},
-+      {0x00008250, 0x00000000},
-+      {0x00008254, 0x00000000},
-+      {0x00008258, 0x00000000},
-+      {0x0000825c, 0x40000000},
-+      {0x00008260, 0x00080922},
-+      {0x00008264, 0x99c00010},
-+      {0x00008268, 0xffffffff},
-+      {0x0000826c, 0x0000ffff},
-+      {0x00008270, 0x00000000},
-+      {0x00008274, 0x40000000},
-+      {0x00008278, 0x003e4180},
-+      {0x0000827c, 0x00000004},
-+      {0x00008284, 0x0000002c},
-+      {0x00008288, 0x0000002c},
-+      {0x0000828c, 0x000000ff},
-+      {0x00008294, 0x00000000},
-+      {0x00008298, 0x00000000},
-+      {0x0000829c, 0x00000000},
-+      {0x00008300, 0x00000140},
-+      {0x00008314, 0x00000000},
-+      {0x0000831c, 0x0000010d},
-+      {0x00008328, 0x00000000},
-+      {0x0000832c, 0x0000001f},
-+      {0x00008330, 0x00000302},
-+      {0x00008334, 0x00000700},
-+      {0x00008338, 0xffff0000},
-+      {0x0000833c, 0x02400000},
-+      {0x00008340, 0x000107ff},
-+      {0x00008344, 0xaa48105b},
-+      {0x00008348, 0x008f0000},
-+      {0x0000835c, 0x00000000},
-+      {0x00008360, 0xffffffff},
-+      {0x00008364, 0xffffffff},
-+      {0x00008368, 0x00000000},
-+      {0x00008370, 0x00000000},
-+      {0x00008374, 0x000000ff},
-+      {0x00008378, 0x00000000},
-+      {0x0000837c, 0x00000000},
-+      {0x00008380, 0xffffffff},
-+      {0x00008384, 0xffffffff},
-+      {0x00008390, 0xffffffff},
-+      {0x00008394, 0xffffffff},
-+      {0x00008398, 0x00000000},
-+      {0x0000839c, 0x00000000},
-+      {0x000083a4, 0x0000fa14},
-+      {0x000083a8, 0x000f0c00},
-+      {0x000083ac, 0x33332210},
-+      {0x000083b0, 0x33332210},
-+      {0x000083b4, 0x33332210},
-+      {0x000083b8, 0x33332210},
-+      {0x000083bc, 0x00000000},
-+      {0x000083c0, 0x00000000},
-+      {0x000083c4, 0x00000000},
-+      {0x000083c8, 0x00000000},
-+      {0x000083cc, 0x00000200},
-+      {0x000083d0, 0x000301ff},
-+};
-+
-+static const u32 ar9462_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a398, 0x00000000},
-+      {0x0000a39c, 0x6f7f0301},
-+      {0x0000a3a0, 0xca9228ee},
-+};
-+
-+static const u32 ar9462_1p0_sys3ant[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00063280, 0x00040807},
-+      {0x00063284, 0x104ccccc},
-+};
-+
-+static const u32 ar9462_pcie_phy_clkreq_enable_L1_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x10053e5e},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0000580c},
-+};
-+
-+static const u32 ar9462_1p0_mac_core_emulation[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00000030, 0x00060085},
-+      {0x00000044, 0x00000008},
-+      {0x0000805c, 0xffffc7ff},
-+      {0x00008344, 0xaa4a105b},
-+};
-+
-+static const u32 ar9462_common_rx_gain_table_ar9280_2p0_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x02000101},
-+      {0x0000a004, 0x02000102},
-+      {0x0000a008, 0x02000103},
-+      {0x0000a00c, 0x02000104},
-+      {0x0000a010, 0x02000200},
-+      {0x0000a014, 0x02000201},
-+      {0x0000a018, 0x02000202},
-+      {0x0000a01c, 0x02000203},
-+      {0x0000a020, 0x02000204},
-+      {0x0000a024, 0x02000205},
-+      {0x0000a028, 0x02000208},
-+      {0x0000a02c, 0x02000302},
-+      {0x0000a030, 0x02000303},
-+      {0x0000a034, 0x02000304},
-+      {0x0000a038, 0x02000400},
-+      {0x0000a03c, 0x02010300},
-+      {0x0000a040, 0x02010301},
-+      {0x0000a044, 0x02010302},
-+      {0x0000a048, 0x02000500},
-+      {0x0000a04c, 0x02010400},
-+      {0x0000a050, 0x02020300},
-+      {0x0000a054, 0x02020301},
-+      {0x0000a058, 0x02020302},
-+      {0x0000a05c, 0x02020303},
-+      {0x0000a060, 0x02020400},
-+      {0x0000a064, 0x02030300},
-+      {0x0000a068, 0x02030301},
-+      {0x0000a06c, 0x02030302},
-+      {0x0000a070, 0x02030303},
-+      {0x0000a074, 0x02030400},
-+      {0x0000a078, 0x02040300},
-+      {0x0000a07c, 0x02040301},
-+      {0x0000a080, 0x02040302},
-+      {0x0000a084, 0x02040303},
-+      {0x0000a088, 0x02030500},
-+      {0x0000a08c, 0x02040400},
-+      {0x0000a090, 0x02050203},
-+      {0x0000a094, 0x02050204},
-+      {0x0000a098, 0x02050205},
-+      {0x0000a09c, 0x02040500},
-+      {0x0000a0a0, 0x02050301},
-+      {0x0000a0a4, 0x02050302},
-+      {0x0000a0a8, 0x02050303},
-+      {0x0000a0ac, 0x02050400},
-+      {0x0000a0b0, 0x02050401},
-+      {0x0000a0b4, 0x02050402},
-+      {0x0000a0b8, 0x02050403},
-+      {0x0000a0bc, 0x02050500},
-+      {0x0000a0c0, 0x02050501},
-+      {0x0000a0c4, 0x02050502},
-+      {0x0000a0c8, 0x02050503},
-+      {0x0000a0cc, 0x02050504},
-+      {0x0000a0d0, 0x02050600},
-+      {0x0000a0d4, 0x02050601},
-+      {0x0000a0d8, 0x02050602},
-+      {0x0000a0dc, 0x02050603},
-+      {0x0000a0e0, 0x02050604},
-+      {0x0000a0e4, 0x02050700},
-+      {0x0000a0e8, 0x02050701},
-+      {0x0000a0ec, 0x02050702},
-+      {0x0000a0f0, 0x02050703},
-+      {0x0000a0f4, 0x02050704},
-+      {0x0000a0f8, 0x02050705},
-+      {0x0000a0fc, 0x02050708},
-+      {0x0000a100, 0x02050709},
-+      {0x0000a104, 0x0205070a},
-+      {0x0000a108, 0x0205070b},
-+      {0x0000a10c, 0x0205070c},
-+      {0x0000a110, 0x0205070d},
-+      {0x0000a114, 0x02050710},
-+      {0x0000a118, 0x02050711},
-+      {0x0000a11c, 0x02050712},
-+      {0x0000a120, 0x02050713},
-+      {0x0000a124, 0x02050714},
-+      {0x0000a128, 0x02050715},
-+      {0x0000a12c, 0x02050730},
-+      {0x0000a130, 0x02050731},
-+      {0x0000a134, 0x02050732},
-+      {0x0000a138, 0x02050733},
-+      {0x0000a13c, 0x02050734},
-+      {0x0000a140, 0x02050735},
-+      {0x0000a144, 0x02050750},
-+      {0x0000a148, 0x02050751},
-+      {0x0000a14c, 0x02050752},
-+      {0x0000a150, 0x02050753},
-+      {0x0000a154, 0x02050754},
-+      {0x0000a158, 0x02050755},
-+      {0x0000a15c, 0x02050770},
-+      {0x0000a160, 0x02050771},
-+      {0x0000a164, 0x02050772},
-+      {0x0000a168, 0x02050773},
-+      {0x0000a16c, 0x02050774},
-+      {0x0000a170, 0x02050775},
-+      {0x0000a174, 0x00000776},
-+      {0x0000a178, 0x00000776},
-+      {0x0000a17c, 0x00000776},
-+      {0x0000a180, 0x00000776},
-+      {0x0000a184, 0x00000776},
-+      {0x0000a188, 0x00000776},
-+      {0x0000a18c, 0x00000776},
-+      {0x0000a190, 0x00000776},
-+      {0x0000a194, 0x00000776},
-+      {0x0000a198, 0x00000776},
-+      {0x0000a19c, 0x00000776},
-+      {0x0000a1a0, 0x00000776},
-+      {0x0000a1a4, 0x00000776},
-+      {0x0000a1a8, 0x00000776},
-+      {0x0000a1ac, 0x00000776},
-+      {0x0000a1b0, 0x00000776},
-+      {0x0000a1b4, 0x00000776},
-+      {0x0000a1b8, 0x00000776},
-+      {0x0000a1bc, 0x00000776},
-+      {0x0000a1c0, 0x00000776},
-+      {0x0000a1c4, 0x00000776},
-+      {0x0000a1c8, 0x00000776},
-+      {0x0000a1cc, 0x00000776},
-+      {0x0000a1d0, 0x00000776},
-+      {0x0000a1d4, 0x00000776},
-+      {0x0000a1d8, 0x00000776},
-+      {0x0000a1dc, 0x00000776},
-+      {0x0000a1e0, 0x00000776},
-+      {0x0000a1e4, 0x00000776},
-+      {0x0000a1e8, 0x00000776},
-+      {0x0000a1ec, 0x00000776},
-+      {0x0000a1f0, 0x00000776},
-+      {0x0000a1f4, 0x00000776},
-+      {0x0000a1f8, 0x00000776},
-+      {0x0000a1fc, 0x00000776},
-+      {0x0000b000, 0x02000101},
-+      {0x0000b004, 0x02000102},
-+      {0x0000b008, 0x02000103},
-+      {0x0000b00c, 0x02000104},
-+      {0x0000b010, 0x02000200},
-+      {0x0000b014, 0x02000201},
-+      {0x0000b018, 0x02000202},
-+      {0x0000b01c, 0x02000203},
-+      {0x0000b020, 0x02000204},
-+      {0x0000b024, 0x02000205},
-+      {0x0000b028, 0x02000208},
-+      {0x0000b02c, 0x02000302},
-+      {0x0000b030, 0x02000303},
-+      {0x0000b034, 0x02000304},
-+      {0x0000b038, 0x02000400},
-+      {0x0000b03c, 0x02010300},
-+      {0x0000b040, 0x02010301},
-+      {0x0000b044, 0x02010302},
-+      {0x0000b048, 0x02000500},
-+      {0x0000b04c, 0x02010400},
-+      {0x0000b050, 0x02020300},
-+      {0x0000b054, 0x02020301},
-+      {0x0000b058, 0x02020302},
-+      {0x0000b05c, 0x02020303},
-+      {0x0000b060, 0x02020400},
-+      {0x0000b064, 0x02030300},
-+      {0x0000b068, 0x02030301},
-+      {0x0000b06c, 0x02030302},
-+      {0x0000b070, 0x02030303},
-+      {0x0000b074, 0x02030400},
-+      {0x0000b078, 0x02040300},
-+      {0x0000b07c, 0x02040301},
-+      {0x0000b080, 0x02040302},
-+      {0x0000b084, 0x02040303},
-+      {0x0000b088, 0x02030500},
-+      {0x0000b08c, 0x02040400},
-+      {0x0000b090, 0x02050203},
-+      {0x0000b094, 0x02050204},
-+      {0x0000b098, 0x02050205},
-+      {0x0000b09c, 0x02040500},
-+      {0x0000b0a0, 0x02050301},
-+      {0x0000b0a4, 0x02050302},
-+      {0x0000b0a8, 0x02050303},
-+      {0x0000b0ac, 0x02050400},
-+      {0x0000b0b0, 0x02050401},
-+      {0x0000b0b4, 0x02050402},
-+      {0x0000b0b8, 0x02050403},
-+      {0x0000b0bc, 0x02050500},
-+      {0x0000b0c0, 0x02050501},
-+      {0x0000b0c4, 0x02050502},
-+      {0x0000b0c8, 0x02050503},
-+      {0x0000b0cc, 0x02050504},
-+      {0x0000b0d0, 0x02050600},
-+      {0x0000b0d4, 0x02050601},
-+      {0x0000b0d8, 0x02050602},
-+      {0x0000b0dc, 0x02050603},
-+      {0x0000b0e0, 0x02050604},
-+      {0x0000b0e4, 0x02050700},
-+      {0x0000b0e8, 0x02050701},
-+      {0x0000b0ec, 0x02050702},
-+      {0x0000b0f0, 0x02050703},
-+      {0x0000b0f4, 0x02050704},
-+      {0x0000b0f8, 0x02050705},
-+      {0x0000b0fc, 0x02050708},
-+      {0x0000b100, 0x02050709},
-+      {0x0000b104, 0x0205070a},
-+      {0x0000b108, 0x0205070b},
-+      {0x0000b10c, 0x0205070c},
-+      {0x0000b110, 0x0205070d},
-+      {0x0000b114, 0x02050710},
-+      {0x0000b118, 0x02050711},
-+      {0x0000b11c, 0x02050712},
-+      {0x0000b120, 0x02050713},
-+      {0x0000b124, 0x02050714},
-+      {0x0000b128, 0x02050715},
-+      {0x0000b12c, 0x02050730},
-+      {0x0000b130, 0x02050731},
-+      {0x0000b134, 0x02050732},
-+      {0x0000b138, 0x02050733},
-+      {0x0000b13c, 0x02050734},
-+      {0x0000b140, 0x02050735},
-+      {0x0000b144, 0x02050750},
-+      {0x0000b148, 0x02050751},
-+      {0x0000b14c, 0x02050752},
-+      {0x0000b150, 0x02050753},
-+      {0x0000b154, 0x02050754},
-+      {0x0000b158, 0x02050755},
-+      {0x0000b15c, 0x02050770},
-+      {0x0000b160, 0x02050771},
-+      {0x0000b164, 0x02050772},
-+      {0x0000b168, 0x02050773},
-+      {0x0000b16c, 0x02050774},
-+      {0x0000b170, 0x02050775},
-+      {0x0000b174, 0x00000776},
-+      {0x0000b178, 0x00000776},
-+      {0x0000b17c, 0x00000776},
-+      {0x0000b180, 0x00000776},
-+      {0x0000b184, 0x00000776},
-+      {0x0000b188, 0x00000776},
-+      {0x0000b18c, 0x00000776},
-+      {0x0000b190, 0x00000776},
-+      {0x0000b194, 0x00000776},
-+      {0x0000b198, 0x00000776},
-+      {0x0000b19c, 0x00000776},
-+      {0x0000b1a0, 0x00000776},
-+      {0x0000b1a4, 0x00000776},
-+      {0x0000b1a8, 0x00000776},
-+      {0x0000b1ac, 0x00000776},
-+      {0x0000b1b0, 0x00000776},
-+      {0x0000b1b4, 0x00000776},
-+      {0x0000b1b8, 0x00000776},
-+      {0x0000b1bc, 0x00000776},
-+      {0x0000b1c0, 0x00000776},
-+      {0x0000b1c4, 0x00000776},
-+      {0x0000b1c8, 0x00000776},
-+      {0x0000b1cc, 0x00000776},
-+      {0x0000b1d0, 0x00000776},
-+      {0x0000b1d4, 0x00000776},
-+      {0x0000b1d8, 0x00000776},
-+      {0x0000b1dc, 0x00000776},
-+      {0x0000b1e0, 0x00000776},
-+      {0x0000b1e4, 0x00000776},
-+      {0x0000b1e8, 0x00000776},
-+      {0x0000b1ec, 0x00000776},
-+      {0x0000b1f0, 0x00000776},
-+      {0x0000b1f4, 0x00000776},
-+      {0x0000b1f8, 0x00000776},
-+      {0x0000b1fc, 0x00000776},
-+};
 +
-+static const u32 ar9200_ar9280_2p0_radio_core_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00007800, 0x00040000},
-+      {0x00007804, 0xdb005012},
-+      {0x00007808, 0x04924914},
-+      {0x0000780c, 0x21084210},
-+      {0x00007810, 0x6d801300},
-+      {0x00007814, 0x0019beff},
-+      {0x00007818, 0x07e41000},
-+      {0x0000781c, 0x00392000},
-+      {0x00007820, 0x92592480},
-+      {0x00007824, 0x00040000},
-+      {0x00007828, 0xdb005012},
-+      {0x0000782c, 0x04924914},
-+      {0x00007830, 0x21084210},
-+      {0x00007834, 0x6d801300},
-+      {0x00007838, 0x0019beff},
-+      {0x0000783c, 0x07e40000},
-+      {0x00007840, 0x00392000},
-+      {0x00007844, 0x92592480},
-+      {0x00007848, 0x00100000},
-+      {0x0000784c, 0x773f0567},
-+      {0x00007850, 0x54214514},
-+      {0x00007854, 0x12035828},
-+      {0x00007858, 0x92592692},
-+      {0x0000785c, 0x00000000},
-+      {0x00007860, 0x56400000},
-+      {0x00007864, 0x0a8e370e},
-+      {0x00007868, 0xc0102850},
-+      {0x0000786c, 0x812d4000},
-+      {0x00007870, 0x807ec400},
-+      {0x00007874, 0x001b6db0},
-+      {0x00007878, 0x00376b63},
-+      {0x0000787c, 0x06db6db6},
-+      {0x00007880, 0x006d8000},
-+      {0x00007884, 0xffeffffe},
-+      {0x00007888, 0xffeffffe},
-+      {0x0000788c, 0x00010000},
-+      {0x00007890, 0x02060aeb},
-+      {0x00007894, 0x5a108000},
-+};
-+
-+static const u32 ar9462_1p0_baseband_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x00009e3c, 0xcf946221, 0xcf946221, 0xcf946221, 0xcf946221},
-+      {0x00009e44, 0x005c0000, 0x005c0000, 0x005c0000, 0x005c0000},
-+      {0x0000a258, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
-+      {0x0000a25c, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
-+      {0x0000a28c, 0x00011111, 0x00011111, 0x00011111, 0x00011111},
-+      {0x0000a2c4, 0x00148d18, 0x00148d18, 0x00148d20, 0x00148d20},
-+      {0x0000a2d8, 0xf999a800, 0xf999a800, 0xf999a80c, 0xf999a80c},
-+      {0x0000a50c, 0x0000c00a, 0x0000c00a, 0x0000c00a, 0x0000c00a},
-+      {0x0000a538, 0x00038e8c, 0x00038e8c, 0x00038e8c, 0x00038e8c},
-+      {0x0000a53c, 0x0003cecc, 0x0003cecc, 0x0003cecc, 0x0003cecc},
-+      {0x0000a540, 0x00040ed4, 0x00040ed4, 0x00040ed4, 0x00040ed4},
-+      {0x0000a544, 0x00044edc, 0x00044edc, 0x00044edc, 0x00044edc},
-+      {0x0000a548, 0x00048ede, 0x00048ede, 0x00048ede, 0x00048ede},
-+      {0x0000a54c, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
-+      {0x0000a550, 0x00050f5e, 0x00050f5e, 0x00050f5e, 0x00050f5e},
-+      {0x0000a554, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e},
-+      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+};
-+
-+static const u32 ar9462_pcie_phy_pll_on_clkreq_disable_L1_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x10012e5e},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0000580c},
-+};
-+
-+static const u32 ar9462_common_rx_gain_table_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x01910190},
-+      {0x0000a030, 0x01930192},
-+      {0x0000a034, 0x01950194},
-+      {0x0000a038, 0x038a0196},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x22222229},
-+      {0x0000a084, 0x1d1d1d1d},
-+      {0x0000a088, 0x1d1d1d1d},
-+      {0x0000a08c, 0x1d1d1d1d},
-+      {0x0000a090, 0x171d1d1d},
-+      {0x0000a094, 0x11111717},
-+      {0x0000a098, 0x00030311},
-+      {0x0000a09c, 0x00000000},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x2a2d2f32},
-+      {0x0000b084, 0x21232328},
-+      {0x0000b088, 0x19191c1e},
-+      {0x0000b08c, 0x12141417},
-+      {0x0000b090, 0x07070e0e},
-+      {0x0000b094, 0x03030305},
-+      {0x0000b098, 0x00000003},
-+      {0x0000b09c, 0x00000000},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_modes_high_ob_db_tx_gain_table_1p0[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-+      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
-+      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
-+      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
-+      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
-+      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
-+      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
-+      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
-+      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
-+      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
-+      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
-+      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
-+      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
-+      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
-+      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
-+      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
-+      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
-+      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
-+      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
-+      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
-+      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
-+      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
-+      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
-+      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
-+      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
-+};
-+
-+static const u32 ar9462_common_wo_xlna_rx_gain_table_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x03820190},
-+      {0x0000a030, 0x03840383},
-+      {0x0000a034, 0x03880385},
-+      {0x0000a038, 0x038a0389},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x29292929},
-+      {0x0000a084, 0x29292929},
-+      {0x0000a088, 0x29292929},
-+      {0x0000a08c, 0x29292929},
-+      {0x0000a090, 0x22292929},
-+      {0x0000a094, 0x1d1d2222},
-+      {0x0000a098, 0x0c111117},
-+      {0x0000a09c, 0x00030303},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x32323232},
-+      {0x0000b084, 0x2f2f3232},
-+      {0x0000b088, 0x23282a2d},
-+      {0x0000b08c, 0x1c1e2123},
-+      {0x0000b090, 0x14171919},
-+      {0x0000b094, 0x0e0e1214},
-+      {0x0000b098, 0x03050707},
-+      {0x0000b09c, 0x00030303},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_1p0_mac_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
-+      {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
-+      {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
-+      {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
-+      {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
-+      {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
-+      {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
-+      {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
-+};
-+
-+static const u32 ar9462_1p0_mac_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00008014, 0x10f810f8, 0x10f810f8, 0x10f810f8, 0x10f810f8},
-+      {0x0000801c, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017},
-+};
-+
-+static const u32 ar9462_1p0_tx_gain_table_baseband_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0000a410, 0x000000d5, 0x000000d5, 0x000000d5, 0x000000d5},
-+      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x00004002, 0x00004002, 0x00004002, 0x00004002},
-+      {0x0000a508, 0x00008004, 0x00008004, 0x00008004, 0x00008004},
-+      {0x0000a510, 0x0001000c, 0x0001000c, 0x0001000c, 0x0001000c},
-+      {0x0000a514, 0x0001420b, 0x0001420b, 0x0001420b, 0x0001420b},
-+      {0x0000a518, 0x0001824a, 0x0001824a, 0x0001824a, 0x0001824a},
-+      {0x0000a51c, 0x0001c44a, 0x0001c44a, 0x0001c44a, 0x0001c44a},
-+      {0x0000a520, 0x0002064a, 0x0002064a, 0x0002064a, 0x0002064a},
-+      {0x0000a524, 0x0002484a, 0x0002484a, 0x0002484a, 0x0002484a},
-+      {0x0000a528, 0x00028a4a, 0x00028a4a, 0x00028a4a, 0x00028a4a},
-+      {0x0000a52c, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
-+      {0x0000a530, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a},
-+      {0x0000a534, 0x00034e8a, 0x00034e8a, 0x00034e8a, 0x00034e8a},
-+};
-+
-+static const u32 ar9462_1p0_radio_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
-+      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24646c08, 0x24646c08},
-+      {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
-+      {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
-+      {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
-+      {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
-+      {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
-+};
-+
-+static const u32 ar9462_1p0_soc_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00007010, 0x00001133, 0x00001133, 0x00001133, 0x00001133},
-+};
-+
-+static const u32 ar9462_1p0_baseband_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00009800, 0xafe68e30},
-+      {0x00009804, 0xfd14e000},
-+      {0x00009808, 0x9c0a9f6b},
-+      {0x0000980c, 0x04900000},
-+      {0x00009814, 0x9280c00a},
-+      {0x00009818, 0x00000000},
-+      {0x0000981c, 0x00020028},
-+      {0x00009834, 0x6400a290},
-+      {0x00009838, 0x0108ecff},
-+      {0x0000983c, 0x0d000600},
-+      {0x00009880, 0x201fff00},
-+      {0x00009884, 0x00001042},
-+      {0x000098a4, 0x00200400},
-+      {0x000098b0, 0x32840bbe},
-+      {0x000098d0, 0x004b6a8e},
-+      {0x000098d4, 0x00000820},
-+      {0x000098dc, 0x00000000},
-+      {0x000098e4, 0x01ffffff},
-+      {0x000098e8, 0x01ffffff},
-+      {0x000098ec, 0x01ffffff},
-+      {0x000098f0, 0x00000000},
-+      {0x000098f4, 0x00000000},
-+      {0x00009c04, 0xff55ff55},
-+      {0x00009c08, 0x0320ff55},
-+      {0x00009c0c, 0x00000000},
-+      {0x00009c10, 0x00000000},
-+      {0x00009c14, 0x00046384},
-+      {0x00009c18, 0x05b6b440},
-+      {0x00009c1c, 0x00b6b440},
-+      {0x00009d00, 0xc080a333},
-+      {0x00009d04, 0x40206c10},
-+      {0x00009d08, 0x009c4060},
-+      {0x00009d0c, 0x9883800a},
-+      {0x00009d10, 0x01834061},
-+      {0x00009d14, 0x00c0040b},
-+      {0x00009d18, 0x00000000},
-+      {0x00009e08, 0x0038230c},
-+      {0x00009e24, 0x990bb514},
-+      {0x00009e28, 0x0c6f0000},
-+      {0x00009e30, 0x06336f77},
-+      {0x00009e34, 0x6af6532f},
-+      {0x00009e38, 0x0cc80c00},
-+      {0x00009e40, 0x0d261820},
-+      {0x00009e4c, 0x00001004},
-+      {0x00009e50, 0x00ff03f1},
-+      {0x00009e54, 0x64c355c7},
-+      {0x00009e58, 0xfd897735},
-+      {0x00009e5c, 0xe9198724},
-+      {0x00009fc0, 0x803e4788},
-+      {0x00009fc4, 0x0001efb5},
-+      {0x00009fcc, 0x40000014},
-+      {0x00009fd0, 0x01193b93},
-+      {0x0000a20c, 0x00000000},
-+      {0x0000a220, 0x00000000},
-+      {0x0000a224, 0x00000000},
-+      {0x0000a228, 0x10002310},
-+      {0x0000a23c, 0x00000000},
-+      {0x0000a244, 0x0c000000},
-+      {0x0000a2a0, 0x00000001},
-+      {0x0000a2c0, 0x00000001},
-+      {0x0000a2c8, 0x00000000},
-+      {0x0000a2cc, 0x18c43433},
-+      {0x0000a2d4, 0x00000000},
-+      {0x0000a2ec, 0x00000000},
-+      {0x0000a2f0, 0x00000000},
-+      {0x0000a2f4, 0x00000000},
-+      {0x0000a2f8, 0x00000000},
-+      {0x0000a344, 0x00000000},
-+      {0x0000a34c, 0x00000000},
-+      {0x0000a350, 0x0000a000},
-+      {0x0000a364, 0x00000000},
-+      {0x0000a370, 0x00000000},
-+      {0x0000a390, 0x00000001},
-+      {0x0000a394, 0x00000444},
-+      {0x0000a398, 0x001f0e0f},
-+      {0x0000a39c, 0x0075393f},
-+      {0x0000a3a0, 0xb79f6427},
-+      {0x0000a3a4, 0x00000000},
-+      {0x0000a3a8, 0xaaaaaaaa},
-+      {0x0000a3ac, 0x3c466478},
-+      {0x0000a3c0, 0x20202020},
-+      {0x0000a3c4, 0x22222220},
-+      {0x0000a3c8, 0x20200020},
-+      {0x0000a3cc, 0x20202020},
-+      {0x0000a3d0, 0x20202020},
-+      {0x0000a3d4, 0x20202020},
-+      {0x0000a3d8, 0x20202020},
-+      {0x0000a3dc, 0x20202020},
-+      {0x0000a3e0, 0x20202020},
-+      {0x0000a3e4, 0x20202020},
-+      {0x0000a3e8, 0x20202020},
-+      {0x0000a3ec, 0x20202020},
-+      {0x0000a3f0, 0x00000000},
-+      {0x0000a3f4, 0x00000006},
-+      {0x0000a3f8, 0x0c9bd380},
-+      {0x0000a3fc, 0x000f0f01},
-+      {0x0000a400, 0x8fa91f01},
-+      {0x0000a404, 0x00000000},
-+      {0x0000a408, 0x0e79e5c6},
-+      {0x0000a40c, 0x00820820},
-+      {0x0000a414, 0x1ce739ce},
-+      {0x0000a418, 0x2d001dce},
-+      {0x0000a41c, 0x1ce739ce},
-+      {0x0000a420, 0x000001ce},
-+      {0x0000a424, 0x1ce739ce},
-+      {0x0000a428, 0x000001ce},
-+      {0x0000a42c, 0x1ce739ce},
-+      {0x0000a430, 0x1ce739ce},
-+      {0x0000a434, 0x00000000},
-+      {0x0000a438, 0x00001801},
-+      {0x0000a43c, 0x00100000},
-+      {0x0000a440, 0x00000000},
-+      {0x0000a444, 0x00000000},
-+      {0x0000a448, 0x05000080},
-+      {0x0000a44c, 0x00000001},
-+      {0x0000a450, 0x00010000},
-+      {0x0000a458, 0x00000000},
-+      {0x0000a644, 0xbfad9d74},
-+      {0x0000a648, 0x0048060a},
-+      {0x0000a64c, 0x00003c37},
-+      {0x0000a670, 0x03020100},
-+      {0x0000a674, 0x09080504},
-+      {0x0000a678, 0x0d0c0b0a},
-+      {0x0000a67c, 0x13121110},
-+      {0x0000a680, 0x31301514},
-+      {0x0000a684, 0x35343332},
-+      {0x0000a688, 0x00000036},
-+      {0x0000a690, 0x00000838},
-+      {0x0000a6b0, 0x0000000a},
-+      {0x0000a6b4, 0x28f12c01},
-+      {0x0000a7c0, 0x00000000},
-+      {0x0000a7c4, 0xfffffffc},
-+      {0x0000a7c8, 0x00000000},
-+      {0x0000a7cc, 0x00000000},
-+      {0x0000a7d0, 0x00000000},
-+      {0x0000a7d4, 0x00000004},
-+      {0x0000a7dc, 0x00000001},
-+      {0x0000a8d0, 0x004b6a8e},
-+      {0x0000a8d4, 0x00000820},
-+      {0x0000a8dc, 0x00000000},
-+      {0x0000a8f0, 0x00000000},
-+      {0x0000a8f4, 0x00000000},
-+      {0x0000b2d0, 0x00000080},
-+      {0x0000b2d4, 0x00000000},
-+      {0x0000b2ec, 0x00000000},
-+      {0x0000b2f0, 0x00000000},
-+      {0x0000b2f4, 0x00000000},
-+      {0x0000b2f8, 0x00000000},
-+      {0x0000b408, 0x0e79e5c0},
-+      {0x0000b40c, 0x00820820},
-+      {0x0000b420, 0x00000000},
-+      {0x0000b6b0, 0x0000000a},
-+      {0x0000b6b4, 0x00c00001},
-+};
-+
-+static const u32 ar9462_1p0_baseband_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
-+      {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
-+      {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
-+      {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
-+      {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
-+      {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
-+      {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
-+      {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0},
-+      {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
-+      {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
-+      {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e},
-+      {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e},
-+      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
-+      {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
-+      {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
-+      {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782},
-+      {0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
-+      {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
-+      {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
-+      {0x0000a204, 0x0131b7c0, 0x0131b7c4, 0x0131b7c4, 0x0131b7c0},
-+      {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
-+      {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
-+      {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
-+      {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
-+      {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
-+      {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
-+      {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
-+      {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
-+      {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
-+      {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
-+      {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
-+      {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
-+      {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
-+      {0x0000a288, 0x00000110, 0x00000110, 0x00100110, 0x00100110},
-+      {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
-+      {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
-+      {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
-+      {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
-+      {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
-+      {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
-+      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
-+      {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
-+      {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
-+};
-+
-+static const u32 ar9462_modes_fast_clock_1p0[][3] = {
-+      /* Addr      5G_HT20     5G_HT40   */
-+      {0x00001030, 0x00000268, 0x000004d0},
-+      {0x00001070, 0x0000018c, 0x00000318},
-+      {0x000010b0, 0x00000fd0, 0x00001fa0},
-+      {0x00008014, 0x044c044c, 0x08980898},
-+      {0x0000801c, 0x148ec02b, 0x148ec057},
-+      {0x00008318, 0x000044c0, 0x00008980},
-+      {0x00009e00, 0x0372131c, 0x0372131c},
-+      {0x0000a230, 0x0000400b, 0x00004016},
-+      {0x0000a254, 0x00000898, 0x00001130},
-+};
-+
-+static const u32 ar9462_modes_low_ob_db_tx_gain_table_1p0[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-+      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
-+      {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
-+      {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
-+      {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
-+      {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
-+      {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
-+      {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
-+      {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
-+      {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
-+      {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
-+      {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
-+      {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
-+      {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
-+      {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
-+      {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
-+      {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
-+      {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
-+      {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
-+      {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
-+      {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
-+      {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
-+      {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
-+      {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
-+      {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
-+      {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
-+      {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
-+};
-+
-+static const u32 ar9462_1p0_soc_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00007010, 0x00002233, 0x00002233, 0x00002233, 0x00002233},
-+};
-+
-+static const u32 ar9462_common_mixed_rx_gain_table_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x03820190},
-+      {0x0000a030, 0x03840383},
-+      {0x0000a034, 0x03880385},
-+      {0x0000a038, 0x038a0389},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x29292929},
-+      {0x0000a084, 0x29292929},
-+      {0x0000a088, 0x29292929},
-+      {0x0000a08c, 0x29292929},
-+      {0x0000a090, 0x22292929},
-+      {0x0000a094, 0x1d1d2222},
-+      {0x0000a098, 0x0c111117},
-+      {0x0000a09c, 0x00030303},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x2a2d2f32},
-+      {0x0000b084, 0x21232328},
-+      {0x0000b088, 0x19191c1e},
-+      {0x0000b08c, 0x12141417},
-+      {0x0000b090, 0x07070e0e},
-+      {0x0000b094, 0x03030305},
-+      {0x0000b098, 0x00000003},
-+      {0x0000b09c, 0x00000000},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_pcie_phy_clkreq_disable_L1_1p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x10013e5e},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0000580c},
-+};
-+
-+static const u32 ar9462_1p0_baseband_core_emulation[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00009800, 0xafa68e30},
-+      {0x00009884, 0x00002842},
-+      {0x00009c04, 0xff55ff55},
-+      {0x00009c08, 0x0320ff55},
-+      {0x00009e50, 0x00000000},
-+      {0x00009fcc, 0x00000014},
-+      {0x0000a344, 0x00000010},
-+      {0x0000a398, 0x00000000},
-+      {0x0000a39c, 0x71733d01},
-+      {0x0000a3a0, 0xd0ad5c12},
-+      {0x0000a3c0, 0x22222220},
-+      {0x0000a3c4, 0x22222222},
-+      {0x0000a404, 0x00418a11},
-+      {0x0000a418, 0x050001ce},
-+      {0x0000a438, 0x00001800},
-+      {0x0000a458, 0x01444452},
-+      {0x0000a644, 0x3fad9d74},
-+      {0x0000a690, 0x00000038},
-+};
-+
-+static const u32 ar9462_1p0_radio_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00016000, 0x36db6db6},
-+      {0x00016004, 0x6db6db40},
-+      {0x00016008, 0x73f00000},
-+      {0x0001600c, 0x00000000},
-+      {0x00016010, 0x6d820001},
-+      {0x00016040, 0x7f80fff8},
-+      {0x0001604c, 0x2699e04f},
-+      {0x00016050, 0x6db6db6c},
-+      {0x00016054, 0x6db60000},
-+      {0x00016058, 0x6c200000},
-+      {0x00016080, 0x00040000},
-+      {0x00016084, 0x9a68048c},
-+      {0x00016088, 0x54214514},
-+      {0x0001608c, 0x12030409},
-+      {0x00016090, 0x24926490},
-+      {0x00016098, 0xd2888888},
-+      {0x000160a0, 0x0a108ffe},
-+      {0x000160a4, 0x812fc490},
-+      {0x000160a8, 0x423c8000},
-+      {0x000160b4, 0x92000000},
-+      {0x000160b8, 0x0285dddc},
-+      {0x000160bc, 0x02908888},
-+      {0x000160c0, 0x00adb6d0},
-+      {0x000160c4, 0x6db6db60},
-+      {0x000160c8, 0x6db6db6c},
-+      {0x000160cc, 0x0de6c1b0},
-+      {0x00016100, 0x3fffbe04},
-+      {0x00016104, 0xfff80000},
-+      {0x00016108, 0x00200400},
-+      {0x00016110, 0x00000000},
-+      {0x00016144, 0x02084080},
-+      {0x00016148, 0x000080c0},
-+      {0x00016280, 0x050a0001},
-+      {0x00016284, 0x3d841400},
-+      {0x00016288, 0x00000000},
-+      {0x0001628c, 0xe3000000},
-+      {0x00016290, 0xa1005080},
-+      {0x00016294, 0x00000020},
-+      {0x00016298, 0x50a02900},
-+      {0x00016340, 0x121e4276},
-+      {0x00016344, 0x00300000},
-+      {0x00016400, 0x36db6db6},
-+      {0x00016404, 0x6db6db40},
-+      {0x00016408, 0x73f00000},
-+      {0x0001640c, 0x00000000},
-+      {0x00016410, 0x6c800001},
-+      {0x00016440, 0x7f80fff8},
-+      {0x0001644c, 0x4699e04f},
-+      {0x00016450, 0x6db6db6c},
-+      {0x00016454, 0x6db60000},
-+      {0x00016500, 0x3fffbe04},
-+      {0x00016504, 0xfff80000},
-+      {0x00016508, 0x00200400},
-+      {0x00016510, 0x00000000},
-+      {0x00016544, 0x02084080},
-+      {0x00016548, 0x000080c0},
-+};
-+
-+static const u32 ar9462_1p0_soc_preamble[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00007020, 0x00000000},
-+      {0x00007034, 0x00000002},
-+      {0x00007038, 0x000004c2},
-+};
-+
-+static const u32 ar9462_1p0_sys2ant[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00063120, 0x00801980},
-+};
-+
-+#endif /* INITVALS_9462_1P0_H */
---- /dev/null
-+++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
-@@ -0,0 +1,1928 @@
-+/*
-+ * Copyright (c) 2010 Atheros Communications Inc.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#ifndef INITVALS_9462_2P0_H
-+#define INITVALS_9462_2P0_H
-+
-+/* AR9462 2.0 */
-+
-+static const u32 ar9462_modes_fast_clock_2p0[][3] = {
-+      /* Addr      5G_HT20     5G_HT40   */
-+      {0x00001030, 0x00000268, 0x000004d0},
-+      {0x00001070, 0x0000018c, 0x00000318},
-+      {0x000010b0, 0x00000fd0, 0x00001fa0},
-+      {0x00008014, 0x044c044c, 0x08980898},
-+      {0x0000801c, 0x148ec02b, 0x148ec057},
-+      {0x00008318, 0x000044c0, 0x00008980},
-+      {0x00009e00, 0x0372131c, 0x0372131c},
-+      {0x0000a230, 0x0000400b, 0x00004016},
-+      {0x0000a254, 0x00000898, 0x00001130},
-+};
-+
-+static const u32 ar9462_pciephy_clkreq_enable_L1_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x18253ede},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0003580c},
-+};
-+
-+static const u32 ar9462_2p0_baseband_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
-+      {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
-+      {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
-+      {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
-+      {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
-+      {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
-+      {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
-+      {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0},
-+      {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
-+      {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
-+      {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e},
-+      {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3039605e, 0x33795d5e},
-+      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
-+      {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
-+      {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
-+      {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782},
-+      {0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
-+      {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
-+      {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
-+      {0x0000a204, 0x013187c0, 0x013187c4, 0x013187c4, 0x013187c0},
-+      {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
-+      {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
-+      {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
-+      {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
-+      {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
-+      {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
-+      {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
-+      {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
-+      {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
-+      {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
-+      {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
-+      {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
-+      {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
-+      {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
-+      {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
-+      {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
-+      {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
-+      {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
-+      {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
-+      {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
-+      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
-+      {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
-+      {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
-+};
-+
-+static const u32 ar9462_2p0_mac_core_emulation[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00000030, 0x000e0085},
-+      {0x00000044, 0x00000008},
-+      {0x0000805c, 0xffffc7ff},
-+      {0x00008344, 0xaa4a105b},
-+};
-+
-+static const u32 ar9462_common_rx_gain_table_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x01910190},
-+      {0x0000a030, 0x01930192},
-+      {0x0000a034, 0x01950194},
-+      {0x0000a038, 0x038a0196},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x22222229},
-+      {0x0000a084, 0x1d1d1d1d},
-+      {0x0000a088, 0x1d1d1d1d},
-+      {0x0000a08c, 0x1d1d1d1d},
-+      {0x0000a090, 0x171d1d1d},
-+      {0x0000a094, 0x11111717},
-+      {0x0000a098, 0x00030311},
-+      {0x0000a09c, 0x00000000},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x2a2d2f32},
-+      {0x0000b084, 0x21232328},
-+      {0x0000b088, 0x19191c1e},
-+      {0x0000b08c, 0x12141417},
-+      {0x0000b090, 0x07070e0e},
-+      {0x0000b094, 0x03030305},
-+      {0x0000b098, 0x00000003},
-+      {0x0000b09c, 0x00000000},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_pciephy_clkreq_disable_L1_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x18213ede},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0003580c},
-+};
-+
-+static const u32 ar9462_pciephy_pll_on_clkreq_disable_L1_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00018c00, 0x18212ede},
-+      {0x00018c04, 0x000801d8},
-+      {0x00018c08, 0x0003580c},
-+};
-+
-+static const u32 ar9462_2p0_sys3ant[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00063280, 0x00040807},
-+      {0x00063284, 0x104ccccc},
-+};
-+
-+static const u32 ar9462_common_rx_gain_table_ar9280_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x02000101},
-+      {0x0000a004, 0x02000102},
-+      {0x0000a008, 0x02000103},
-+      {0x0000a00c, 0x02000104},
-+      {0x0000a010, 0x02000200},
-+      {0x0000a014, 0x02000201},
-+      {0x0000a018, 0x02000202},
-+      {0x0000a01c, 0x02000203},
-+      {0x0000a020, 0x02000204},
-+      {0x0000a024, 0x02000205},
-+      {0x0000a028, 0x02000208},
-+      {0x0000a02c, 0x02000302},
-+      {0x0000a030, 0x02000303},
-+      {0x0000a034, 0x02000304},
-+      {0x0000a038, 0x02000400},
-+      {0x0000a03c, 0x02010300},
-+      {0x0000a040, 0x02010301},
-+      {0x0000a044, 0x02010302},
-+      {0x0000a048, 0x02000500},
-+      {0x0000a04c, 0x02010400},
-+      {0x0000a050, 0x02020300},
-+      {0x0000a054, 0x02020301},
-+      {0x0000a058, 0x02020302},
-+      {0x0000a05c, 0x02020303},
-+      {0x0000a060, 0x02020400},
-+      {0x0000a064, 0x02030300},
-+      {0x0000a068, 0x02030301},
-+      {0x0000a06c, 0x02030302},
-+      {0x0000a070, 0x02030303},
-+      {0x0000a074, 0x02030400},
-+      {0x0000a078, 0x02040300},
-+      {0x0000a07c, 0x02040301},
-+      {0x0000a080, 0x02040302},
-+      {0x0000a084, 0x02040303},
-+      {0x0000a088, 0x02030500},
-+      {0x0000a08c, 0x02040400},
-+      {0x0000a090, 0x02050203},
-+      {0x0000a094, 0x02050204},
-+      {0x0000a098, 0x02050205},
-+      {0x0000a09c, 0x02040500},
-+      {0x0000a0a0, 0x02050301},
-+      {0x0000a0a4, 0x02050302},
-+      {0x0000a0a8, 0x02050303},
-+      {0x0000a0ac, 0x02050400},
-+      {0x0000a0b0, 0x02050401},
-+      {0x0000a0b4, 0x02050402},
-+      {0x0000a0b8, 0x02050403},
-+      {0x0000a0bc, 0x02050500},
-+      {0x0000a0c0, 0x02050501},
-+      {0x0000a0c4, 0x02050502},
-+      {0x0000a0c8, 0x02050503},
-+      {0x0000a0cc, 0x02050504},
-+      {0x0000a0d0, 0x02050600},
-+      {0x0000a0d4, 0x02050601},
-+      {0x0000a0d8, 0x02050602},
-+      {0x0000a0dc, 0x02050603},
-+      {0x0000a0e0, 0x02050604},
-+      {0x0000a0e4, 0x02050700},
-+      {0x0000a0e8, 0x02050701},
-+      {0x0000a0ec, 0x02050702},
-+      {0x0000a0f0, 0x02050703},
-+      {0x0000a0f4, 0x02050704},
-+      {0x0000a0f8, 0x02050705},
-+      {0x0000a0fc, 0x02050708},
-+      {0x0000a100, 0x02050709},
-+      {0x0000a104, 0x0205070a},
-+      {0x0000a108, 0x0205070b},
-+      {0x0000a10c, 0x0205070c},
-+      {0x0000a110, 0x0205070d},
-+      {0x0000a114, 0x02050710},
-+      {0x0000a118, 0x02050711},
-+      {0x0000a11c, 0x02050712},
-+      {0x0000a120, 0x02050713},
-+      {0x0000a124, 0x02050714},
-+      {0x0000a128, 0x02050715},
-+      {0x0000a12c, 0x02050730},
-+      {0x0000a130, 0x02050731},
-+      {0x0000a134, 0x02050732},
-+      {0x0000a138, 0x02050733},
-+      {0x0000a13c, 0x02050734},
-+      {0x0000a140, 0x02050735},
-+      {0x0000a144, 0x02050750},
-+      {0x0000a148, 0x02050751},
-+      {0x0000a14c, 0x02050752},
-+      {0x0000a150, 0x02050753},
-+      {0x0000a154, 0x02050754},
-+      {0x0000a158, 0x02050755},
-+      {0x0000a15c, 0x02050770},
-+      {0x0000a160, 0x02050771},
-+      {0x0000a164, 0x02050772},
-+      {0x0000a168, 0x02050773},
-+      {0x0000a16c, 0x02050774},
-+      {0x0000a170, 0x02050775},
-+      {0x0000a174, 0x00000776},
-+      {0x0000a178, 0x00000776},
-+      {0x0000a17c, 0x00000776},
-+      {0x0000a180, 0x00000776},
-+      {0x0000a184, 0x00000776},
-+      {0x0000a188, 0x00000776},
-+      {0x0000a18c, 0x00000776},
-+      {0x0000a190, 0x00000776},
-+      {0x0000a194, 0x00000776},
-+      {0x0000a198, 0x00000776},
-+      {0x0000a19c, 0x00000776},
-+      {0x0000a1a0, 0x00000776},
-+      {0x0000a1a4, 0x00000776},
-+      {0x0000a1a8, 0x00000776},
-+      {0x0000a1ac, 0x00000776},
-+      {0x0000a1b0, 0x00000776},
-+      {0x0000a1b4, 0x00000776},
-+      {0x0000a1b8, 0x00000776},
-+      {0x0000a1bc, 0x00000776},
-+      {0x0000a1c0, 0x00000776},
-+      {0x0000a1c4, 0x00000776},
-+      {0x0000a1c8, 0x00000776},
-+      {0x0000a1cc, 0x00000776},
-+      {0x0000a1d0, 0x00000776},
-+      {0x0000a1d4, 0x00000776},
-+      {0x0000a1d8, 0x00000776},
-+      {0x0000a1dc, 0x00000776},
-+      {0x0000a1e0, 0x00000776},
-+      {0x0000a1e4, 0x00000776},
-+      {0x0000a1e8, 0x00000776},
-+      {0x0000a1ec, 0x00000776},
-+      {0x0000a1f0, 0x00000776},
-+      {0x0000a1f4, 0x00000776},
-+      {0x0000a1f8, 0x00000776},
-+      {0x0000a1fc, 0x00000776},
-+      {0x0000b000, 0x02000101},
-+      {0x0000b004, 0x02000102},
-+      {0x0000b008, 0x02000103},
-+      {0x0000b00c, 0x02000104},
-+      {0x0000b010, 0x02000200},
-+      {0x0000b014, 0x02000201},
-+      {0x0000b018, 0x02000202},
-+      {0x0000b01c, 0x02000203},
-+      {0x0000b020, 0x02000204},
-+      {0x0000b024, 0x02000205},
-+      {0x0000b028, 0x02000208},
-+      {0x0000b02c, 0x02000302},
-+      {0x0000b030, 0x02000303},
-+      {0x0000b034, 0x02000304},
-+      {0x0000b038, 0x02000400},
-+      {0x0000b03c, 0x02010300},
-+      {0x0000b040, 0x02010301},
-+      {0x0000b044, 0x02010302},
-+      {0x0000b048, 0x02000500},
-+      {0x0000b04c, 0x02010400},
-+      {0x0000b050, 0x02020300},
-+      {0x0000b054, 0x02020301},
-+      {0x0000b058, 0x02020302},
-+      {0x0000b05c, 0x02020303},
-+      {0x0000b060, 0x02020400},
-+      {0x0000b064, 0x02030300},
-+      {0x0000b068, 0x02030301},
-+      {0x0000b06c, 0x02030302},
-+      {0x0000b070, 0x02030303},
-+      {0x0000b074, 0x02030400},
-+      {0x0000b078, 0x02040300},
-+      {0x0000b07c, 0x02040301},
-+      {0x0000b080, 0x02040302},
-+      {0x0000b084, 0x02040303},
-+      {0x0000b088, 0x02030500},
-+      {0x0000b08c, 0x02040400},
-+      {0x0000b090, 0x02050203},
-+      {0x0000b094, 0x02050204},
-+      {0x0000b098, 0x02050205},
-+      {0x0000b09c, 0x02040500},
-+      {0x0000b0a0, 0x02050301},
-+      {0x0000b0a4, 0x02050302},
-+      {0x0000b0a8, 0x02050303},
-+      {0x0000b0ac, 0x02050400},
-+      {0x0000b0b0, 0x02050401},
-+      {0x0000b0b4, 0x02050402},
-+      {0x0000b0b8, 0x02050403},
-+      {0x0000b0bc, 0x02050500},
-+      {0x0000b0c0, 0x02050501},
-+      {0x0000b0c4, 0x02050502},
-+      {0x0000b0c8, 0x02050503},
-+      {0x0000b0cc, 0x02050504},
-+      {0x0000b0d0, 0x02050600},
-+      {0x0000b0d4, 0x02050601},
-+      {0x0000b0d8, 0x02050602},
-+      {0x0000b0dc, 0x02050603},
-+      {0x0000b0e0, 0x02050604},
-+      {0x0000b0e4, 0x02050700},
-+      {0x0000b0e8, 0x02050701},
-+      {0x0000b0ec, 0x02050702},
-+      {0x0000b0f0, 0x02050703},
-+      {0x0000b0f4, 0x02050704},
-+      {0x0000b0f8, 0x02050705},
-+      {0x0000b0fc, 0x02050708},
-+      {0x0000b100, 0x02050709},
-+      {0x0000b104, 0x0205070a},
-+      {0x0000b108, 0x0205070b},
-+      {0x0000b10c, 0x0205070c},
-+      {0x0000b110, 0x0205070d},
-+      {0x0000b114, 0x02050710},
-+      {0x0000b118, 0x02050711},
-+      {0x0000b11c, 0x02050712},
-+      {0x0000b120, 0x02050713},
-+      {0x0000b124, 0x02050714},
-+      {0x0000b128, 0x02050715},
-+      {0x0000b12c, 0x02050730},
-+      {0x0000b130, 0x02050731},
-+      {0x0000b134, 0x02050732},
-+      {0x0000b138, 0x02050733},
-+      {0x0000b13c, 0x02050734},
-+      {0x0000b140, 0x02050735},
-+      {0x0000b144, 0x02050750},
-+      {0x0000b148, 0x02050751},
-+      {0x0000b14c, 0x02050752},
-+      {0x0000b150, 0x02050753},
-+      {0x0000b154, 0x02050754},
-+      {0x0000b158, 0x02050755},
-+      {0x0000b15c, 0x02050770},
-+      {0x0000b160, 0x02050771},
-+      {0x0000b164, 0x02050772},
-+      {0x0000b168, 0x02050773},
-+      {0x0000b16c, 0x02050774},
-+      {0x0000b170, 0x02050775},
-+      {0x0000b174, 0x00000776},
-+      {0x0000b178, 0x00000776},
-+      {0x0000b17c, 0x00000776},
-+      {0x0000b180, 0x00000776},
-+      {0x0000b184, 0x00000776},
-+      {0x0000b188, 0x00000776},
-+      {0x0000b18c, 0x00000776},
-+      {0x0000b190, 0x00000776},
-+      {0x0000b194, 0x00000776},
-+      {0x0000b198, 0x00000776},
-+      {0x0000b19c, 0x00000776},
-+      {0x0000b1a0, 0x00000776},
-+      {0x0000b1a4, 0x00000776},
-+      {0x0000b1a8, 0x00000776},
-+      {0x0000b1ac, 0x00000776},
-+      {0x0000b1b0, 0x00000776},
-+      {0x0000b1b4, 0x00000776},
-+      {0x0000b1b8, 0x00000776},
-+      {0x0000b1bc, 0x00000776},
-+      {0x0000b1c0, 0x00000776},
-+      {0x0000b1c4, 0x00000776},
-+      {0x0000b1c8, 0x00000776},
-+      {0x0000b1cc, 0x00000776},
-+      {0x0000b1d0, 0x00000776},
-+      {0x0000b1d4, 0x00000776},
-+      {0x0000b1d8, 0x00000776},
-+      {0x0000b1dc, 0x00000776},
-+      {0x0000b1e0, 0x00000776},
-+      {0x0000b1e4, 0x00000776},
-+      {0x0000b1e8, 0x00000776},
-+      {0x0000b1ec, 0x00000776},
-+      {0x0000b1f0, 0x00000776},
-+      {0x0000b1f4, 0x00000776},
-+      {0x0000b1f8, 0x00000776},
-+      {0x0000b1fc, 0x00000776},
-+};
-+
-+static const u32 ar9200_ar9280_2p0_radio_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00007800, 0x00040000},
-+      {0x00007804, 0xdb005012},
-+      {0x00007808, 0x04924914},
-+      {0x0000780c, 0x21084210},
-+      {0x00007810, 0x6d801300},
-+      {0x00007814, 0x0019beff},
-+      {0x00007818, 0x07e41000},
-+      {0x0000781c, 0x00392000},
-+      {0x00007820, 0x92592480},
-+      {0x00007824, 0x00040000},
-+      {0x00007828, 0xdb005012},
-+      {0x0000782c, 0x04924914},
-+      {0x00007830, 0x21084210},
-+      {0x00007834, 0x6d801300},
-+      {0x00007838, 0x0019beff},
-+      {0x0000783c, 0x07e40000},
-+      {0x00007840, 0x00392000},
-+      {0x00007844, 0x92592480},
-+      {0x00007848, 0x00100000},
-+      {0x0000784c, 0x773f0567},
-+      {0x00007850, 0x54214514},
-+      {0x00007854, 0x12035828},
-+      {0x00007858, 0x92592692},
-+      {0x0000785c, 0x00000000},
-+      {0x00007860, 0x56400000},
-+      {0x00007864, 0x0a8e370e},
-+      {0x00007868, 0xc0102850},
-+      {0x0000786c, 0x812d4000},
-+      {0x00007870, 0x807ec400},
-+      {0x00007874, 0x001b6db0},
-+      {0x00007878, 0x00376b63},
-+      {0x0000787c, 0x06db6db6},
-+      {0x00007880, 0x006d8000},
-+      {0x00007884, 0xffeffffe},
-+      {0x00007888, 0xffeffffe},
-+      {0x0000788c, 0x00010000},
-+      {0x00007890, 0x02060aeb},
-+      {0x00007894, 0x5a108000},
-+};
-+
-+static const u32 ar9462_2p0_mac_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00008014, 0x10f810f8, 0x10f810f8, 0x10f810f8, 0x10f810f8},
-+      {0x0000801c, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017},
-+};
-+
-+static const u32 ar9462_2p0_radio_postamble_sys3ant[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
-+      {0x00016140, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
-+      {0x00016540, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
-+};
-+
-+static const u32 ar9462_2p0_baseband_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x00009e3c, 0xcf946221, 0xcf946221, 0xcf946221, 0xcf946221},
-+      {0x00009e44, 0xfc5c0000, 0xfc5c0000, 0xfc5c0000, 0xfc5c0000},
-+      {0x0000a258, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
-+      {0x0000a25c, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
-+      {0x0000a28c, 0x00011111, 0x00011111, 0x00011111, 0x00011111},
-+      {0x0000a2c4, 0x00148d18, 0x00148d18, 0x00148d20, 0x00148d20},
-+      {0x0000a2d8, 0xf999a800, 0xf999a800, 0xf999a80c, 0xf999a80c},
-+      {0x0000a50c, 0x0000c00a, 0x0000c00a, 0x0000c00a, 0x0000c00a},
-+      {0x0000a538, 0x00038e8c, 0x00038e8c, 0x00038e8c, 0x00038e8c},
-+      {0x0000a53c, 0x0003cecc, 0x0003cecc, 0x0003cecc, 0x0003cecc},
-+      {0x0000a540, 0x00040ed4, 0x00040ed4, 0x00040ed4, 0x00040ed4},
-+      {0x0000a544, 0x00044edc, 0x00044edc, 0x00044edc, 0x00044edc},
-+      {0x0000a548, 0x00048ede, 0x00048ede, 0x00048ede, 0x00048ede},
-+      {0x0000a54c, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
-+      {0x0000a550, 0x00050f5e, 0x00050f5e, 0x00050f5e, 0x00050f5e},
-+      {0x0000a554, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e},
-+      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+};
-+
-+static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
-+      {0x00016140, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
-+      {0x00016540, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
-+};
-+
-+static const u32 ar9462_common_wo_xlna_rx_gain_table_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x03820190},
-+      {0x0000a030, 0x03840383},
-+      {0x0000a034, 0x03880385},
-+      {0x0000a038, 0x038a0389},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x29292929},
-+      {0x0000a084, 0x29292929},
-+      {0x0000a088, 0x29292929},
-+      {0x0000a08c, 0x29292929},
-+      {0x0000a090, 0x22292929},
-+      {0x0000a094, 0x1d1d2222},
-+      {0x0000a098, 0x0c111117},
-+      {0x0000a09c, 0x00030303},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x32323232},
-+      {0x0000b084, 0x2f2f3232},
-+      {0x0000b088, 0x23282a2d},
-+      {0x0000b08c, 0x1c1e2123},
-+      {0x0000b090, 0x14171919},
-+      {0x0000b094, 0x0e0e1214},
-+      {0x0000b098, 0x03050707},
-+      {0x0000b09c, 0x00030303},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_2p0_baseband_core_txfir_coeff_japan_2484[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a398, 0x00000000},
-+      {0x0000a39c, 0x6f7f0301},
-+      {0x0000a3a0, 0xca9228ee},
-+};
-+
-+static const u32 ar9462_modes_low_ob_db_tx_gain_table_2p0[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
-+      {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-+      {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
-+      {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
-+      {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
-+      {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
-+      {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
-+      {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
-+      {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
-+      {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
-+      {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
-+      {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
-+      {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
-+      {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
-+      {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
-+      {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
-+      {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
-+      {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
-+      {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
-+      {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
-+      {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
-+      {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
-+      {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
-+      {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
-+      {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
-+      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
-+      {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
-+      {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
-+      {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
-+      {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
-+      {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
-+};
-+
-+static const u32 ar9462_2p0_soc_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00007010, 0x00002233, 0x00002233, 0x00002233, 0x00002233},
-+};
-+
-+static const u32 ar9462_2p0_baseband_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00009800, 0xafe68e30},
-+      {0x00009804, 0xfd14e000},
-+      {0x00009808, 0x9c0a9f6b},
-+      {0x0000980c, 0x04900000},
-+      {0x00009814, 0x9280c00a},
-+      {0x00009818, 0x00000000},
-+      {0x0000981c, 0x00020028},
-+      {0x00009834, 0x6400a290},
-+      {0x00009838, 0x0108ecff},
-+      {0x0000983c, 0x0d000600},
-+      {0x00009880, 0x201fff00},
-+      {0x00009884, 0x00001042},
-+      {0x000098a4, 0x00200400},
-+      {0x000098b0, 0x32440bbe},
-+      {0x000098d0, 0x004b6a8e},
-+      {0x000098d4, 0x00000820},
-+      {0x000098dc, 0x00000000},
-+      {0x000098e4, 0x01ffffff},
-+      {0x000098e8, 0x01ffffff},
-+      {0x000098ec, 0x01ffffff},
-+      {0x000098f0, 0x00000000},
-+      {0x000098f4, 0x00000000},
-+      {0x00009bf0, 0x80000000},
-+      {0x00009c04, 0xff55ff55},
-+      {0x00009c08, 0x0320ff55},
-+      {0x00009c0c, 0x00000000},
-+      {0x00009c10, 0x00000000},
-+      {0x00009c14, 0x00046384},
-+      {0x00009c18, 0x05b6b440},
-+      {0x00009c1c, 0x00b6b440},
-+      {0x00009d00, 0xc080a333},
-+      {0x00009d04, 0x40206c10},
-+      {0x00009d08, 0x009c4060},
-+      {0x00009d0c, 0x9883800a},
-+      {0x00009d10, 0x01834061},
-+      {0x00009d14, 0x00c0040b},
-+      {0x00009d18, 0x00000000},
-+      {0x00009e08, 0x0038230c},
-+      {0x00009e24, 0x990bb515},
-+      {0x00009e28, 0x0c6f0000},
-+      {0x00009e30, 0x06336f77},
-+      {0x00009e34, 0x6af6532f},
-+      {0x00009e38, 0x0cc80c00},
-+      {0x00009e40, 0x0d261820},
-+      {0x00009e4c, 0x00001004},
-+      {0x00009e50, 0x00ff03f1},
-+      {0x00009e54, 0xe4c355c7},
-+      {0x00009e58, 0xfd897735},
-+      {0x00009e5c, 0xe9198724},
-+      {0x00009fc0, 0x803e4788},
-+      {0x00009fc4, 0x0001efb5},
-+      {0x00009fcc, 0x40000014},
-+      {0x00009fd0, 0x01193b93},
-+      {0x0000a20c, 0x00000000},
-+      {0x0000a220, 0x00000000},
-+      {0x0000a224, 0x00000000},
-+      {0x0000a228, 0x10002310},
-+      {0x0000a23c, 0x00000000},
-+      {0x0000a244, 0x0c000000},
-+      {0x0000a2a0, 0x00000001},
-+      {0x0000a2c0, 0x00000001},
-+      {0x0000a2c8, 0x00000000},
-+      {0x0000a2cc, 0x18c43433},
-+      {0x0000a2d4, 0x00000000},
-+      {0x0000a2ec, 0x00000000},
-+      {0x0000a2f0, 0x00000000},
-+      {0x0000a2f4, 0x00000000},
-+      {0x0000a2f8, 0x00000000},
-+      {0x0000a344, 0x00000000},
-+      {0x0000a34c, 0x00000000},
-+      {0x0000a350, 0x0000a000},
-+      {0x0000a364, 0x00000000},
-+      {0x0000a370, 0x00000000},
-+      {0x0000a390, 0x00000001},
-+      {0x0000a394, 0x00000444},
-+      {0x0000a398, 0x001f0e0f},
-+      {0x0000a39c, 0x0075393f},
-+      {0x0000a3a0, 0xb79f6427},
-+      {0x0000a3a4, 0x00000000},
-+      {0x0000a3a8, 0xaaaaaaaa},
-+      {0x0000a3ac, 0x3c466478},
-+      {0x0000a3c0, 0x20202020},
-+      {0x0000a3c4, 0x22222220},
-+      {0x0000a3c8, 0x20200020},
-+      {0x0000a3cc, 0x20202020},
-+      {0x0000a3d0, 0x20202020},
-+      {0x0000a3d4, 0x20202020},
-+      {0x0000a3d8, 0x20202020},
-+      {0x0000a3dc, 0x20202020},
-+      {0x0000a3e0, 0x20202020},
-+      {0x0000a3e4, 0x20202020},
-+      {0x0000a3e8, 0x20202020},
-+      {0x0000a3ec, 0x20202020},
-+      {0x0000a3f0, 0x00000000},
-+      {0x0000a3f4, 0x00000006},
-+      {0x0000a3f8, 0x0c9bd380},
-+      {0x0000a3fc, 0x000f0f01},
-+      {0x0000a400, 0x8fa91f01},
-+      {0x0000a404, 0x00000000},
-+      {0x0000a408, 0x0e79e5c6},
-+      {0x0000a40c, 0x00820820},
-+      {0x0000a414, 0x1ce739ce},
-+      {0x0000a418, 0x2d001dce},
-+      {0x0000a41c, 0x1ce739ce},
-+      {0x0000a420, 0x000001ce},
-+      {0x0000a424, 0x1ce739ce},
-+      {0x0000a428, 0x000001ce},
-+      {0x0000a42c, 0x1ce739ce},
-+      {0x0000a430, 0x1ce739ce},
-+      {0x0000a434, 0x00000000},
-+      {0x0000a438, 0x00001801},
-+      {0x0000a43c, 0x00100000},
-+      {0x0000a444, 0x00000000},
-+      {0x0000a448, 0x05000080},
-+      {0x0000a44c, 0x00000001},
-+      {0x0000a450, 0x00010000},
-+      {0x0000a454, 0x07000000},
-+      {0x0000a644, 0xbfad9d74},
-+      {0x0000a648, 0x0048060a},
-+      {0x0000a64c, 0x00002037},
-+      {0x0000a670, 0x03020100},
-+      {0x0000a674, 0x09080504},
-+      {0x0000a678, 0x0d0c0b0a},
-+      {0x0000a67c, 0x13121110},
-+      {0x0000a680, 0x31301514},
-+      {0x0000a684, 0x35343332},
-+      {0x0000a688, 0x00000036},
-+      {0x0000a690, 0x00000838},
-+      {0x0000a6b0, 0x0000000a},
-+      {0x0000a6b4, 0x00512c01},
-+      {0x0000a7c0, 0x00000000},
-+      {0x0000a7c4, 0xfffffffc},
-+      {0x0000a7c8, 0x00000000},
-+      {0x0000a7cc, 0x00000000},
-+      {0x0000a7d0, 0x00000000},
-+      {0x0000a7d4, 0x00000004},
-+      {0x0000a7dc, 0x00000001},
-+      {0x0000a7f0, 0x80000000},
-+      {0x0000a8d0, 0x004b6a8e},
-+      {0x0000a8d4, 0x00000820},
-+      {0x0000a8dc, 0x00000000},
-+      {0x0000a8f0, 0x00000000},
-+      {0x0000a8f4, 0x00000000},
-+      {0x0000abf0, 0x80000000},
-+      {0x0000b2d0, 0x00000080},
-+      {0x0000b2d4, 0x00000000},
-+      {0x0000b2ec, 0x00000000},
-+      {0x0000b2f0, 0x00000000},
-+      {0x0000b2f4, 0x00000000},
-+      {0x0000b2f8, 0x00000000},
-+      {0x0000b408, 0x0e79e5c0},
-+      {0x0000b40c, 0x00820820},
-+      {0x0000b420, 0x00000000},
-+      {0x0000b6b0, 0x0000000a},
-+      {0x0000b6b4, 0x00000001},
-+};
-+
-+static const u32 ar9462_2p0_radio_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
-+      {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
-+      {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
-+      {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
-+};
-+
-+static const u32 ar9462_modes_high_ob_db_tx_gain_table_2p0[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
-+      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-+      {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
-+      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
-+      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
-+      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
-+      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
-+      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
-+      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
-+      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
-+      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
-+      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
-+      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
-+      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
-+      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
-+      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
-+      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
-+      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
-+      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
-+      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
-+      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
-+      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
-+      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
-+      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
-+      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
-+      {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
-+      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
-+      {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
-+};
-+
-+static const u32 ar9462_2p0_radio_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00016000, 0x36db6db6},
-+      {0x00016004, 0x6db6db40},
-+      {0x00016008, 0x73f00000},
-+      {0x0001600c, 0x00000000},
-+      {0x00016010, 0x6d820001},
-+      {0x00016040, 0x7f80fff8},
-+      {0x0001604c, 0x2699e04f},
-+      {0x00016050, 0x6db6db6c},
-+      {0x00016058, 0x6c200000},
-+      {0x00016080, 0x00040000},
-+      {0x00016084, 0x9a68048c},
-+      {0x00016088, 0x54214514},
-+      {0x0001608c, 0x1203040b},
-+      {0x00016090, 0x24926490},
-+      {0x00016098, 0xd2888888},
-+      {0x000160a0, 0x0a108ffe},
-+      {0x000160a4, 0x812fc491},
-+      {0x000160a8, 0x423c8000},
-+      {0x000160b4, 0x92000000},
-+      {0x000160b8, 0x0285dddc},
-+      {0x000160bc, 0x02908888},
-+      {0x000160c0, 0x00adb6d0},
-+      {0x000160c4, 0x6db6db60},
-+      {0x000160c8, 0x6db6db6c},
-+      {0x000160cc, 0x0de6c1b0},
-+      {0x00016100, 0x3fffbe04},
-+      {0x00016104, 0xfff80000},
-+      {0x00016108, 0x00200400},
-+      {0x00016110, 0x00000000},
-+      {0x00016144, 0x02084080},
-+      {0x00016148, 0x000080c0},
-+      {0x00016280, 0x050a0001},
-+      {0x00016284, 0x3d841400},
-+      {0x00016288, 0x00000000},
-+      {0x0001628c, 0xe3000000},
-+      {0x00016290, 0xa1005080},
-+      {0x00016294, 0x00000020},
-+      {0x00016298, 0x54a82900},
-+      {0x00016340, 0x121e4276},
-+      {0x00016344, 0x00300000},
-+      {0x00016400, 0x36db6db6},
-+      {0x00016404, 0x6db6db40},
-+      {0x00016408, 0x73f00000},
-+      {0x0001640c, 0x00000000},
-+      {0x00016410, 0x6c800001},
-+      {0x00016440, 0x7f80fff8},
-+      {0x0001644c, 0x4699e04f},
-+      {0x00016450, 0x6db6db6c},
-+      {0x00016500, 0x3fffbe04},
-+      {0x00016504, 0xfff80000},
-+      {0x00016508, 0x00200400},
-+      {0x00016510, 0x00000000},
-+      {0x00016544, 0x02084080},
-+      {0x00016548, 0x000080c0},
-+};
-+
-+static const u32 ar9462_2p0_tx_gain_table_baseband_postamble_emulation[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x0000a410, 0x000000d5, 0x000000d5, 0x000000d5, 0x000000d5},
-+      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x00004002, 0x00004002, 0x00004002, 0x00004002},
-+      {0x0000a508, 0x00008004, 0x00008004, 0x00008004, 0x00008004},
-+      {0x0000a510, 0x0001000c, 0x0001000c, 0x0001000c, 0x0001000c},
-+      {0x0000a514, 0x0001420b, 0x0001420b, 0x0001420b, 0x0001420b},
-+      {0x0000a518, 0x0001824a, 0x0001824a, 0x0001824a, 0x0001824a},
-+      {0x0000a51c, 0x0001c44a, 0x0001c44a, 0x0001c44a, 0x0001c44a},
-+      {0x0000a520, 0x0002064a, 0x0002064a, 0x0002064a, 0x0002064a},
-+      {0x0000a524, 0x0002484a, 0x0002484a, 0x0002484a, 0x0002484a},
-+      {0x0000a528, 0x00028a4a, 0x00028a4a, 0x00028a4a, 0x00028a4a},
-+      {0x0000a52c, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
-+      {0x0000a530, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a},
-+      {0x0000a534, 0x00034e8a, 0x00034e8a, 0x00034e8a, 0x00034e8a},
-+};
-+
-+static const u32 ar9462_2p0_soc_preamble[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00007020, 0x00000000},
-+      {0x00007034, 0x00000002},
-+      {0x00007038, 0x000004c2},
-+};
-+
-+static const u32 ar9462_2p0_sys2ant[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00063120, 0x00801980},
-+};
-+
-+static const u32 ar9462_2p0_mac_core[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00000008, 0x00000000},
-+      {0x00000030, 0x000e0085},
-+      {0x00000034, 0x00000005},
-+      {0x00000040, 0x00000000},
-+      {0x00000044, 0x00000000},
-+      {0x00000048, 0x00000008},
-+      {0x0000004c, 0x00000010},
-+      {0x00000050, 0x00000000},
-+      {0x00001040, 0x002ffc0f},
-+      {0x00001044, 0x002ffc0f},
-+      {0x00001048, 0x002ffc0f},
-+      {0x0000104c, 0x002ffc0f},
-+      {0x00001050, 0x002ffc0f},
-+      {0x00001054, 0x002ffc0f},
-+      {0x00001058, 0x002ffc0f},
-+      {0x0000105c, 0x002ffc0f},
-+      {0x00001060, 0x002ffc0f},
-+      {0x00001064, 0x002ffc0f},
-+      {0x000010f0, 0x00000100},
-+      {0x00001270, 0x00000000},
-+      {0x000012b0, 0x00000000},
-+      {0x000012f0, 0x00000000},
-+      {0x0000143c, 0x00000000},
-+      {0x0000147c, 0x00000000},
-+      {0x00001810, 0x0f000003},
-+      {0x00008000, 0x00000000},
-+      {0x00008004, 0x00000000},
-+      {0x00008008, 0x00000000},
-+      {0x0000800c, 0x00000000},
-+      {0x00008018, 0x00000000},
-+      {0x00008020, 0x00000000},
-+      {0x00008038, 0x00000000},
-+      {0x0000803c, 0x00080000},
-+      {0x00008040, 0x00000000},
-+      {0x00008044, 0x00000000},
-+      {0x00008048, 0x00000000},
-+      {0x0000804c, 0xffffffff},
-+      {0x00008050, 0xffffffff},
-+      {0x00008054, 0x00000000},
-+      {0x00008058, 0x00000000},
-+      {0x0000805c, 0x000fc78f},
-+      {0x00008060, 0x0000000f},
-+      {0x00008064, 0x00000000},
-+      {0x00008070, 0x00000310},
-+      {0x00008074, 0x00000020},
-+      {0x00008078, 0x00000000},
-+      {0x0000809c, 0x0000000f},
-+      {0x000080a0, 0x00000000},
-+      {0x000080a4, 0x02ff0000},
-+      {0x000080a8, 0x0e070605},
-+      {0x000080ac, 0x0000000d},
-+      {0x000080b0, 0x00000000},
-+      {0x000080b4, 0x00000000},
-+      {0x000080b8, 0x00000000},
-+      {0x000080bc, 0x00000000},
-+      {0x000080c0, 0x2a800000},
-+      {0x000080c4, 0x06900168},
-+      {0x000080c8, 0x13881c20},
-+      {0x000080cc, 0x01f40000},
-+      {0x000080d0, 0x00252500},
-+      {0x000080d4, 0x00b00005},
-+      {0x000080d8, 0x00400002},
-+      {0x000080dc, 0x00000000},
-+      {0x000080e0, 0xffffffff},
-+      {0x000080e4, 0x0000ffff},
-+      {0x000080e8, 0x3f3f3f3f},
-+      {0x000080ec, 0x00000000},
-+      {0x000080f0, 0x00000000},
-+      {0x000080f4, 0x00000000},
-+      {0x000080fc, 0x00020000},
-+      {0x00008100, 0x00000000},
-+      {0x00008108, 0x00000052},
-+      {0x0000810c, 0x00000000},
-+      {0x00008110, 0x00000000},
-+      {0x00008114, 0x000007ff},
-+      {0x00008118, 0x000000aa},
-+      {0x0000811c, 0x00003210},
-+      {0x00008124, 0x00000000},
-+      {0x00008128, 0x00000000},
-+      {0x0000812c, 0x00000000},
-+      {0x00008130, 0x00000000},
-+      {0x00008134, 0x00000000},
-+      {0x00008138, 0x00000000},
-+      {0x0000813c, 0x0000ffff},
-+      {0x00008144, 0xffffffff},
-+      {0x00008168, 0x00000000},
-+      {0x0000816c, 0x00000000},
-+      {0x00008170, 0x18486e00},
-+      {0x00008174, 0x33332210},
-+      {0x00008178, 0x00000000},
-+      {0x0000817c, 0x00020000},
-+      {0x000081c4, 0x33332210},
-+      {0x000081c8, 0x00000000},
-+      {0x000081cc, 0x00000000},
-+      {0x000081d4, 0x00000000},
-+      {0x000081ec, 0x00000000},
-+      {0x000081f0, 0x00000000},
-+      {0x000081f4, 0x00000000},
-+      {0x000081f8, 0x00000000},
-+      {0x000081fc, 0x00000000},
-+      {0x00008240, 0x00100000},
-+      {0x00008244, 0x0010f400},
-+      {0x00008248, 0x00000800},
-+      {0x0000824c, 0x0001e800},
-+      {0x00008250, 0x00000000},
-+      {0x00008254, 0x00000000},
-+      {0x00008258, 0x00000000},
-+      {0x0000825c, 0x40000000},
-+      {0x00008260, 0x00080922},
-+      {0x00008264, 0x99c00010},
-+      {0x00008268, 0xffffffff},
-+      {0x0000826c, 0x0000ffff},
-+      {0x00008270, 0x00000000},
-+      {0x00008274, 0x40000000},
-+      {0x00008278, 0x003e4180},
-+      {0x0000827c, 0x00000004},
-+      {0x00008284, 0x0000002c},
-+      {0x00008288, 0x0000002c},
-+      {0x0000828c, 0x000000ff},
-+      {0x00008294, 0x00000000},
-+      {0x00008298, 0x00000000},
-+      {0x0000829c, 0x00000000},
-+      {0x00008300, 0x00000140},
-+      {0x00008314, 0x00000000},
-+      {0x0000831c, 0x0000010d},
-+      {0x00008328, 0x00000000},
-+      {0x0000832c, 0x0000001f},
-+      {0x00008330, 0x00000302},
-+      {0x00008334, 0x00000700},
-+      {0x00008338, 0xffff0000},
-+      {0x0000833c, 0x02400000},
-+      {0x00008340, 0x000107ff},
-+      {0x00008344, 0xaa48105b},
-+      {0x00008348, 0x008f0000},
-+      {0x0000835c, 0x00000000},
-+      {0x00008360, 0xffffffff},
-+      {0x00008364, 0xffffffff},
-+      {0x00008368, 0x00000000},
-+      {0x00008370, 0x00000000},
-+      {0x00008374, 0x000000ff},
-+      {0x00008378, 0x00000000},
-+      {0x0000837c, 0x00000000},
-+      {0x00008380, 0xffffffff},
-+      {0x00008384, 0xffffffff},
-+      {0x00008390, 0xffffffff},
-+      {0x00008394, 0xffffffff},
-+      {0x00008398, 0x00000000},
-+      {0x0000839c, 0x00000000},
-+      {0x000083a4, 0x0000fa14},
-+      {0x000083a8, 0x000f0c00},
-+      {0x000083ac, 0x33332210},
-+      {0x000083b0, 0x33332210},
-+      {0x000083b4, 0x33332210},
-+      {0x000083b8, 0x33332210},
-+      {0x000083bc, 0x00000000},
-+      {0x000083c0, 0x00000000},
-+      {0x000083c4, 0x00000000},
-+      {0x000083c8, 0x00000000},
-+      {0x000083cc, 0x00000200},
-+      {0x000083d0, 0x000301ff},
-+};
-+
-+static const u32 ar9462_2p0_mac_postamble[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
-+      {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
-+      {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
-+      {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
-+      {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
-+      {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
-+      {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
-+      {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
-+};
-+
-+static const u32 ar9462_common_mixed_rx_gain_table_2p0[][2] = {
-+      /* Addr      allmodes  */
-+      {0x0000a000, 0x00010000},
-+      {0x0000a004, 0x00030002},
-+      {0x0000a008, 0x00050004},
-+      {0x0000a00c, 0x00810080},
-+      {0x0000a010, 0x00830082},
-+      {0x0000a014, 0x01810180},
-+      {0x0000a018, 0x01830182},
-+      {0x0000a01c, 0x01850184},
-+      {0x0000a020, 0x01890188},
-+      {0x0000a024, 0x018b018a},
-+      {0x0000a028, 0x018d018c},
-+      {0x0000a02c, 0x03820190},
-+      {0x0000a030, 0x03840383},
-+      {0x0000a034, 0x03880385},
-+      {0x0000a038, 0x038a0389},
-+      {0x0000a03c, 0x038c038b},
-+      {0x0000a040, 0x0390038d},
-+      {0x0000a044, 0x03920391},
-+      {0x0000a048, 0x03940393},
-+      {0x0000a04c, 0x03960395},
-+      {0x0000a050, 0x00000000},
-+      {0x0000a054, 0x00000000},
-+      {0x0000a058, 0x00000000},
-+      {0x0000a05c, 0x00000000},
-+      {0x0000a060, 0x00000000},
-+      {0x0000a064, 0x00000000},
-+      {0x0000a068, 0x00000000},
-+      {0x0000a06c, 0x00000000},
-+      {0x0000a070, 0x00000000},
-+      {0x0000a074, 0x00000000},
-+      {0x0000a078, 0x00000000},
-+      {0x0000a07c, 0x00000000},
-+      {0x0000a080, 0x29292929},
-+      {0x0000a084, 0x29292929},
-+      {0x0000a088, 0x29292929},
-+      {0x0000a08c, 0x29292929},
-+      {0x0000a090, 0x22292929},
-+      {0x0000a094, 0x1d1d2222},
-+      {0x0000a098, 0x0c111117},
-+      {0x0000a09c, 0x00030303},
-+      {0x0000a0a0, 0x00000000},
-+      {0x0000a0a4, 0x00000000},
-+      {0x0000a0a8, 0x00000000},
-+      {0x0000a0ac, 0x00000000},
-+      {0x0000a0b0, 0x00000000},
-+      {0x0000a0b4, 0x00000000},
-+      {0x0000a0b8, 0x00000000},
-+      {0x0000a0bc, 0x00000000},
-+      {0x0000a0c0, 0x001f0000},
-+      {0x0000a0c4, 0x01000101},
-+      {0x0000a0c8, 0x011e011f},
-+      {0x0000a0cc, 0x011c011d},
-+      {0x0000a0d0, 0x02030204},
-+      {0x0000a0d4, 0x02010202},
-+      {0x0000a0d8, 0x021f0200},
-+      {0x0000a0dc, 0x0302021e},
-+      {0x0000a0e0, 0x03000301},
-+      {0x0000a0e4, 0x031e031f},
-+      {0x0000a0e8, 0x0402031d},
-+      {0x0000a0ec, 0x04000401},
-+      {0x0000a0f0, 0x041e041f},
-+      {0x0000a0f4, 0x0502041d},
-+      {0x0000a0f8, 0x05000501},
-+      {0x0000a0fc, 0x051e051f},
-+      {0x0000a100, 0x06010602},
-+      {0x0000a104, 0x061f0600},
-+      {0x0000a108, 0x061d061e},
-+      {0x0000a10c, 0x07020703},
-+      {0x0000a110, 0x07000701},
-+      {0x0000a114, 0x00000000},
-+      {0x0000a118, 0x00000000},
-+      {0x0000a11c, 0x00000000},
-+      {0x0000a120, 0x00000000},
-+      {0x0000a124, 0x00000000},
-+      {0x0000a128, 0x00000000},
-+      {0x0000a12c, 0x00000000},
-+      {0x0000a130, 0x00000000},
-+      {0x0000a134, 0x00000000},
-+      {0x0000a138, 0x00000000},
-+      {0x0000a13c, 0x00000000},
-+      {0x0000a140, 0x001f0000},
-+      {0x0000a144, 0x01000101},
-+      {0x0000a148, 0x011e011f},
-+      {0x0000a14c, 0x011c011d},
-+      {0x0000a150, 0x02030204},
-+      {0x0000a154, 0x02010202},
-+      {0x0000a158, 0x021f0200},
-+      {0x0000a15c, 0x0302021e},
-+      {0x0000a160, 0x03000301},
-+      {0x0000a164, 0x031e031f},
-+      {0x0000a168, 0x0402031d},
-+      {0x0000a16c, 0x04000401},
-+      {0x0000a170, 0x041e041f},
-+      {0x0000a174, 0x0502041d},
-+      {0x0000a178, 0x05000501},
-+      {0x0000a17c, 0x051e051f},
-+      {0x0000a180, 0x06010602},
-+      {0x0000a184, 0x061f0600},
-+      {0x0000a188, 0x061d061e},
-+      {0x0000a18c, 0x07020703},
-+      {0x0000a190, 0x07000701},
-+      {0x0000a194, 0x00000000},
-+      {0x0000a198, 0x00000000},
-+      {0x0000a19c, 0x00000000},
-+      {0x0000a1a0, 0x00000000},
-+      {0x0000a1a4, 0x00000000},
-+      {0x0000a1a8, 0x00000000},
-+      {0x0000a1ac, 0x00000000},
-+      {0x0000a1b0, 0x00000000},
-+      {0x0000a1b4, 0x00000000},
-+      {0x0000a1b8, 0x00000000},
-+      {0x0000a1bc, 0x00000000},
-+      {0x0000a1c0, 0x00000000},
-+      {0x0000a1c4, 0x00000000},
-+      {0x0000a1c8, 0x00000000},
-+      {0x0000a1cc, 0x00000000},
-+      {0x0000a1d0, 0x00000000},
-+      {0x0000a1d4, 0x00000000},
-+      {0x0000a1d8, 0x00000000},
-+      {0x0000a1dc, 0x00000000},
-+      {0x0000a1e0, 0x00000000},
-+      {0x0000a1e4, 0x00000000},
-+      {0x0000a1e8, 0x00000000},
-+      {0x0000a1ec, 0x00000000},
-+      {0x0000a1f0, 0x00000396},
-+      {0x0000a1f4, 0x00000396},
-+      {0x0000a1f8, 0x00000396},
-+      {0x0000a1fc, 0x00000196},
-+      {0x0000b000, 0x00010000},
-+      {0x0000b004, 0x00030002},
-+      {0x0000b008, 0x00050004},
-+      {0x0000b00c, 0x00810080},
-+      {0x0000b010, 0x00830082},
-+      {0x0000b014, 0x01810180},
-+      {0x0000b018, 0x01830182},
-+      {0x0000b01c, 0x01850184},
-+      {0x0000b020, 0x02810280},
-+      {0x0000b024, 0x02830282},
-+      {0x0000b028, 0x02850284},
-+      {0x0000b02c, 0x02890288},
-+      {0x0000b030, 0x028b028a},
-+      {0x0000b034, 0x0388028c},
-+      {0x0000b038, 0x038a0389},
-+      {0x0000b03c, 0x038c038b},
-+      {0x0000b040, 0x0390038d},
-+      {0x0000b044, 0x03920391},
-+      {0x0000b048, 0x03940393},
-+      {0x0000b04c, 0x03960395},
-+      {0x0000b050, 0x00000000},
-+      {0x0000b054, 0x00000000},
-+      {0x0000b058, 0x00000000},
-+      {0x0000b05c, 0x00000000},
-+      {0x0000b060, 0x00000000},
-+      {0x0000b064, 0x00000000},
-+      {0x0000b068, 0x00000000},
-+      {0x0000b06c, 0x00000000},
-+      {0x0000b070, 0x00000000},
-+      {0x0000b074, 0x00000000},
-+      {0x0000b078, 0x00000000},
-+      {0x0000b07c, 0x00000000},
-+      {0x0000b080, 0x2a2d2f32},
-+      {0x0000b084, 0x21232328},
-+      {0x0000b088, 0x19191c1e},
-+      {0x0000b08c, 0x12141417},
-+      {0x0000b090, 0x07070e0e},
-+      {0x0000b094, 0x03030305},
-+      {0x0000b098, 0x00000003},
-+      {0x0000b09c, 0x00000000},
-+      {0x0000b0a0, 0x00000000},
-+      {0x0000b0a4, 0x00000000},
-+      {0x0000b0a8, 0x00000000},
-+      {0x0000b0ac, 0x00000000},
-+      {0x0000b0b0, 0x00000000},
-+      {0x0000b0b4, 0x00000000},
-+      {0x0000b0b8, 0x00000000},
-+      {0x0000b0bc, 0x00000000},
-+      {0x0000b0c0, 0x003f0020},
-+      {0x0000b0c4, 0x00400041},
-+      {0x0000b0c8, 0x0140005f},
-+      {0x0000b0cc, 0x0160015f},
-+      {0x0000b0d0, 0x017e017f},
-+      {0x0000b0d4, 0x02410242},
-+      {0x0000b0d8, 0x025f0240},
-+      {0x0000b0dc, 0x027f0260},
-+      {0x0000b0e0, 0x0341027e},
-+      {0x0000b0e4, 0x035f0340},
-+      {0x0000b0e8, 0x037f0360},
-+      {0x0000b0ec, 0x04400441},
-+      {0x0000b0f0, 0x0460045f},
-+      {0x0000b0f4, 0x0541047f},
-+      {0x0000b0f8, 0x055f0540},
-+      {0x0000b0fc, 0x057f0560},
-+      {0x0000b100, 0x06400641},
-+      {0x0000b104, 0x0660065f},
-+      {0x0000b108, 0x067e067f},
-+      {0x0000b10c, 0x07410742},
-+      {0x0000b110, 0x075f0740},
-+      {0x0000b114, 0x077f0760},
-+      {0x0000b118, 0x07800781},
-+      {0x0000b11c, 0x07a0079f},
-+      {0x0000b120, 0x07c107bf},
-+      {0x0000b124, 0x000007c0},
-+      {0x0000b128, 0x00000000},
-+      {0x0000b12c, 0x00000000},
-+      {0x0000b130, 0x00000000},
-+      {0x0000b134, 0x00000000},
-+      {0x0000b138, 0x00000000},
-+      {0x0000b13c, 0x00000000},
-+      {0x0000b140, 0x003f0020},
-+      {0x0000b144, 0x00400041},
-+      {0x0000b148, 0x0140005f},
-+      {0x0000b14c, 0x0160015f},
-+      {0x0000b150, 0x017e017f},
-+      {0x0000b154, 0x02410242},
-+      {0x0000b158, 0x025f0240},
-+      {0x0000b15c, 0x027f0260},
-+      {0x0000b160, 0x0341027e},
-+      {0x0000b164, 0x035f0340},
-+      {0x0000b168, 0x037f0360},
-+      {0x0000b16c, 0x04400441},
-+      {0x0000b170, 0x0460045f},
-+      {0x0000b174, 0x0541047f},
-+      {0x0000b178, 0x055f0540},
-+      {0x0000b17c, 0x057f0560},
-+      {0x0000b180, 0x06400641},
-+      {0x0000b184, 0x0660065f},
-+      {0x0000b188, 0x067e067f},
-+      {0x0000b18c, 0x07410742},
-+      {0x0000b190, 0x075f0740},
-+      {0x0000b194, 0x077f0760},
-+      {0x0000b198, 0x07800781},
-+      {0x0000b19c, 0x07a0079f},
-+      {0x0000b1a0, 0x07c107bf},
-+      {0x0000b1a4, 0x000007c0},
-+      {0x0000b1a8, 0x00000000},
-+      {0x0000b1ac, 0x00000000},
-+      {0x0000b1b0, 0x00000000},
-+      {0x0000b1b4, 0x00000000},
-+      {0x0000b1b8, 0x00000000},
-+      {0x0000b1bc, 0x00000000},
-+      {0x0000b1c0, 0x00000000},
-+      {0x0000b1c4, 0x00000000},
-+      {0x0000b1c8, 0x00000000},
-+      {0x0000b1cc, 0x00000000},
-+      {0x0000b1d0, 0x00000000},
-+      {0x0000b1d4, 0x00000000},
-+      {0x0000b1d8, 0x00000000},
-+      {0x0000b1dc, 0x00000000},
-+      {0x0000b1e0, 0x00000000},
-+      {0x0000b1e4, 0x00000000},
-+      {0x0000b1e8, 0x00000000},
-+      {0x0000b1ec, 0x00000000},
-+      {0x0000b1f0, 0x00000396},
-+      {0x0000b1f4, 0x00000396},
-+      {0x0000b1f8, 0x00000396},
-+      {0x0000b1fc, 0x00000196},
-+};
-+
-+static const u32 ar9462_modes_green_ob_db_tx_gain_table_2p0[][5] = {
-+      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-+      {0x000098bc, 0x00000003, 0x00000003, 0x00000003, 0x00000003},
-+      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
-+      {0x0000a458, 0x80000000, 0x80000000, 0x80000000, 0x80000000},
-+      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
-+      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
-+      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
-+      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
-+      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
-+      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
-+      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
-+      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
-+      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
-+      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
-+      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
-+      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
-+      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
-+      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
-+      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
-+      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
-+      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
-+      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
-+      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
-+      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
-+      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
-+      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
-+      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
-+      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
-+      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
-+      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
-+      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
-+      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
-+      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
-+      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
-+      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
-+      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
-+      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
-+      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
-+      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
-+      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
-+      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
-+      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
-+      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
-+      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
-+      {0x00016054, 0x6db60180, 0x6db60180, 0x6db60180, 0x6db60180},
-+      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
-+      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
-+      {0x00016454, 0x6db60180, 0x6db60180, 0x6db60180, 0x6db60180},
-+};
-+
-+static const u32 ar9462_2p0_BTCOEX_MAX_TXPWR_table[][2] = {
-+      /* Addr      allmodes  */
-+      {0x000018c0, 0x10101010},
-+      {0x000018c4, 0x10101010},
-+      {0x000018c8, 0x10101010},
-+      {0x000018cc, 0x10101010},
-+      {0x000018d0, 0x10101010},
-+      {0x000018d4, 0x10101010},
-+      {0x000018d8, 0x10101010},
-+      {0x000018dc, 0x10101010},
-+};
-+
-+static const u32 ar9462_2p0_baseband_core_emulation[][2] = {
-+      /* Addr      allmodes  */
-+      {0x00009800, 0xafa68e30},
-+      {0x00009884, 0x00002842},
-+      {0x00009c04, 0xff55ff55},
-+      {0x00009c08, 0x0320ff55},
-+      {0x00009e50, 0x00000000},
-+      {0x00009fcc, 0x00000014},
-+      {0x0000a344, 0x00000010},
-+      {0x0000a398, 0x00000000},
-+      {0x0000a39c, 0x71733d01},
-+      {0x0000a3a0, 0xd0ad5c12},
-+      {0x0000a3c0, 0x22222220},
-+      {0x0000a3c4, 0x22222222},
-+      {0x0000a404, 0x00418a11},
-+      {0x0000a418, 0x050001ce},
-+      {0x0000a438, 0x00001800},
-+      {0x0000a458, 0x01444452},
-+      {0x0000a644, 0x3fad9d74},
-+      {0x0000a690, 0x00000038},
-+};
-+
-+#endif /* INITVALS_9462_2P0_H */
---- a/drivers/net/wireless/ath/ath9k/ar9480_1p0_initvals.h
-+++ /dev/null
-@@ -1,1833 +0,0 @@
--/*
-- * Copyright (c) 2010 Atheros Communications Inc.
-- *
-- * Permission to use, copy, modify, and/or distribute this software for any
-- * purpose with or without fee is hereby granted, provided that the above
-- * copyright notice and this permission notice appear in all copies.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-- */
--
--#ifndef INITVALS_9480_1P0_H
--#define INITVALS_9480_1P0_H
--
--/* AR9480 1.0 */
--
--static const u32 ar9480_1p0_mac_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00000008, 0x00000000},
--      {0x00000030, 0x00060085},
--      {0x00000034, 0x00000005},
--      {0x00000040, 0x00000000},
--      {0x00000044, 0x00000000},
--      {0x00000048, 0x00000008},
--      {0x0000004c, 0x00000010},
--      {0x00000050, 0x00000000},
--      {0x00001040, 0x002ffc0f},
--      {0x00001044, 0x002ffc0f},
--      {0x00001048, 0x002ffc0f},
--      {0x0000104c, 0x002ffc0f},
--      {0x00001050, 0x002ffc0f},
--      {0x00001054, 0x002ffc0f},
--      {0x00001058, 0x002ffc0f},
--      {0x0000105c, 0x002ffc0f},
--      {0x00001060, 0x002ffc0f},
--      {0x00001064, 0x002ffc0f},
--      {0x000010f0, 0x00000100},
--      {0x00001270, 0x00000000},
--      {0x000012b0, 0x00000000},
--      {0x000012f0, 0x00000000},
--      {0x0000143c, 0x00000000},
--      {0x0000147c, 0x00000000},
--      {0x00001810, 0x0f000003},
--      {0x00008000, 0x00000000},
--      {0x00008004, 0x00000000},
--      {0x00008008, 0x00000000},
--      {0x0000800c, 0x00000000},
--      {0x00008018, 0x00000000},
--      {0x00008020, 0x00000000},
--      {0x00008038, 0x00000000},
--      {0x0000803c, 0x00080000},
--      {0x00008040, 0x00000000},
--      {0x00008044, 0x00000000},
--      {0x00008048, 0x00000000},
--      {0x0000804c, 0xffffffff},
--      {0x00008050, 0xffffffff},
--      {0x00008054, 0x00000000},
--      {0x00008058, 0x00000000},
--      {0x0000805c, 0x000fc78f},
--      {0x00008060, 0x0000000f},
--      {0x00008064, 0x00000000},
--      {0x00008070, 0x00000310},
--      {0x00008074, 0x00000020},
--      {0x00008078, 0x00000000},
--      {0x0000809c, 0x0000000f},
--      {0x000080a0, 0x00000000},
--      {0x000080a4, 0x02ff0000},
--      {0x000080a8, 0x0e070605},
--      {0x000080ac, 0x0000000d},
--      {0x000080b0, 0x00000000},
--      {0x000080b4, 0x00000000},
--      {0x000080b8, 0x00000000},
--      {0x000080bc, 0x00000000},
--      {0x000080c0, 0x2a800000},
--      {0x000080c4, 0x06900168},
--      {0x000080c8, 0x13881c20},
--      {0x000080cc, 0x01f40000},
--      {0x000080d0, 0x00252500},
--      {0x000080d4, 0x00a00005},
--      {0x000080d8, 0x00400002},
--      {0x000080dc, 0x00000000},
--      {0x000080e0, 0xffffffff},
--      {0x000080e4, 0x0000ffff},
--      {0x000080e8, 0x3f3f3f3f},
--      {0x000080ec, 0x00000000},
--      {0x000080f0, 0x00000000},
--      {0x000080f4, 0x00000000},
--      {0x000080fc, 0x00020000},
--      {0x00008100, 0x00000000},
--      {0x00008108, 0x00000052},
--      {0x0000810c, 0x00000000},
--      {0x00008110, 0x00000000},
--      {0x00008114, 0x000007ff},
--      {0x00008118, 0x000000aa},
--      {0x0000811c, 0x00003210},
--      {0x00008124, 0x00000000},
--      {0x00008128, 0x00000000},
--      {0x0000812c, 0x00000000},
--      {0x00008130, 0x00000000},
--      {0x00008134, 0x00000000},
--      {0x00008138, 0x00000000},
--      {0x0000813c, 0x0000ffff},
--      {0x00008144, 0xffffffff},
--      {0x00008168, 0x00000000},
--      {0x0000816c, 0x00000000},
--      {0x00008170, 0x18486e00},
--      {0x00008174, 0x33332210},
--      {0x00008178, 0x00000000},
--      {0x0000817c, 0x00020000},
--      {0x000081c4, 0x33332210},
--      {0x000081c8, 0x00000000},
--      {0x000081cc, 0x00000000},
--      {0x000081d4, 0x00000000},
--      {0x000081ec, 0x00000000},
--      {0x000081f0, 0x00000000},
--      {0x000081f4, 0x00000000},
--      {0x000081f8, 0x00000000},
--      {0x000081fc, 0x00000000},
--      {0x00008240, 0x00100000},
--      {0x00008244, 0x0010f400},
--      {0x00008248, 0x00000800},
--      {0x0000824c, 0x0001e800},
--      {0x00008250, 0x00000000},
--      {0x00008254, 0x00000000},
--      {0x00008258, 0x00000000},
--      {0x0000825c, 0x40000000},
--      {0x00008260, 0x00080922},
--      {0x00008264, 0x99c00010},
--      {0x00008268, 0xffffffff},
--      {0x0000826c, 0x0000ffff},
--      {0x00008270, 0x00000000},
--      {0x00008274, 0x40000000},
--      {0x00008278, 0x003e4180},
--      {0x0000827c, 0x00000004},
--      {0x00008284, 0x0000002c},
--      {0x00008288, 0x0000002c},
--      {0x0000828c, 0x000000ff},
--      {0x00008294, 0x00000000},
--      {0x00008298, 0x00000000},
--      {0x0000829c, 0x00000000},
--      {0x00008300, 0x00000140},
--      {0x00008314, 0x00000000},
--      {0x0000831c, 0x0000010d},
--      {0x00008328, 0x00000000},
--      {0x0000832c, 0x0000001f},
--      {0x00008330, 0x00000302},
--      {0x00008334, 0x00000700},
--      {0x00008338, 0xffff0000},
--      {0x0000833c, 0x02400000},
--      {0x00008340, 0x000107ff},
--      {0x00008344, 0xaa48105b},
--      {0x00008348, 0x008f0000},
--      {0x0000835c, 0x00000000},
--      {0x00008360, 0xffffffff},
--      {0x00008364, 0xffffffff},
--      {0x00008368, 0x00000000},
--      {0x00008370, 0x00000000},
--      {0x00008374, 0x000000ff},
--      {0x00008378, 0x00000000},
--      {0x0000837c, 0x00000000},
--      {0x00008380, 0xffffffff},
--      {0x00008384, 0xffffffff},
--      {0x00008390, 0xffffffff},
--      {0x00008394, 0xffffffff},
--      {0x00008398, 0x00000000},
--      {0x0000839c, 0x00000000},
--      {0x000083a4, 0x0000fa14},
--      {0x000083a8, 0x000f0c00},
--      {0x000083ac, 0x33332210},
--      {0x000083b0, 0x33332210},
--      {0x000083b4, 0x33332210},
--      {0x000083b8, 0x33332210},
--      {0x000083bc, 0x00000000},
--      {0x000083c0, 0x00000000},
--      {0x000083c4, 0x00000000},
--      {0x000083c8, 0x00000000},
--      {0x000083cc, 0x00000200},
--      {0x000083d0, 0x000301ff},
--};
--
--static const u32 ar9480_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a398, 0x00000000},
--      {0x0000a39c, 0x6f7f0301},
--      {0x0000a3a0, 0xca9228ee},
--};
--
--static const u32 ar9480_1p0_sys3ant[][2] = {
--      /* Addr      allmodes  */
--      {0x00063280, 0x00040807},
--      {0x00063284, 0x104ccccc},
--};
--
--static const u32 ar9480_pcie_phy_clkreq_enable_L1_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x10053e5e},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0000580c},
--};
--
--static const u32 ar9480_1p0_mac_core_emulation[][2] = {
--      /* Addr      allmodes  */
--      {0x00000030, 0x00060085},
--      {0x00000044, 0x00000008},
--      {0x0000805c, 0xffffc7ff},
--      {0x00008344, 0xaa4a105b},
--};
--
--static const u32 ar9480_common_rx_gain_table_ar9280_2p0_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x02000101},
--      {0x0000a004, 0x02000102},
--      {0x0000a008, 0x02000103},
--      {0x0000a00c, 0x02000104},
--      {0x0000a010, 0x02000200},
--      {0x0000a014, 0x02000201},
--      {0x0000a018, 0x02000202},
--      {0x0000a01c, 0x02000203},
--      {0x0000a020, 0x02000204},
--      {0x0000a024, 0x02000205},
--      {0x0000a028, 0x02000208},
--      {0x0000a02c, 0x02000302},
--      {0x0000a030, 0x02000303},
--      {0x0000a034, 0x02000304},
--      {0x0000a038, 0x02000400},
--      {0x0000a03c, 0x02010300},
--      {0x0000a040, 0x02010301},
--      {0x0000a044, 0x02010302},
--      {0x0000a048, 0x02000500},
--      {0x0000a04c, 0x02010400},
--      {0x0000a050, 0x02020300},
--      {0x0000a054, 0x02020301},
--      {0x0000a058, 0x02020302},
--      {0x0000a05c, 0x02020303},
--      {0x0000a060, 0x02020400},
--      {0x0000a064, 0x02030300},
--      {0x0000a068, 0x02030301},
--      {0x0000a06c, 0x02030302},
--      {0x0000a070, 0x02030303},
--      {0x0000a074, 0x02030400},
--      {0x0000a078, 0x02040300},
--      {0x0000a07c, 0x02040301},
--      {0x0000a080, 0x02040302},
--      {0x0000a084, 0x02040303},
--      {0x0000a088, 0x02030500},
--      {0x0000a08c, 0x02040400},
--      {0x0000a090, 0x02050203},
--      {0x0000a094, 0x02050204},
--      {0x0000a098, 0x02050205},
--      {0x0000a09c, 0x02040500},
--      {0x0000a0a0, 0x02050301},
--      {0x0000a0a4, 0x02050302},
--      {0x0000a0a8, 0x02050303},
--      {0x0000a0ac, 0x02050400},
--      {0x0000a0b0, 0x02050401},
--      {0x0000a0b4, 0x02050402},
--      {0x0000a0b8, 0x02050403},
--      {0x0000a0bc, 0x02050500},
--      {0x0000a0c0, 0x02050501},
--      {0x0000a0c4, 0x02050502},
--      {0x0000a0c8, 0x02050503},
--      {0x0000a0cc, 0x02050504},
--      {0x0000a0d0, 0x02050600},
--      {0x0000a0d4, 0x02050601},
--      {0x0000a0d8, 0x02050602},
--      {0x0000a0dc, 0x02050603},
--      {0x0000a0e0, 0x02050604},
--      {0x0000a0e4, 0x02050700},
--      {0x0000a0e8, 0x02050701},
--      {0x0000a0ec, 0x02050702},
--      {0x0000a0f0, 0x02050703},
--      {0x0000a0f4, 0x02050704},
--      {0x0000a0f8, 0x02050705},
--      {0x0000a0fc, 0x02050708},
--      {0x0000a100, 0x02050709},
--      {0x0000a104, 0x0205070a},
--      {0x0000a108, 0x0205070b},
--      {0x0000a10c, 0x0205070c},
--      {0x0000a110, 0x0205070d},
--      {0x0000a114, 0x02050710},
--      {0x0000a118, 0x02050711},
--      {0x0000a11c, 0x02050712},
--      {0x0000a120, 0x02050713},
--      {0x0000a124, 0x02050714},
--      {0x0000a128, 0x02050715},
--      {0x0000a12c, 0x02050730},
--      {0x0000a130, 0x02050731},
--      {0x0000a134, 0x02050732},
--      {0x0000a138, 0x02050733},
--      {0x0000a13c, 0x02050734},
--      {0x0000a140, 0x02050735},
--      {0x0000a144, 0x02050750},
--      {0x0000a148, 0x02050751},
--      {0x0000a14c, 0x02050752},
--      {0x0000a150, 0x02050753},
--      {0x0000a154, 0x02050754},
--      {0x0000a158, 0x02050755},
--      {0x0000a15c, 0x02050770},
--      {0x0000a160, 0x02050771},
--      {0x0000a164, 0x02050772},
--      {0x0000a168, 0x02050773},
--      {0x0000a16c, 0x02050774},
--      {0x0000a170, 0x02050775},
--      {0x0000a174, 0x00000776},
--      {0x0000a178, 0x00000776},
--      {0x0000a17c, 0x00000776},
--      {0x0000a180, 0x00000776},
--      {0x0000a184, 0x00000776},
--      {0x0000a188, 0x00000776},
--      {0x0000a18c, 0x00000776},
--      {0x0000a190, 0x00000776},
--      {0x0000a194, 0x00000776},
--      {0x0000a198, 0x00000776},
--      {0x0000a19c, 0x00000776},
--      {0x0000a1a0, 0x00000776},
--      {0x0000a1a4, 0x00000776},
--      {0x0000a1a8, 0x00000776},
--      {0x0000a1ac, 0x00000776},
--      {0x0000a1b0, 0x00000776},
--      {0x0000a1b4, 0x00000776},
--      {0x0000a1b8, 0x00000776},
--      {0x0000a1bc, 0x00000776},
--      {0x0000a1c0, 0x00000776},
--      {0x0000a1c4, 0x00000776},
--      {0x0000a1c8, 0x00000776},
--      {0x0000a1cc, 0x00000776},
--      {0x0000a1d0, 0x00000776},
--      {0x0000a1d4, 0x00000776},
--      {0x0000a1d8, 0x00000776},
--      {0x0000a1dc, 0x00000776},
--      {0x0000a1e0, 0x00000776},
--      {0x0000a1e4, 0x00000776},
--      {0x0000a1e8, 0x00000776},
--      {0x0000a1ec, 0x00000776},
--      {0x0000a1f0, 0x00000776},
--      {0x0000a1f4, 0x00000776},
--      {0x0000a1f8, 0x00000776},
--      {0x0000a1fc, 0x00000776},
--      {0x0000b000, 0x02000101},
--      {0x0000b004, 0x02000102},
--      {0x0000b008, 0x02000103},
--      {0x0000b00c, 0x02000104},
--      {0x0000b010, 0x02000200},
--      {0x0000b014, 0x02000201},
--      {0x0000b018, 0x02000202},
--      {0x0000b01c, 0x02000203},
--      {0x0000b020, 0x02000204},
--      {0x0000b024, 0x02000205},
--      {0x0000b028, 0x02000208},
--      {0x0000b02c, 0x02000302},
--      {0x0000b030, 0x02000303},
--      {0x0000b034, 0x02000304},
--      {0x0000b038, 0x02000400},
--      {0x0000b03c, 0x02010300},
--      {0x0000b040, 0x02010301},
--      {0x0000b044, 0x02010302},
--      {0x0000b048, 0x02000500},
--      {0x0000b04c, 0x02010400},
--      {0x0000b050, 0x02020300},
--      {0x0000b054, 0x02020301},
--      {0x0000b058, 0x02020302},
--      {0x0000b05c, 0x02020303},
--      {0x0000b060, 0x02020400},
--      {0x0000b064, 0x02030300},
--      {0x0000b068, 0x02030301},
--      {0x0000b06c, 0x02030302},
--      {0x0000b070, 0x02030303},
--      {0x0000b074, 0x02030400},
--      {0x0000b078, 0x02040300},
--      {0x0000b07c, 0x02040301},
--      {0x0000b080, 0x02040302},
--      {0x0000b084, 0x02040303},
--      {0x0000b088, 0x02030500},
--      {0x0000b08c, 0x02040400},
--      {0x0000b090, 0x02050203},
--      {0x0000b094, 0x02050204},
--      {0x0000b098, 0x02050205},
--      {0x0000b09c, 0x02040500},
--      {0x0000b0a0, 0x02050301},
--      {0x0000b0a4, 0x02050302},
--      {0x0000b0a8, 0x02050303},
--      {0x0000b0ac, 0x02050400},
--      {0x0000b0b0, 0x02050401},
--      {0x0000b0b4, 0x02050402},
--      {0x0000b0b8, 0x02050403},
--      {0x0000b0bc, 0x02050500},
--      {0x0000b0c0, 0x02050501},
--      {0x0000b0c4, 0x02050502},
--      {0x0000b0c8, 0x02050503},
--      {0x0000b0cc, 0x02050504},
--      {0x0000b0d0, 0x02050600},
--      {0x0000b0d4, 0x02050601},
--      {0x0000b0d8, 0x02050602},
--      {0x0000b0dc, 0x02050603},
--      {0x0000b0e0, 0x02050604},
--      {0x0000b0e4, 0x02050700},
--      {0x0000b0e8, 0x02050701},
--      {0x0000b0ec, 0x02050702},
--      {0x0000b0f0, 0x02050703},
--      {0x0000b0f4, 0x02050704},
--      {0x0000b0f8, 0x02050705},
--      {0x0000b0fc, 0x02050708},
--      {0x0000b100, 0x02050709},
--      {0x0000b104, 0x0205070a},
--      {0x0000b108, 0x0205070b},
--      {0x0000b10c, 0x0205070c},
--      {0x0000b110, 0x0205070d},
--      {0x0000b114, 0x02050710},
--      {0x0000b118, 0x02050711},
--      {0x0000b11c, 0x02050712},
--      {0x0000b120, 0x02050713},
--      {0x0000b124, 0x02050714},
--      {0x0000b128, 0x02050715},
--      {0x0000b12c, 0x02050730},
--      {0x0000b130, 0x02050731},
--      {0x0000b134, 0x02050732},
--      {0x0000b138, 0x02050733},
--      {0x0000b13c, 0x02050734},
--      {0x0000b140, 0x02050735},
--      {0x0000b144, 0x02050750},
--      {0x0000b148, 0x02050751},
--      {0x0000b14c, 0x02050752},
--      {0x0000b150, 0x02050753},
--      {0x0000b154, 0x02050754},
--      {0x0000b158, 0x02050755},
--      {0x0000b15c, 0x02050770},
--      {0x0000b160, 0x02050771},
--      {0x0000b164, 0x02050772},
--      {0x0000b168, 0x02050773},
--      {0x0000b16c, 0x02050774},
--      {0x0000b170, 0x02050775},
--      {0x0000b174, 0x00000776},
--      {0x0000b178, 0x00000776},
--      {0x0000b17c, 0x00000776},
--      {0x0000b180, 0x00000776},
--      {0x0000b184, 0x00000776},
--      {0x0000b188, 0x00000776},
--      {0x0000b18c, 0x00000776},
--      {0x0000b190, 0x00000776},
--      {0x0000b194, 0x00000776},
--      {0x0000b198, 0x00000776},
--      {0x0000b19c, 0x00000776},
--      {0x0000b1a0, 0x00000776},
--      {0x0000b1a4, 0x00000776},
--      {0x0000b1a8, 0x00000776},
--      {0x0000b1ac, 0x00000776},
--      {0x0000b1b0, 0x00000776},
--      {0x0000b1b4, 0x00000776},
--      {0x0000b1b8, 0x00000776},
--      {0x0000b1bc, 0x00000776},
--      {0x0000b1c0, 0x00000776},
--      {0x0000b1c4, 0x00000776},
--      {0x0000b1c8, 0x00000776},
--      {0x0000b1cc, 0x00000776},
--      {0x0000b1d0, 0x00000776},
--      {0x0000b1d4, 0x00000776},
--      {0x0000b1d8, 0x00000776},
--      {0x0000b1dc, 0x00000776},
--      {0x0000b1e0, 0x00000776},
--      {0x0000b1e4, 0x00000776},
--      {0x0000b1e8, 0x00000776},
--      {0x0000b1ec, 0x00000776},
--      {0x0000b1f0, 0x00000776},
--      {0x0000b1f4, 0x00000776},
--      {0x0000b1f8, 0x00000776},
--      {0x0000b1fc, 0x00000776},
--};
--
--static const u32 ar9200_ar9280_2p0_radio_core_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00007800, 0x00040000},
--      {0x00007804, 0xdb005012},
--      {0x00007808, 0x04924914},
--      {0x0000780c, 0x21084210},
--      {0x00007810, 0x6d801300},
--      {0x00007814, 0x0019beff},
--      {0x00007818, 0x07e41000},
--      {0x0000781c, 0x00392000},
--      {0x00007820, 0x92592480},
--      {0x00007824, 0x00040000},
--      {0x00007828, 0xdb005012},
--      {0x0000782c, 0x04924914},
--      {0x00007830, 0x21084210},
--      {0x00007834, 0x6d801300},
--      {0x00007838, 0x0019beff},
--      {0x0000783c, 0x07e40000},
--      {0x00007840, 0x00392000},
--      {0x00007844, 0x92592480},
--      {0x00007848, 0x00100000},
--      {0x0000784c, 0x773f0567},
--      {0x00007850, 0x54214514},
--      {0x00007854, 0x12035828},
--      {0x00007858, 0x92592692},
--      {0x0000785c, 0x00000000},
--      {0x00007860, 0x56400000},
--      {0x00007864, 0x0a8e370e},
--      {0x00007868, 0xc0102850},
--      {0x0000786c, 0x812d4000},
--      {0x00007870, 0x807ec400},
--      {0x00007874, 0x001b6db0},
--      {0x00007878, 0x00376b63},
--      {0x0000787c, 0x06db6db6},
--      {0x00007880, 0x006d8000},
--      {0x00007884, 0xffeffffe},
--      {0x00007888, 0xffeffffe},
--      {0x0000788c, 0x00010000},
--      {0x00007890, 0x02060aeb},
--      {0x00007894, 0x5a108000},
--};
--
--static const u32 ar9480_1p0_baseband_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x00009e3c, 0xcf946221, 0xcf946221, 0xcf946221, 0xcf946221},
--      {0x00009e44, 0x005c0000, 0x005c0000, 0x005c0000, 0x005c0000},
--      {0x0000a258, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
--      {0x0000a25c, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
--      {0x0000a28c, 0x00011111, 0x00011111, 0x00011111, 0x00011111},
--      {0x0000a2c4, 0x00148d18, 0x00148d18, 0x00148d20, 0x00148d20},
--      {0x0000a2d8, 0xf999a800, 0xf999a800, 0xf999a80c, 0xf999a80c},
--      {0x0000a50c, 0x0000c00a, 0x0000c00a, 0x0000c00a, 0x0000c00a},
--      {0x0000a538, 0x00038e8c, 0x00038e8c, 0x00038e8c, 0x00038e8c},
--      {0x0000a53c, 0x0003cecc, 0x0003cecc, 0x0003cecc, 0x0003cecc},
--      {0x0000a540, 0x00040ed4, 0x00040ed4, 0x00040ed4, 0x00040ed4},
--      {0x0000a544, 0x00044edc, 0x00044edc, 0x00044edc, 0x00044edc},
--      {0x0000a548, 0x00048ede, 0x00048ede, 0x00048ede, 0x00048ede},
--      {0x0000a54c, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
--      {0x0000a550, 0x00050f5e, 0x00050f5e, 0x00050f5e, 0x00050f5e},
--      {0x0000a554, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e},
--      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--};
--
--static const u32 ar9480_pcie_phy_pll_on_clkreq_disable_L1_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x10012e5e},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0000580c},
--};
--
--static const u32 ar9480_common_rx_gain_table_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x01910190},
--      {0x0000a030, 0x01930192},
--      {0x0000a034, 0x01950194},
--      {0x0000a038, 0x038a0196},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x22222229},
--      {0x0000a084, 0x1d1d1d1d},
--      {0x0000a088, 0x1d1d1d1d},
--      {0x0000a08c, 0x1d1d1d1d},
--      {0x0000a090, 0x171d1d1d},
--      {0x0000a094, 0x11111717},
--      {0x0000a098, 0x00030311},
--      {0x0000a09c, 0x00000000},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x2a2d2f32},
--      {0x0000b084, 0x21232328},
--      {0x0000b088, 0x19191c1e},
--      {0x0000b08c, 0x12141417},
--      {0x0000b090, 0x07070e0e},
--      {0x0000b094, 0x03030305},
--      {0x0000b098, 0x00000003},
--      {0x0000b09c, 0x00000000},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_modes_high_ob_db_tx_gain_table_1p0[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
--      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
--      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
--      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
--      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
--      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
--      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
--      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
--      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
--      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
--      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
--      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
--      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
--      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
--      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
--      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
--      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
--      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
--      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
--      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
--      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
--      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
--      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
--      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
--      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
--      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
--      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
--      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
--};
--
--static const u32 ar9480_common_wo_xlna_rx_gain_table_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x03820190},
--      {0x0000a030, 0x03840383},
--      {0x0000a034, 0x03880385},
--      {0x0000a038, 0x038a0389},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x29292929},
--      {0x0000a084, 0x29292929},
--      {0x0000a088, 0x29292929},
--      {0x0000a08c, 0x29292929},
--      {0x0000a090, 0x22292929},
--      {0x0000a094, 0x1d1d2222},
--      {0x0000a098, 0x0c111117},
--      {0x0000a09c, 0x00030303},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x32323232},
--      {0x0000b084, 0x2f2f3232},
--      {0x0000b088, 0x23282a2d},
--      {0x0000b08c, 0x1c1e2123},
--      {0x0000b090, 0x14171919},
--      {0x0000b094, 0x0e0e1214},
--      {0x0000b098, 0x03050707},
--      {0x0000b09c, 0x00030303},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_1p0_mac_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
--      {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
--      {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
--      {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
--      {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
--      {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
--      {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
--      {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
--};
--
--static const u32 ar9480_1p0_mac_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00008014, 0x10f810f8, 0x10f810f8, 0x10f810f8, 0x10f810f8},
--      {0x0000801c, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017},
--};
--
--static const u32 ar9480_1p0_tx_gain_table_baseband_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0000a410, 0x000000d5, 0x000000d5, 0x000000d5, 0x000000d5},
--      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a504, 0x00004002, 0x00004002, 0x00004002, 0x00004002},
--      {0x0000a508, 0x00008004, 0x00008004, 0x00008004, 0x00008004},
--      {0x0000a510, 0x0001000c, 0x0001000c, 0x0001000c, 0x0001000c},
--      {0x0000a514, 0x0001420b, 0x0001420b, 0x0001420b, 0x0001420b},
--      {0x0000a518, 0x0001824a, 0x0001824a, 0x0001824a, 0x0001824a},
--      {0x0000a51c, 0x0001c44a, 0x0001c44a, 0x0001c44a, 0x0001c44a},
--      {0x0000a520, 0x0002064a, 0x0002064a, 0x0002064a, 0x0002064a},
--      {0x0000a524, 0x0002484a, 0x0002484a, 0x0002484a, 0x0002484a},
--      {0x0000a528, 0x00028a4a, 0x00028a4a, 0x00028a4a, 0x00028a4a},
--      {0x0000a52c, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
--      {0x0000a530, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a},
--      {0x0000a534, 0x00034e8a, 0x00034e8a, 0x00034e8a, 0x00034e8a},
--};
--
--static const u32 ar9480_1p0_radio_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
--      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24646c08, 0x24646c08},
--      {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
--      {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
--      {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
--      {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
--      {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
--};
--
--static const u32 ar9480_1p0_soc_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00007010, 0x00001133, 0x00001133, 0x00001133, 0x00001133},
--};
--
--static const u32 ar9480_1p0_baseband_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00009800, 0xafe68e30},
--      {0x00009804, 0xfd14e000},
--      {0x00009808, 0x9c0a9f6b},
--      {0x0000980c, 0x04900000},
--      {0x00009814, 0x9280c00a},
--      {0x00009818, 0x00000000},
--      {0x0000981c, 0x00020028},
--      {0x00009834, 0x6400a290},
--      {0x00009838, 0x0108ecff},
--      {0x0000983c, 0x0d000600},
--      {0x00009880, 0x201fff00},
--      {0x00009884, 0x00001042},
--      {0x000098a4, 0x00200400},
--      {0x000098b0, 0x32840bbe},
--      {0x000098d0, 0x004b6a8e},
--      {0x000098d4, 0x00000820},
--      {0x000098dc, 0x00000000},
--      {0x000098e4, 0x01ffffff},
--      {0x000098e8, 0x01ffffff},
--      {0x000098ec, 0x01ffffff},
--      {0x000098f0, 0x00000000},
--      {0x000098f4, 0x00000000},
--      {0x00009c04, 0xff55ff55},
--      {0x00009c08, 0x0320ff55},
--      {0x00009c0c, 0x00000000},
--      {0x00009c10, 0x00000000},
--      {0x00009c14, 0x00046384},
--      {0x00009c18, 0x05b6b440},
--      {0x00009c1c, 0x00b6b440},
--      {0x00009d00, 0xc080a333},
--      {0x00009d04, 0x40206c10},
--      {0x00009d08, 0x009c4060},
--      {0x00009d0c, 0x9883800a},
--      {0x00009d10, 0x01834061},
--      {0x00009d14, 0x00c0040b},
--      {0x00009d18, 0x00000000},
--      {0x00009e08, 0x0038230c},
--      {0x00009e24, 0x990bb514},
--      {0x00009e28, 0x0c6f0000},
--      {0x00009e30, 0x06336f77},
--      {0x00009e34, 0x6af6532f},
--      {0x00009e38, 0x0cc80c00},
--      {0x00009e40, 0x0d261820},
--      {0x00009e4c, 0x00001004},
--      {0x00009e50, 0x00ff03f1},
--      {0x00009e54, 0x64c355c7},
--      {0x00009e58, 0xfd897735},
--      {0x00009e5c, 0xe9198724},
--      {0x00009fc0, 0x803e4788},
--      {0x00009fc4, 0x0001efb5},
--      {0x00009fcc, 0x40000014},
--      {0x00009fd0, 0x01193b93},
--      {0x0000a20c, 0x00000000},
--      {0x0000a220, 0x00000000},
--      {0x0000a224, 0x00000000},
--      {0x0000a228, 0x10002310},
--      {0x0000a23c, 0x00000000},
--      {0x0000a244, 0x0c000000},
--      {0x0000a2a0, 0x00000001},
--      {0x0000a2c0, 0x00000001},
--      {0x0000a2c8, 0x00000000},
--      {0x0000a2cc, 0x18c43433},
--      {0x0000a2d4, 0x00000000},
--      {0x0000a2ec, 0x00000000},
--      {0x0000a2f0, 0x00000000},
--      {0x0000a2f4, 0x00000000},
--      {0x0000a2f8, 0x00000000},
--      {0x0000a344, 0x00000000},
--      {0x0000a34c, 0x00000000},
--      {0x0000a350, 0x0000a000},
--      {0x0000a364, 0x00000000},
--      {0x0000a370, 0x00000000},
--      {0x0000a390, 0x00000001},
--      {0x0000a394, 0x00000444},
--      {0x0000a398, 0x001f0e0f},
--      {0x0000a39c, 0x0075393f},
--      {0x0000a3a0, 0xb79f6427},
--      {0x0000a3a4, 0x00000000},
--      {0x0000a3a8, 0xaaaaaaaa},
--      {0x0000a3ac, 0x3c466478},
--      {0x0000a3c0, 0x20202020},
--      {0x0000a3c4, 0x22222220},
--      {0x0000a3c8, 0x20200020},
--      {0x0000a3cc, 0x20202020},
--      {0x0000a3d0, 0x20202020},
--      {0x0000a3d4, 0x20202020},
--      {0x0000a3d8, 0x20202020},
--      {0x0000a3dc, 0x20202020},
--      {0x0000a3e0, 0x20202020},
--      {0x0000a3e4, 0x20202020},
--      {0x0000a3e8, 0x20202020},
--      {0x0000a3ec, 0x20202020},
--      {0x0000a3f0, 0x00000000},
--      {0x0000a3f4, 0x00000006},
--      {0x0000a3f8, 0x0c9bd380},
--      {0x0000a3fc, 0x000f0f01},
--      {0x0000a400, 0x8fa91f01},
--      {0x0000a404, 0x00000000},
--      {0x0000a408, 0x0e79e5c6},
--      {0x0000a40c, 0x00820820},
--      {0x0000a414, 0x1ce739ce},
--      {0x0000a418, 0x2d001dce},
--      {0x0000a41c, 0x1ce739ce},
--      {0x0000a420, 0x000001ce},
--      {0x0000a424, 0x1ce739ce},
--      {0x0000a428, 0x000001ce},
--      {0x0000a42c, 0x1ce739ce},
--      {0x0000a430, 0x1ce739ce},
--      {0x0000a434, 0x00000000},
--      {0x0000a438, 0x00001801},
--      {0x0000a43c, 0x00100000},
--      {0x0000a440, 0x00000000},
--      {0x0000a444, 0x00000000},
--      {0x0000a448, 0x05000080},
--      {0x0000a44c, 0x00000001},
--      {0x0000a450, 0x00010000},
--      {0x0000a458, 0x00000000},
--      {0x0000a644, 0xbfad9d74},
--      {0x0000a648, 0x0048060a},
--      {0x0000a64c, 0x00003c37},
--      {0x0000a670, 0x03020100},
--      {0x0000a674, 0x09080504},
--      {0x0000a678, 0x0d0c0b0a},
--      {0x0000a67c, 0x13121110},
--      {0x0000a680, 0x31301514},
--      {0x0000a684, 0x35343332},
--      {0x0000a688, 0x00000036},
--      {0x0000a690, 0x00000838},
--      {0x0000a6b0, 0x0000000a},
--      {0x0000a6b4, 0x28f12c01},
--      {0x0000a7c0, 0x00000000},
--      {0x0000a7c4, 0xfffffffc},
--      {0x0000a7c8, 0x00000000},
--      {0x0000a7cc, 0x00000000},
--      {0x0000a7d0, 0x00000000},
--      {0x0000a7d4, 0x00000004},
--      {0x0000a7dc, 0x00000001},
--      {0x0000a8d0, 0x004b6a8e},
--      {0x0000a8d4, 0x00000820},
--      {0x0000a8dc, 0x00000000},
--      {0x0000a8f0, 0x00000000},
--      {0x0000a8f4, 0x00000000},
--      {0x0000b2d0, 0x00000080},
--      {0x0000b2d4, 0x00000000},
--      {0x0000b2ec, 0x00000000},
--      {0x0000b2f0, 0x00000000},
--      {0x0000b2f4, 0x00000000},
--      {0x0000b2f8, 0x00000000},
--      {0x0000b408, 0x0e79e5c0},
--      {0x0000b40c, 0x00820820},
--      {0x0000b420, 0x00000000},
--      {0x0000b6b0, 0x0000000a},
--      {0x0000b6b4, 0x00c00001},
--};
--
--static const u32 ar9480_1p0_baseband_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
--      {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
--      {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
--      {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
--      {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
--      {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
--      {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
--      {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0},
--      {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
--      {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
--      {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e},
--      {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e},
--      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
--      {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
--      {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
--      {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782},
--      {0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
--      {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
--      {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
--      {0x0000a204, 0x0131b7c0, 0x0131b7c4, 0x0131b7c4, 0x0131b7c0},
--      {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
--      {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
--      {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
--      {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
--      {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
--      {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
--      {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
--      {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
--      {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
--      {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
--      {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
--      {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
--      {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
--      {0x0000a288, 0x00000110, 0x00000110, 0x00100110, 0x00100110},
--      {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
--      {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
--      {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
--      {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
--      {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
--      {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
--      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
--      {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
--      {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
--};
--
--static const u32 ar9480_modes_fast_clock_1p0[][3] = {
--      /* Addr      5G_HT20     5G_HT40   */
--      {0x00001030, 0x00000268, 0x000004d0},
--      {0x00001070, 0x0000018c, 0x00000318},
--      {0x000010b0, 0x00000fd0, 0x00001fa0},
--      {0x00008014, 0x044c044c, 0x08980898},
--      {0x0000801c, 0x148ec02b, 0x148ec057},
--      {0x00008318, 0x000044c0, 0x00008980},
--      {0x00009e00, 0x0372131c, 0x0372131c},
--      {0x0000a230, 0x0000400b, 0x00004016},
--      {0x0000a254, 0x00000898, 0x00001130},
--};
--
--static const u32 ar9480_modes_low_ob_db_tx_gain_table_1p0[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
--      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
--      {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
--      {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
--      {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
--      {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
--      {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
--      {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
--      {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
--      {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
--      {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
--      {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
--      {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
--      {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
--      {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
--      {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
--      {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
--      {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
--      {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
--      {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
--      {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
--      {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
--      {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
--      {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
--      {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
--      {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
--      {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
--      {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
--      {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
--      {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
--};
--
--static const u32 ar9480_1p0_soc_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00007010, 0x00002233, 0x00002233, 0x00002233, 0x00002233},
--};
--
--static const u32 ar9480_common_mixed_rx_gain_table_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x03820190},
--      {0x0000a030, 0x03840383},
--      {0x0000a034, 0x03880385},
--      {0x0000a038, 0x038a0389},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x29292929},
--      {0x0000a084, 0x29292929},
--      {0x0000a088, 0x29292929},
--      {0x0000a08c, 0x29292929},
--      {0x0000a090, 0x22292929},
--      {0x0000a094, 0x1d1d2222},
--      {0x0000a098, 0x0c111117},
--      {0x0000a09c, 0x00030303},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x2a2d2f32},
--      {0x0000b084, 0x21232328},
--      {0x0000b088, 0x19191c1e},
--      {0x0000b08c, 0x12141417},
--      {0x0000b090, 0x07070e0e},
--      {0x0000b094, 0x03030305},
--      {0x0000b098, 0x00000003},
--      {0x0000b09c, 0x00000000},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_pcie_phy_clkreq_disable_L1_1p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x10013e5e},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0000580c},
--};
--
--static const u32 ar9480_1p0_baseband_core_emulation[][2] = {
--      /* Addr      allmodes  */
--      {0x00009800, 0xafa68e30},
--      {0x00009884, 0x00002842},
--      {0x00009c04, 0xff55ff55},
--      {0x00009c08, 0x0320ff55},
--      {0x00009e50, 0x00000000},
--      {0x00009fcc, 0x00000014},
--      {0x0000a344, 0x00000010},
--      {0x0000a398, 0x00000000},
--      {0x0000a39c, 0x71733d01},
--      {0x0000a3a0, 0xd0ad5c12},
--      {0x0000a3c0, 0x22222220},
--      {0x0000a3c4, 0x22222222},
--      {0x0000a404, 0x00418a11},
--      {0x0000a418, 0x050001ce},
--      {0x0000a438, 0x00001800},
--      {0x0000a458, 0x01444452},
--      {0x0000a644, 0x3fad9d74},
--      {0x0000a690, 0x00000038},
--};
--
--static const u32 ar9480_1p0_radio_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00016000, 0x36db6db6},
--      {0x00016004, 0x6db6db40},
--      {0x00016008, 0x73f00000},
--      {0x0001600c, 0x00000000},
--      {0x00016010, 0x6d820001},
--      {0x00016040, 0x7f80fff8},
--      {0x0001604c, 0x2699e04f},
--      {0x00016050, 0x6db6db6c},
--      {0x00016054, 0x6db60000},
--      {0x00016058, 0x6c200000},
--      {0x00016080, 0x00040000},
--      {0x00016084, 0x9a68048c},
--      {0x00016088, 0x54214514},
--      {0x0001608c, 0x12030409},
--      {0x00016090, 0x24926490},
--      {0x00016098, 0xd2888888},
--      {0x000160a0, 0x0a108ffe},
--      {0x000160a4, 0x812fc490},
--      {0x000160a8, 0x423c8000},
--      {0x000160b4, 0x92000000},
--      {0x000160b8, 0x0285dddc},
--      {0x000160bc, 0x02908888},
--      {0x000160c0, 0x00adb6d0},
--      {0x000160c4, 0x6db6db60},
--      {0x000160c8, 0x6db6db6c},
--      {0x000160cc, 0x0de6c1b0},
--      {0x00016100, 0x3fffbe04},
--      {0x00016104, 0xfff80000},
--      {0x00016108, 0x00200400},
--      {0x00016110, 0x00000000},
--      {0x00016144, 0x02084080},
--      {0x00016148, 0x000080c0},
--      {0x00016280, 0x050a0001},
--      {0x00016284, 0x3d841400},
--      {0x00016288, 0x00000000},
--      {0x0001628c, 0xe3000000},
--      {0x00016290, 0xa1005080},
--      {0x00016294, 0x00000020},
--      {0x00016298, 0x50a02900},
--      {0x00016340, 0x121e4276},
--      {0x00016344, 0x00300000},
--      {0x00016400, 0x36db6db6},
--      {0x00016404, 0x6db6db40},
--      {0x00016408, 0x73f00000},
--      {0x0001640c, 0x00000000},
--      {0x00016410, 0x6c800001},
--      {0x00016440, 0x7f80fff8},
--      {0x0001644c, 0x4699e04f},
--      {0x00016450, 0x6db6db6c},
--      {0x00016454, 0x6db60000},
--      {0x00016500, 0x3fffbe04},
--      {0x00016504, 0xfff80000},
--      {0x00016508, 0x00200400},
--      {0x00016510, 0x00000000},
--      {0x00016544, 0x02084080},
--      {0x00016548, 0x000080c0},
--};
--
--static const u32 ar9480_1p0_soc_preamble[][2] = {
--      /* Addr      allmodes  */
--      {0x00007020, 0x00000000},
--      {0x00007034, 0x00000002},
--      {0x00007038, 0x000004c2},
--};
--
--static const u32 ar9480_1p0_sys2ant[][2] = {
--      /* Addr      allmodes  */
--      {0x00063120, 0x00801980},
--};
--
--#endif /* INITVALS_9480_1P0_H */
---- a/drivers/net/wireless/ath/ath9k/ar9480_2p0_initvals.h
-+++ /dev/null
-@@ -1,1928 +0,0 @@
--/*
-- * Copyright (c) 2010 Atheros Communications Inc.
-- *
-- * Permission to use, copy, modify, and/or distribute this software for any
-- * purpose with or without fee is hereby granted, provided that the above
-- * copyright notice and this permission notice appear in all copies.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-- */
--
--#ifndef INITVALS_9480_2P0_H
--#define INITVALS_9480_2P0_H
--
--/* AR9480 2.0 */
--
--static const u32 ar9480_modes_fast_clock_2p0[][3] = {
--      /* Addr      5G_HT20     5G_HT40   */
--      {0x00001030, 0x00000268, 0x000004d0},
--      {0x00001070, 0x0000018c, 0x00000318},
--      {0x000010b0, 0x00000fd0, 0x00001fa0},
--      {0x00008014, 0x044c044c, 0x08980898},
--      {0x0000801c, 0x148ec02b, 0x148ec057},
--      {0x00008318, 0x000044c0, 0x00008980},
--      {0x00009e00, 0x0372131c, 0x0372131c},
--      {0x0000a230, 0x0000400b, 0x00004016},
--      {0x0000a254, 0x00000898, 0x00001130},
--};
--
--static const u32 ar9480_pciephy_clkreq_enable_L1_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x18253ede},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0003580c},
--};
--
--static const u32 ar9480_2p0_baseband_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
--      {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
--      {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
--      {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
--      {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
--      {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
--      {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
--      {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0},
--      {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
--      {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
--      {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e},
--      {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3039605e, 0x33795d5e},
--      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
--      {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
--      {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
--      {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c782},
--      {0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
--      {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
--      {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
--      {0x0000a204, 0x013187c0, 0x013187c4, 0x013187c4, 0x013187c0},
--      {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
--      {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
--      {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
--      {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
--      {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
--      {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
--      {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
--      {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
--      {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
--      {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
--      {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
--      {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
--      {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
--      {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
--      {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
--      {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
--      {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
--      {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
--      {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
--      {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
--      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
--      {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
--      {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
--};
--
--static const u32 ar9480_2p0_mac_core_emulation[][2] = {
--      /* Addr      allmodes  */
--      {0x00000030, 0x000e0085},
--      {0x00000044, 0x00000008},
--      {0x0000805c, 0xffffc7ff},
--      {0x00008344, 0xaa4a105b},
--};
--
--static const u32 ar9480_common_rx_gain_table_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x01910190},
--      {0x0000a030, 0x01930192},
--      {0x0000a034, 0x01950194},
--      {0x0000a038, 0x038a0196},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x22222229},
--      {0x0000a084, 0x1d1d1d1d},
--      {0x0000a088, 0x1d1d1d1d},
--      {0x0000a08c, 0x1d1d1d1d},
--      {0x0000a090, 0x171d1d1d},
--      {0x0000a094, 0x11111717},
--      {0x0000a098, 0x00030311},
--      {0x0000a09c, 0x00000000},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x2a2d2f32},
--      {0x0000b084, 0x21232328},
--      {0x0000b088, 0x19191c1e},
--      {0x0000b08c, 0x12141417},
--      {0x0000b090, 0x07070e0e},
--      {0x0000b094, 0x03030305},
--      {0x0000b098, 0x00000003},
--      {0x0000b09c, 0x00000000},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_pciephy_clkreq_disable_L1_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x18213ede},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0003580c},
--};
--
--static const u32 ar9480_pciephy_pll_on_clkreq_disable_L1_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x00018c00, 0x18212ede},
--      {0x00018c04, 0x000801d8},
--      {0x00018c08, 0x0003580c},
--};
--
--static const u32 ar9480_2p0_sys3ant[][2] = {
--      /* Addr      allmodes  */
--      {0x00063280, 0x00040807},
--      {0x00063284, 0x104ccccc},
--};
--
--static const u32 ar9480_common_rx_gain_table_ar9280_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x02000101},
--      {0x0000a004, 0x02000102},
--      {0x0000a008, 0x02000103},
--      {0x0000a00c, 0x02000104},
--      {0x0000a010, 0x02000200},
--      {0x0000a014, 0x02000201},
--      {0x0000a018, 0x02000202},
--      {0x0000a01c, 0x02000203},
--      {0x0000a020, 0x02000204},
--      {0x0000a024, 0x02000205},
--      {0x0000a028, 0x02000208},
--      {0x0000a02c, 0x02000302},
--      {0x0000a030, 0x02000303},
--      {0x0000a034, 0x02000304},
--      {0x0000a038, 0x02000400},
--      {0x0000a03c, 0x02010300},
--      {0x0000a040, 0x02010301},
--      {0x0000a044, 0x02010302},
--      {0x0000a048, 0x02000500},
--      {0x0000a04c, 0x02010400},
--      {0x0000a050, 0x02020300},
--      {0x0000a054, 0x02020301},
--      {0x0000a058, 0x02020302},
--      {0x0000a05c, 0x02020303},
--      {0x0000a060, 0x02020400},
--      {0x0000a064, 0x02030300},
--      {0x0000a068, 0x02030301},
--      {0x0000a06c, 0x02030302},
--      {0x0000a070, 0x02030303},
--      {0x0000a074, 0x02030400},
--      {0x0000a078, 0x02040300},
--      {0x0000a07c, 0x02040301},
--      {0x0000a080, 0x02040302},
--      {0x0000a084, 0x02040303},
--      {0x0000a088, 0x02030500},
--      {0x0000a08c, 0x02040400},
--      {0x0000a090, 0x02050203},
--      {0x0000a094, 0x02050204},
--      {0x0000a098, 0x02050205},
--      {0x0000a09c, 0x02040500},
--      {0x0000a0a0, 0x02050301},
--      {0x0000a0a4, 0x02050302},
--      {0x0000a0a8, 0x02050303},
--      {0x0000a0ac, 0x02050400},
--      {0x0000a0b0, 0x02050401},
--      {0x0000a0b4, 0x02050402},
--      {0x0000a0b8, 0x02050403},
--      {0x0000a0bc, 0x02050500},
--      {0x0000a0c0, 0x02050501},
--      {0x0000a0c4, 0x02050502},
--      {0x0000a0c8, 0x02050503},
--      {0x0000a0cc, 0x02050504},
--      {0x0000a0d0, 0x02050600},
--      {0x0000a0d4, 0x02050601},
--      {0x0000a0d8, 0x02050602},
--      {0x0000a0dc, 0x02050603},
--      {0x0000a0e0, 0x02050604},
--      {0x0000a0e4, 0x02050700},
--      {0x0000a0e8, 0x02050701},
--      {0x0000a0ec, 0x02050702},
--      {0x0000a0f0, 0x02050703},
--      {0x0000a0f4, 0x02050704},
--      {0x0000a0f8, 0x02050705},
--      {0x0000a0fc, 0x02050708},
--      {0x0000a100, 0x02050709},
--      {0x0000a104, 0x0205070a},
--      {0x0000a108, 0x0205070b},
--      {0x0000a10c, 0x0205070c},
--      {0x0000a110, 0x0205070d},
--      {0x0000a114, 0x02050710},
--      {0x0000a118, 0x02050711},
--      {0x0000a11c, 0x02050712},
--      {0x0000a120, 0x02050713},
--      {0x0000a124, 0x02050714},
--      {0x0000a128, 0x02050715},
--      {0x0000a12c, 0x02050730},
--      {0x0000a130, 0x02050731},
--      {0x0000a134, 0x02050732},
--      {0x0000a138, 0x02050733},
--      {0x0000a13c, 0x02050734},
--      {0x0000a140, 0x02050735},
--      {0x0000a144, 0x02050750},
--      {0x0000a148, 0x02050751},
--      {0x0000a14c, 0x02050752},
--      {0x0000a150, 0x02050753},
--      {0x0000a154, 0x02050754},
--      {0x0000a158, 0x02050755},
--      {0x0000a15c, 0x02050770},
--      {0x0000a160, 0x02050771},
--      {0x0000a164, 0x02050772},
--      {0x0000a168, 0x02050773},
--      {0x0000a16c, 0x02050774},
--      {0x0000a170, 0x02050775},
--      {0x0000a174, 0x00000776},
--      {0x0000a178, 0x00000776},
--      {0x0000a17c, 0x00000776},
--      {0x0000a180, 0x00000776},
--      {0x0000a184, 0x00000776},
--      {0x0000a188, 0x00000776},
--      {0x0000a18c, 0x00000776},
--      {0x0000a190, 0x00000776},
--      {0x0000a194, 0x00000776},
--      {0x0000a198, 0x00000776},
--      {0x0000a19c, 0x00000776},
--      {0x0000a1a0, 0x00000776},
--      {0x0000a1a4, 0x00000776},
--      {0x0000a1a8, 0x00000776},
--      {0x0000a1ac, 0x00000776},
--      {0x0000a1b0, 0x00000776},
--      {0x0000a1b4, 0x00000776},
--      {0x0000a1b8, 0x00000776},
--      {0x0000a1bc, 0x00000776},
--      {0x0000a1c0, 0x00000776},
--      {0x0000a1c4, 0x00000776},
--      {0x0000a1c8, 0x00000776},
--      {0x0000a1cc, 0x00000776},
--      {0x0000a1d0, 0x00000776},
--      {0x0000a1d4, 0x00000776},
--      {0x0000a1d8, 0x00000776},
--      {0x0000a1dc, 0x00000776},
--      {0x0000a1e0, 0x00000776},
--      {0x0000a1e4, 0x00000776},
--      {0x0000a1e8, 0x00000776},
--      {0x0000a1ec, 0x00000776},
--      {0x0000a1f0, 0x00000776},
--      {0x0000a1f4, 0x00000776},
--      {0x0000a1f8, 0x00000776},
--      {0x0000a1fc, 0x00000776},
--      {0x0000b000, 0x02000101},
--      {0x0000b004, 0x02000102},
--      {0x0000b008, 0x02000103},
--      {0x0000b00c, 0x02000104},
--      {0x0000b010, 0x02000200},
--      {0x0000b014, 0x02000201},
--      {0x0000b018, 0x02000202},
--      {0x0000b01c, 0x02000203},
--      {0x0000b020, 0x02000204},
--      {0x0000b024, 0x02000205},
--      {0x0000b028, 0x02000208},
--      {0x0000b02c, 0x02000302},
--      {0x0000b030, 0x02000303},
--      {0x0000b034, 0x02000304},
--      {0x0000b038, 0x02000400},
--      {0x0000b03c, 0x02010300},
--      {0x0000b040, 0x02010301},
--      {0x0000b044, 0x02010302},
--      {0x0000b048, 0x02000500},
--      {0x0000b04c, 0x02010400},
--      {0x0000b050, 0x02020300},
--      {0x0000b054, 0x02020301},
--      {0x0000b058, 0x02020302},
--      {0x0000b05c, 0x02020303},
--      {0x0000b060, 0x02020400},
--      {0x0000b064, 0x02030300},
--      {0x0000b068, 0x02030301},
--      {0x0000b06c, 0x02030302},
--      {0x0000b070, 0x02030303},
--      {0x0000b074, 0x02030400},
--      {0x0000b078, 0x02040300},
--      {0x0000b07c, 0x02040301},
--      {0x0000b080, 0x02040302},
--      {0x0000b084, 0x02040303},
--      {0x0000b088, 0x02030500},
--      {0x0000b08c, 0x02040400},
--      {0x0000b090, 0x02050203},
--      {0x0000b094, 0x02050204},
--      {0x0000b098, 0x02050205},
--      {0x0000b09c, 0x02040500},
--      {0x0000b0a0, 0x02050301},
--      {0x0000b0a4, 0x02050302},
--      {0x0000b0a8, 0x02050303},
--      {0x0000b0ac, 0x02050400},
--      {0x0000b0b0, 0x02050401},
--      {0x0000b0b4, 0x02050402},
--      {0x0000b0b8, 0x02050403},
--      {0x0000b0bc, 0x02050500},
--      {0x0000b0c0, 0x02050501},
--      {0x0000b0c4, 0x02050502},
--      {0x0000b0c8, 0x02050503},
--      {0x0000b0cc, 0x02050504},
--      {0x0000b0d0, 0x02050600},
--      {0x0000b0d4, 0x02050601},
--      {0x0000b0d8, 0x02050602},
--      {0x0000b0dc, 0x02050603},
--      {0x0000b0e0, 0x02050604},
--      {0x0000b0e4, 0x02050700},
--      {0x0000b0e8, 0x02050701},
--      {0x0000b0ec, 0x02050702},
--      {0x0000b0f0, 0x02050703},
--      {0x0000b0f4, 0x02050704},
--      {0x0000b0f8, 0x02050705},
--      {0x0000b0fc, 0x02050708},
--      {0x0000b100, 0x02050709},
--      {0x0000b104, 0x0205070a},
--      {0x0000b108, 0x0205070b},
--      {0x0000b10c, 0x0205070c},
--      {0x0000b110, 0x0205070d},
--      {0x0000b114, 0x02050710},
--      {0x0000b118, 0x02050711},
--      {0x0000b11c, 0x02050712},
--      {0x0000b120, 0x02050713},
--      {0x0000b124, 0x02050714},
--      {0x0000b128, 0x02050715},
--      {0x0000b12c, 0x02050730},
--      {0x0000b130, 0x02050731},
--      {0x0000b134, 0x02050732},
--      {0x0000b138, 0x02050733},
--      {0x0000b13c, 0x02050734},
--      {0x0000b140, 0x02050735},
--      {0x0000b144, 0x02050750},
--      {0x0000b148, 0x02050751},
--      {0x0000b14c, 0x02050752},
--      {0x0000b150, 0x02050753},
--      {0x0000b154, 0x02050754},
--      {0x0000b158, 0x02050755},
--      {0x0000b15c, 0x02050770},
--      {0x0000b160, 0x02050771},
--      {0x0000b164, 0x02050772},
--      {0x0000b168, 0x02050773},
--      {0x0000b16c, 0x02050774},
--      {0x0000b170, 0x02050775},
--      {0x0000b174, 0x00000776},
--      {0x0000b178, 0x00000776},
--      {0x0000b17c, 0x00000776},
--      {0x0000b180, 0x00000776},
--      {0x0000b184, 0x00000776},
--      {0x0000b188, 0x00000776},
--      {0x0000b18c, 0x00000776},
--      {0x0000b190, 0x00000776},
--      {0x0000b194, 0x00000776},
--      {0x0000b198, 0x00000776},
--      {0x0000b19c, 0x00000776},
--      {0x0000b1a0, 0x00000776},
--      {0x0000b1a4, 0x00000776},
--      {0x0000b1a8, 0x00000776},
--      {0x0000b1ac, 0x00000776},
--      {0x0000b1b0, 0x00000776},
--      {0x0000b1b4, 0x00000776},
--      {0x0000b1b8, 0x00000776},
--      {0x0000b1bc, 0x00000776},
--      {0x0000b1c0, 0x00000776},
--      {0x0000b1c4, 0x00000776},
--      {0x0000b1c8, 0x00000776},
--      {0x0000b1cc, 0x00000776},
--      {0x0000b1d0, 0x00000776},
--      {0x0000b1d4, 0x00000776},
--      {0x0000b1d8, 0x00000776},
--      {0x0000b1dc, 0x00000776},
--      {0x0000b1e0, 0x00000776},
--      {0x0000b1e4, 0x00000776},
--      {0x0000b1e8, 0x00000776},
--      {0x0000b1ec, 0x00000776},
--      {0x0000b1f0, 0x00000776},
--      {0x0000b1f4, 0x00000776},
--      {0x0000b1f8, 0x00000776},
--      {0x0000b1fc, 0x00000776},
--};
--
--static const u32 ar9200_ar9280_2p0_radio_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00007800, 0x00040000},
--      {0x00007804, 0xdb005012},
--      {0x00007808, 0x04924914},
--      {0x0000780c, 0x21084210},
--      {0x00007810, 0x6d801300},
--      {0x00007814, 0x0019beff},
--      {0x00007818, 0x07e41000},
--      {0x0000781c, 0x00392000},
--      {0x00007820, 0x92592480},
--      {0x00007824, 0x00040000},
--      {0x00007828, 0xdb005012},
--      {0x0000782c, 0x04924914},
--      {0x00007830, 0x21084210},
--      {0x00007834, 0x6d801300},
--      {0x00007838, 0x0019beff},
--      {0x0000783c, 0x07e40000},
--      {0x00007840, 0x00392000},
--      {0x00007844, 0x92592480},
--      {0x00007848, 0x00100000},
--      {0x0000784c, 0x773f0567},
--      {0x00007850, 0x54214514},
--      {0x00007854, 0x12035828},
--      {0x00007858, 0x92592692},
--      {0x0000785c, 0x00000000},
--      {0x00007860, 0x56400000},
--      {0x00007864, 0x0a8e370e},
--      {0x00007868, 0xc0102850},
--      {0x0000786c, 0x812d4000},
--      {0x00007870, 0x807ec400},
--      {0x00007874, 0x001b6db0},
--      {0x00007878, 0x00376b63},
--      {0x0000787c, 0x06db6db6},
--      {0x00007880, 0x006d8000},
--      {0x00007884, 0xffeffffe},
--      {0x00007888, 0xffeffffe},
--      {0x0000788c, 0x00010000},
--      {0x00007890, 0x02060aeb},
--      {0x00007894, 0x5a108000},
--};
--
--static const u32 ar9480_2p0_mac_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00008014, 0x10f810f8, 0x10f810f8, 0x10f810f8, 0x10f810f8},
--      {0x0000801c, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017},
--};
--
--static const u32 ar9480_2p0_radio_postamble_sys3ant[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
--      {0x00016140, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
--      {0x00016540, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
--};
--
--static const u32 ar9480_2p0_baseband_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x00009e3c, 0xcf946221, 0xcf946221, 0xcf946221, 0xcf946221},
--      {0x00009e44, 0xfc5c0000, 0xfc5c0000, 0xfc5c0000, 0xfc5c0000},
--      {0x0000a258, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
--      {0x0000a25c, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
--      {0x0000a28c, 0x00011111, 0x00011111, 0x00011111, 0x00011111},
--      {0x0000a2c4, 0x00148d18, 0x00148d18, 0x00148d20, 0x00148d20},
--      {0x0000a2d8, 0xf999a800, 0xf999a800, 0xf999a80c, 0xf999a80c},
--      {0x0000a50c, 0x0000c00a, 0x0000c00a, 0x0000c00a, 0x0000c00a},
--      {0x0000a538, 0x00038e8c, 0x00038e8c, 0x00038e8c, 0x00038e8c},
--      {0x0000a53c, 0x0003cecc, 0x0003cecc, 0x0003cecc, 0x0003cecc},
--      {0x0000a540, 0x00040ed4, 0x00040ed4, 0x00040ed4, 0x00040ed4},
--      {0x0000a544, 0x00044edc, 0x00044edc, 0x00044edc, 0x00044edc},
--      {0x0000a548, 0x00048ede, 0x00048ede, 0x00048ede, 0x00048ede},
--      {0x0000a54c, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
--      {0x0000a550, 0x00050f5e, 0x00050f5e, 0x00050f5e, 0x00050f5e},
--      {0x0000a554, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e},
--      {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--};
--
--static const u32 ar9480_2p0_radio_postamble_sys2ant[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
--      {0x00016140, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
--      {0x00016540, 0x10804008, 0x10804008, 0x90804008, 0x90804008},
--};
--
--static const u32 ar9480_common_wo_xlna_rx_gain_table_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x03820190},
--      {0x0000a030, 0x03840383},
--      {0x0000a034, 0x03880385},
--      {0x0000a038, 0x038a0389},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x29292929},
--      {0x0000a084, 0x29292929},
--      {0x0000a088, 0x29292929},
--      {0x0000a08c, 0x29292929},
--      {0x0000a090, 0x22292929},
--      {0x0000a094, 0x1d1d2222},
--      {0x0000a098, 0x0c111117},
--      {0x0000a09c, 0x00030303},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x32323232},
--      {0x0000b084, 0x2f2f3232},
--      {0x0000b088, 0x23282a2d},
--      {0x0000b08c, 0x1c1e2123},
--      {0x0000b090, 0x14171919},
--      {0x0000b094, 0x0e0e1214},
--      {0x0000b098, 0x03050707},
--      {0x0000b09c, 0x00030303},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_2p0_baseband_core_txfir_coeff_japan_2484[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a398, 0x00000000},
--      {0x0000a39c, 0x6f7f0301},
--      {0x0000a3a0, 0xca9228ee},
--};
--
--static const u32 ar9480_modes_low_ob_db_tx_gain_table_2p0[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
--      {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
--      {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
--      {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
--      {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
--      {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
--      {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
--      {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
--      {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
--      {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
--      {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
--      {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
--      {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
--      {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
--      {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
--      {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
--      {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
--      {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
--      {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
--      {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
--      {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
--      {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
--      {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
--      {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
--      {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
--      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
--      {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
--      {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
--      {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
--      {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
--      {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
--      {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
--      {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
--      {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
--};
--
--static const u32 ar9480_2p0_soc_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00007010, 0x00002233, 0x00002233, 0x00002233, 0x00002233},
--};
--
--static const u32 ar9480_2p0_baseband_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00009800, 0xafe68e30},
--      {0x00009804, 0xfd14e000},
--      {0x00009808, 0x9c0a9f6b},
--      {0x0000980c, 0x04900000},
--      {0x00009814, 0x9280c00a},
--      {0x00009818, 0x00000000},
--      {0x0000981c, 0x00020028},
--      {0x00009834, 0x6400a290},
--      {0x00009838, 0x0108ecff},
--      {0x0000983c, 0x0d000600},
--      {0x00009880, 0x201fff00},
--      {0x00009884, 0x00001042},
--      {0x000098a4, 0x00200400},
--      {0x000098b0, 0x32440bbe},
--      {0x000098d0, 0x004b6a8e},
--      {0x000098d4, 0x00000820},
--      {0x000098dc, 0x00000000},
--      {0x000098e4, 0x01ffffff},
--      {0x000098e8, 0x01ffffff},
--      {0x000098ec, 0x01ffffff},
--      {0x000098f0, 0x00000000},
--      {0x000098f4, 0x00000000},
--      {0x00009bf0, 0x80000000},
--      {0x00009c04, 0xff55ff55},
--      {0x00009c08, 0x0320ff55},
--      {0x00009c0c, 0x00000000},
--      {0x00009c10, 0x00000000},
--      {0x00009c14, 0x00046384},
--      {0x00009c18, 0x05b6b440},
--      {0x00009c1c, 0x00b6b440},
--      {0x00009d00, 0xc080a333},
--      {0x00009d04, 0x40206c10},
--      {0x00009d08, 0x009c4060},
--      {0x00009d0c, 0x9883800a},
--      {0x00009d10, 0x01834061},
--      {0x00009d14, 0x00c0040b},
--      {0x00009d18, 0x00000000},
--      {0x00009e08, 0x0038230c},
--      {0x00009e24, 0x990bb515},
--      {0x00009e28, 0x0c6f0000},
--      {0x00009e30, 0x06336f77},
--      {0x00009e34, 0x6af6532f},
--      {0x00009e38, 0x0cc80c00},
--      {0x00009e40, 0x0d261820},
--      {0x00009e4c, 0x00001004},
--      {0x00009e50, 0x00ff03f1},
--      {0x00009e54, 0xe4c355c7},
--      {0x00009e58, 0xfd897735},
--      {0x00009e5c, 0xe9198724},
--      {0x00009fc0, 0x803e4788},
--      {0x00009fc4, 0x0001efb5},
--      {0x00009fcc, 0x40000014},
--      {0x00009fd0, 0x01193b93},
--      {0x0000a20c, 0x00000000},
--      {0x0000a220, 0x00000000},
--      {0x0000a224, 0x00000000},
--      {0x0000a228, 0x10002310},
--      {0x0000a23c, 0x00000000},
--      {0x0000a244, 0x0c000000},
--      {0x0000a2a0, 0x00000001},
--      {0x0000a2c0, 0x00000001},
--      {0x0000a2c8, 0x00000000},
--      {0x0000a2cc, 0x18c43433},
--      {0x0000a2d4, 0x00000000},
--      {0x0000a2ec, 0x00000000},
--      {0x0000a2f0, 0x00000000},
--      {0x0000a2f4, 0x00000000},
--      {0x0000a2f8, 0x00000000},
--      {0x0000a344, 0x00000000},
--      {0x0000a34c, 0x00000000},
--      {0x0000a350, 0x0000a000},
--      {0x0000a364, 0x00000000},
--      {0x0000a370, 0x00000000},
--      {0x0000a390, 0x00000001},
--      {0x0000a394, 0x00000444},
--      {0x0000a398, 0x001f0e0f},
--      {0x0000a39c, 0x0075393f},
--      {0x0000a3a0, 0xb79f6427},
--      {0x0000a3a4, 0x00000000},
--      {0x0000a3a8, 0xaaaaaaaa},
--      {0x0000a3ac, 0x3c466478},
--      {0x0000a3c0, 0x20202020},
--      {0x0000a3c4, 0x22222220},
--      {0x0000a3c8, 0x20200020},
--      {0x0000a3cc, 0x20202020},
--      {0x0000a3d0, 0x20202020},
--      {0x0000a3d4, 0x20202020},
--      {0x0000a3d8, 0x20202020},
--      {0x0000a3dc, 0x20202020},
--      {0x0000a3e0, 0x20202020},
--      {0x0000a3e4, 0x20202020},
--      {0x0000a3e8, 0x20202020},
--      {0x0000a3ec, 0x20202020},
--      {0x0000a3f0, 0x00000000},
--      {0x0000a3f4, 0x00000006},
--      {0x0000a3f8, 0x0c9bd380},
--      {0x0000a3fc, 0x000f0f01},
--      {0x0000a400, 0x8fa91f01},
--      {0x0000a404, 0x00000000},
--      {0x0000a408, 0x0e79e5c6},
--      {0x0000a40c, 0x00820820},
--      {0x0000a414, 0x1ce739ce},
--      {0x0000a418, 0x2d001dce},
--      {0x0000a41c, 0x1ce739ce},
--      {0x0000a420, 0x000001ce},
--      {0x0000a424, 0x1ce739ce},
--      {0x0000a428, 0x000001ce},
--      {0x0000a42c, 0x1ce739ce},
--      {0x0000a430, 0x1ce739ce},
--      {0x0000a434, 0x00000000},
--      {0x0000a438, 0x00001801},
--      {0x0000a43c, 0x00100000},
--      {0x0000a444, 0x00000000},
--      {0x0000a448, 0x05000080},
--      {0x0000a44c, 0x00000001},
--      {0x0000a450, 0x00010000},
--      {0x0000a454, 0x07000000},
--      {0x0000a644, 0xbfad9d74},
--      {0x0000a648, 0x0048060a},
--      {0x0000a64c, 0x00002037},
--      {0x0000a670, 0x03020100},
--      {0x0000a674, 0x09080504},
--      {0x0000a678, 0x0d0c0b0a},
--      {0x0000a67c, 0x13121110},
--      {0x0000a680, 0x31301514},
--      {0x0000a684, 0x35343332},
--      {0x0000a688, 0x00000036},
--      {0x0000a690, 0x00000838},
--      {0x0000a6b0, 0x0000000a},
--      {0x0000a6b4, 0x00512c01},
--      {0x0000a7c0, 0x00000000},
--      {0x0000a7c4, 0xfffffffc},
--      {0x0000a7c8, 0x00000000},
--      {0x0000a7cc, 0x00000000},
--      {0x0000a7d0, 0x00000000},
--      {0x0000a7d4, 0x00000004},
--      {0x0000a7dc, 0x00000001},
--      {0x0000a7f0, 0x80000000},
--      {0x0000a8d0, 0x004b6a8e},
--      {0x0000a8d4, 0x00000820},
--      {0x0000a8dc, 0x00000000},
--      {0x0000a8f0, 0x00000000},
--      {0x0000a8f4, 0x00000000},
--      {0x0000abf0, 0x80000000},
--      {0x0000b2d0, 0x00000080},
--      {0x0000b2d4, 0x00000000},
--      {0x0000b2ec, 0x00000000},
--      {0x0000b2f0, 0x00000000},
--      {0x0000b2f4, 0x00000000},
--      {0x0000b2f8, 0x00000000},
--      {0x0000b408, 0x0e79e5c0},
--      {0x0000b40c, 0x00820820},
--      {0x0000b420, 0x00000000},
--      {0x0000b6b0, 0x0000000a},
--      {0x0000b6b4, 0x00000001},
--};
--
--static const u32 ar9480_2p0_radio_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
--      {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
--      {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
--      {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
--};
--
--static const u32 ar9480_modes_high_ob_db_tx_gain_table_2p0[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
--      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
--      {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
--      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
--      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
--      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
--      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
--      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
--      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
--      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
--      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
--      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
--      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
--      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
--      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
--      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
--      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
--      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
--      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
--      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
--      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
--      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
--      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
--      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
--      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
--      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
--      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
--      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
--      {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
--      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
--      {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
--};
--
--static const u32 ar9480_2p0_radio_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00016000, 0x36db6db6},
--      {0x00016004, 0x6db6db40},
--      {0x00016008, 0x73f00000},
--      {0x0001600c, 0x00000000},
--      {0x00016010, 0x6d820001},
--      {0x00016040, 0x7f80fff8},
--      {0x0001604c, 0x2699e04f},
--      {0x00016050, 0x6db6db6c},
--      {0x00016058, 0x6c200000},
--      {0x00016080, 0x00040000},
--      {0x00016084, 0x9a68048c},
--      {0x00016088, 0x54214514},
--      {0x0001608c, 0x1203040b},
--      {0x00016090, 0x24926490},
--      {0x00016098, 0xd2888888},
--      {0x000160a0, 0x0a108ffe},
--      {0x000160a4, 0x812fc491},
--      {0x000160a8, 0x423c8000},
--      {0x000160b4, 0x92000000},
--      {0x000160b8, 0x0285dddc},
--      {0x000160bc, 0x02908888},
--      {0x000160c0, 0x00adb6d0},
--      {0x000160c4, 0x6db6db60},
--      {0x000160c8, 0x6db6db6c},
--      {0x000160cc, 0x0de6c1b0},
--      {0x00016100, 0x3fffbe04},
--      {0x00016104, 0xfff80000},
--      {0x00016108, 0x00200400},
--      {0x00016110, 0x00000000},
--      {0x00016144, 0x02084080},
--      {0x00016148, 0x000080c0},
--      {0x00016280, 0x050a0001},
--      {0x00016284, 0x3d841400},
--      {0x00016288, 0x00000000},
--      {0x0001628c, 0xe3000000},
--      {0x00016290, 0xa1005080},
--      {0x00016294, 0x00000020},
--      {0x00016298, 0x54a82900},
--      {0x00016340, 0x121e4276},
--      {0x00016344, 0x00300000},
--      {0x00016400, 0x36db6db6},
--      {0x00016404, 0x6db6db40},
--      {0x00016408, 0x73f00000},
--      {0x0001640c, 0x00000000},
--      {0x00016410, 0x6c800001},
--      {0x00016440, 0x7f80fff8},
--      {0x0001644c, 0x4699e04f},
--      {0x00016450, 0x6db6db6c},
--      {0x00016500, 0x3fffbe04},
--      {0x00016504, 0xfff80000},
--      {0x00016508, 0x00200400},
--      {0x00016510, 0x00000000},
--      {0x00016544, 0x02084080},
--      {0x00016548, 0x000080c0},
--};
--
--static const u32 ar9480_2p0_tx_gain_table_baseband_postamble_emulation[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x0000a410, 0x000000d5, 0x000000d5, 0x000000d5, 0x000000d5},
--      {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a504, 0x00004002, 0x00004002, 0x00004002, 0x00004002},
--      {0x0000a508, 0x00008004, 0x00008004, 0x00008004, 0x00008004},
--      {0x0000a510, 0x0001000c, 0x0001000c, 0x0001000c, 0x0001000c},
--      {0x0000a514, 0x0001420b, 0x0001420b, 0x0001420b, 0x0001420b},
--      {0x0000a518, 0x0001824a, 0x0001824a, 0x0001824a, 0x0001824a},
--      {0x0000a51c, 0x0001c44a, 0x0001c44a, 0x0001c44a, 0x0001c44a},
--      {0x0000a520, 0x0002064a, 0x0002064a, 0x0002064a, 0x0002064a},
--      {0x0000a524, 0x0002484a, 0x0002484a, 0x0002484a, 0x0002484a},
--      {0x0000a528, 0x00028a4a, 0x00028a4a, 0x00028a4a, 0x00028a4a},
--      {0x0000a52c, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
--      {0x0000a530, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a},
--      {0x0000a534, 0x00034e8a, 0x00034e8a, 0x00034e8a, 0x00034e8a},
--};
--
--static const u32 ar9480_2p0_soc_preamble[][2] = {
--      /* Addr      allmodes  */
--      {0x00007020, 0x00000000},
--      {0x00007034, 0x00000002},
--      {0x00007038, 0x000004c2},
--};
--
--static const u32 ar9480_2p0_sys2ant[][2] = {
--      /* Addr      allmodes  */
--      {0x00063120, 0x00801980},
--};
--
--static const u32 ar9480_2p0_mac_core[][2] = {
--      /* Addr      allmodes  */
--      {0x00000008, 0x00000000},
--      {0x00000030, 0x000e0085},
--      {0x00000034, 0x00000005},
--      {0x00000040, 0x00000000},
--      {0x00000044, 0x00000000},
--      {0x00000048, 0x00000008},
--      {0x0000004c, 0x00000010},
--      {0x00000050, 0x00000000},
--      {0x00001040, 0x002ffc0f},
--      {0x00001044, 0x002ffc0f},
--      {0x00001048, 0x002ffc0f},
--      {0x0000104c, 0x002ffc0f},
--      {0x00001050, 0x002ffc0f},
--      {0x00001054, 0x002ffc0f},
--      {0x00001058, 0x002ffc0f},
--      {0x0000105c, 0x002ffc0f},
--      {0x00001060, 0x002ffc0f},
--      {0x00001064, 0x002ffc0f},
--      {0x000010f0, 0x00000100},
--      {0x00001270, 0x00000000},
--      {0x000012b0, 0x00000000},
--      {0x000012f0, 0x00000000},
--      {0x0000143c, 0x00000000},
--      {0x0000147c, 0x00000000},
--      {0x00001810, 0x0f000003},
--      {0x00008000, 0x00000000},
--      {0x00008004, 0x00000000},
--      {0x00008008, 0x00000000},
--      {0x0000800c, 0x00000000},
--      {0x00008018, 0x00000000},
--      {0x00008020, 0x00000000},
--      {0x00008038, 0x00000000},
--      {0x0000803c, 0x00080000},
--      {0x00008040, 0x00000000},
--      {0x00008044, 0x00000000},
--      {0x00008048, 0x00000000},
--      {0x0000804c, 0xffffffff},
--      {0x00008050, 0xffffffff},
--      {0x00008054, 0x00000000},
--      {0x00008058, 0x00000000},
--      {0x0000805c, 0x000fc78f},
--      {0x00008060, 0x0000000f},
--      {0x00008064, 0x00000000},
--      {0x00008070, 0x00000310},
--      {0x00008074, 0x00000020},
--      {0x00008078, 0x00000000},
--      {0x0000809c, 0x0000000f},
--      {0x000080a0, 0x00000000},
--      {0x000080a4, 0x02ff0000},
--      {0x000080a8, 0x0e070605},
--      {0x000080ac, 0x0000000d},
--      {0x000080b0, 0x00000000},
--      {0x000080b4, 0x00000000},
--      {0x000080b8, 0x00000000},
--      {0x000080bc, 0x00000000},
--      {0x000080c0, 0x2a800000},
--      {0x000080c4, 0x06900168},
--      {0x000080c8, 0x13881c20},
--      {0x000080cc, 0x01f40000},
--      {0x000080d0, 0x00252500},
--      {0x000080d4, 0x00b00005},
--      {0x000080d8, 0x00400002},
--      {0x000080dc, 0x00000000},
--      {0x000080e0, 0xffffffff},
--      {0x000080e4, 0x0000ffff},
--      {0x000080e8, 0x3f3f3f3f},
--      {0x000080ec, 0x00000000},
--      {0x000080f0, 0x00000000},
--      {0x000080f4, 0x00000000},
--      {0x000080fc, 0x00020000},
--      {0x00008100, 0x00000000},
--      {0x00008108, 0x00000052},
--      {0x0000810c, 0x00000000},
--      {0x00008110, 0x00000000},
--      {0x00008114, 0x000007ff},
--      {0x00008118, 0x000000aa},
--      {0x0000811c, 0x00003210},
--      {0x00008124, 0x00000000},
--      {0x00008128, 0x00000000},
--      {0x0000812c, 0x00000000},
--      {0x00008130, 0x00000000},
--      {0x00008134, 0x00000000},
--      {0x00008138, 0x00000000},
--      {0x0000813c, 0x0000ffff},
--      {0x00008144, 0xffffffff},
--      {0x00008168, 0x00000000},
--      {0x0000816c, 0x00000000},
--      {0x00008170, 0x18486e00},
--      {0x00008174, 0x33332210},
--      {0x00008178, 0x00000000},
--      {0x0000817c, 0x00020000},
--      {0x000081c4, 0x33332210},
--      {0x000081c8, 0x00000000},
--      {0x000081cc, 0x00000000},
--      {0x000081d4, 0x00000000},
--      {0x000081ec, 0x00000000},
--      {0x000081f0, 0x00000000},
--      {0x000081f4, 0x00000000},
--      {0x000081f8, 0x00000000},
--      {0x000081fc, 0x00000000},
--      {0x00008240, 0x00100000},
--      {0x00008244, 0x0010f400},
--      {0x00008248, 0x00000800},
--      {0x0000824c, 0x0001e800},
--      {0x00008250, 0x00000000},
--      {0x00008254, 0x00000000},
--      {0x00008258, 0x00000000},
--      {0x0000825c, 0x40000000},
--      {0x00008260, 0x00080922},
--      {0x00008264, 0x99c00010},
--      {0x00008268, 0xffffffff},
--      {0x0000826c, 0x0000ffff},
--      {0x00008270, 0x00000000},
--      {0x00008274, 0x40000000},
--      {0x00008278, 0x003e4180},
--      {0x0000827c, 0x00000004},
--      {0x00008284, 0x0000002c},
--      {0x00008288, 0x0000002c},
--      {0x0000828c, 0x000000ff},
--      {0x00008294, 0x00000000},
--      {0x00008298, 0x00000000},
--      {0x0000829c, 0x00000000},
--      {0x00008300, 0x00000140},
--      {0x00008314, 0x00000000},
--      {0x0000831c, 0x0000010d},
--      {0x00008328, 0x00000000},
--      {0x0000832c, 0x0000001f},
--      {0x00008330, 0x00000302},
--      {0x00008334, 0x00000700},
--      {0x00008338, 0xffff0000},
--      {0x0000833c, 0x02400000},
--      {0x00008340, 0x000107ff},
--      {0x00008344, 0xaa48105b},
--      {0x00008348, 0x008f0000},
--      {0x0000835c, 0x00000000},
--      {0x00008360, 0xffffffff},
--      {0x00008364, 0xffffffff},
--      {0x00008368, 0x00000000},
--      {0x00008370, 0x00000000},
--      {0x00008374, 0x000000ff},
--      {0x00008378, 0x00000000},
--      {0x0000837c, 0x00000000},
--      {0x00008380, 0xffffffff},
--      {0x00008384, 0xffffffff},
--      {0x00008390, 0xffffffff},
--      {0x00008394, 0xffffffff},
--      {0x00008398, 0x00000000},
--      {0x0000839c, 0x00000000},
--      {0x000083a4, 0x0000fa14},
--      {0x000083a8, 0x000f0c00},
--      {0x000083ac, 0x33332210},
--      {0x000083b0, 0x33332210},
--      {0x000083b4, 0x33332210},
--      {0x000083b8, 0x33332210},
--      {0x000083bc, 0x00000000},
--      {0x000083c0, 0x00000000},
--      {0x000083c4, 0x00000000},
--      {0x000083c8, 0x00000000},
--      {0x000083cc, 0x00000200},
--      {0x000083d0, 0x000301ff},
--};
--
--static const u32 ar9480_2p0_mac_postamble[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
--      {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
--      {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
--      {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
--      {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
--      {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
--      {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
--      {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
--};
--
--static const u32 ar9480_common_mixed_rx_gain_table_2p0[][2] = {
--      /* Addr      allmodes  */
--      {0x0000a000, 0x00010000},
--      {0x0000a004, 0x00030002},
--      {0x0000a008, 0x00050004},
--      {0x0000a00c, 0x00810080},
--      {0x0000a010, 0x00830082},
--      {0x0000a014, 0x01810180},
--      {0x0000a018, 0x01830182},
--      {0x0000a01c, 0x01850184},
--      {0x0000a020, 0x01890188},
--      {0x0000a024, 0x018b018a},
--      {0x0000a028, 0x018d018c},
--      {0x0000a02c, 0x03820190},
--      {0x0000a030, 0x03840383},
--      {0x0000a034, 0x03880385},
--      {0x0000a038, 0x038a0389},
--      {0x0000a03c, 0x038c038b},
--      {0x0000a040, 0x0390038d},
--      {0x0000a044, 0x03920391},
--      {0x0000a048, 0x03940393},
--      {0x0000a04c, 0x03960395},
--      {0x0000a050, 0x00000000},
--      {0x0000a054, 0x00000000},
--      {0x0000a058, 0x00000000},
--      {0x0000a05c, 0x00000000},
--      {0x0000a060, 0x00000000},
--      {0x0000a064, 0x00000000},
--      {0x0000a068, 0x00000000},
--      {0x0000a06c, 0x00000000},
--      {0x0000a070, 0x00000000},
--      {0x0000a074, 0x00000000},
--      {0x0000a078, 0x00000000},
--      {0x0000a07c, 0x00000000},
--      {0x0000a080, 0x29292929},
--      {0x0000a084, 0x29292929},
--      {0x0000a088, 0x29292929},
--      {0x0000a08c, 0x29292929},
--      {0x0000a090, 0x22292929},
--      {0x0000a094, 0x1d1d2222},
--      {0x0000a098, 0x0c111117},
--      {0x0000a09c, 0x00030303},
--      {0x0000a0a0, 0x00000000},
--      {0x0000a0a4, 0x00000000},
--      {0x0000a0a8, 0x00000000},
--      {0x0000a0ac, 0x00000000},
--      {0x0000a0b0, 0x00000000},
--      {0x0000a0b4, 0x00000000},
--      {0x0000a0b8, 0x00000000},
--      {0x0000a0bc, 0x00000000},
--      {0x0000a0c0, 0x001f0000},
--      {0x0000a0c4, 0x01000101},
--      {0x0000a0c8, 0x011e011f},
--      {0x0000a0cc, 0x011c011d},
--      {0x0000a0d0, 0x02030204},
--      {0x0000a0d4, 0x02010202},
--      {0x0000a0d8, 0x021f0200},
--      {0x0000a0dc, 0x0302021e},
--      {0x0000a0e0, 0x03000301},
--      {0x0000a0e4, 0x031e031f},
--      {0x0000a0e8, 0x0402031d},
--      {0x0000a0ec, 0x04000401},
--      {0x0000a0f0, 0x041e041f},
--      {0x0000a0f4, 0x0502041d},
--      {0x0000a0f8, 0x05000501},
--      {0x0000a0fc, 0x051e051f},
--      {0x0000a100, 0x06010602},
--      {0x0000a104, 0x061f0600},
--      {0x0000a108, 0x061d061e},
--      {0x0000a10c, 0x07020703},
--      {0x0000a110, 0x07000701},
--      {0x0000a114, 0x00000000},
--      {0x0000a118, 0x00000000},
--      {0x0000a11c, 0x00000000},
--      {0x0000a120, 0x00000000},
--      {0x0000a124, 0x00000000},
--      {0x0000a128, 0x00000000},
--      {0x0000a12c, 0x00000000},
--      {0x0000a130, 0x00000000},
--      {0x0000a134, 0x00000000},
--      {0x0000a138, 0x00000000},
--      {0x0000a13c, 0x00000000},
--      {0x0000a140, 0x001f0000},
--      {0x0000a144, 0x01000101},
--      {0x0000a148, 0x011e011f},
--      {0x0000a14c, 0x011c011d},
--      {0x0000a150, 0x02030204},
--      {0x0000a154, 0x02010202},
--      {0x0000a158, 0x021f0200},
--      {0x0000a15c, 0x0302021e},
--      {0x0000a160, 0x03000301},
--      {0x0000a164, 0x031e031f},
--      {0x0000a168, 0x0402031d},
--      {0x0000a16c, 0x04000401},
--      {0x0000a170, 0x041e041f},
--      {0x0000a174, 0x0502041d},
--      {0x0000a178, 0x05000501},
--      {0x0000a17c, 0x051e051f},
--      {0x0000a180, 0x06010602},
--      {0x0000a184, 0x061f0600},
--      {0x0000a188, 0x061d061e},
--      {0x0000a18c, 0x07020703},
--      {0x0000a190, 0x07000701},
--      {0x0000a194, 0x00000000},
--      {0x0000a198, 0x00000000},
--      {0x0000a19c, 0x00000000},
--      {0x0000a1a0, 0x00000000},
--      {0x0000a1a4, 0x00000000},
--      {0x0000a1a8, 0x00000000},
--      {0x0000a1ac, 0x00000000},
--      {0x0000a1b0, 0x00000000},
--      {0x0000a1b4, 0x00000000},
--      {0x0000a1b8, 0x00000000},
--      {0x0000a1bc, 0x00000000},
--      {0x0000a1c0, 0x00000000},
--      {0x0000a1c4, 0x00000000},
--      {0x0000a1c8, 0x00000000},
--      {0x0000a1cc, 0x00000000},
--      {0x0000a1d0, 0x00000000},
--      {0x0000a1d4, 0x00000000},
--      {0x0000a1d8, 0x00000000},
--      {0x0000a1dc, 0x00000000},
--      {0x0000a1e0, 0x00000000},
--      {0x0000a1e4, 0x00000000},
--      {0x0000a1e8, 0x00000000},
--      {0x0000a1ec, 0x00000000},
--      {0x0000a1f0, 0x00000396},
--      {0x0000a1f4, 0x00000396},
--      {0x0000a1f8, 0x00000396},
--      {0x0000a1fc, 0x00000196},
--      {0x0000b000, 0x00010000},
--      {0x0000b004, 0x00030002},
--      {0x0000b008, 0x00050004},
--      {0x0000b00c, 0x00810080},
--      {0x0000b010, 0x00830082},
--      {0x0000b014, 0x01810180},
--      {0x0000b018, 0x01830182},
--      {0x0000b01c, 0x01850184},
--      {0x0000b020, 0x02810280},
--      {0x0000b024, 0x02830282},
--      {0x0000b028, 0x02850284},
--      {0x0000b02c, 0x02890288},
--      {0x0000b030, 0x028b028a},
--      {0x0000b034, 0x0388028c},
--      {0x0000b038, 0x038a0389},
--      {0x0000b03c, 0x038c038b},
--      {0x0000b040, 0x0390038d},
--      {0x0000b044, 0x03920391},
--      {0x0000b048, 0x03940393},
--      {0x0000b04c, 0x03960395},
--      {0x0000b050, 0x00000000},
--      {0x0000b054, 0x00000000},
--      {0x0000b058, 0x00000000},
--      {0x0000b05c, 0x00000000},
--      {0x0000b060, 0x00000000},
--      {0x0000b064, 0x00000000},
--      {0x0000b068, 0x00000000},
--      {0x0000b06c, 0x00000000},
--      {0x0000b070, 0x00000000},
--      {0x0000b074, 0x00000000},
--      {0x0000b078, 0x00000000},
--      {0x0000b07c, 0x00000000},
--      {0x0000b080, 0x2a2d2f32},
--      {0x0000b084, 0x21232328},
--      {0x0000b088, 0x19191c1e},
--      {0x0000b08c, 0x12141417},
--      {0x0000b090, 0x07070e0e},
--      {0x0000b094, 0x03030305},
--      {0x0000b098, 0x00000003},
--      {0x0000b09c, 0x00000000},
--      {0x0000b0a0, 0x00000000},
--      {0x0000b0a4, 0x00000000},
--      {0x0000b0a8, 0x00000000},
--      {0x0000b0ac, 0x00000000},
--      {0x0000b0b0, 0x00000000},
--      {0x0000b0b4, 0x00000000},
--      {0x0000b0b8, 0x00000000},
--      {0x0000b0bc, 0x00000000},
--      {0x0000b0c0, 0x003f0020},
--      {0x0000b0c4, 0x00400041},
--      {0x0000b0c8, 0x0140005f},
--      {0x0000b0cc, 0x0160015f},
--      {0x0000b0d0, 0x017e017f},
--      {0x0000b0d4, 0x02410242},
--      {0x0000b0d8, 0x025f0240},
--      {0x0000b0dc, 0x027f0260},
--      {0x0000b0e0, 0x0341027e},
--      {0x0000b0e4, 0x035f0340},
--      {0x0000b0e8, 0x037f0360},
--      {0x0000b0ec, 0x04400441},
--      {0x0000b0f0, 0x0460045f},
--      {0x0000b0f4, 0x0541047f},
--      {0x0000b0f8, 0x055f0540},
--      {0x0000b0fc, 0x057f0560},
--      {0x0000b100, 0x06400641},
--      {0x0000b104, 0x0660065f},
--      {0x0000b108, 0x067e067f},
--      {0x0000b10c, 0x07410742},
--      {0x0000b110, 0x075f0740},
--      {0x0000b114, 0x077f0760},
--      {0x0000b118, 0x07800781},
--      {0x0000b11c, 0x07a0079f},
--      {0x0000b120, 0x07c107bf},
--      {0x0000b124, 0x000007c0},
--      {0x0000b128, 0x00000000},
--      {0x0000b12c, 0x00000000},
--      {0x0000b130, 0x00000000},
--      {0x0000b134, 0x00000000},
--      {0x0000b138, 0x00000000},
--      {0x0000b13c, 0x00000000},
--      {0x0000b140, 0x003f0020},
--      {0x0000b144, 0x00400041},
--      {0x0000b148, 0x0140005f},
--      {0x0000b14c, 0x0160015f},
--      {0x0000b150, 0x017e017f},
--      {0x0000b154, 0x02410242},
--      {0x0000b158, 0x025f0240},
--      {0x0000b15c, 0x027f0260},
--      {0x0000b160, 0x0341027e},
--      {0x0000b164, 0x035f0340},
--      {0x0000b168, 0x037f0360},
--      {0x0000b16c, 0x04400441},
--      {0x0000b170, 0x0460045f},
--      {0x0000b174, 0x0541047f},
--      {0x0000b178, 0x055f0540},
--      {0x0000b17c, 0x057f0560},
--      {0x0000b180, 0x06400641},
--      {0x0000b184, 0x0660065f},
--      {0x0000b188, 0x067e067f},
--      {0x0000b18c, 0x07410742},
--      {0x0000b190, 0x075f0740},
--      {0x0000b194, 0x077f0760},
--      {0x0000b198, 0x07800781},
--      {0x0000b19c, 0x07a0079f},
--      {0x0000b1a0, 0x07c107bf},
--      {0x0000b1a4, 0x000007c0},
--      {0x0000b1a8, 0x00000000},
--      {0x0000b1ac, 0x00000000},
--      {0x0000b1b0, 0x00000000},
--      {0x0000b1b4, 0x00000000},
--      {0x0000b1b8, 0x00000000},
--      {0x0000b1bc, 0x00000000},
--      {0x0000b1c0, 0x00000000},
--      {0x0000b1c4, 0x00000000},
--      {0x0000b1c8, 0x00000000},
--      {0x0000b1cc, 0x00000000},
--      {0x0000b1d0, 0x00000000},
--      {0x0000b1d4, 0x00000000},
--      {0x0000b1d8, 0x00000000},
--      {0x0000b1dc, 0x00000000},
--      {0x0000b1e0, 0x00000000},
--      {0x0000b1e4, 0x00000000},
--      {0x0000b1e8, 0x00000000},
--      {0x0000b1ec, 0x00000000},
--      {0x0000b1f0, 0x00000396},
--      {0x0000b1f4, 0x00000396},
--      {0x0000b1f8, 0x00000396},
--      {0x0000b1fc, 0x00000196},
--};
--
--static const u32 ar9480_modes_green_ob_db_tx_gain_table_2p0[][5] = {
--      /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
--      {0x000098bc, 0x00000003, 0x00000003, 0x00000003, 0x00000003},
--      {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
--      {0x0000a458, 0x80000000, 0x80000000, 0x80000000, 0x80000000},
--      {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
--      {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
--      {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
--      {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
--      {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
--      {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
--      {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
--      {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
--      {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
--      {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
--      {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
--      {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
--      {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
--      {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
--      {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
--      {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
--      {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
--      {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
--      {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81},
--      {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
--      {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84},
--      {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
--      {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
--      {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
--      {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
--      {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec},
--      {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
--      {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
--      {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
--      {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
--      {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
--      {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
--      {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
--      {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
--      {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
--      {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
--      {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
--      {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
--      {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
--      {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
--      {0x00016054, 0x6db60180, 0x6db60180, 0x6db60180, 0x6db60180},
--      {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
--      {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
--      {0x00016454, 0x6db60180, 0x6db60180, 0x6db60180, 0x6db60180},
--};
--
--static const u32 ar9480_2p0_BTCOEX_MAX_TXPWR_table[][2] = {
--      /* Addr      allmodes  */
--      {0x000018c0, 0x10101010},
--      {0x000018c4, 0x10101010},
--      {0x000018c8, 0x10101010},
--      {0x000018cc, 0x10101010},
--      {0x000018d0, 0x10101010},
--      {0x000018d4, 0x10101010},
--      {0x000018d8, 0x10101010},
--      {0x000018dc, 0x10101010},
--};
--
--static const u32 ar9480_2p0_baseband_core_emulation[][2] = {
--      /* Addr      allmodes  */
--      {0x00009800, 0xafa68e30},
--      {0x00009884, 0x00002842},
--      {0x00009c04, 0xff55ff55},
--      {0x00009c08, 0x0320ff55},
--      {0x00009e50, 0x00000000},
--      {0x00009fcc, 0x00000014},
--      {0x0000a344, 0x00000010},
--      {0x0000a398, 0x00000000},
--      {0x0000a39c, 0x71733d01},
--      {0x0000a3a0, 0xd0ad5c12},
--      {0x0000a3c0, 0x22222220},
--      {0x0000a3c4, 0x22222222},
--      {0x0000a404, 0x00418a11},
--      {0x0000a418, 0x050001ce},
--      {0x0000a438, 0x00001800},
--      {0x0000a458, 0x01444452},
--      {0x0000a644, 0x3fad9d74},
--      {0x0000a690, 0x00000038},
--};
--
--#endif /* INITVALS_9480_2P0_H */
---- a/drivers/net/wireless/ath/ath9k/ath9k.h
-+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -458,7 +458,7 @@ void ath9k_btcoex_timer_pause(struct ath
- #define ATH_LED_PIN_9287              8
- #define ATH_LED_PIN_9300              10
- #define ATH_LED_PIN_9485              6
--#define ATH_LED_PIN_9480              0
-+#define ATH_LED_PIN_9462              0
- #ifdef CONFIG_MAC80211_LEDS
- void ath_init_leds(struct ath_softc *sc);
---- a/drivers/net/wireless/ath/ath9k/beacon.c
-+++ b/drivers/net/wireless/ath/ath9k/beacon.c
-@@ -515,7 +515,7 @@ static void ath_beacon_config_ap(struct 
-       sc->sc_flags |= SC_OP_TSF_RESET;
-       ath9k_beacon_init(sc, nexttbtt, intval);
-       sc->beacon.bmisscnt = 0;
--      ath9k_hw_set_interrupts(ah, ah->imask);
-+      ath9k_hw_set_interrupts(ah);
-       ath9k_hw_enable_interrupts(ah);
- }
+ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
+ {
+       struct sk_buff *skb2;
+@@ -680,12 +697,8 @@ void ieee80211_tx_status(struct ieee8021
+                       if (info->flags & IEEE80211_TX_STAT_ACK) {
+                               if (sta->lost_packets)
+                                       sta->lost_packets = 0;
+-                      } else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) {
+-                              cfg80211_cqm_pktloss_notify(sta->sdata->dev,
+-                                                          sta->sta.addr,
+-                                                          sta->lost_packets,
+-                                                          GFP_ATOMIC);
+-                              sta->lost_packets = 0;
++                      } else {
++                              ieee80211_lost_packet(sta, skb);
+                       }
+               }
  
-@@ -643,7 +643,7 @@ static void ath_beacon_config_sta(struct
-       ath9k_hw_set_sta_beacon_timers(ah, &bs);
-       ah->imask |= ATH9K_INT_BMISS;
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -1107,6 +1107,8 @@ static void sta_ps_end(struct sta_info *
+               return;
+       }
  
--      ath9k_hw_set_interrupts(ah, ah->imask);
-+      ath9k_hw_set_interrupts(ah);
-       ath9k_hw_enable_interrupts(ah);
++      set_sta_flag(sta, WLAN_STA_PS_DELIVER);
++      clear_sta_flag(sta, WLAN_STA_PS_STA);
+       ieee80211_sta_ps_deliver_wakeup(sta);
  }
  
-@@ -679,7 +679,7 @@ static void ath_beacon_config_adhoc(stru
-       ath9k_beacon_init(sc, nexttbtt, intval);
-       sc->beacon.bmisscnt = 0;
--      ath9k_hw_set_interrupts(ah, ah->imask);
-+      ath9k_hw_set_interrupts(ah);
-       ath9k_hw_enable_interrupts(ah);
- }
+--- a/net/mac80211/sta_info.h
++++ b/net/mac80211/sta_info.h
+@@ -82,6 +82,7 @@ enum ieee80211_sta_info_flags {
+       WLAN_STA_TOFFSET_KNOWN,
+       WLAN_STA_MPSP_OWNER,
+       WLAN_STA_MPSP_RECIPIENT,
++      WLAN_STA_PS_DELIVER,
+ };
  
-@@ -821,11 +821,11 @@ void ath9k_set_beaconing_status(struct a
-       if (status) {
-               /* Re-enable beaconing */
-               ah->imask |= ATH9K_INT_SWBA;
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-       } else {
-               /* Disable SWBA interrupt */
-               ah->imask &= ~ATH9K_INT_SWBA;
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-               tasklet_kill(&sc->bcon_tasklet);
-               ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq);
-       }
---- a/drivers/net/wireless/ath/ath9k/common.c
-+++ b/drivers/net/wireless/ath/ath9k/common.c
-@@ -161,10 +161,12 @@ EXPORT_SYMBOL(ath9k_cmn_count_streams);
- void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
-                           u16 new_txpow, u16 *txpower)
+ #define ADDBA_RESP_INTERVAL HZ
+@@ -265,7 +266,7 @@ struct ieee80211_tx_latency_stat {
+  * @last_rx_rate_vht_nss: rx status nss of last data packet
+  * @lock: used for locking all fields that require locking, see comments
+  *    in the header file.
+- * @drv_unblock_wk: used for driver PS unblocking
++ * @drv_deliver_wk: used for delivering frames after driver PS unblocking
+  * @listen_interval: listen interval of this station, when we're acting as AP
+  * @_flags: STA flags, see &enum ieee80211_sta_info_flags, do not use directly
+  * @ps_lock: used for powersave (when mac80211 is the AP) related locking
+@@ -278,7 +279,6 @@ struct ieee80211_tx_latency_stat {
+  * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on
+  * @rx_packets: Number of MSDUs received from this STA
+  * @rx_bytes: Number of bytes received from this STA
+- * @wep_weak_iv_count: number of weak WEP IVs received from this station
+  * @last_rx: time (in jiffies) when last frame was received from this STA
+  * @last_connected: time (in seconds) when a station got connected
+  * @num_duplicates: number of duplicate frames received from this STA
+@@ -345,7 +345,7 @@ struct sta_info {
+       void *rate_ctrl_priv;
+       spinlock_t lock;
+-      struct work_struct drv_unblock_wk;
++      struct work_struct drv_deliver_wk;
+       u16 listen_interval;
+@@ -367,7 +367,6 @@ struct sta_info {
+       /* Updated from RX path only, no locking requirements */
+       unsigned long rx_packets;
+       u64 rx_bytes;
+-      unsigned long wep_weak_iv_count;
+       unsigned long last_rx;
+       long last_connected;
+       unsigned long num_duplicates;
+@@ -628,6 +627,8 @@ void sta_set_rate_info_tx(struct sta_inf
+                         struct rate_info *rinfo);
+ void sta_set_rate_info_rx(struct sta_info *sta,
+                         struct rate_info *rinfo);
++void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo);
++
+ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
+                         unsigned long exp_time);
+ u8 sta_info_tx_streams(struct sta_info *sta);
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -469,7 +469,8 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
+               return TX_CONTINUE;
+       if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) ||
+-                    test_sta_flag(sta, WLAN_STA_PS_DRIVER)) &&
++                    test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
++                    test_sta_flag(sta, WLAN_STA_PS_DELIVER)) &&
+                    !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
+               int ac = skb_get_queue_mapping(tx->skb);
+@@ -486,7 +487,8 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
+                * ahead and Tx the packet.
+                */
+               if (!test_sta_flag(sta, WLAN_STA_PS_STA) &&
+-                  !test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
++                  !test_sta_flag(sta, WLAN_STA_PS_DRIVER) &&
++                  !test_sta_flag(sta, WLAN_STA_PS_DELIVER)) {
+                       spin_unlock(&sta->ps_lock);
+                       return TX_CONTINUE;
+               }
+@@ -1618,12 +1620,12 @@ netdev_tx_t ieee80211_monitor_start_xmit
  {
--      if (cur_txpow != new_txpow) {
-+      struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
-+
-+      if (reg->power_limit != new_txpow) {
-               ath9k_hw_set_txpowerlimit(ah, new_txpow, false);
-               /* read back in case value is clamped */
--              *txpower = ath9k_hw_regulatory(ah)->power_limit;
-+              *txpower = reg->max_power_level;
+       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_chanctx_conf *chanctx_conf;
+-      struct ieee80211_channel *chan;
+       struct ieee80211_radiotap_header *prthdr =
+               (struct ieee80211_radiotap_header *)skb->data;
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+       struct ieee80211_hdr *hdr;
+       struct ieee80211_sub_if_data *tmp_sdata, *sdata;
++      struct cfg80211_chan_def *chandef;
+       u16 len_rthdr;
+       int hdrlen;
+@@ -1721,9 +1723,9 @@ netdev_tx_t ieee80211_monitor_start_xmit
        }
- }
- EXPORT_SYMBOL(ath9k_cmn_update_txpow);
---- a/drivers/net/wireless/ath/ath9k/debug.c
-+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -523,9 +523,22 @@ static ssize_t read_file_wiphy(struct fi
-       if (tmp & ATH9K_RX_FILTER_PHYRADAR)
-               len += snprintf(buf + len, sizeof(buf) - len, " PHYRADAR");
-       if (tmp & ATH9K_RX_FILTER_MCAST_BCAST_ALL)
--              len += snprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL\n");
--      else
--              len += snprintf(buf + len, sizeof(buf) - len, "\n");
-+              len += snprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL");
-+
-+      len += snprintf(buf + len, sizeof(buf) - len,
-+                     "\n\nReset causes:\n"
-+                     "  baseband hang: %d\n"
-+                     "  baseband watchdog: %d\n"
-+                     "  fatal hardware error interrupt: %d\n"
-+                     "  tx hardware error: %d\n"
-+                     "  tx path hang: %d\n"
-+                     "  pll rx hang: %d\n",
-+                     sc->debug.stats.reset[RESET_TYPE_BB_HANG],
-+                     sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG],
-+                     sc->debug.stats.reset[RESET_TYPE_FATAL_INT],
-+                     sc->debug.stats.reset[RESET_TYPE_TX_ERROR],
-+                     sc->debug.stats.reset[RESET_TYPE_TX_HANG],
-+                     sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
-       if (len > sizeof(buf))
-               len = sizeof(buf);
---- a/drivers/net/wireless/ath/ath9k/debug.h
-+++ b/drivers/net/wireless/ath/ath9k/debug.h
-@@ -25,8 +25,10 @@ struct ath_buf;
- #ifdef CONFIG_ATH9K_DEBUGFS
- #define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
-+#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++
- #else
- #define TX_STAT_INC(q, c) do { } while (0)
-+#define RESET_STAT_INC(sc, type) do { } while (0)
- #endif
- #ifdef CONFIG_ATH9K_DEBUGFS
-@@ -171,10 +173,21 @@ struct ath_rx_stats {
-       u8 rs_antenna;
- };
-+enum ath_reset_type {
-+      RESET_TYPE_BB_HANG,
-+      RESET_TYPE_BB_WATCHDOG,
-+      RESET_TYPE_FATAL_INT,
-+      RESET_TYPE_TX_ERROR,
-+      RESET_TYPE_TX_HANG,
-+      RESET_TYPE_PLL_HANG,
-+      __RESET_TYPE_MAX
-+};
-+
- struct ath_stats {
-       struct ath_interrupt_stats istats;
-       struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
-       struct ath_rx_stats rxstats;
-+      u32 reset[__RESET_TYPE_MAX];
- };
  
- #define ATH_DBG_MAX_SAMPLES   10
---- a/drivers/net/wireless/ath/ath9k/eeprom.h
-+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
-@@ -108,7 +108,7 @@
- #define EEP_RFSILENT_ENABLED_S      0
- #define EEP_RFSILENT_POLARITY       0x0002
- #define EEP_RFSILENT_POLARITY_S     1
--#define EEP_RFSILENT_GPIO_SEL       (AR_SREV_9480(ah) ? 0x00fc : 0x001c)
-+#define EEP_RFSILENT_GPIO_SEL       (AR_SREV_9462(ah) ? 0x00fc : 0x001c)
- #define EEP_RFSILENT_GPIO_SEL_S     2
- #define AR5416_OPFLAGS_11A           0x01
-@@ -220,7 +220,6 @@ enum eeprom_param {
-       EEP_MAC_MID,
-       EEP_MAC_LSW,
-       EEP_REG_0,
--      EEP_REG_1,
-       EEP_OP_CAP,
-       EEP_OP_MODE,
-       EEP_RF_SILENT,
-@@ -248,7 +247,9 @@ enum eeprom_param {
-       EEP_PAPRD,
-       EEP_MODAL_VER,
-       EEP_ANT_DIV_CTL1,
--      EEP_CHAIN_MASK_REDUCE
-+      EEP_CHAIN_MASK_REDUCE,
-+      EEP_ANTENNA_GAIN_2G,
-+      EEP_ANTENNA_GAIN_5G
- };
+       if (chanctx_conf)
+-              chan = chanctx_conf->def.chan;
++              chandef = &chanctx_conf->def;
+       else if (!local->use_chanctx)
+-              chan = local->_oper_chandef.chan;
++              chandef = &local->_oper_chandef;
+       else
+               goto fail_rcu;
  
- enum ar5416_rates {
-@@ -652,8 +653,7 @@ struct eeprom_ops {
-       void (*set_addac)(struct ath_hw *hw, struct ath9k_channel *chan);
-       void (*set_txpower)(struct ath_hw *hw, struct ath9k_channel *chan,
-                          u16 cfgCtl, u8 twiceAntennaReduction,
--                         u8 twiceMaxRegulatoryPower, u8 powerLimit,
--                         bool test);
-+                         u8 powerLimit, bool test);
-       u16 (*get_spur_channel)(struct ath_hw *ah, u16 i, bool is2GHz);
- };
+@@ -1743,10 +1745,11 @@ netdev_tx_t ieee80211_monitor_start_xmit
+        * radar detection by itself. We can do that later by adding a
+        * monitor flag interfaces used for AP support.
+        */
+-      if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
++      if (!cfg80211_reg_can_beacon(local->hw.wiphy, chandef,
++                                   sdata->vif.type))
+               goto fail_rcu;
  
---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
-@@ -322,8 +322,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct
-               return get_unaligned_be16(pBase->macAddr + 4);
-       case EEP_REG_0:
-               return pBase->regDmn[0];
--      case EEP_REG_1:
--              return pBase->regDmn[1];
-       case EEP_OP_CAP:
-               return pBase->deviceCap;
-       case EEP_OP_MODE:
-@@ -350,6 +348,8 @@ static u32 ath9k_hw_4k_get_eeprom(struct
-               return pModal->antdiv_ctl1;
-       case EEP_TXGAIN_TYPE:
-               return pBase->txGainType;
-+      case EEP_ANTENNA_GAIN_2G:
-+              return pModal->antennaGainCh[0];
-       default:
-               return 0;
-       }
-@@ -462,8 +462,7 @@ static void ath9k_hw_set_4k_power_per_ra
-                                                struct ath9k_channel *chan,
-                                                int16_t *ratesArray,
-                                                u16 cfgCtl,
--                                               u16 AntennaReduction,
--                                               u16 twiceMaxRegulatoryPower,
-+                                               u16 antenna_reduction,
-                                                u16 powerLimit)
- {
- #define CMP_TEST_GRP \
-@@ -472,20 +471,16 @@ static void ath9k_hw_set_4k_power_per_ra
-       || (((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == \
-           ((pEepData->ctlIndex[i] & CTL_MODE_M) | SD_NO_CTL))
+-      ieee80211_xmit(sdata, skb, chan->band);
++      ieee80211_xmit(sdata, skb, chandef->chan->band);
+       rcu_read_unlock();
  
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
+       return NETDEV_TX_OK;
+@@ -2425,7 +2428,7 @@ static void ieee80211_set_csa(struct iee
+       u8 *beacon_data;
+       size_t beacon_data_len;
        int i;
--      int16_t twiceLargestAntenna;
-       u16 twiceMinEdgePower;
-       u16 twiceMaxEdgePower = MAX_RATE_POWER;
--      u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-+      u16 scaledPower = 0, minCtlPower;
-       u16 numCtlModes;
-       const u16 *pCtlMode;
-       u16 ctlMode, freq;
-       struct chan_centers centers;
-       struct cal_ctl_data_4k *rep;
-       struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
--      static const u16 tpScaleReductionTable[5] =
--              { 0, 3, 6, 9, MAX_RATE_POWER };
-       struct cal_target_power_leg targetPowerOfdm, targetPowerCck = {
-               0, { 0, 0, 0, 0}
-       };
-@@ -503,19 +498,7 @@ static void ath9k_hw_set_4k_power_per_ra
-       ath9k_hw_get_channel_centers(ah, chan, &centers);
--      twiceLargestAntenna = pEepData->modalHeader.antennaGainCh[0];
--      twiceLargestAntenna = (int16_t)min(AntennaReduction -
--                                         twiceLargestAntenna, 0);
--
--      maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna;
--      if (regulatory->tp_scale != ATH9K_TP_SCALE_MAX) {
--              maxRegAllowedPower -=
--                      (tpScaleReductionTable[(regulatory->tp_scale)] * 2);
--      }
--
--      scaledPower = min(powerLimit, maxRegAllowedPower);
--      scaledPower = max((u16)0, scaledPower);
--
-+      scaledPower = powerLimit - antenna_reduction;
-       numCtlModes = ARRAY_SIZE(ctlModesFor11g) - SUB_NUM_CTL_MODES_AT_2G_40;
-       pCtlMode = ctlModesFor11g;
-@@ -671,7 +654,6 @@ static void ath9k_hw_4k_set_txpower(stru
-                                   struct ath9k_channel *chan,
-                                   u16 cfgCtl,
-                                   u8 twiceAntennaReduction,
--                                  u8 twiceMaxRegulatoryPower,
-                                   u8 powerLimit, bool test)
- {
-       struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-@@ -691,7 +673,6 @@ static void ath9k_hw_4k_set_txpower(stru
-       ath9k_hw_set_4k_power_per_rate_table(ah, chan,
-                                            &ratesArray[0], cfgCtl,
-                                            twiceAntennaReduction,
--                                           twiceMaxRegulatoryPower,
-                                            powerLimit);
-       ath9k_hw_set_4k_power_cal_table(ah, chan);
---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
-@@ -308,8 +308,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(st
-               return get_unaligned_be16(pBase->macAddr + 4);
-       case EEP_REG_0:
-               return pBase->regDmn[0];
--      case EEP_REG_1:
--              return pBase->regDmn[1];
-       case EEP_OP_CAP:
-               return pBase->deviceCap;
-       case EEP_OP_MODE:
-@@ -336,6 +334,9 @@ static u32 ath9k_hw_ar9287_get_eeprom(st
-                       return pBase->tempSensSlopePalOn;
-               else
-                       return 0;
-+      case EEP_ANTENNA_GAIN_2G:
-+              return max_t(u8, pModal->antennaGainCh[0],
-+                               pModal->antennaGainCh[1]);
-       default:
-               return 0;
-       }
-@@ -554,8 +555,7 @@ static void ath9k_hw_set_ar9287_power_pe
-                                                    struct ath9k_channel *chan,
-                                                    int16_t *ratesArray,
-                                                    u16 cfgCtl,
--                                                   u16 AntennaReduction,
--                                                   u16 twiceMaxRegulatoryPower,
-+                                                   u16 antenna_reduction,
-                                                    u16 powerLimit)
- {
- #define CMP_CTL \
-@@ -569,12 +569,8 @@ static void ath9k_hw_set_ar9287_power_pe
- #define REDUCE_SCALED_POWER_BY_TWO_CHAIN     6
- #define REDUCE_SCALED_POWER_BY_THREE_CHAIN   10
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       u16 twiceMaxEdgePower = MAX_RATE_POWER;
--      static const u16 tpScaleReductionTable[5] =
--              { 0, 3, 6, 9, MAX_RATE_POWER };
-       int i;
--      int16_t twiceLargestAntenna;
-       struct cal_ctl_data_ar9287 *rep;
-       struct cal_target_power_leg targetPowerOfdm = {0, {0, 0, 0, 0} },
-                                   targetPowerCck = {0, {0, 0, 0, 0} };
-@@ -582,7 +578,7 @@ static void ath9k_hw_set_ar9287_power_pe
-                                   targetPowerCckExt = {0, {0, 0, 0, 0} };
-       struct cal_target_power_ht targetPowerHt20,
-                                   targetPowerHt40 = {0, {0, 0, 0, 0} };
--      u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-+      u16 scaledPower = 0, minCtlPower;
-       static const u16 ctlModesFor11g[] = {
-               CTL_11B, CTL_11G, CTL_2GHT20,
-               CTL_11B_EXT, CTL_11G_EXT, CTL_2GHT40
-@@ -597,24 +593,7 @@ static void ath9k_hw_set_ar9287_power_pe
-       tx_chainmask = ah->txchainmask;
-       ath9k_hw_get_channel_centers(ah, chan, &centers);
--
--      /* Compute TxPower reduction due to Antenna Gain */
--      twiceLargestAntenna = max(pEepData->modalHeader.antennaGainCh[0],
--                                pEepData->modalHeader.antennaGainCh[1]);
--      twiceLargestAntenna = (int16_t)min((AntennaReduction) -
--                                         twiceLargestAntenna, 0);
--
--      /*
--       * scaledPower is the minimum of the user input power level
--       * and the regulatory allowed power level.
--       */
--      maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna;
--
--      if (regulatory->tp_scale != ATH9K_TP_SCALE_MAX)
--              maxRegAllowedPower -=
--                      (tpScaleReductionTable[(regulatory->tp_scale)] * 2);
--
--      scaledPower = min(powerLimit, maxRegAllowedPower);
-+      scaledPower = powerLimit - antenna_reduction;
+-      u8 count = sdata->csa_current_counter;
++      u8 count = beacon->csa_current_counter;
  
-       /*
-        * Reduce scaled Power by number of chains active
-@@ -815,7 +794,6 @@ static void ath9k_hw_set_ar9287_power_pe
- static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
-                                       struct ath9k_channel *chan, u16 cfgCtl,
-                                       u8 twiceAntennaReduction,
--                                      u8 twiceMaxRegulatoryPower,
-                                       u8 powerLimit, bool test)
- {
-       struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-@@ -834,7 +812,6 @@ static void ath9k_hw_ar9287_set_txpower(
-       ath9k_hw_set_ar9287_power_per_rate_table(ah, chan,
-                                                &ratesArray[0], cfgCtl,
-                                                twiceAntennaReduction,
--                                               twiceMaxRegulatoryPower,
-                                                powerLimit);
-       ath9k_hw_set_ar9287_power_cal_table(ah, chan);
---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
-@@ -400,6 +400,7 @@ static u32 ath9k_hw_def_get_eeprom(struc
-       struct ar5416_eeprom_def *eep = &ah->eeprom.def;
-       struct modal_eep_header *pModal = eep->modalHeader;
-       struct base_eep_header *pBase = &eep->baseEepHeader;
-+      int band = 0;
-       switch (param) {
-       case EEP_NFTHRESH_5:
-@@ -414,8 +415,6 @@ static u32 ath9k_hw_def_get_eeprom(struc
-               return get_unaligned_be16(pBase->macAddr + 4);
-       case EEP_REG_0:
-               return pBase->regDmn[0];
--      case EEP_REG_1:
--              return pBase->regDmn[1];
-       case EEP_OP_CAP:
-               return pBase->deviceCap;
-       case EEP_OP_MODE:
-@@ -467,6 +466,14 @@ static u32 ath9k_hw_def_get_eeprom(struc
-                       return pBase->pwr_table_offset;
-               else
-                       return AR5416_PWR_TABLE_OFFSET_DB;
-+      case EEP_ANTENNA_GAIN_2G:
-+              band = 1;
-+              /* fall through */
-+      case EEP_ANTENNA_GAIN_5G:
-+              return max_t(u8, max_t(u8,
-+                      pModal[band].antennaGainCh[0],
-+                      pModal[band].antennaGainCh[1]),
-+                      pModal[band].antennaGainCh[2]);
-       default:
-               return 0;
+       switch (sdata->vif.type) {
+       case NL80211_IFTYPE_AP:
+@@ -2444,46 +2447,54 @@ static void ieee80211_set_csa(struct iee
+               return;
        }
-@@ -986,21 +993,15 @@ static void ath9k_hw_set_def_power_per_r
-                                                 struct ath9k_channel *chan,
-                                                 int16_t *ratesArray,
-                                                 u16 cfgCtl,
--                                                u16 AntennaReduction,
--                                                u16 twiceMaxRegulatoryPower,
-+                                                u16 antenna_reduction,
-                                                 u16 powerLimit)
- {
- #define REDUCE_SCALED_POWER_BY_TWO_CHAIN     6  /* 10*log10(2)*2 */
- #define REDUCE_SCALED_POWER_BY_THREE_CHAIN   9 /* 10*log10(3)*2 */
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
-       u16 twiceMaxEdgePower = MAX_RATE_POWER;
--      static const u16 tpScaleReductionTable[5] =
--              { 0, 3, 6, 9, MAX_RATE_POWER };
--
-       int i;
--      int16_t twiceLargestAntenna;
-       struct cal_ctl_data *rep;
-       struct cal_target_power_leg targetPowerOfdm, targetPowerCck = {
-               0, { 0, 0, 0, 0}
-@@ -1012,7 +1013,7 @@ static void ath9k_hw_set_def_power_per_r
-       struct cal_target_power_ht targetPowerHt20, targetPowerHt40 = {
-               0, {0, 0, 0, 0}
-       };
--      u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-+      u16 scaledPower = 0, minCtlPower;
-       static const u16 ctlModesFor11a[] = {
-               CTL_11A, CTL_5GHT20, CTL_11A_EXT, CTL_5GHT40
-       };
-@@ -1031,27 +1032,7 @@ static void ath9k_hw_set_def_power_per_r
-       ath9k_hw_get_channel_centers(ah, chan, &centers);
--      twiceLargestAntenna = max(
--              pEepData->modalHeader
--                      [IS_CHAN_2GHZ(chan)].antennaGainCh[0],
--              pEepData->modalHeader
--                      [IS_CHAN_2GHZ(chan)].antennaGainCh[1]);
--
--      twiceLargestAntenna = max((u8)twiceLargestAntenna,
--                                pEepData->modalHeader
--                                [IS_CHAN_2GHZ(chan)].antennaGainCh[2]);
--
--      twiceLargestAntenna = (int16_t)min(AntennaReduction -
--                                         twiceLargestAntenna, 0);
++      rcu_read_lock();
+       for (i = 0; i < IEEE80211_MAX_CSA_COUNTERS_NUM; ++i) {
+-              u16 counter_offset_beacon =
+-                      sdata->csa_counter_offset_beacon[i];
+-              u16 counter_offset_presp = sdata->csa_counter_offset_presp[i];
 -
--      maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna;
+-              if (counter_offset_beacon) {
+-                      if (WARN_ON(counter_offset_beacon >= beacon_data_len))
+-                              return;
 -
--      if (regulatory->tp_scale != ATH9K_TP_SCALE_MAX) {
--              maxRegAllowedPower -=
--                      (tpScaleReductionTable[(regulatory->tp_scale)] * 2);
--      }
+-                      beacon_data[counter_offset_beacon] = count;
+-              }
 -
--      scaledPower = min(powerLimit, maxRegAllowedPower);
-+      scaledPower = powerLimit - antenna_reduction;
-       switch (ar5416_get_ntxchains(tx_chainmask)) {
-       case 1:
-@@ -1256,7 +1237,6 @@ static void ath9k_hw_def_set_txpower(str
-                                   struct ath9k_channel *chan,
-                                   u16 cfgCtl,
-                                   u8 twiceAntennaReduction,
--                                  u8 twiceMaxRegulatoryPower,
-                                   u8 powerLimit, bool test)
- {
- #define RT_AR_DELTA(x) (ratesArray[x] - cck_ofdm_delta)
-@@ -1278,7 +1258,6 @@ static void ath9k_hw_def_set_txpower(str
-       ath9k_hw_set_def_power_per_rate_table(ah, chan,
-                                              &ratesArray[0], cfgCtl,
-                                              twiceAntennaReduction,
--                                             twiceMaxRegulatoryPower,
-                                              powerLimit);
-       ath9k_hw_set_def_power_cal_table(ah, chan);
---- a/drivers/net/wireless/ath/ath9k/gpio.c
-+++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -48,8 +48,8 @@ void ath_init_leds(struct ath_softc *sc)
-                       sc->sc_ah->led_pin = ATH_LED_PIN_9485;
-               else if (AR_SREV_9300(sc->sc_ah))
-                       sc->sc_ah->led_pin = ATH_LED_PIN_9300;
--              else if (AR_SREV_9480(sc->sc_ah))
--                      sc->sc_ah->led_pin = ATH_LED_PIN_9480;
-+              else if (AR_SREV_9462(sc->sc_ah))
-+                      sc->sc_ah->led_pin = ATH_LED_PIN_9462;
-               else
-                       sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
-       }
-@@ -155,7 +155,7 @@ static void ath9k_gen_timer_start(struct
-       if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
-               ath9k_hw_disable_interrupts(ah);
-               ah->imask |= ATH9K_INT_GENTIMER;
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-               ath9k_hw_enable_interrupts(ah);
-       }
- }
-@@ -170,7 +170,7 @@ static void ath9k_gen_timer_stop(struct 
-       if (timer_table->timer_mask.val == 0) {
-               ath9k_hw_disable_interrupts(ah);
-               ah->imask &= ~ATH9K_INT_GENTIMER;
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-               ath9k_hw_enable_interrupts(ah);
-       }
- }
---- a/drivers/net/wireless/ath/ath9k/hw-ops.h
-+++ b/drivers/net/wireless/ath/ath9k/hw-ops.h
-@@ -205,4 +205,11 @@ static inline void ath9k_hw_setup_calibr
-       ath9k_hw_private_ops(ah)->setup_calibration(ah, currCal);
- }
-+static inline int ath9k_hw_fast_chan_change(struct ath_hw *ah,
-+                                          struct ath9k_channel *chan,
-+                                          u8 *ini_reloaded)
-+{
-+      return ath9k_hw_private_ops(ah)->fast_chan_change(ah, chan,
-+                                                        ini_reloaded);
-+}
- #endif /* ATH9K_HW_OPS_H */
---- a/drivers/net/wireless/ath/ath9k/hw.c
-+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -285,7 +285,7 @@ static void ath9k_hw_read_revisions(stru
-                       (val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S;
-               ah->hw_version.macRev = MS(val, AR_SREV_REVISION2);
--              if (AR_SREV_9480(ah))
-+              if (AR_SREV_9462(ah))
-                       ah->is_pciexpress = true;
-               else
-                       ah->is_pciexpress = (val &
-@@ -433,7 +433,6 @@ static void ath9k_hw_init_defaults(struc
-       regulatory->country_code = CTRY_DEFAULT;
-       regulatory->power_limit = MAX_RATE_POWER;
--      regulatory->tp_scale = ATH9K_TP_SCALE_MAX;
-       ah->hw_version.magic = AR5416_MAGIC;
-       ah->hw_version.subvendorid = 0;
-@@ -542,6 +541,9 @@ static int __ath9k_hw_init(struct ath_hw
-               return -EIO;
-       }
-+      if (AR_SREV_9462(ah))
-+              ah->WARegVal &= ~AR_WA_D3_L1_DISABLE;
+-              if (sdata->vif.type == NL80211_IFTYPE_AP &&
+-                  counter_offset_presp) {
+-                      rcu_read_lock();
+-                      resp = rcu_dereference(sdata->u.ap.probe_resp);
++              resp = rcu_dereference(sdata->u.ap.probe_resp);
+-                      /* If nl80211 accepted the offset, this should
+-                       * not happen.
+-                       */
+-                      if (WARN_ON(!resp)) {
++              if (beacon->csa_counter_offsets[i]) {
++                      if (WARN_ON_ONCE(beacon->csa_counter_offsets[i] >=
++                                       beacon_data_len)) {
+                               rcu_read_unlock();
+                               return;
+                       }
+-                      resp->data[counter_offset_presp] = count;
+-                      rcu_read_unlock();
 +
-       ath9k_hw_init_defaults(ah);
-       ath9k_hw_init_config(ah);
-@@ -585,7 +587,7 @@ static int __ath9k_hw_init(struct ath_hw
-       case AR_SREV_VERSION_9330:
-       case AR_SREV_VERSION_9485:
-       case AR_SREV_VERSION_9340:
--      case AR_SREV_VERSION_9480:
-+      case AR_SREV_VERSION_9462:
-               break;
-       default:
-               ath_err(common,
-@@ -670,7 +672,7 @@ int ath9k_hw_init(struct ath_hw *ah)
-       case AR9300_DEVID_AR9330:
-       case AR9300_DEVID_AR9340:
-       case AR9300_DEVID_AR9580:
--      case AR9300_DEVID_AR9480:
-+      case AR9300_DEVID_AR9462:
-               break;
-       default:
-               if (common->bus_ops->ath_bus_type == ATH_USB)
-@@ -1389,11 +1391,17 @@ static bool ath9k_hw_chip_reset(struct a
- static bool ath9k_hw_channel_change(struct ath_hw *ah,
-                                   struct ath9k_channel *chan)
- {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-       struct ath_common *common = ath9k_hw_common(ah);
--      struct ieee80211_channel *channel = chan->chan;
-       u32 qnum;
-       int r;
-+      bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
-+      bool band_switch, mode_diff;
-+      u8 ini_reloaded;
++                      beacon_data[beacon->csa_counter_offsets[i]] = count;
+               }
 +
-+      band_switch = (chan->channelFlags & (CHANNEL_2GHZ | CHANNEL_5GHZ)) !=
-+                    (ah->curchan->channelFlags & (CHANNEL_2GHZ |
-+                                                  CHANNEL_5GHZ));
-+      mode_diff = (chan->chanmode != ah->curchan->chanmode);
-       for (qnum = 0; qnum < AR_NUM_QCU; qnum++) {
-               if (ath9k_hw_numtxpending(ah, qnum)) {
-@@ -1408,6 +1416,18 @@ static bool ath9k_hw_channel_change(stru
-               return false;
++              if (sdata->vif.type == NL80211_IFTYPE_AP && resp &&
++                  resp->csa_counter_offsets)
++                      resp->data[resp->csa_counter_offsets[i]] = count;
        }
++      rcu_read_unlock();
+ }
  
-+      if (edma && (band_switch || mode_diff)) {
-+              ath9k_hw_mark_phy_inactive(ah);
-+              udelay(5);
+ u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif)
+ {
+       struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
++      struct beacon_data *beacon = NULL;
++      u8 count = 0;
 +
-+              ath9k_hw_init_pll(ah, NULL);
++      rcu_read_lock();
 +
-+              if (ath9k_hw_fast_chan_change(ah, chan, &ini_reloaded)) {
-+                      ath_err(common, "Failed to do fast channel change\n");
-+                      return false;
-+              }
-+      }
++      if (sdata->vif.type == NL80211_IFTYPE_AP)
++              beacon = rcu_dereference(sdata->u.ap.beacon);
++      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
++              beacon = rcu_dereference(sdata->u.ibss.presp);
++      else if (ieee80211_vif_is_mesh(&sdata->vif))
++              beacon = rcu_dereference(sdata->u.mesh.beacon);
 +
-       ath9k_hw_set_channel_regs(ah, chan);
-       r = ath9k_hw_rf_set_freq(ah, chan);
-@@ -1416,14 +1436,7 @@ static bool ath9k_hw_channel_change(stru
-               return false;
-       }
-       ath9k_hw_set_clockrate(ah);
--
--      ah->eep_ops->set_txpower(ah, chan,
--                           ath9k_regd_get_ctl(regulatory, chan),
--                           channel->max_antenna_gain * 2,
--                           channel->max_power * 2,
--                           min((u32) MAX_RATE_POWER,
--                           (u32) regulatory->power_limit), false);
--
-+      ath9k_hw_apply_txpower(ah, chan);
-       ath9k_hw_rfbus_done(ah);
++      if (!beacon)
++              goto unlock;
  
-       if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
-@@ -1431,6 +1444,18 @@ static bool ath9k_hw_channel_change(stru
+-      sdata->csa_current_counter--;
++      beacon->csa_current_counter--;
  
-       ath9k_hw_spur_mitigate_freq(ah, chan);
+       /* the counter should never reach 0 */
+-      WARN_ON(!sdata->csa_current_counter);
++      WARN_ON_ONCE(!beacon->csa_current_counter);
++      count = beacon->csa_current_counter;
  
-+      if (edma && (band_switch || mode_diff)) {
-+              ah->ah_flags |= AH_FASTCC;
-+              if (band_switch || ini_reloaded)
-+                      ah->eep_ops->set_board_values(ah, chan);
-+
-+              ath9k_hw_init_bb(ah, chan);
-+
-+              if (band_switch || ini_reloaded)
-+                      ath9k_hw_init_cal(ah, chan);
-+              ah->ah_flags &= ~AH_FASTCC;
-+      }
-+
-       return true;
+-      return sdata->csa_current_counter;
++unlock:
++      rcu_read_unlock();
++      return count;
  }
+ EXPORT_SYMBOL(ieee80211_csa_update_counter);
  
-@@ -1486,6 +1511,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
-       u32 macStaId1;
-       u64 tsf = 0;
-       int i, r;
-+      bool allow_fbs = false;
+@@ -2493,7 +2504,6 @@ bool ieee80211_csa_is_complete(struct ie
+       struct beacon_data *beacon = NULL;
+       u8 *beacon_data;
+       size_t beacon_data_len;
+-      int counter_beacon = sdata->csa_counter_offset_beacon[0];
+       int ret = false;
  
-       if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
-               return -EIO;
-@@ -1504,16 +1530,22 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+       if (!ieee80211_sdata_running(sdata))
+@@ -2531,10 +2541,13 @@ bool ieee80211_csa_is_complete(struct ie
+               goto out;
        }
-       ah->noise = ath9k_hw_getchan_noise(ah, chan);
--      if ((AR_SREV_9280(ah) && common->bus_ops->ath_bus_type == ATH_PCI) ||
--          (AR_SREV_9300_20_OR_LATER(ah) && IS_CHAN_5GHZ(chan)))
-+      if (AR_SREV_9280(ah) && common->bus_ops->ath_bus_type == ATH_PCI)
-               bChannelChange = false;
-+      if (caldata &&
-+          caldata->done_txiqcal_once &&
-+          caldata->done_txclcal_once &&
-+          caldata->rtt_hist.num_readings)
-+              allow_fbs = true;
+-      if (WARN_ON(counter_beacon > beacon_data_len))
++      if (!beacon->csa_counter_offsets[0])
++              goto out;
 +
-       if (bChannelChange &&
-           (ah->chip_fullsleep != true) &&
-           (ah->curchan != NULL) &&
-           (chan->channel != ah->curchan->channel) &&
--          ((chan->channelFlags & CHANNEL_ALL) ==
--           (ah->curchan->channelFlags & CHANNEL_ALL))) {
-+          (allow_fbs ||
-+           ((chan->channelFlags & CHANNEL_ALL) ==
-+            (ah->curchan->channelFlags & CHANNEL_ALL)))) {
-               if (ath9k_hw_channel_change(ah, chan)) {
-                       ath9k_hw_loadnf(ah, ah->curchan);
-                       ath9k_hw_start_nfcal(ah, true);
-@@ -1684,6 +1716,11 @@ int ath9k_hw_reset(struct ath_hw *ah, st
-       ath9k_hw_init_bb(ah, chan);
-+      if (caldata) {
-+              caldata->done_txiqcal_once = false;
-+              caldata->done_txclcal_once = false;
-+              caldata->rtt_hist.num_readings = 0;
-+      }
-       if (!ath9k_hw_init_cal(ah, chan))
-               return -EIO;
++      if (WARN_ON_ONCE(beacon->csa_counter_offsets[0] > beacon_data_len))
+               goto out;
  
-@@ -1753,7 +1790,7 @@ static void ath9k_set_power_sleep(struct
+-      if (beacon_data[counter_beacon] == 1)
++      if (beacon_data[beacon->csa_counter_offsets[0]] == 1)
+               ret = true;
+  out:
+       rcu_read_unlock();
+@@ -2550,6 +2563,7 @@ __ieee80211_beacon_get(struct ieee80211_
+                      bool is_template)
  {
-       REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
-       if (setChip) {
--              if (AR_SREV_9480(ah)) {
-+              if (AR_SREV_9462(ah)) {
-                       REG_WRITE(ah, AR_TIMER_MODE,
-                                 REG_READ(ah, AR_TIMER_MODE) & 0xFFFFFF00);
-                       REG_WRITE(ah, AR_NDP2_TIMER_MODE, REG_READ(ah,
-@@ -1771,7 +1808,7 @@ static void ath9k_set_power_sleep(struct
-                */
-               REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
--              if (AR_SREV_9480(ah))
-+              if (AR_SREV_9462(ah))
-                       udelay(100);
-               if (!AR_SREV_9100(ah) && !AR_SREV_9300_20_OR_LATER(ah))
-@@ -1779,15 +1816,14 @@ static void ath9k_set_power_sleep(struct
-               /* Shutdown chip. Active low */
-               if (!AR_SREV_5416(ah) &&
--                              !AR_SREV_9271(ah) && !AR_SREV_9480_10(ah)) {
-+                              !AR_SREV_9271(ah) && !AR_SREV_9462_10(ah)) {
-                       REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
-                       udelay(2);
+       struct ieee80211_local *local = hw_to_local(hw);
++      struct beacon_data *beacon = NULL;
+       struct sk_buff *skb = NULL;
+       struct ieee80211_tx_info *info;
+       struct ieee80211_sub_if_data *sdata = NULL;
+@@ -2571,10 +2585,10 @@ __ieee80211_beacon_get(struct ieee80211_
+       if (sdata->vif.type == NL80211_IFTYPE_AP) {
+               struct ieee80211_if_ap *ap = &sdata->u.ap;
+-              struct beacon_data *beacon = rcu_dereference(ap->beacon);
++              beacon = rcu_dereference(ap->beacon);
+               if (beacon) {
+-                      if (sdata->vif.csa_active) {
++                      if (beacon->csa_counter_offsets[0]) {
+                               if (!is_template)
+                                       ieee80211_csa_update_counter(vif);
+@@ -2615,37 +2629,37 @@ __ieee80211_beacon_get(struct ieee80211_
+       } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
+               struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
+               struct ieee80211_hdr *hdr;
+-              struct beacon_data *presp = rcu_dereference(ifibss->presp);
+-              if (!presp)
++              beacon = rcu_dereference(ifibss->presp);
++              if (!beacon)
+                       goto out;
+-              if (sdata->vif.csa_active) {
++              if (beacon->csa_counter_offsets[0]) {
+                       if (!is_template)
+                               ieee80211_csa_update_counter(vif);
+-                      ieee80211_set_csa(sdata, presp);
++                      ieee80211_set_csa(sdata, beacon);
                }
-       }
  
-       /* Clear Bit 14 of AR_WA after putting chip into Full Sleep mode. */
--      if (!AR_SREV_9480(ah))
--              REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
-+      REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
- }
+-              skb = dev_alloc_skb(local->tx_headroom + presp->head_len +
++              skb = dev_alloc_skb(local->tx_headroom + beacon->head_len +
+                                   local->hw.extra_beacon_tailroom);
+               if (!skb)
+                       goto out;
+               skb_reserve(skb, local->tx_headroom);
+-              memcpy(skb_put(skb, presp->head_len), presp->head,
+-                     presp->head_len);
++              memcpy(skb_put(skb, beacon->head_len), beacon->head,
++                     beacon->head_len);
+               hdr = (struct ieee80211_hdr *) skb->data;
+               hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+                                                IEEE80211_STYPE_BEACON);
+       } else if (ieee80211_vif_is_mesh(&sdata->vif)) {
+               struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+-              struct beacon_data *bcn = rcu_dereference(ifmsh->beacon);
+-              if (!bcn)
++              beacon = rcu_dereference(ifmsh->beacon);
++              if (!beacon)
+                       goto out;
+-              if (sdata->vif.csa_active) {
++              if (beacon->csa_counter_offsets[0]) {
+                       if (!is_template)
+                               /* TODO: For mesh csa_counter is in TU, so
+                                * decrementing it by one isn't correct, but
+@@ -2654,40 +2668,42 @@ __ieee80211_beacon_get(struct ieee80211_
+                                */
+                               ieee80211_csa_update_counter(vif);
  
- /*
-@@ -1818,7 +1854,7 @@ static void ath9k_set_power_network_slee
-                        * SYS_WAKING and SYS_SLEEPING messages which will make
-                        * BT CPU to busy to process.
-                        */
--                      if (AR_SREV_9480(ah)) {
-+                      if (AR_SREV_9462(ah)) {
-                               val = REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_EN) &
-                                       ~AR_MCI_INTERRUPT_RX_HW_MSG_MASK;
-                               REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, val);
-@@ -1830,7 +1866,7 @@ static void ath9k_set_power_network_slee
-                       REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE,
-                                   AR_RTC_FORCE_WAKE_EN);
--                      if (AR_SREV_9480(ah))
-+                      if (AR_SREV_9462(ah))
-                               udelay(30);
+-                      ieee80211_set_csa(sdata, bcn);
++                      ieee80211_set_csa(sdata, beacon);
                }
-       }
-@@ -2082,11 +2118,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw
-       eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
-       regulatory->current_rd = eeval;
--      eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1);
--      if (AR_SREV_9285_12_OR_LATER(ah))
--              eeval |= AR9285_RDEXT_DEFAULT;
--      regulatory->current_rd_ext = eeval;
--
-       if (ah->opmode != NL80211_IFTYPE_AP &&
-           ah->hw_version.subvendorid == AR_SUBVENDOR_ID_NEW_A) {
-               if (regulatory->current_rd == 0x64 ||
-@@ -2294,6 +2325,14 @@ int ath9k_hw_fill_cap_info(struct ath_hw
-               rx_chainmask >>= 1;
-       }
  
-+      if (AR_SREV_9300_20_OR_LATER(ah)) {
-+              ah->enabled_cals |= TX_IQ_CAL;
-+              if (!AR_SREV_9330(ah))
-+                      ah->enabled_cals |= TX_IQ_ON_AGC_CAL;
-+      }
-+      if (AR_SREV_9462(ah))
-+              pCap->hw_caps |= ATH9K_HW_CAP_RTT;
-+
-       return 0;
- }
+               if (ifmsh->sync_ops)
+-                      ifmsh->sync_ops->adjust_tbtt(sdata, bcn);
++                      ifmsh->sync_ops->adjust_tbtt(sdata, beacon);
+               skb = dev_alloc_skb(local->tx_headroom +
+-                                  bcn->head_len +
++                                  beacon->head_len +
+                                   256 + /* TIM IE */
+-                                  bcn->tail_len +
++                                  beacon->tail_len +
+                                   local->hw.extra_beacon_tailroom);
+               if (!skb)
+                       goto out;
+               skb_reserve(skb, local->tx_headroom);
+-              memcpy(skb_put(skb, bcn->head_len), bcn->head, bcn->head_len);
++              memcpy(skb_put(skb, beacon->head_len), beacon->head,
++                     beacon->head_len);
+               ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb, is_template);
+               if (offs) {
+-                      offs->tim_offset = bcn->head_len;
+-                      offs->tim_length = skb->len - bcn->head_len;
++                      offs->tim_offset = beacon->head_len;
++                      offs->tim_length = skb->len - beacon->head_len;
+               }
  
-@@ -2454,7 +2493,7 @@ void ath9k_hw_setrxfilter(struct ath_hw 
+-              memcpy(skb_put(skb, bcn->tail_len), bcn->tail, bcn->tail_len);
++              memcpy(skb_put(skb, beacon->tail_len), beacon->tail,
++                     beacon->tail_len);
+       } else {
+               WARN_ON(1);
+               goto out;
+       }
  
-       ENABLE_REGWRITE_BUFFER(ah);
+       /* CSA offsets */
+-      if (offs) {
++      if (offs && beacon) {
+               int i;
  
--      if (AR_SREV_9480(ah))
-+      if (AR_SREV_9462(ah))
-               bits |= ATH9K_RX_FILTER_CONTROL_WRAPPER;
+               for (i = 0; i < IEEE80211_MAX_CSA_COUNTERS_NUM; i++) {
+-                      u16 csa_off = sdata->csa_counter_offset_beacon[i];
++                      u16 csa_off = beacon->csa_counter_offsets[i];
  
-       REG_WRITE(ah, AR_RX_FILTER, bits);
-@@ -2498,23 +2537,56 @@ bool ath9k_hw_disable(struct ath_hw *ah)
+                       if (!csa_off)
+                               continue;
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -947,6 +947,40 @@ static inline u8 rt2800_get_beacon_offse
+       return BEACON_BASE_TO_OFFSET(rt2800_hw_beacon_base(rt2x00dev, index));
  }
- EXPORT_SYMBOL(ath9k_hw_disable);
  
-+static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan)
-+{
-+      enum eeprom_param gain_param;
-+
-+      if (IS_CHAN_2GHZ(chan))
-+              gain_param = EEP_ANTENNA_GAIN_2G;
-+      else
-+              gain_param = EEP_ANTENNA_GAIN_5G;
-+
-+      return ah->eep_ops->get_eeprom(ah, gain_param);
-+}
-+
-+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
++static void rt2800_update_beacons_setup(struct rt2x00_dev *rt2x00dev)
 +{
-+      struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
-+      struct ieee80211_channel *channel;
-+      int chan_pwr, new_pwr, max_gain;
-+      int ant_gain, ant_reduction = 0;
++      struct data_queue *queue = rt2x00dev->bcn;
++      struct queue_entry *entry;
++      int i, bcn_num = 0;
++      u64 off, reg = 0;
++      u32 bssid_dw1;
 +
-+      if (!chan)
-+              return;
++      /*
++       * Setup offsets of all active beacons in BCN_OFFSET{0,1} registers.
++       */
++      for (i = 0; i < queue->limit; i++) {
++              entry = &queue->entries[i];
++              if (!test_bit(ENTRY_BCN_ENABLED, &entry->flags))
++                      continue;
++              off = rt2800_get_beacon_offset(rt2x00dev, entry->entry_idx);
++              reg |= off << (8 * bcn_num);
++              bcn_num++;
++      }
 +
-+      channel = chan->chan;
-+      chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
-+      new_pwr = min_t(int, chan_pwr, reg->power_limit);
-+      max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2;
++      WARN_ON_ONCE(bcn_num != rt2x00dev->intf_beaconing);
 +
-+      ant_gain = get_antenna_gain(ah, chan);
-+      if (ant_gain > max_gain)
-+              ant_reduction = ant_gain - max_gain;
++      rt2800_register_write(rt2x00dev, BCN_OFFSET0, (u32) reg);
++      rt2800_register_write(rt2x00dev, BCN_OFFSET1, (u32) (reg >> 32));
 +
-+      ah->eep_ops->set_txpower(ah, chan,
-+                               ath9k_regd_get_ctl(reg, chan),
-+                               ant_reduction, new_pwr, false);
++      /*
++       * H/W sends up to MAC_BSSID_DW1_BSS_BCN_NUM + 1 consecutive beacons.
++       */
++      rt2800_register_read(rt2x00dev, MAC_BSSID_DW1, &bssid_dw1);
++      rt2x00_set_field32(&bssid_dw1, MAC_BSSID_DW1_BSS_BCN_NUM,
++                         bcn_num > 0 ? bcn_num - 1 : 0);
++      rt2800_register_write(rt2x00dev, MAC_BSSID_DW1, bssid_dw1);
 +}
 +
- void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
+ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
  {
--      struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
-+      struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
-       struct ath9k_channel *chan = ah->curchan;
-       struct ieee80211_channel *channel = chan->chan;
--      int reg_pwr = min_t(int, MAX_RATE_POWER, limit);
--      int chan_pwr = channel->max_power * 2;
-+      reg->power_limit = min_t(int, limit, MAX_RATE_POWER);
-       if (test)
--              reg_pwr = chan_pwr = MAX_RATE_POWER;
-+              channel->max_power = MAX_RATE_POWER / 2;
--      regulatory->power_limit = reg_pwr;
-+      ath9k_hw_apply_txpower(ah, chan);
--      ah->eep_ops->set_txpower(ah, chan,
--                               ath9k_regd_get_ctl(regulatory, chan),
--                               channel->max_antenna_gain * 2,
--                               chan_pwr, reg_pwr, test);
-+      if (test)
-+              channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2);
- }
- EXPORT_SYMBOL(ath9k_hw_set_txpowerlimit);
-@@ -2713,9 +2785,9 @@ void ath9k_hw_gen_timer_start(struct ath
-       REG_SET_BIT(ah, gen_tmr_configuration[timer->index].mode_addr,
-                   gen_tmr_configuration[timer->index].mode_mask);
--      if (AR_SREV_9480(ah)) {
-+      if (AR_SREV_9462(ah)) {
-               /*
--               * Starting from AR9480, each generic timer can select which tsf
-+               * Starting from AR9462, each generic timer can select which tsf
-                * to use. But we still follow the old rule, 0 - 7 use tsf and
-                * 8 - 15  use tsf2.
-                */
-@@ -2832,7 +2904,7 @@ static struct {
-       { AR_SREV_VERSION_9330,         "9330" },
-       { AR_SREV_VERSION_9340,         "9340" },
-       { AR_SREV_VERSION_9485,         "9485" },
--      { AR_SREV_VERSION_9480,         "9480" },
-+      { AR_SREV_VERSION_9462,         "9462" },
- };
- /* For devices with external radios */
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -46,7 +46,7 @@
- #define AR9300_DEVID_AR9340   0x0031
- #define AR9300_DEVID_AR9485_PCIE 0x0032
- #define AR9300_DEVID_AR9580   0x0033
--#define AR9300_DEVID_AR9480   0x0034
-+#define AR9300_DEVID_AR9462   0x0034
- #define AR9300_DEVID_AR9330   0x0035
- #define AR5416_AR9100_DEVID   0x000b
-@@ -202,6 +202,7 @@ enum ath9k_hw_caps {
-       ATH9K_HW_CAP_2GHZ                       = BIT(13),
-       ATH9K_HW_CAP_5GHZ                       = BIT(14),
-       ATH9K_HW_CAP_APM                        = BIT(15),
-+      ATH9K_HW_CAP_RTT                        = BIT(16),
- };
+       struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+@@ -1003,6 +1037,12 @@ void rt2800_write_beacon(struct queue_en
  
- struct ath9k_hw_capabilities {
-@@ -337,6 +338,16 @@ enum ath9k_int {
-        CHANNEL_HT40PLUS |                     \
-        CHANNEL_HT40MINUS)
-+#define MAX_RTT_TABLE_ENTRY     6
-+#define RTT_HIST_MAX            3
-+struct ath9k_rtt_hist {
-+      u32 table[AR9300_MAX_CHAINS][RTT_HIST_MAX][MAX_RTT_TABLE_ENTRY];
-+      u8 num_readings;
-+};
+       rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
+                                  entry->skb->len + padding_len);
++      __set_bit(ENTRY_BCN_ENABLED, &entry->flags);
 +
-+#define MAX_IQCAL_MEASUREMENT 8
-+#define MAX_CL_TAB_ENTRY      16
-+
- struct ath9k_hw_cal_data {
-       u16 channel;
-       u32 channelFlags;
-@@ -346,9 +357,15 @@ struct ath9k_hw_cal_data {
-       bool paprd_done;
-       bool nfcal_pending;
-       bool nfcal_interference;
-+      bool done_txiqcal_once;
-+      bool done_txclcal_once;
-       u16 small_signal_gain[AR9300_MAX_CHAINS];
-       u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ];
-+      u32 num_measures[AR9300_MAX_CHAINS];
-+      int tx_corr_coeff[MAX_IQCAL_MEASUREMENT][AR9300_MAX_CHAINS];
-+      u32 tx_clcal[AR9300_MAX_CHAINS][MAX_CL_TAB_ENTRY];
-       struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
-+      struct ath9k_rtt_hist rtt_hist;
- };
++      /*
++       * Change global beacons settings.
++       */
++      rt2800_update_beacons_setup(rt2x00dev);
  
- struct ath9k_channel {
-@@ -390,14 +407,6 @@ enum ath9k_power_mode {
-       ATH9K_PM_UNDEFINED
- };
+       /*
+        * Restore beaconing state.
+@@ -1053,8 +1093,13 @@ void rt2800_clear_beacon(struct queue_en
+        * Clear beacon.
+        */
+       rt2800_clear_beacon_register(rt2x00dev, entry->entry_idx);
++      __clear_bit(ENTRY_BCN_ENABLED, &entry->flags);
  
--enum ath9k_tp_scale {
--      ATH9K_TP_SCALE_MAX = 0,
--      ATH9K_TP_SCALE_50,
--      ATH9K_TP_SCALE_25,
--      ATH9K_TP_SCALE_12,
--      ATH9K_TP_SCALE_MIN
--};
--
- enum ser_reg_mode {
-       SER_REG_MODE_OFF = 0,
-       SER_REG_MODE_ON = 1,
-@@ -591,6 +600,8 @@ struct ath_hw_private_ops {
-       void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
-       void (*set_radar_params)(struct ath_hw *ah,
-                                struct ath_hw_radar_conf *conf);
-+      int (*fast_chan_change)(struct ath_hw *ah, struct ath9k_channel *chan,
-+                              u8 *ini_reloaded);
-       /* ANI */
-       void (*ani_cache_ini_regs)(struct ath_hw *ah);
-@@ -632,9 +643,16 @@ struct ath_nf_limits {
-       s16 nominal;
- };
+       /*
++       * Change global beacons settings.
++       */
++      rt2800_update_beacons_setup(rt2x00dev);
++      /*
+        * Restore beaconing state.
+        */
+       rt2800_register_write(rt2x00dev, BCN_TIME_CFG, orig_reg);
+@@ -1556,7 +1601,7 @@ void rt2800_config_intf(struct rt2x00_de
+               if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
+                       reg = le32_to_cpu(conf->bssid[1]);
+                       rt2x00_set_field32(&reg, MAC_BSSID_DW1_BSS_ID_MASK, 3);
+-                      rt2x00_set_field32(&reg, MAC_BSSID_DW1_BSS_BCN_NUM, 7);
++                      rt2x00_set_field32(&reg, MAC_BSSID_DW1_BSS_BCN_NUM, 0);
+                       conf->bssid[1] = cpu_to_le32(reg);
+               }
  
-+enum ath_cal_list {
-+      TX_IQ_CAL         =     BIT(0),
-+      TX_IQ_ON_AGC_CAL  =     BIT(1),
-+      TX_CL_CAL         =     BIT(2),
-+};
-+
- /* ah_flags */
- #define AH_USE_EEPROM   0x1
- #define AH_UNPLUGGED    0x2 /* The card has been physically removed. */
-+#define AH_FASTCC       0x4
- struct ath_hw {
-       struct ath_ops reg_ops;
-@@ -692,6 +710,7 @@ struct ath_hw {
-       atomic_t intr_ref_cnt;
-       bool chip_fullsleep;
-       u32 atim_window;
-+      u32 modes_index;
-       /* Calibration */
-       u32 supp_cals;
-@@ -730,6 +749,7 @@ struct ath_hw {
-               int32_t sign[AR5416_MAX_CHAINS];
-       } meas3;
-       u16 cal_samples;
-+      u8 enabled_cals;
-       u32 sta_id1_defaults;
-       u32 misc_mode;
-@@ -968,6 +988,7 @@ void ath9k_hw_htc_resetinit(struct ath_h
- /* PHY */
- void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
-                                  u32 *coef_mantissa, u32 *coef_exponent);
-+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan);
- /*
-  * Code Specific to AR5008, AR9001 or AR9002,
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -626,7 +626,6 @@ static void ath9k_init_band_txpower(stru
-       struct ieee80211_supported_band *sband;
-       struct ieee80211_channel *chan;
-       struct ath_hw *ah = sc->sc_ah;
--      struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
-       int i;
+@@ -4517,28 +4562,6 @@ static int rt2800_init_registers(struct 
+       if (ret)
+               return ret;
+-      rt2800_register_read(rt2x00dev, BCN_OFFSET0, &reg);
+-      rt2x00_set_field32(&reg, BCN_OFFSET0_BCN0,
+-                         rt2800_get_beacon_offset(rt2x00dev, 0));
+-      rt2x00_set_field32(&reg, BCN_OFFSET0_BCN1,
+-                         rt2800_get_beacon_offset(rt2x00dev, 1));
+-      rt2x00_set_field32(&reg, BCN_OFFSET0_BCN2,
+-                         rt2800_get_beacon_offset(rt2x00dev, 2));
+-      rt2x00_set_field32(&reg, BCN_OFFSET0_BCN3,
+-                         rt2800_get_beacon_offset(rt2x00dev, 3));
+-      rt2800_register_write(rt2x00dev, BCN_OFFSET0, reg);
+-
+-      rt2800_register_read(rt2x00dev, BCN_OFFSET1, &reg);
+-      rt2x00_set_field32(&reg, BCN_OFFSET1_BCN4,
+-                         rt2800_get_beacon_offset(rt2x00dev, 4));
+-      rt2x00_set_field32(&reg, BCN_OFFSET1_BCN5,
+-                         rt2800_get_beacon_offset(rt2x00dev, 5));
+-      rt2x00_set_field32(&reg, BCN_OFFSET1_BCN6,
+-                         rt2800_get_beacon_offset(rt2x00dev, 6));
+-      rt2x00_set_field32(&reg, BCN_OFFSET1_BCN7,
+-                         rt2800_get_beacon_offset(rt2x00dev, 7));
+-      rt2800_register_write(rt2x00dev, BCN_OFFSET1, reg);
+-
+       rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE, 0x0000013f);
+       rt2800_register_write(rt2x00dev, HT_BASIC_RATE, 0x00008003);
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -141,8 +141,11 @@ static void rt2x00lib_intf_scheduled_ite
+       if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
+               return;
  
-       sband = &sc->sbands[band];
-@@ -635,7 +634,6 @@ static void ath9k_init_band_txpower(stru
-               ah->curchan = &ah->channels[chan->hw_value];
-               ath9k_cmn_update_ichannel(ah->curchan, chan, NL80211_CHAN_HT20);
-               ath9k_hw_set_txpowerlimit(ah, MAX_RATE_POWER, true);
--              chan->max_power = reg->max_power_level / 2;
-       }
+-      if (test_and_clear_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags))
++      if (test_and_clear_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags)) {
++              mutex_lock(&intf->beacon_skb_mutex);
+               rt2x00queue_update_beacon(rt2x00dev, vif);
++              mutex_unlock(&intf->beacon_skb_mutex);
++      }
  }
  
---- a/drivers/net/wireless/ath/ath9k/mac.c
-+++ b/drivers/net/wireless/ath/ath9k/mac.c
-@@ -620,8 +620,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
-                       rs->rs_status |= ATH9K_RXERR_DECRYPT;
-               else if (ads.ds_rxstatus8 & AR_MichaelErr)
-                       rs->rs_status |= ATH9K_RXERR_MIC;
--              else if (ads.ds_rxstatus8 & AR_KeyMiss)
--                      rs->rs_status |= ATH9K_RXERR_DECRYPT;
-+              if (ads.ds_rxstatus8 & AR_KeyMiss)
-+                      rs->rs_status |= ATH9K_RXERR_KEYMISS;
+ static void rt2x00lib_intf_scheduled(struct work_struct *work)
+@@ -216,7 +219,7 @@ static void rt2x00lib_beaconupdate_iter(
+        * never be called for USB devices.
+        */
+       WARN_ON(rt2x00_is_usb(rt2x00dev));
+-      rt2x00queue_update_beacon_locked(rt2x00dev, vif);
++      rt2x00queue_update_beacon(rt2x00dev, vif);
+ }
+ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
+--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
+@@ -487,6 +487,8 @@ int rt2x00mac_set_key(struct ieee80211_h
+       crypto.cipher = rt2x00crypto_key_to_cipher(key);
+       if (crypto.cipher == CIPHER_NONE)
+               return -EOPNOTSUPP;
++      if (crypto.cipher == CIPHER_TKIP && rt2x00_is_usb(rt2x00dev))
++              return -EOPNOTSUPP;
+       crypto.cmd = cmd;
+@@ -624,25 +626,24 @@ void rt2x00mac_bss_info_changed(struct i
+        * Start/stop beaconing.
+        */
+       if (changes & BSS_CHANGED_BEACON_ENABLED) {
++              mutex_lock(&intf->beacon_skb_mutex);
+               if (!bss_conf->enable_beacon && intf->enable_beacon) {
+                       rt2x00dev->intf_beaconing--;
+                       intf->enable_beacon = false;
+-                      /*
+-                       * Clear beacon in the H/W for this vif. This is needed
+-                       * to disable beaconing on this particular interface
+-                       * and keep it running on other interfaces.
+-                       */
+-                      rt2x00queue_clear_beacon(rt2x00dev, vif);
+                       if (rt2x00dev->intf_beaconing == 0) {
+                               /*
+                                * Last beaconing interface disabled
+                                * -> stop beacon queue.
+                                */
+-                              mutex_lock(&intf->beacon_skb_mutex);
+                               rt2x00queue_stop_queue(rt2x00dev->bcn);
+-                              mutex_unlock(&intf->beacon_skb_mutex);
+                       }
++                      /*
++                       * Clear beacon in the H/W for this vif. This is needed
++                       * to disable beaconing on this particular interface
++                       * and keep it running on other interfaces.
++                       */
++                      rt2x00queue_clear_beacon(rt2x00dev, vif);
+               } else if (bss_conf->enable_beacon && !intf->enable_beacon) {
+                       rt2x00dev->intf_beaconing++;
+                       intf->enable_beacon = true;
+@@ -658,11 +659,10 @@ void rt2x00mac_bss_info_changed(struct i
+                                * First beaconing interface enabled
+                                * -> start beacon queue.
+                                */
+-                              mutex_lock(&intf->beacon_skb_mutex);
+                               rt2x00queue_start_queue(rt2x00dev->bcn);
+-                              mutex_unlock(&intf->beacon_skb_mutex);
+                       }
+               }
++              mutex_unlock(&intf->beacon_skb_mutex);
        }
  
+       /*
+--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
+@@ -754,8 +754,6 @@ int rt2x00queue_clear_beacon(struct rt2x
+       if (unlikely(!intf->beacon))
+               return -ENOBUFS;
+-      mutex_lock(&intf->beacon_skb_mutex);
+-
+       /*
+        * Clean up the beacon skb.
+        */
+@@ -768,13 +766,11 @@ int rt2x00queue_clear_beacon(struct rt2x
+       if (rt2x00dev->ops->lib->clear_beacon)
+               rt2x00dev->ops->lib->clear_beacon(intf->beacon);
+-      mutex_unlock(&intf->beacon_skb_mutex);
+-
        return 0;
-@@ -827,9 +827,9 @@ void ath9k_hw_enable_interrupts(struct a
  }
- EXPORT_SYMBOL(ath9k_hw_enable_interrupts);
  
--void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints)
-+void ath9k_hw_set_interrupts(struct ath_hw *ah)
+-int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev,
+-                                   struct ieee80211_vif *vif)
++int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
++                            struct ieee80211_vif *vif)
  {
--      enum ath9k_int omask = ah->imask;
-+      enum ath9k_int ints = ah->imask;
-       u32 mask, mask2;
-       struct ath9k_hw_capabilities *pCap = &ah->caps;
-       struct ath_common *common = ath9k_hw_common(ah);
-@@ -837,7 +837,7 @@ void ath9k_hw_set_interrupts(struct ath_
-       if (!(ints & ATH9K_INT_GLOBAL))
-               ath9k_hw_disable_interrupts(ah);
--      ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints);
-+      ath_dbg(common, ATH_DBG_INTERRUPT, "New interrupt mask 0x%x\n", ints);
-       mask = ints & ATH9K_INT_COMMON;
-       mask2 = 0;
---- a/drivers/net/wireless/ath/ath9k/mac.h
-+++ b/drivers/net/wireless/ath/ath9k/mac.h
-@@ -75,9 +75,10 @@
- #define ATH9K_TXERR_XTXOP          0x08
- #define ATH9K_TXERR_TIMER_EXPIRED  0x10
- #define ATH9K_TX_ACKED                   0x20
-+#define ATH9K_TX_FLUSH                   0x40
- #define ATH9K_TXERR_MASK                                              \
-       (ATH9K_TXERR_XRETRY | ATH9K_TXERR_FILT | ATH9K_TXERR_FIFO |     \
--       ATH9K_TXERR_XTXOP | ATH9K_TXERR_TIMER_EXPIRED)
-+       ATH9K_TXERR_XTXOP | ATH9K_TXERR_TIMER_EXPIRED | ATH9K_TX_FLUSH)
- #define ATH9K_TX_BA                0x01
- #define ATH9K_TX_PWRMGMT           0x02
-@@ -181,6 +182,7 @@ struct ath_htc_rx_status {
- #define ATH9K_RXERR_FIFO          0x04
- #define ATH9K_RXERR_DECRYPT       0x08
- #define ATH9K_RXERR_MIC           0x10
-+#define ATH9K_RXERR_KEYMISS       0x20
- #define ATH9K_RX_MORE             0x01
- #define ATH9K_RX_MORE_AGGR        0x02
-@@ -734,7 +736,7 @@ int ath9k_hw_beaconq_setup(struct ath_hw
- /* Interrupt Handling */
- bool ath9k_hw_intrpend(struct ath_hw *ah);
--void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints);
-+void ath9k_hw_set_interrupts(struct ath_hw *ah);
- void ath9k_hw_enable_interrupts(struct ath_hw *ah);
- void ath9k_hw_disable_interrupts(struct ath_hw *ah);
+       struct rt2x00_intf *intf = vif_to_intf(vif);
+       struct skb_frame_desc *skbdesc;
+@@ -815,19 +811,6 @@ int rt2x00queue_update_beacon_locked(str
+ }
  
+-int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
+-                            struct ieee80211_vif *vif)
+-{
+-      struct rt2x00_intf *intf = vif_to_intf(vif);
+-      int ret;
+-
+-      mutex_lock(&intf->beacon_skb_mutex);
+-      ret = rt2x00queue_update_beacon_locked(rt2x00dev, vif);
+-      mutex_unlock(&intf->beacon_skb_mutex);
+-
+-      return ret;
+-}
+-
+ bool rt2x00queue_for_each_entry(struct data_queue *queue,
+                               enum queue_index start,
+                               enum queue_index end,
+--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
++++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
+@@ -353,6 +353,7 @@ struct txentry_desc {
+  */
+ enum queue_entry_flags {
+       ENTRY_BCN_ASSIGNED,
++      ENTRY_BCN_ENABLED,
+       ENTRY_OWNER_DEVICE_DATA,
+       ENTRY_DATA_PENDING,
+       ENTRY_DATA_IO_FAILED,
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -273,7 +273,7 @@ static bool ath_complete_reset(struct at
-       ath9k_cmn_update_txpow(ah, sc->curtxpow,
-                              sc->config.txpowlimit, &sc->curtxpow);
--      ath9k_hw_set_interrupts(ah, ah->imask);
-+      ath9k_hw_set_interrupts(ah);
-       ath9k_hw_enable_interrupts(ah);
-       if (!(sc->sc_flags & (SC_OP_OFFCHANNEL)) && start) {
-@@ -679,6 +679,16 @@ void ath9k_tasklet(unsigned long data)
-       if ((status & ATH9K_INT_FATAL) ||
-           (status & ATH9K_INT_BB_WATCHDOG)) {
-+#ifdef CONFIG_ATH9K_DEBUGFS
-+              enum ath_reset_type type;
-+
-+              if (status & ATH9K_INT_FATAL)
-+                      type = RESET_TYPE_FATAL_INT;
-+              else
-+                      type = RESET_TYPE_BB_WATCHDOG;
-+
-+              RESET_STAT_INC(sc, type);
-+#endif
-               ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
-               goto out;
-       }
-@@ -823,7 +833,7 @@ irqreturn_t ath_isr(int irq, void *dev)
+@@ -1757,7 +1757,6 @@ out:
+ void ath9k_update_p2p_ps(struct ath_softc *sc, struct ieee80211_vif *vif)
+ {
+       struct ath_vif *avp = (void *)vif->drv_priv;
+-      unsigned long flags;
+       u32 tsf;
  
-       if (status & ATH9K_INT_RXEOL) {
-               ah->imask &= ~(ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-       }
+       if (!sc->p2p_ps_timer)
+@@ -1767,14 +1766,9 @@ void ath9k_update_p2p_ps(struct ath_soft
+               return;
  
-       if (status & ATH9K_INT_MIB) {
-@@ -995,8 +1005,10 @@ void ath_hw_check(struct work_struct *wo
-       ath_dbg(common, ATH_DBG_RESET, "Possible baseband hang, "
-               "busy=%d (try %d)\n", busy, sc->hw_busy_count + 1);
-       if (busy >= 99) {
--              if (++sc->hw_busy_count >= 3)
-+              if (++sc->hw_busy_count >= 3) {
-+                      RESET_STAT_INC(sc, RESET_TYPE_BB_HANG);
-                       ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
-+              }
+       sc->p2p_ps_vif = avp;
+-
+-      spin_lock_irqsave(&sc->sc_pm_lock, flags);
+-      if (!(sc->ps_flags & PS_BEACON_SYNC)) {
+-              tsf = ath9k_hw_gettsf32(sc->sc_ah);
+-              ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf);
+-              ath9k_update_p2p_ps_timer(sc, avp);
+-      }
+-      spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
++      tsf = ath9k_hw_gettsf32(sc->sc_ah);
++      ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf);
++      ath9k_update_p2p_ps_timer(sc, avp);
+ }
  
-       } else if (busy >= 0)
-               sc->hw_busy_count = 0;
-@@ -1016,6 +1028,7 @@ static void ath_hw_pll_rx_hang_check(str
-                       /* Rx is hung for more than 500ms. Reset it */
-                       ath_dbg(common, ATH_DBG_RESET,
-                               "Possible RX hang, resetting");
-+                      RESET_STAT_INC(sc, RESET_TYPE_PLL_HANG);
-                       ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
-                       count = 0;
-               }
-@@ -1396,7 +1409,7 @@ static void ath9k_calculate_summary_stat
-               ah->imask &= ~ATH9K_INT_TSFOOR;
+ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
+@@ -1791,6 +1785,7 @@ static void ath9k_bss_info_changed(struc
+       struct ath_hw *ah = sc->sc_ah;
+       struct ath_common *common = ath9k_hw_common(ah);
+       struct ath_vif *avp = (void *)vif->drv_priv;
++      unsigned long flags;
+       int slottime;
+       ath9k_ps_wakeup(sc);
+@@ -1853,7 +1848,10 @@ static void ath9k_bss_info_changed(struc
+       if (changed & BSS_CHANGED_P2P_PS) {
+               spin_lock_bh(&sc->sc_pcu_lock);
+-              ath9k_update_p2p_ps(sc, vif);
++              spin_lock_irqsave(&sc->sc_pm_lock, flags);
++              if (!(sc->ps_flags & PS_BEACON_SYNC))
++                      ath9k_update_p2p_ps(sc, vif);
++              spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
+               spin_unlock_bh(&sc->sc_pcu_lock);
        }
  
--      ath9k_hw_set_interrupts(ah, ah->imask);
-+      ath9k_hw_set_interrupts(ah);
-       /* Set up ANI */
-       if (iter_data.naps > 0) {
-@@ -1571,7 +1584,7 @@ static void ath9k_enable_ps(struct ath_s
-       if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) {
-               if ((ah->imask & ATH9K_INT_TIM_TIMER) == 0) {
-                       ah->imask |= ATH9K_INT_TIM_TIMER;
--                      ath9k_hw_set_interrupts(ah, ah->imask);
-+                      ath9k_hw_set_interrupts(ah);
-               }
-               ath9k_hw_setrxabort(ah, 1);
-       }
-@@ -1591,7 +1604,7 @@ static void ath9k_disable_ps(struct ath_
-                                 PS_WAIT_FOR_TX_ACK);
-               if (ah->imask & ATH9K_INT_TIM_TIMER) {
-                       ah->imask &= ~ATH9K_INT_TIM_TIMER;
--                      ath9k_hw_set_interrupts(ah, ah->imask);
-+                      ath9k_hw_set_interrupts(ah);
-               }
-       }
+@@ -2232,14 +2230,6 @@ static void ath9k_sw_scan_complete(struc
+       clear_bit(ATH_OP_SCANNING, &common->op_flags);
+ }
  
---- a/drivers/net/wireless/ath/ath9k/pci.c
-+++ b/drivers/net/wireless/ath/ath9k/pci.c
-@@ -33,7 +33,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_i
-       { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E  AR9300 */
-       { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E  AR9485 */
-       { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E  AR9580 */
--      { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E  AR9480 */
-+      { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E  AR9462 */
-       { 0 }
+-static void ath9k_channel_switch_beacon(struct ieee80211_hw *hw,
+-                                      struct ieee80211_vif *vif,
+-                                      struct cfg80211_chan_def *chandef)
+-{
+-      /* depend on vif->csa_active only */
+-      return;
+-}
+-
+ struct ieee80211_ops ath9k_ops = {
+       .tx                 = ath9k_tx,
+       .start              = ath9k_start,
+@@ -2287,5 +2277,4 @@ struct ieee80211_ops ath9k_ops = {
+ #endif
+       .sw_scan_start      = ath9k_sw_scan_start,
+       .sw_scan_complete   = ath9k_sw_scan_complete,
+-      .channel_switch_beacon     = ath9k_channel_switch_beacon,
  };
+--- a/drivers/net/wireless/ath/ath10k/mac.c
++++ b/drivers/net/wireless/ath/ath10k/mac.c
+@@ -4142,14 +4142,6 @@ static int ath10k_set_bitrate_mask(struc
+                                          fixed_nss, force_sgi);
+ }
  
---- a/drivers/net/wireless/ath/ath9k/recv.c
-+++ b/drivers/net/wireless/ath/ath9k/recv.c
-@@ -433,12 +433,9 @@ void ath_rx_cleanup(struct ath_softc *sc
+-static void ath10k_channel_switch_beacon(struct ieee80211_hw *hw,
+-                                       struct ieee80211_vif *vif,
+-                                       struct cfg80211_chan_def *chandef)
+-{
+-      /* there's no need to do anything here. vif->csa_active is enough */
+-      return;
+-}
+-
+ static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+                                struct ieee80211_sta *sta,
+@@ -4256,7 +4248,6 @@ static const struct ieee80211_ops ath10k
+       .restart_complete               = ath10k_restart_complete,
+       .get_survey                     = ath10k_get_survey,
+       .set_bitrate_mask               = ath10k_set_bitrate_mask,
+-      .channel_switch_beacon          = ath10k_channel_switch_beacon,
+       .sta_rc_update                  = ath10k_sta_rc_update,
+       .get_tsf                        = ath10k_get_tsf,
+ #ifdef CONFIG_PM
+--- a/net/mac80211/cfg.c
++++ b/net/mac80211/cfg.c
+@@ -468,327 +468,6 @@ void sta_set_rate_info_rx(struct sta_inf
+               rinfo->flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH;
+ }
  
- u32 ath_calcrxfilter(struct ath_softc *sc)
- {
--#define       RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)
+-static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
+-{
+-      struct ieee80211_sub_if_data *sdata = sta->sdata;
+-      struct ieee80211_local *local = sdata->local;
+-      struct rate_control_ref *ref = local->rate_ctrl;
+-      struct timespec uptime;
+-      u64 packets = 0;
+-      u32 thr = 0;
+-      int i, ac;
+-
+-      sinfo->generation = sdata->local->sta_generation;
+-
+-      sinfo->filled = STATION_INFO_INACTIVE_TIME |
+-                      STATION_INFO_RX_BYTES64 |
+-                      STATION_INFO_TX_BYTES64 |
+-                      STATION_INFO_RX_PACKETS |
+-                      STATION_INFO_TX_PACKETS |
+-                      STATION_INFO_TX_RETRIES |
+-                      STATION_INFO_TX_FAILED |
+-                      STATION_INFO_TX_BITRATE |
+-                      STATION_INFO_RX_BITRATE |
+-                      STATION_INFO_RX_DROP_MISC |
+-                      STATION_INFO_BSS_PARAM |
+-                      STATION_INFO_CONNECTED_TIME |
+-                      STATION_INFO_STA_FLAGS |
+-                      STATION_INFO_BEACON_LOSS_COUNT;
+-
+-      do_posix_clock_monotonic_gettime(&uptime);
+-      sinfo->connected_time = uptime.tv_sec - sta->last_connected;
+-
+-      sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
+-      sinfo->tx_bytes = 0;
+-      for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
+-              sinfo->tx_bytes += sta->tx_bytes[ac];
+-              packets += sta->tx_packets[ac];
+-      }
+-      sinfo->tx_packets = packets;
+-      sinfo->rx_bytes = sta->rx_bytes;
+-      sinfo->rx_packets = sta->rx_packets;
+-      sinfo->tx_retries = sta->tx_retry_count;
+-      sinfo->tx_failed = sta->tx_retry_failed;
+-      sinfo->rx_dropped_misc = sta->rx_dropped;
+-      sinfo->beacon_loss_count = sta->beacon_loss_count;
+-
+-      if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
+-          (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
+-              sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG;
+-              if (!local->ops->get_rssi ||
+-                  drv_get_rssi(local, sdata, &sta->sta, &sinfo->signal))
+-                      sinfo->signal = (s8)sta->last_signal;
+-              sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
+-      }
+-      if (sta->chains) {
+-              sinfo->filled |= STATION_INFO_CHAIN_SIGNAL |
+-                               STATION_INFO_CHAIN_SIGNAL_AVG;
+-
+-              sinfo->chains = sta->chains;
+-              for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
+-                      sinfo->chain_signal[i] = sta->chain_signal_last[i];
+-                      sinfo->chain_signal_avg[i] =
+-                              (s8) -ewma_read(&sta->chain_signal_avg[i]);
+-              }
+-      }
+-
+-      sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
+-      sta_set_rate_info_rx(sta, &sinfo->rxrate);
+-
+-      if (ieee80211_vif_is_mesh(&sdata->vif)) {
+-#ifdef CPTCFG_MAC80211_MESH
+-              sinfo->filled |= STATION_INFO_LLID |
+-                               STATION_INFO_PLID |
+-                               STATION_INFO_PLINK_STATE |
+-                               STATION_INFO_LOCAL_PM |
+-                               STATION_INFO_PEER_PM |
+-                               STATION_INFO_NONPEER_PM;
+-
+-              sinfo->llid = sta->llid;
+-              sinfo->plid = sta->plid;
+-              sinfo->plink_state = sta->plink_state;
+-              if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
+-                      sinfo->filled |= STATION_INFO_T_OFFSET;
+-                      sinfo->t_offset = sta->t_offset;
+-              }
+-              sinfo->local_pm = sta->local_pm;
+-              sinfo->peer_pm = sta->peer_pm;
+-              sinfo->nonpeer_pm = sta->nonpeer_pm;
+-#endif
+-      }
+-
+-      sinfo->bss_param.flags = 0;
+-      if (sdata->vif.bss_conf.use_cts_prot)
+-              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT;
+-      if (sdata->vif.bss_conf.use_short_preamble)
+-              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
+-      if (sdata->vif.bss_conf.use_short_slot)
+-              sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
+-      sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
+-      sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
+-
+-      sinfo->sta_flags.set = 0;
+-      sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
+-                              BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
+-                              BIT(NL80211_STA_FLAG_WME) |
+-                              BIT(NL80211_STA_FLAG_MFP) |
+-                              BIT(NL80211_STA_FLAG_AUTHENTICATED) |
+-                              BIT(NL80211_STA_FLAG_ASSOCIATED) |
+-                              BIT(NL80211_STA_FLAG_TDLS_PEER);
+-      if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
+-      if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
+-      if (test_sta_flag(sta, WLAN_STA_WME))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
+-      if (test_sta_flag(sta, WLAN_STA_MFP))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
+-      if (test_sta_flag(sta, WLAN_STA_AUTH))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
+-      if (test_sta_flag(sta, WLAN_STA_ASSOC))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_ASSOCIATED);
+-      if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
+-              sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER);
+-
+-      /* check if the driver has a SW RC implementation */
+-      if (ref && ref->ops->get_expected_throughput)
+-              thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv);
+-      else
+-              thr = drv_get_expected_throughput(local, &sta->sta);
+-
+-      if (thr != 0) {
+-              sinfo->filled |= STATION_INFO_EXPECTED_THROUGHPUT;
+-              sinfo->expected_throughput = thr;
+-      }
+-}
+-
+-static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
+-      "rx_packets", "rx_bytes", "wep_weak_iv_count",
+-      "rx_duplicates", "rx_fragments", "rx_dropped",
+-      "tx_packets", "tx_bytes", "tx_fragments",
+-      "tx_filtered", "tx_retry_failed", "tx_retries",
+-      "beacon_loss", "sta_state", "txrate", "rxrate", "signal",
+-      "channel", "noise", "ch_time", "ch_time_busy",
+-      "ch_time_ext_busy", "ch_time_rx", "ch_time_tx"
+-};
+-#define STA_STATS_LEN ARRAY_SIZE(ieee80211_gstrings_sta_stats)
+-
+-static int ieee80211_get_et_sset_count(struct wiphy *wiphy,
+-                                     struct net_device *dev,
+-                                     int sset)
+-{
+-      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+-      int rv = 0;
+-
+-      if (sset == ETH_SS_STATS)
+-              rv += STA_STATS_LEN;
+-
+-      rv += drv_get_et_sset_count(sdata, sset);
+-
+-      if (rv == 0)
+-              return -EOPNOTSUPP;
+-      return rv;
+-}
+-
+-static void ieee80211_get_et_stats(struct wiphy *wiphy,
+-                                 struct net_device *dev,
+-                                 struct ethtool_stats *stats,
+-                                 u64 *data)
+-{
+-      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+-      struct ieee80211_chanctx_conf *chanctx_conf;
+-      struct ieee80211_channel *channel;
+-      struct sta_info *sta;
+-      struct ieee80211_local *local = sdata->local;
+-      struct station_info sinfo;
+-      struct survey_info survey;
+-      int i, q;
+-#define STA_STATS_SURVEY_LEN 7
+-
+-      memset(data, 0, sizeof(u64) * STA_STATS_LEN);
+-
+-#define ADD_STA_STATS(sta)                            \
+-      do {                                            \
+-              data[i++] += sta->rx_packets;           \
+-              data[i++] += sta->rx_bytes;             \
+-              data[i++] += sta->wep_weak_iv_count;    \
+-              data[i++] += sta->num_duplicates;       \
+-              data[i++] += sta->rx_fragments;         \
+-              data[i++] += sta->rx_dropped;           \
+-                                                      \
+-              data[i++] += sinfo.tx_packets;          \
+-              data[i++] += sinfo.tx_bytes;            \
+-              data[i++] += sta->tx_fragments;         \
+-              data[i++] += sta->tx_filtered_count;    \
+-              data[i++] += sta->tx_retry_failed;      \
+-              data[i++] += sta->tx_retry_count;       \
+-              data[i++] += sta->beacon_loss_count;    \
+-      } while (0)
+-
+-      /* For Managed stations, find the single station based on BSSID
+-       * and use that.  For interface types, iterate through all available
+-       * stations and add stats for any station that is assigned to this
+-       * network device.
+-       */
+-
+-      mutex_lock(&local->sta_mtx);
+-
+-      if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+-              sta = sta_info_get_bss(sdata, sdata->u.mgd.bssid);
+-
+-              if (!(sta && !WARN_ON(sta->sdata->dev != dev)))
+-                      goto do_survey;
+-
+-              sinfo.filled = 0;
+-              sta_set_sinfo(sta, &sinfo);
+-
+-              i = 0;
+-              ADD_STA_STATS(sta);
+-
+-              data[i++] = sta->sta_state;
+-
+-
+-              if (sinfo.filled & STATION_INFO_TX_BITRATE)
+-                      data[i] = 100000 *
+-                              cfg80211_calculate_bitrate(&sinfo.txrate);
+-              i++;
+-              if (sinfo.filled & STATION_INFO_RX_BITRATE)
+-                      data[i] = 100000 *
+-                              cfg80211_calculate_bitrate(&sinfo.rxrate);
+-              i++;
+-
+-              if (sinfo.filled & STATION_INFO_SIGNAL_AVG)
+-                      data[i] = (u8)sinfo.signal_avg;
+-              i++;
+-      } else {
+-              list_for_each_entry(sta, &local->sta_list, list) {
+-                      /* Make sure this station belongs to the proper dev */
+-                      if (sta->sdata->dev != dev)
+-                              continue;
+-
+-                      sinfo.filled = 0;
+-                      sta_set_sinfo(sta, &sinfo);
+-                      i = 0;
+-                      ADD_STA_STATS(sta);
+-              }
+-      }
+-
+-do_survey:
+-      i = STA_STATS_LEN - STA_STATS_SURVEY_LEN;
+-      /* Get survey stats for current channel */
+-      survey.filled = 0;
+-
+-      rcu_read_lock();
+-      chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
+-      if (chanctx_conf)
+-              channel = chanctx_conf->def.chan;
+-      else
+-              channel = NULL;
+-      rcu_read_unlock();
+-
+-      if (channel) {
+-              q = 0;
+-              do {
+-                      survey.filled = 0;
+-                      if (drv_get_survey(local, q, &survey) != 0) {
+-                              survey.filled = 0;
+-                              break;
+-                      }
+-                      q++;
+-              } while (channel != survey.channel);
+-      }
+-
+-      if (survey.filled)
+-              data[i++] = survey.channel->center_freq;
+-      else
+-              data[i++] = 0;
+-      if (survey.filled & SURVEY_INFO_NOISE_DBM)
+-              data[i++] = (u8)survey.noise;
+-      else
+-              data[i++] = -1LL;
+-      if (survey.filled & SURVEY_INFO_CHANNEL_TIME)
+-              data[i++] = survey.channel_time;
+-      else
+-              data[i++] = -1LL;
+-      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_BUSY)
+-              data[i++] = survey.channel_time_busy;
+-      else
+-              data[i++] = -1LL;
+-      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_EXT_BUSY)
+-              data[i++] = survey.channel_time_ext_busy;
+-      else
+-              data[i++] = -1LL;
+-      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_RX)
+-              data[i++] = survey.channel_time_rx;
+-      else
+-              data[i++] = -1LL;
+-      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_TX)
+-              data[i++] = survey.channel_time_tx;
+-      else
+-              data[i++] = -1LL;
+-
+-      mutex_unlock(&local->sta_mtx);
+-
+-      if (WARN_ON(i != STA_STATS_LEN))
+-              return;
 -
-       u32 rfilt;
--      rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
--              | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
-+      rfilt = ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
-               | ATH9K_RX_FILTER_MCAST;
-       if (sc->rx.rxfilter & FIF_PROBE_REQ)
-@@ -811,6 +808,7 @@ static bool ath9k_rx_accept(struct ath_c
-                           struct ath_rx_status *rx_stats,
-                           bool *decrypt_error)
+-      drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN]));
+-}
+-
+-static void ieee80211_get_et_strings(struct wiphy *wiphy,
+-                                   struct net_device *dev,
+-                                   u32 sset, u8 *data)
+-{
+-      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+-      int sz_sta_stats = 0;
+-
+-      if (sset == ETH_SS_STATS) {
+-              sz_sta_stats = sizeof(ieee80211_gstrings_sta_stats);
+-              memcpy(data, ieee80211_gstrings_sta_stats, sz_sta_stats);
+-      }
+-      drv_get_et_strings(sdata, sset, &(data[sz_sta_stats]));
+-}
+-
+ static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
+                                 int idx, u8 *mac, struct station_info *sinfo)
  {
-+      struct ath_softc *sc = (struct ath_softc *) common->priv;
-       bool is_mc, is_valid_tkip, strip_mic, mic_error;
-       struct ath_hw *ah = common->ah;
-       __le16 fc;
-@@ -823,7 +821,8 @@ static bool ath9k_rx_accept(struct ath_c
-               test_bit(rx_stats->rs_keyix, common->tkip_keymap);
-       strip_mic = is_valid_tkip && ieee80211_is_data(fc) &&
-               !(rx_stats->rs_status &
--              (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC));
-+              (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
-+               ATH9K_RXERR_KEYMISS));
-       if (!rx_stats->rs_datalen)
-               return false;
-@@ -851,6 +850,8 @@ static bool ath9k_rx_accept(struct ath_c
-        * descriptors.
-        */
-       if (rx_stats->rs_status != 0) {
-+              u8 status_mask;
-+
-               if (rx_stats->rs_status & ATH9K_RXERR_CRC) {
-                       rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
-                       mic_error = false;
-@@ -858,7 +859,8 @@ static bool ath9k_rx_accept(struct ath_c
-               if (rx_stats->rs_status & ATH9K_RXERR_PHY)
-                       return false;
--              if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
-+              if ((rx_stats->rs_status & ATH9K_RXERR_DECRYPT) ||
-+                  (!is_mc && (rx_stats->rs_status & ATH9K_RXERR_KEYMISS))) {
-                       *decrypt_error = true;
-                       mic_error = false;
-               }
-@@ -868,17 +870,14 @@ static bool ath9k_rx_accept(struct ath_c
-                * decryption and MIC failures. For monitor mode,
-                * we also ignore the CRC error.
-                */
--              if (ah->is_monitoring) {
--                      if (rx_stats->rs_status &
--                          ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
--                            ATH9K_RXERR_CRC))
--                              return false;
--              } else {
--                      if (rx_stats->rs_status &
--                          ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
--                              return false;
--                      }
--              }
-+              status_mask = ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
-+                            ATH9K_RXERR_KEYMISS;
-+
-+              if (ah->is_monitoring && (sc->rx.rxfilter & FIF_FCSFAIL))
-+                      status_mask |= ATH9K_RXERR_CRC;
-+
-+              if (rx_stats->rs_status & ~status_mask)
-+                      return false;
-       }
+@@ -875,7 +554,8 @@ static int ieee80211_set_monitor_channel
+ }
  
-       /*
-@@ -1973,7 +1972,7 @@ requeue:
+ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
+-                                  const u8 *resp, size_t resp_len)
++                                  const u8 *resp, size_t resp_len,
++                                  const struct ieee80211_csa_settings *csa)
+ {
+       struct probe_resp *new, *old;
  
-       if (!(ah->imask & ATH9K_INT_RXEOL)) {
-               ah->imask |= (ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
--              ath9k_hw_set_interrupts(ah, ah->imask);
-+              ath9k_hw_set_interrupts(ah);
-       }
+@@ -891,6 +571,11 @@ static int ieee80211_set_probe_resp(stru
+       new->len = resp_len;
+       memcpy(new->data, resp, resp_len);
  
-       return 0;
---- a/drivers/net/wireless/ath/ath9k/reg.h
-+++ b/drivers/net/wireless/ath/ath9k/reg.h
-@@ -796,9 +796,9 @@
- #define AR_SREV_VERSION_9340          0x300
- #define AR_SREV_VERSION_9580          0x1C0
- #define AR_SREV_REVISION_9580_10      4 /* AR9580 1.0 */
--#define AR_SREV_VERSION_9480          0x280
--#define AR_SREV_REVISION_9480_10      0
--#define AR_SREV_REVISION_9480_20      2
-+#define AR_SREV_VERSION_9462          0x280
-+#define AR_SREV_REVISION_9462_10      0
-+#define AR_SREV_REVISION_9462_20      2
- #define AR_SREV_5416(_ah) \
-       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
-@@ -895,20 +895,20 @@
-     (AR_SREV_9285_12_OR_LATER(_ah) && \
-      ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
--#define AR_SREV_9480(_ah) \
--      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9480))
-+#define AR_SREV_9462(_ah) \
-+      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462))
--#define AR_SREV_9480_10(_ah) \
--      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9480) && \
--      ((_ah)->hw_version.macRev == AR_SREV_REVISION_9480_10))
--
--#define AR_SREV_9480_20(_ah) \
--      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9480) && \
--      ((_ah)->hw_version.macRev == AR_SREV_REVISION_9480_20))
--
--#define AR_SREV_9480_20_OR_LATER(_ah) \
--      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9480) && \
--      ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9480_20))
-+#define AR_SREV_9462_10(_ah) \
-+      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \
-+      ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_10))
-+
-+#define AR_SREV_9462_20(_ah) \
-+      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \
-+      ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_20))
++      if (csa)
++              memcpy(new->csa_counter_offsets, csa->counter_offsets_presp,
++                     csa->n_counter_offsets_presp *
++                     sizeof(new->csa_counter_offsets[0]));
 +
-+#define AR_SREV_9462_20_OR_LATER(_ah) \
-+      (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \
-+      ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20))
- #define AR_SREV_9580(_ah) \
-       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \
-@@ -1933,6 +1933,7 @@ enum {
- #define AR_PHY_AGC_CONTROL_NO_UPDATE_NF               0x00020000  /* don't update noise floor automatically */
- #define AR_PHY_AGC_CONTROL_EXT_NF_PWR_MEAS    0x00040000  /* extend noise floor power measurement */
- #define AR_PHY_AGC_CONTROL_CLC_SUCCESS                0x00080000  /* carrier leak calibration done */
-+#define AR_PHY_AGC_CONTROL_PKDET_CAL          0x00100000
- #define AR_PHY_AGC_CONTROL_YCOK_MAX           0x000003c0
- #define AR_PHY_AGC_CONTROL_YCOK_MAX_S         6
+       rcu_assign_pointer(sdata->u.ap.probe_resp, new);
+       if (old)
+               kfree_rcu(old, rcu_head);
+@@ -899,7 +584,8 @@ static int ieee80211_set_probe_resp(stru
+ }
  
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -373,7 +373,7 @@ static void ath_tx_complete_aggr(struct 
-       struct ath_frame_info *fi;
-       int nframes;
-       u8 tidno;
--      bool clear_filter;
-+      bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
-       skb = bf->bf_mpdu;
-       hdr = (struct ieee80211_hdr *)skb->data;
-@@ -462,12 +462,12 @@ static void ath_tx_complete_aggr(struct 
-                                * the un-acked sub-frames
-                                */
-                               txfail = 1;
-+                      } else if (flush) {
-+                              txpending = 1;
-                       } else if (fi->retries < ATH_MAX_SW_RETRIES) {
--                              if (!(ts->ts_status & ATH9K_TXERR_FILT) ||
--                                  !an->sleeping)
-+                              if (txok || !an->sleeping)
-                                       ath_tx_set_retry(sc, txq, bf->bf_mpdu);
--                              clear_filter = true;
-                               txpending = 1;
-                       } else {
-                               txfail = 1;
-@@ -521,7 +521,8 @@ static void ath_tx_complete_aggr(struct 
-                                               ath_tx_complete_buf(sc, bf, txq,
-                                                                   &bf_head,
--                                                                  ts, 0, 1);
-+                                                                  ts, 0,
-+                                                                  !flush);
-                                               break;
-                                       }
-@@ -545,11 +546,13 @@ static void ath_tx_complete_aggr(struct 
-                       ieee80211_sta_set_buffered(sta, tid->tidno, true);
-               spin_lock_bh(&txq->axq_lock);
--              if (clear_filter)
--                      tid->ac->clear_ps_filter = true;
-               skb_queue_splice(&bf_pending, &tid->buf_q);
--              if (!an->sleeping)
-+              if (!an->sleeping) {
-                       ath_tx_queue_tid(txq, tid);
+ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
+-                                 struct cfg80211_beacon_data *params)
++                                 struct cfg80211_beacon_data *params,
++                                 const struct ieee80211_csa_settings *csa)
+ {
+       struct beacon_data *new, *old;
+       int new_head_len, new_tail_len;
+@@ -943,6 +629,13 @@ static int ieee80211_assign_beacon(struc
+       new->head_len = new_head_len;
+       new->tail_len = new_tail_len;
++      if (csa) {
++              new->csa_current_counter = csa->count;
++              memcpy(new->csa_counter_offsets, csa->counter_offsets_beacon,
++                     csa->n_counter_offsets_beacon *
++                     sizeof(new->csa_counter_offsets[0]));
++      }
 +
-+                      if (ts->ts_status & ATH9K_TXERR_FILT)
-+                              tid->ac->clear_ps_filter = true;
-+              }
-               spin_unlock_bh(&txq->axq_lock);
+       /* copy in head */
+       if (params->head)
+               memcpy(new->head, params->head, new_head_len);
+@@ -957,7 +650,7 @@ static int ieee80211_assign_beacon(struc
+                       memcpy(new->tail, old->tail, new_tail_len);
+       err = ieee80211_set_probe_resp(sdata, params->probe_resp,
+-                                     params->probe_resp_len);
++                                     params->probe_resp_len, csa);
+       if (err < 0)
+               return err;
+       if (err == 0)
+@@ -1042,7 +735,7 @@ static int ieee80211_start_ap(struct wip
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
+                                       IEEE80211_P2P_OPPPS_ENABLE_BIT;
+-      err = ieee80211_assign_beacon(sdata, &params->beacon);
++      err = ieee80211_assign_beacon(sdata, &params->beacon, NULL);
+       if (err < 0) {
+               ieee80211_vif_release_channel(sdata);
+               return err;
+@@ -1090,7 +783,7 @@ static int ieee80211_change_beacon(struc
+       if (!old)
+               return -ENOENT;
+-      err = ieee80211_assign_beacon(sdata, params);
++      err = ieee80211_assign_beacon(sdata, params, NULL);
+       if (err < 0)
+               return err;
+       ieee80211_bss_info_change_notify(sdata, err);
+@@ -3073,7 +2766,8 @@ static int ieee80211_set_after_csa_beaco
+       switch (sdata->vif.type) {
+       case NL80211_IFTYPE_AP:
+-              err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon);
++              err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon,
++                                            NULL);
+               kfree(sdata->u.ap.next_beacon);
+               sdata->u.ap.next_beacon = NULL;
+@@ -3176,6 +2870,7 @@ static int ieee80211_set_csa_beacon(stru
+                                   struct cfg80211_csa_settings *params,
+                                   u32 *changed)
+ {
++      struct ieee80211_csa_settings csa = {};
+       int err;
+       switch (sdata->vif.type) {
+@@ -3210,20 +2905,13 @@ static int ieee80211_set_csa_beacon(stru
+                    IEEE80211_MAX_CSA_COUNTERS_NUM))
+                       return -EINVAL;
+-              /* make sure we don't have garbage in other counters */
+-              memset(sdata->csa_counter_offset_beacon, 0,
+-                     sizeof(sdata->csa_counter_offset_beacon));
+-              memset(sdata->csa_counter_offset_presp, 0,
+-                     sizeof(sdata->csa_counter_offset_presp));
+-
+-              memcpy(sdata->csa_counter_offset_beacon,
+-                     params->counter_offsets_beacon,
+-                     params->n_counter_offsets_beacon * sizeof(u16));
+-              memcpy(sdata->csa_counter_offset_presp,
+-                     params->counter_offsets_presp,
+-                     params->n_counter_offsets_presp * sizeof(u16));
++              csa.counter_offsets_beacon = params->counter_offsets_beacon;
++              csa.counter_offsets_presp = params->counter_offsets_presp;
++              csa.n_counter_offsets_beacon = params->n_counter_offsets_beacon;
++              csa.n_counter_offsets_presp = params->n_counter_offsets_presp;
++              csa.count = params->count;
+-              err = ieee80211_assign_beacon(sdata, &params->beacon_csa);
++              err = ieee80211_assign_beacon(sdata, &params->beacon_csa, &csa);
+               if (err < 0) {
+                       kfree(sdata->u.ap.next_beacon);
+                       return err;
+@@ -3367,7 +3055,6 @@ __ieee80211_channel_switch(struct wiphy 
+       sdata->csa_radar_required = params->radar_required;
+       sdata->csa_chandef = params->chandef;
+       sdata->csa_block_tx = params->block_tx;
+-      sdata->csa_current_counter = params->count;
+       sdata->vif.csa_active = true;
+       if (sdata->csa_block_tx)
+@@ -3515,10 +3202,23 @@ static int ieee80211_mgmt_tx(struct wiph
+            sdata->vif.type == NL80211_IFTYPE_ADHOC) &&
+           params->n_csa_offsets) {
+               int i;
+-              u8 c = sdata->csa_current_counter;
++              struct beacon_data *beacon = NULL;
++
++              rcu_read_lock();
+-              for (i = 0; i < params->n_csa_offsets; i++)
+-                      data[params->csa_offsets[i]] = c;
++              if (sdata->vif.type == NL80211_IFTYPE_AP)
++                      beacon = rcu_dereference(sdata->u.ap.beacon);
++              else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
++                      beacon = rcu_dereference(sdata->u.ibss.presp);
++              else if (ieee80211_vif_is_mesh(&sdata->vif))
++                      beacon = rcu_dereference(sdata->u.mesh.beacon);
++
++              if (beacon)
++                      for (i = 0; i < params->n_csa_offsets; i++)
++                              data[params->csa_offsets[i]] =
++                                      beacon->csa_current_counter;
++
++              rcu_read_unlock();
        }
  
-@@ -564,8 +567,10 @@ static void ath_tx_complete_aggr(struct 
-       rcu_read_unlock();
--      if (needreset)
-+      if (needreset) {
-+              RESET_STAT_INC(sc, RESET_TYPE_TX_ERROR);
-               ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
-+      }
+       IEEE80211_SKB_CB(skb)->flags = flags;
+@@ -3598,21 +3298,6 @@ static int ieee80211_get_antenna(struct 
+       return drv_get_antenna(local, tx_ant, rx_ant);
  }
  
- static bool ath_lookup_legacy(struct ath_buf *bf)
-@@ -1407,6 +1412,7 @@ static void ath_drain_txq_list(struct at
-       struct ath_tx_status ts;
-       memset(&ts, 0, sizeof(ts));
-+      ts.ts_status = ATH9K_TX_FLUSH;
-       INIT_LIST_HEAD(&bf_head);
-       while (!list_empty(list)) {
-@@ -1473,7 +1479,8 @@ bool ath_drain_all_txq(struct ath_softc 
-       struct ath_hw *ah = sc->sc_ah;
-       struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_txq *txq;
--      int i, npend = 0;
-+      int i;
-+      u32 npend = 0;
-       if (sc->sc_flags & SC_OP_INVALID)
-               return true;
-@@ -1485,11 +1492,12 @@ bool ath_drain_all_txq(struct ath_softc 
-               if (!ATH_TXQ_SETUP(sc, i))
-                       continue;
--              npend += ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum);
-+              if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum))
-+                      npend |= BIT(i);
-       }
-       if (npend)
--              ath_err(common, "Failed to stop TX DMA!\n");
-+              ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend);
-       for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
-               if (!ATH_TXQ_SETUP(sc, i))
-@@ -2211,6 +2219,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");
-+              RESET_STAT_INC(sc, RESET_TYPE_TX_HANG);
-               ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
-       }
---- a/drivers/net/wireless/ath/carl9170/main.c
-+++ b/drivers/net/wireless/ath/carl9170/main.c
-@@ -1914,7 +1914,6 @@ static int carl9170_parse_eeprom(struct 
-               ar->hw->channel_change_time = 80 * 1000;
-       regulatory->current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]);
--      regulatory->current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]);
+-static int ieee80211_set_ringparam(struct wiphy *wiphy, u32 tx, u32 rx)
+-{
+-      struct ieee80211_local *local = wiphy_priv(wiphy);
+-
+-      return drv_set_ringparam(local, tx, rx);
+-}
+-
+-static void ieee80211_get_ringparam(struct wiphy *wiphy,
+-                                  u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
+-{
+-      struct ieee80211_local *local = wiphy_priv(wiphy);
+-
+-      drv_get_ringparam(local, tx, tx_max, rx, rx_max);
+-}
+-
+ static int ieee80211_set_rekey_data(struct wiphy *wiphy,
+                                   struct net_device *dev,
+                                   struct cfg80211_gtk_rekey_data *data)
+@@ -3844,8 +3529,6 @@ const struct cfg80211_ops mac80211_confi
+       .mgmt_frame_register = ieee80211_mgmt_frame_register,
+       .set_antenna = ieee80211_set_antenna,
+       .get_antenna = ieee80211_get_antenna,
+-      .set_ringparam = ieee80211_set_ringparam,
+-      .get_ringparam = ieee80211_get_ringparam,
+       .set_rekey_data = ieee80211_set_rekey_data,
+       .tdls_oper = ieee80211_tdls_oper,
+       .tdls_mgmt = ieee80211_tdls_mgmt,
+@@ -3854,9 +3537,6 @@ const struct cfg80211_ops mac80211_confi
+ #ifdef CONFIG_PM
+       .set_wakeup = ieee80211_set_wakeup,
+ #endif
+-      .get_et_sset_count = ieee80211_get_et_sset_count,
+-      .get_et_stats = ieee80211_get_et_stats,
+-      .get_et_strings = ieee80211_get_et_strings,
+       .get_channel = ieee80211_cfg_get_channel,
+       .start_radar_detection = ieee80211_start_radar_detection,
+       .channel_switch = ieee80211_channel_switch,
+--- a/net/mac80211/debugfs_sta.c
++++ b/net/mac80211/debugfs_sta.c
+@@ -587,7 +587,6 @@ void ieee80211_sta_debugfs_add(struct st
+       DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
+       DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
+       DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count);
+-      DEBUGFS_ADD_COUNTER(wep_weak_iv_count, wep_weak_iv_count);
+       if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
+               debugfs_create_x32("driver_buffered_tids", 0400,
+--- a/net/mac80211/wep.c
++++ b/net/mac80211/wep.c
+@@ -271,22 +271,6 @@ static int ieee80211_wep_decrypt(struct 
+       return ret;
+ }
  
-       /* second part of wiphy init */
-       SET_IEEE80211_PERM_ADDR(ar->hw, ar->eeprom.mac_address);
+-
+-static bool ieee80211_wep_is_weak_iv(struct sk_buff *skb,
+-                                   struct ieee80211_key *key)
+-{
+-      struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+-      unsigned int hdrlen;
+-      u8 *ivpos;
+-      u32 iv;
+-
+-      hdrlen = ieee80211_hdrlen(hdr->frame_control);
+-      ivpos = skb->data + hdrlen;
+-      iv = (ivpos[0] << 16) | (ivpos[1] << 8) | ivpos[2];
+-
+-      return ieee80211_wep_weak_iv(iv, key->conf.keylen);
+-}
+-
+ ieee80211_rx_result
+ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx)
+ {
+@@ -301,16 +285,12 @@ ieee80211_crypto_wep_decrypt(struct ieee
+       if (!(status->flag & RX_FLAG_DECRYPTED)) {
+               if (skb_linearize(rx->skb))
+                       return RX_DROP_UNUSABLE;
+-              if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key))
+-                      rx->sta->wep_weak_iv_count++;
+               if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key))
+                       return RX_DROP_UNUSABLE;
+       } else if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
+               if (!pskb_may_pull(rx->skb, ieee80211_hdrlen(fc) +
+                                           IEEE80211_WEP_IV_LEN))
+                       return RX_DROP_UNUSABLE;
+-              if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key))
+-                      rx->sta->wep_weak_iv_count++;
+               ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key);
+               /* remove ICV */
+               if (pskb_trim(rx->skb, rx->skb->len - IEEE80211_WEP_ICV_LEN))
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -1119,6 +1119,7 @@ struct cfg80211_ibss_params {
-       u8 *ssid;
-       u8 *bssid;
-       struct ieee80211_channel *channel;
-+      enum nl80211_channel_type channel_type;
-       u8 *ie;
-       u8 ssid_len, ie_len;
-       u16 beacon_interval;
-@@ -3185,6 +3186,16 @@ void cfg80211_gtk_rekey_notify(struct ne
- void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
-                                    const u8 *bssid, bool preauth, gfp_t gfp);
-+/**
-+ * cfg80211_can_use_ext_chan - test if ht40 on extension channel can be used
-+ * @wiphy: the wiphy
-+ * @chan: main channel
-+ * @channel_type: HT mode
-+ */
-+bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
-+                                struct ieee80211_channel *chan,
-+                                enum nl80211_channel_type channel_type);
+@@ -2278,16 +2278,6 @@ struct cfg80211_qos_map {
+  *
+  * @set_noack_map: Set the NoAck Map for the TIDs.
+  *
+- * @get_et_sset_count:  Ethtool API to get string-set count.
+- *    See @ethtool_ops.get_sset_count
+- *
+- * @get_et_stats:  Ethtool API to get a set of u64 stats.
+- *    See @ethtool_ops.get_ethtool_stats
+- *
+- * @get_et_strings:  Ethtool API to get a set of strings to describe stats
+- *    and perhaps other supported types of ethtool data-sets.
+- *    See @ethtool_ops.get_strings
+- *
+  * @get_channel: Get the current operating channel for the virtual interface.
+  *    For monitor interfaces, it should return %NULL unless there's a single
+  *    current monitoring channel.
+@@ -2529,13 +2519,6 @@ struct cfg80211_ops {
+                                 struct net_device *dev,
+                                 u16 noack_map);
+-      int     (*get_et_sset_count)(struct wiphy *wiphy,
+-                                   struct net_device *dev, int sset);
+-      void    (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev,
+-                              struct ethtool_stats *stats, u64 *data);
+-      void    (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
+-                                u32 sset, u8 *data);
+-
+       int     (*get_channel)(struct wiphy *wiphy,
+                              struct wireless_dev *wdev,
+                              struct cfg80211_chan_def *chandef);
+@@ -4846,6 +4829,10 @@ void cfg80211_stop_iface(struct wiphy *w
+  */
+ void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
++
++/* ethtool helper */
++void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
 +
  /* Logging, debugging and troubleshooting/diagnostic helpers. */
  
  /* wiphy_printk helpers, similar to dev_printk */
---- a/net/mac80211/agg-rx.c
-+++ b/net/mac80211/agg-rx.c
-@@ -180,6 +180,10 @@ static void ieee80211_send_addba_resp(st
-               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
-+      else if (sdata->vif.type == NL80211_IFTYPE_WDS)
-+              memcpy(mgmt->bssid, da, ETH_ALEN);
-+      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-+              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
-       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
-                                         IEEE80211_STYPE_ACTION);
---- a/net/mac80211/agg-tx.c
-+++ b/net/mac80211/agg-tx.c
-@@ -77,10 +77,13 @@ static void ieee80211_send_addba_request
-       memcpy(mgmt->da, da, ETH_ALEN);
-       memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
-       if (sdata->vif.type == NL80211_IFTYPE_AP ||
--          sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
-+          sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
-+          sdata->vif.type == NL80211_IFTYPE_WDS)
-               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
-+      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-+              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
+--- a/net/mac80211/Makefile
++++ b/net/mac80211/Makefile
+@@ -17,6 +17,7 @@ mac80211-y := \
+       aes_ccm.o \
+       aes_cmac.o \
+       cfg.o \
++      ethtool.o \
+       rx.o \
+       spectmgmt.o \
+       tx.o \
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -229,16 +229,29 @@ struct ieee80211_rx_data {
+       u16 tkip_iv16;
+ };
  
-       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
-                                         IEEE80211_STYPE_ACTION);
-@@ -397,7 +400,9 @@ int ieee80211_start_tx_ba_session(struct
-        */
-       if (sdata->vif.type != NL80211_IFTYPE_STATION &&
-           sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
--          sdata->vif.type != NL80211_IFTYPE_AP)
-+          sdata->vif.type != NL80211_IFTYPE_AP &&
-+          sdata->vif.type != NL80211_IFTYPE_ADHOC &&
-+          sdata->vif.type != NL80211_IFTYPE_WDS)
-               return -EINVAL;
-       if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -1886,7 +1886,7 @@ ieee80211_offchan_tx_done(struct ieee802
-        * so in that case userspace will have to deal with it.
-        */
++struct ieee80211_csa_settings {
++      const u16 *counter_offsets_beacon;
++      const u16 *counter_offsets_presp;
++
++      int n_counter_offsets_beacon;
++      int n_counter_offsets_presp;
++
++      u8 count;
++};
++
+ struct beacon_data {
+       u8 *head, *tail;
+       int head_len, tail_len;
+       struct ieee80211_meshconf_ie *meshconf;
++      u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
++      u8 csa_current_counter;
+       struct rcu_head rcu_head;
+ };
  
--      if (wk->offchan_tx.wait && wk->offchan_tx.frame)
-+      if (wk->offchan_tx.wait && !wk->offchan_tx.status)
-               cfg80211_mgmt_tx_status(wk->sdata->dev,
-                                       (unsigned long) wk->offchan_tx.frame,
-                                       wk->ie, wk->ie_len, false, GFP_KERNEL);
---- a/net/mac80211/debugfs_sta.c
-+++ b/net/mac80211/debugfs_sta.c
-@@ -63,11 +63,11 @@ static ssize_t sta_flags_read(struct fil
-       test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : ""
-       int res = scnprintf(buf, sizeof(buf),
--                          "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
-+                          "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
-                           TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
-                           TEST(PS_DRIVER), TEST(AUTHORIZED),
-                           TEST(SHORT_PREAMBLE), TEST(ASSOC_AP),
--                          TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT),
-+                          TEST(WME), TEST(CLEAR_PS_FILT),
-                           TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
-                           TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
-                           TEST(TDLS_PEER_AUTH));
---- a/net/mac80211/ht.c
-+++ b/net/mac80211/ht.c
-@@ -199,6 +199,8 @@ void ieee80211_send_delba(struct ieee802
-               memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
-+      else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-+              memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
+ struct probe_resp {
+       struct rcu_head rcu_head;
+       int len;
++      u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
+       u8 data[0];
+ };
  
-       mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
-                                         IEEE80211_STYPE_ACTION);
---- a/net/mac80211/ibss.c
-+++ b/net/mac80211/ibss.c
-@@ -77,6 +77,7 @@ static void __ieee80211_sta_join_ibss(st
-       struct cfg80211_bss *bss;
-       u32 bss_change;
-       u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
-+      enum nl80211_channel_type channel_type;
-       lockdep_assert_held(&ifibss->mtx);
-@@ -104,8 +105,16 @@ static void __ieee80211_sta_join_ibss(st
-       sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
--      local->oper_channel = chan;
--      WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
-+      channel_type = ifibss->channel_type;
-+      if (channel_type > NL80211_CHAN_HT20 &&
-+          !cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type))
-+              channel_type = NL80211_CHAN_HT20;
-+      if (!ieee80211_set_channel_type(local, sdata, channel_type)) {
-+              /* can only fail due to HT40+/- mismatch */
-+              channel_type = NL80211_CHAN_HT20;
-+              WARN_ON(!ieee80211_set_channel_type(local, sdata,
-+                                                  NL80211_CHAN_HT20));
-+      }
-       ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
-       sband = local->hw.wiphy->bands[chan->band];
-@@ -171,6 +180,18 @@ static void __ieee80211_sta_join_ibss(st
-               memcpy(skb_put(skb, ifibss->ie_len),
-                      ifibss->ie, ifibss->ie_len);
-+      /* add HT capability and information IEs */
-+      if (channel_type && sband->ht_cap.ht_supported) {
-+              pos = skb_put(skb, 4 +
-+                                 sizeof(struct ieee80211_ht_cap) +
-+                                 sizeof(struct ieee80211_ht_info));
-+              pos = ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
-+              pos = ieee80211_ie_build_ht_info(pos,
-+                                               &sband->ht_cap,
-+                                               chan,
-+                                               channel_type);
-+      }
-+
-       if (local->hw.queues >= 4) {
-               pos = skb_put(skb, 9);
-               *pos++ = WLAN_EID_VENDOR_SPECIFIC;
-@@ -194,6 +215,7 @@ static void __ieee80211_sta_join_ibss(st
-       bss_change |= BSS_CHANGED_BEACON;
-       bss_change |= BSS_CHANGED_BEACON_ENABLED;
-       bss_change |= BSS_CHANGED_BASIC_RATES;
-+      bss_change |= BSS_CHANGED_HT;
-       bss_change |= BSS_CHANGED_IBSS;
-       sdata->vif.bss_conf.ibss_joined = true;
-       ieee80211_bss_info_change_notify(sdata, bss_change);
-@@ -266,6 +288,7 @@ static void ieee80211_rx_bss_info(struct
-       u64 beacon_timestamp, rx_timestamp;
-       u32 supp_rates = 0;
-       enum ieee80211_band band = rx_status->band;
-+      struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
-       if (elems->ds_params && elems->ds_params_len == 1)
-               freq = ieee80211_channel_to_frequency(elems->ds_params[0],
-@@ -275,7 +298,10 @@ static void ieee80211_rx_bss_info(struct
-       channel = ieee80211_get_channel(local->hw.wiphy, freq);
--      if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
-+      if (!channel ||
-+          channel->flags & (IEEE80211_CHAN_DISABLED ||
-+                            IEEE80211_CHAN_NO_IBSS ||
-+                            IEEE80211_CHAN_RADAR))
-               return;
+@@ -754,8 +767,6 @@ struct ieee80211_sub_if_data {
+       struct mac80211_qos_map __rcu *qos_map;
  
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
-@@ -313,8 +339,41 @@ static void ieee80211_rx_bss_info(struct
-                                               GFP_ATOMIC);
-               }
+       struct work_struct csa_finalize_work;
+-      u16 csa_counter_offset_beacon[IEEE80211_MAX_CSA_COUNTERS_NUM];
+-      u16 csa_counter_offset_presp[IEEE80211_MAX_CSA_COUNTERS_NUM];
+       bool csa_radar_required;
+       bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
+       struct cfg80211_chan_def csa_chandef;
+@@ -767,7 +778,6 @@ struct ieee80211_sub_if_data {
+       struct ieee80211_chanctx *reserved_chanctx;
+       struct cfg80211_chan_def reserved_chandef;
+       bool reserved_radar_required;
+-      u8 csa_current_counter;
  
--              if (sta && elems->wmm_info)
--                      set_sta_flag(sta, WLAN_STA_WME);
-+              if (sta) {
-+                      if (elems->wmm_info)
-+                              set_sta_flag(sta, WLAN_STA_WME);
-+
-+                      /* we both use HT */
-+                      if (elems->ht_info_elem && elems->ht_cap_elem &&
-+                          sdata->u.ibss.channel_type) {
-+                              enum nl80211_channel_type channel_type =
-+                                      ieee80211_ht_info_to_channel_type(
-+                                                         elems->ht_info_elem);
-+                              struct ieee80211_sta_ht_cap sta_ht_cap_new;
-+
-+                              /*
-+                               * fall back to HT20 if we don't use or use
-+                               * the other extension channel
-+                               */
-+                              if (channel_type > NL80211_CHAN_HT20 &&
-+                                  channel_type != sdata->u.ibss.channel_type)
-+                                      channel_type = NL80211_CHAN_HT20;
-+
-+                              ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
-+                                              elems->ht_cap_elem,
-+                                              &sta_ht_cap_new);
-+                              if (memcmp(&sta->sta.ht_cap, &sta_ht_cap_new,
-+                                         sizeof(sta_ht_cap_new))) {
-+                                      memcpy(&sta->sta.ht_cap,
-+                                             &sta_ht_cap_new,
-+                                             sizeof(sta_ht_cap_new));
-+                                      rate_control_rate_update(local, sband,
-+                                                      sta,
-+                                                      IEEE80211_RC_HT_CHANGED,
-+                                                      channel_type);
-+                              }
-+                      }
-+              }
+       /* used to reconfigure hardware SM PS */
+       struct work_struct recalc_smps;
+@@ -1850,6 +1860,8 @@ int ieee80211_tdls_oper(struct wiphy *wi
+                       const u8 *peer, enum nl80211_tdls_operation oper);
  
-               rcu_read_unlock();
-       }
-@@ -896,10 +955,15 @@ int ieee80211_ibss_join(struct ieee80211
-       struct sk_buff *skb;
-       skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
--                          36 /* bitrates */ +
--                          34 /* SSID */ +
--                          3  /* DS params */ +
--                          4  /* IBSS params */ +
-+                          sizeof(struct ieee80211_hdr_3addr) +
-+                          12 /* struct ieee80211_mgmt.u.beacon */ +
-+                          2 + IEEE80211_MAX_SSID_LEN /* max SSID */ +
-+                          2 + 8 /* max Supported Rates */ +
-+                          3 /* max DS params */ +
-+                          4 /* IBSS params */ +
-+                          2 + (IEEE80211_MAX_SUPP_RATES - 8) +
-+                          2 + sizeof(struct ieee80211_ht_cap) +
-+                          2 + sizeof(struct ieee80211_ht_info) +
-                           params->ie_len);
-       if (!skb)
-               return -ENOMEM;
-@@ -920,13 +984,15 @@ int ieee80211_ibss_join(struct ieee80211
-       sdata->vif.bss_conf.beacon_int = params->beacon_interval;
-       sdata->u.ibss.channel = params->channel;
-+      sdata->u.ibss.channel_type = params->channel_type;
-       sdata->u.ibss.fixed_channel = params->channel_fixed;
-       /* fix ourselves to that channel now already */
-       if (params->channel_fixed) {
-               sdata->local->oper_channel = params->channel;
--              WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata,
--                                                  NL80211_CHAN_NO_HT));
-+              if (!ieee80211_set_channel_type(sdata->local, sdata,
-+                                             params->channel_type))
-+                      return -EINVAL;
-       }
  
-       if (params->ie) {
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -346,6 +346,7 @@ struct ieee80211_work {
-               struct {
-                       struct sk_buff *frame;
-                       u32 wait;
-+                      bool status;
-               } offchan_tx;
-       };
-@@ -465,6 +466,7 @@ struct ieee80211_if_ibss {
-       u8 ssid_len, ie_len;
-       u8 *ie;
-       struct ieee80211_channel *channel;
-+      enum nl80211_channel_type channel_type;
-       unsigned long ibss_join_req;
-       /* probe response/beacon for IBSS */
-@@ -1351,6 +1353,12 @@ void ieee80211_recalc_smps(struct ieee80
- size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
-                         const u8 *ids, int n_ids, size_t offset);
- size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
-+u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
-+                            u16 cap);
-+u8 *ieee80211_ie_build_ht_info(u8 *pos,
-+                              struct ieee80211_sta_ht_cap *ht_cap,
-+                              struct ieee80211_channel *channel,
-+                              enum nl80211_channel_type channel_type);
- /* internal work items */
- void ieee80211_work_init(struct ieee80211_local *local);
-@@ -1379,6 +1387,8 @@ ieee80211_get_channel_mode(struct ieee80
- bool ieee80211_set_channel_type(struct ieee80211_local *local,
-                               struct ieee80211_sub_if_data *sdata,
-                               enum nl80211_channel_type chantype);
-+enum nl80211_channel_type
-+ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info);
- #ifdef CONFIG_MAC80211_NOINLINE
++extern const struct ethtool_ops ieee80211_ethtool_ops;
++
+ #ifdef CPTCFG_MAC80211_NOINLINE
  #define debug_noinline noinline
+ #else
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -178,7 +178,6 @@ static int ieee80211_do_open(struct net_
+@@ -399,6 +399,7 @@ int ieee80211_add_virtual_monitor(struct
+       sdata->vif.type = NL80211_IFTYPE_MONITOR;
+       snprintf(sdata->name, IFNAMSIZ, "%s-monitor",
+                wiphy_name(local->hw.wiphy));
++      sdata->wdev.iftype = NL80211_IFTYPE_MONITOR;
+       sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM;
+@@ -1303,6 +1304,7 @@ static void ieee80211_setup_sdata(struct
+       sdata->control_port_protocol = cpu_to_be16(ETH_P_PAE);
+       sdata->control_port_no_encrypt = false;
+       sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM;
++      sdata->vif.bss_conf.idle = true;
+       sdata->noack_map = 0;
+@@ -1721,6 +1723,8 @@ int ieee80211_if_add(struct ieee80211_lo
+               ndev->features |= local->hw.netdev_features;
++              netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops);
++
+               ret = register_netdevice(ndev);
+               if (ret) {
+                       free_netdev(ndev);
+--- a/net/wireless/core.c
++++ b/net/wireless/core.c
+@@ -25,7 +25,6 @@
+ #include "sysfs.h"
+ #include "debugfs.h"
+ #include "wext-compat.h"
+-#include "ethtool.h"
+ #include "rdev-ops.h"
+ /* name for sysfs, %d is appended */
+@@ -940,8 +939,6 @@ static int cfg80211_netdev_notifier_call
+               /* allow mac80211 to determine the timeout */
+               wdev->ps_timeout = -1;
+-              netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops);
+-
+               if ((wdev->iftype == NL80211_IFTYPE_STATION ||
+                    wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
+                    wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr)
+--- a/net/wireless/ethtool.c
++++ b/net/wireless/ethtool.c
+@@ -1,11 +1,9 @@
+ #include <linux/utsname.h>
+ #include <net/cfg80211.h>
+ #include "core.h"
+-#include "ethtool.h"
+ #include "rdev-ops.h"
+-static void cfg80211_get_drvinfo(struct net_device *dev,
+-                                      struct ethtool_drvinfo *info)
++void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
  {
-       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-       struct ieee80211_local *local = sdata->local;
--      struct sta_info *sta;
-       u32 changed = 0;
-       int res;
-       u32 hw_reconf_flags = 0;
-@@ -290,27 +289,6 @@ static int ieee80211_do_open(struct net_
-       set_bit(SDATA_STATE_RUNNING, &sdata->state);
--      if (sdata->vif.type == NL80211_IFTYPE_WDS) {
--              /* Create STA entry for the WDS peer */
--              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
--                                   GFP_KERNEL);
--              if (!sta) {
--                      res = -ENOMEM;
--                      goto err_del_interface;
--              }
--
--              /* no atomic bitop required since STA is not live yet */
--              set_sta_flag(sta, WLAN_STA_AUTHORIZED);
+       struct wireless_dev *wdev = dev->ieee80211_ptr;
+@@ -23,84 +21,4 @@ static void cfg80211_get_drvinfo(struct 
+       strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
+               sizeof(info->bus_info));
+ }
 -
--              res = sta_info_insert(sta);
--              if (res) {
--                      /* STA has been freed */
--                      goto err_del_interface;
--              }
+-static int cfg80211_get_regs_len(struct net_device *dev)
+-{
+-      /* For now, return 0... */
+-      return 0;
+-}
+-
+-static void cfg80211_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+-                      void *data)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-
+-      regs->version = wdev->wiphy->hw_version;
+-      regs->len = 0;
+-}
+-
+-static void cfg80211_get_ringparam(struct net_device *dev,
+-                                 struct ethtool_ringparam *rp)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-      struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-
+-      memset(rp, 0, sizeof(*rp));
+-
+-      if (rdev->ops->get_ringparam)
+-              rdev_get_ringparam(rdev, &rp->tx_pending, &rp->tx_max_pending,
+-                                 &rp->rx_pending, &rp->rx_max_pending);
+-}
+-
+-static int cfg80211_set_ringparam(struct net_device *dev,
+-                                struct ethtool_ringparam *rp)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-      struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-
+-      if (rp->rx_mini_pending != 0 || rp->rx_jumbo_pending != 0)
+-              return -EINVAL;
+-
+-      if (rdev->ops->set_ringparam)
+-              return rdev_set_ringparam(rdev, rp->tx_pending, rp->rx_pending);
+-
+-      return -ENOTSUPP;
+-}
+-
+-static int cfg80211_get_sset_count(struct net_device *dev, int sset)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-      struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-      if (rdev->ops->get_et_sset_count)
+-              return rdev_get_et_sset_count(rdev, dev, sset);
+-      return -EOPNOTSUPP;
+-}
+-
+-static void cfg80211_get_stats(struct net_device *dev,
+-                             struct ethtool_stats *stats, u64 *data)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-      struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-      if (rdev->ops->get_et_stats)
+-              rdev_get_et_stats(rdev, dev, stats, data);
+-}
+-
+-static void cfg80211_get_strings(struct net_device *dev, u32 sset, u8 *data)
+-{
+-      struct wireless_dev *wdev = dev->ieee80211_ptr;
+-      struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
+-      if (rdev->ops->get_et_strings)
+-              rdev_get_et_strings(rdev, dev, sset, data);
+-}
+-
+-const struct ethtool_ops cfg80211_ethtool_ops = {
+-      .get_drvinfo = cfg80211_get_drvinfo,
+-      .get_regs_len = cfg80211_get_regs_len,
+-      .get_regs = cfg80211_get_regs,
+-      .get_link = ethtool_op_get_link,
+-      .get_ringparam = cfg80211_get_ringparam,
+-      .set_ringparam = cfg80211_set_ringparam,
+-      .get_strings = cfg80211_get_strings,
+-      .get_ethtool_stats = cfg80211_get_stats,
+-      .get_sset_count = cfg80211_get_sset_count,
+-};
++EXPORT_SYMBOL(cfg80211_get_drvinfo);
+--- a/net/wireless/ethtool.h
++++ /dev/null
+@@ -1,6 +0,0 @@
+-#ifndef __CFG80211_ETHTOOL__
+-#define __CFG80211_ETHTOOL__
 -
--              rate_control_rate_init(sta);
--      }
+-extern const struct ethtool_ops cfg80211_ethtool_ops;
 -
-       /*
-        * set_multicast_list will be invoked by the networking core
-        * which will check whether any increments here were done in
-@@ -344,8 +322,7 @@ static int ieee80211_do_open(struct net_
-       netif_tx_start_all_queues(dev);
+-#endif /* __CFG80211_ETHTOOL__ */
+--- a/net/wireless/rdev-ops.h
++++ b/net/wireless/rdev-ops.h
+@@ -714,25 +714,6 @@ static inline int rdev_get_antenna(struc
+       return ret;
+ }
  
-       return 0;
-- err_del_interface:
--      drv_remove_interface(local, &sdata->vif);
-+
-  err_stop:
-       if (!local->open_count)
-               drv_stop(local);
-@@ -716,6 +693,70 @@ static void ieee80211_if_setup(struct ne
-       dev->destructor = free_netdev;
+-static inline int rdev_set_ringparam(struct cfg80211_registered_device *rdev,
+-                                   u32 tx, u32 rx)
+-{
+-      int ret;
+-      trace_rdev_set_ringparam(&rdev->wiphy, tx, rx);
+-      ret = rdev->ops->set_ringparam(&rdev->wiphy, tx, rx);
+-      trace_rdev_return_int(&rdev->wiphy, ret);
+-      return ret;
+-}
+-
+-static inline void rdev_get_ringparam(struct cfg80211_registered_device *rdev,
+-                                    u32 *tx, u32 *tx_max, u32 *rx,
+-                                    u32 *rx_max)
+-{
+-      trace_rdev_get_ringparam(&rdev->wiphy);
+-      rdev->ops->get_ringparam(&rdev->wiphy, tx, tx_max, rx, rx_max);
+-      trace_rdev_return_void_tx_rx(&rdev->wiphy, *tx, *tx_max, *rx, *rx_max);
+-}
+-
+ static inline int
+ rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
+                     struct net_device *dev,
+@@ -816,35 +797,6 @@ static inline int rdev_set_noack_map(str
  }
  
-+static void ieee80211_wds_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
-+                                       struct sk_buff *skb)
+ static inline int
+-rdev_get_et_sset_count(struct cfg80211_registered_device *rdev,
+-                     struct net_device *dev, int sset)
+-{
+-      int ret;
+-      trace_rdev_get_et_sset_count(&rdev->wiphy, dev, sset);
+-      ret = rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset);
+-      trace_rdev_return_int(&rdev->wiphy, ret);
+-      return ret;
+-}
+-
+-static inline void rdev_get_et_stats(struct cfg80211_registered_device *rdev,
+-                                   struct net_device *dev,
+-                                   struct ethtool_stats *stats, u64 *data)
+-{
+-      trace_rdev_get_et_stats(&rdev->wiphy, dev);
+-      rdev->ops->get_et_stats(&rdev->wiphy, dev, stats, data);
+-      trace_rdev_return_void(&rdev->wiphy);
+-}
+-
+-static inline void rdev_get_et_strings(struct cfg80211_registered_device *rdev,
+-                                     struct net_device *dev, u32 sset,
+-                                     u8 *data)
+-{
+-      trace_rdev_get_et_strings(&rdev->wiphy, dev, sset);
+-      rdev->ops->get_et_strings(&rdev->wiphy, dev, sset, data);
+-      trace_rdev_return_void(&rdev->wiphy);
+-}
+-
+-static inline int
+ rdev_get_channel(struct cfg80211_registered_device *rdev,
+                struct wireless_dev *wdev,
+                struct cfg80211_chan_def *chandef)
+--- a/net/wireless/trace.h
++++ b/net/wireless/trace.h
+@@ -298,11 +298,6 @@ DEFINE_EVENT(wiphy_only_evt, rdev_return
+       TP_ARGS(wiphy)
+ );
+-DEFINE_EVENT(wiphy_only_evt, rdev_get_ringparam,
+-      TP_PROTO(struct wiphy *wiphy),
+-      TP_ARGS(wiphy)
+-);
+-
+ DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
+       TP_PROTO(struct wiphy *wiphy),
+       TP_ARGS(wiphy)
+@@ -580,11 +575,6 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_stop
+       TP_ARGS(wiphy, netdev)
+ );
+-DEFINE_EVENT(wiphy_netdev_evt, rdev_get_et_stats,
+-      TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
+-      TP_ARGS(wiphy, netdev)
+-);
+-
+ DEFINE_EVENT(wiphy_netdev_evt, rdev_sched_scan_stop,
+       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
+       TP_ARGS(wiphy, netdev)
+@@ -1439,11 +1429,6 @@ DECLARE_EVENT_CLASS(tx_rx_evt,
+                 WIPHY_PR_ARG, __entry->tx, __entry->rx)
+ );
+-DEFINE_EVENT(tx_rx_evt, rdev_set_ringparam,
+-      TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
+-      TP_ARGS(wiphy, rx, tx)
+-);
+-
+ DEFINE_EVENT(tx_rx_evt, rdev_set_antenna,
+       TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
+       TP_ARGS(wiphy, rx, tx)
+@@ -1725,40 +1710,6 @@ TRACE_EVENT(rdev_set_noack_map,
+                 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
+ );
+-TRACE_EVENT(rdev_get_et_sset_count,
+-      TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int sset),
+-      TP_ARGS(wiphy, netdev, sset),
+-      TP_STRUCT__entry(
+-              WIPHY_ENTRY
+-              NETDEV_ENTRY
+-              __field(int, sset)
+-      ),
+-      TP_fast_assign(
+-              WIPHY_ASSIGN;
+-              NETDEV_ASSIGN;
+-              __entry->sset = sset;
+-      ),
+-      TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", sset: %d",
+-                WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sset)
+-);
+-
+-TRACE_EVENT(rdev_get_et_strings,
+-      TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 sset),
+-      TP_ARGS(wiphy, netdev, sset),
+-      TP_STRUCT__entry(
+-              WIPHY_ENTRY
+-              NETDEV_ENTRY
+-              __field(u32, sset)
+-      ),
+-      TP_fast_assign(
+-              WIPHY_ASSIGN;
+-              NETDEV_ASSIGN;
+-              __entry->sset = sset;
+-      ),
+-      TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", sset: %u",
+-                WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sset)
+-);
+-
+ DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
+       TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+       TP_ARGS(wiphy, wdev)
+--- /dev/null
++++ b/net/mac80211/ethtool.c
+@@ -0,0 +1,244 @@
++/*
++ * mac80211 ethtool hooks for cfg80211
++ *
++ * Copied from cfg.c - originally
++ * Copyright 2006-2010        Johannes Berg <johannes@sipsolutions.net>
++ * Copyright 2014     Intel Corporation (Author: Johannes Berg)
++ *
++ * This file is GPLv2 as found in COPYING.
++ */
++#include <linux/types.h>
++#include <net/cfg80211.h>
++#include "ieee80211_i.h"
++#include "sta_info.h"
++#include "driver-ops.h"
++
++static int ieee80211_set_ringparam(struct net_device *dev,
++                                 struct ethtool_ringparam *rp)
 +{
-+      struct ieee80211_local *local = sdata->local;
-+      struct ieee80211_rx_status *rx_status;
-+      struct ieee802_11_elems elems;
-+      struct ieee80211_mgmt *mgmt;
-+      struct sta_info *sta;
-+      size_t baselen;
-+      u32 rates = 0;
-+      u16 stype;
-+      bool new = false;
-+      enum ieee80211_band band = local->hw.conf.channel->band;
-+      struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
++      struct ieee80211_local *local = wiphy_priv(dev->ieee80211_ptr->wiphy);
 +
-+      rx_status = IEEE80211_SKB_RXCB(skb);
-+      mgmt = (struct ieee80211_mgmt *) skb->data;
-+      stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
++      if (rp->rx_mini_pending != 0 || rp->rx_jumbo_pending != 0)
++              return -EINVAL;
 +
-+      if (stype != IEEE80211_STYPE_BEACON)
-+              return;
++      return drv_set_ringparam(local, rp->tx_pending, rp->rx_pending);
++}
 +
-+      baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
-+      if (baselen > skb->len)
-+              return;
++static void ieee80211_get_ringparam(struct net_device *dev,
++                                  struct ethtool_ringparam *rp)
++{
++      struct ieee80211_local *local = wiphy_priv(dev->ieee80211_ptr->wiphy);
 +
-+      ieee802_11_parse_elems(mgmt->u.probe_resp.variable,
-+                             skb->len - baselen, &elems);
++      memset(rp, 0, sizeof(*rp));
 +
-+      rates = ieee80211_sta_get_rates(local, &elems, band);
++      drv_get_ringparam(local, &rp->tx_pending, &rp->tx_max_pending,
++                        &rp->rx_pending, &rp->rx_max_pending);
++}
 +
-+      rcu_read_lock();
++static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
++      "rx_packets", "rx_bytes",
++      "rx_duplicates", "rx_fragments", "rx_dropped",
++      "tx_packets", "tx_bytes", "tx_fragments",
++      "tx_filtered", "tx_retry_failed", "tx_retries",
++      "beacon_loss", "sta_state", "txrate", "rxrate", "signal",
++      "channel", "noise", "ch_time", "ch_time_busy",
++      "ch_time_ext_busy", "ch_time_rx", "ch_time_tx"
++};
++#define STA_STATS_LEN ARRAY_SIZE(ieee80211_gstrings_sta_stats)
 +
-+      sta = sta_info_get(sdata, sdata->u.wds.remote_addr);
++static int ieee80211_get_sset_count(struct net_device *dev, int sset)
++{
++      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
++      int rv = 0;
 +
-+      if (!sta) {
-+              rcu_read_unlock();
-+              sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
-+                                   GFP_KERNEL);
-+              if (!sta)
-+                      return;
++      if (sset == ETH_SS_STATS)
++              rv += STA_STATS_LEN;
 +
-+              new = true;
-+      }
++      rv += drv_get_et_sset_count(sdata, sset);
 +
-+      sta->last_rx = jiffies;
-+      sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
++      if (rv == 0)
++              return -EOPNOTSUPP;
++      return rv;
++}
 +
-+      if (elems.ht_cap_elem)
-+              ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
-+                              elems.ht_cap_elem, &sta->sta.ht_cap);
++static void ieee80211_get_stats(struct net_device *dev,
++                              struct ethtool_stats *stats,
++                              u64 *data)
++{
++      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
++      struct ieee80211_chanctx_conf *chanctx_conf;
++      struct ieee80211_channel *channel;
++      struct sta_info *sta;
++      struct ieee80211_local *local = sdata->local;
++      struct station_info sinfo;
++      struct survey_info survey;
++      int i, q;
++#define STA_STATS_SURVEY_LEN 7
++
++      memset(data, 0, sizeof(u64) * STA_STATS_LEN);
++
++#define ADD_STA_STATS(sta)                            \
++      do {                                            \
++              data[i++] += sta->rx_packets;           \
++              data[i++] += sta->rx_bytes;             \
++              data[i++] += sta->num_duplicates;       \
++              data[i++] += sta->rx_fragments;         \
++              data[i++] += sta->rx_dropped;           \
++                                                      \
++              data[i++] += sinfo.tx_packets;          \
++              data[i++] += sinfo.tx_bytes;            \
++              data[i++] += sta->tx_fragments;         \
++              data[i++] += sta->tx_filtered_count;    \
++              data[i++] += sta->tx_retry_failed;      \
++              data[i++] += sta->tx_retry_count;       \
++              data[i++] += sta->beacon_loss_count;    \
++      } while (0)
++
++      /* For Managed stations, find the single station based on BSSID
++       * and use that.  For interface types, iterate through all available
++       * stations and add stats for any station that is assigned to this
++       * network device.
++       */
 +
-+      if (elems.wmm_param)
-+              set_sta_flag(sta, WLAN_STA_WME);
++      mutex_lock(&local->sta_mtx);
 +
-+      if (new) {
-+              set_sta_flag(sta, WLAN_STA_AUTHORIZED);
-+              rate_control_rate_init(sta);
-+              sta_info_insert_rcu(sta);
-+      }
++      if (sdata->vif.type == NL80211_IFTYPE_STATION) {
++              sta = sta_info_get_bss(sdata, sdata->u.mgd.bssid);
 +
-+      rcu_read_unlock();
-+}
++              if (!(sta && !WARN_ON(sta->sdata->dev != dev)))
++                      goto do_survey;
 +
- static void ieee80211_iface_work(struct work_struct *work)
- {
-       struct ieee80211_sub_if_data *sdata =
-@@ -820,6 +861,9 @@ static void ieee80211_iface_work(struct 
-                               break;
-                       ieee80211_mesh_rx_queued_mgmt(sdata, skb);
-                       break;
-+              case NL80211_IFTYPE_WDS:
-+                      ieee80211_wds_rx_queued_mgmt(sdata, skb);
-+                      break;
-               default:
-                       WARN(1, "frame for unexpected interface type");
-                       break;
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2211,7 +2211,9 @@ ieee80211_rx_h_action(struct ieee80211_r
-                */
-               if (sdata->vif.type != NL80211_IFTYPE_STATION &&
-                   sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
--                  sdata->vif.type != NL80211_IFTYPE_AP)
-+                  sdata->vif.type != NL80211_IFTYPE_AP &&
-+                  sdata->vif.type != NL80211_IFTYPE_ADHOC &&
-+                  sdata->vif.type != NL80211_IFTYPE_WDS)
-                       break;
-               /* verify action_code is present */
-@@ -2426,13 +2428,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
-       if (!ieee80211_vif_is_mesh(&sdata->vif) &&
-           sdata->vif.type != NL80211_IFTYPE_ADHOC &&
--          sdata->vif.type != NL80211_IFTYPE_STATION)
-+          sdata->vif.type != NL80211_IFTYPE_STATION &&
-+          sdata->vif.type != NL80211_IFTYPE_WDS)
-               return RX_DROP_MONITOR;
-       switch (stype) {
-       case cpu_to_le16(IEEE80211_STYPE_BEACON):
-       case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
--              /* process for all: mesh, mlme, ibss */
-+              /* process for all: mesh, mlme, ibss, wds */
-               break;
-       case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
-       case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
-@@ -2775,10 +2778,16 @@ static int prepare_for_handlers(struct i
-               }
-               break;
-       case NL80211_IFTYPE_WDS:
--              if (bssid || !ieee80211_is_data(hdr->frame_control))
--                      return 0;
-               if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
-                       return 0;
++              sinfo.filled = 0;
++              sta_set_sinfo(sta, &sinfo);
 +
-+              if (ieee80211_is_data(hdr->frame_control) ||
-+                  ieee80211_is_action(hdr->frame_control)) {
-+                      if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
-+                              return 0;
-+              } else if (!ieee80211_is_beacon(hdr->frame_control))
-+                      return 0;
++              i = 0;
++              ADD_STA_STATS(sta);
 +
-               break;
-       default:
-               /* should never get here */
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -32,7 +32,6 @@
-  *    frames.
-  * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP.
-  * @WLAN_STA_WME: Station is a QoS-STA.
-- * @WLAN_STA_WDS: Station is one of our WDS peers.
-  * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
-  *    IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
-  *    frame to this station is transmitted.
-@@ -61,7 +60,6 @@ enum ieee80211_sta_info_flags {
-       WLAN_STA_SHORT_PREAMBLE,
-       WLAN_STA_ASSOC_AP,
-       WLAN_STA_WME,
--      WLAN_STA_WDS,
-       WLAN_STA_CLEAR_PS_FILT,
-       WLAN_STA_MFP,
-       WLAN_STA_BLOCK_BA,
---- a/net/mac80211/status.c
-+++ b/net/mac80211/status.c
-@@ -429,7 +429,7 @@ void ieee80211_tx_status(struct ieee8021
-                               continue;
-                       if (wk->offchan_tx.frame != skb)
-                               continue;
--                      wk->offchan_tx.frame = NULL;
-+                      wk->offchan_tx.status = true;
-                       break;
-               }
-               rcu_read_unlock();
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -836,23 +836,8 @@ int ieee80211_build_preq_ies(struct ieee
-               offset = noffset;
-       }
--      if (sband->ht_cap.ht_supported) {
--              u16 cap = sband->ht_cap.cap;
--              __le16 tmp;
--
--              *pos++ = WLAN_EID_HT_CAPABILITY;
--              *pos++ = sizeof(struct ieee80211_ht_cap);
--              memset(pos, 0, sizeof(struct ieee80211_ht_cap));
--              tmp = cpu_to_le16(cap);
--              memcpy(pos, &tmp, sizeof(u16));
--              pos += sizeof(u16);
--              *pos++ = sband->ht_cap.ampdu_factor |
--                       (sband->ht_cap.ampdu_density <<
--                              IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
--              memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
--              pos += sizeof(sband->ht_cap.mcs);
--              pos += 2 + 4 + 1; /* ext info, BF cap, antsel */
--      }
-+      if (sband->ht_cap.ht_supported)
-+              pos = ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
-       /*
-        * If adding more here, adjust code in main.c
-@@ -1443,3 +1428,100 @@ int ieee80211_add_ext_srates_ie(struct i
-       }
-       return 0;
- }
++              data[i++] = sta->sta_state;
 +
-+u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
-+                            u16 cap)
-+{
-+      __le16 tmp;
 +
-+      *pos++ = WLAN_EID_HT_CAPABILITY;
-+      *pos++ = sizeof(struct ieee80211_ht_cap);
-+      memset(pos, 0, sizeof(struct ieee80211_ht_cap));
++              if (sinfo.filled & STATION_INFO_TX_BITRATE)
++                      data[i] = 100000 *
++                              cfg80211_calculate_bitrate(&sinfo.txrate);
++              i++;
++              if (sinfo.filled & STATION_INFO_RX_BITRATE)
++                      data[i] = 100000 *
++                              cfg80211_calculate_bitrate(&sinfo.rxrate);
++              i++;
 +
-+      /* capability flags */
-+      tmp = cpu_to_le16(cap);
-+      memcpy(pos, &tmp, sizeof(u16));
-+      pos += sizeof(u16);
++              if (sinfo.filled & STATION_INFO_SIGNAL_AVG)
++                      data[i] = (u8)sinfo.signal_avg;
++              i++;
++      } else {
++              list_for_each_entry(sta, &local->sta_list, list) {
++                      /* Make sure this station belongs to the proper dev */
++                      if (sta->sdata->dev != dev)
++                              continue;
++
++                      sinfo.filled = 0;
++                      sta_set_sinfo(sta, &sinfo);
++                      i = 0;
++                      ADD_STA_STATS(sta);
++              }
++      }
++
++do_survey:
++      i = STA_STATS_LEN - STA_STATS_SURVEY_LEN;
++      /* Get survey stats for current channel */
++      survey.filled = 0;
 +
-+      /* AMPDU parameters */
-+      *pos++ = sband->ht_cap.ampdu_factor |
-+               (sband->ht_cap.ampdu_density <<
-+                      IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
++      rcu_read_lock();
++      chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
++      if (chanctx_conf)
++              channel = chanctx_conf->def.chan;
++      else
++              channel = NULL;
++      rcu_read_unlock();
 +
-+      /* MCS set */
-+      memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
-+      pos += sizeof(sband->ht_cap.mcs);
++      if (channel) {
++              q = 0;
++              do {
++                      survey.filled = 0;
++                      if (drv_get_survey(local, q, &survey) != 0) {
++                              survey.filled = 0;
++                              break;
++                      }
++                      q++;
++              } while (channel != survey.channel);
++      }
 +
-+      /* extended capabilities */
-+      pos += sizeof(__le16);
++      if (survey.filled)
++              data[i++] = survey.channel->center_freq;
++      else
++              data[i++] = 0;
++      if (survey.filled & SURVEY_INFO_NOISE_DBM)
++              data[i++] = (u8)survey.noise;
++      else
++              data[i++] = -1LL;
++      if (survey.filled & SURVEY_INFO_CHANNEL_TIME)
++              data[i++] = survey.channel_time;
++      else
++              data[i++] = -1LL;
++      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_BUSY)
++              data[i++] = survey.channel_time_busy;
++      else
++              data[i++] = -1LL;
++      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_EXT_BUSY)
++              data[i++] = survey.channel_time_ext_busy;
++      else
++              data[i++] = -1LL;
++      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_RX)
++              data[i++] = survey.channel_time_rx;
++      else
++              data[i++] = -1LL;
++      if (survey.filled & SURVEY_INFO_CHANNEL_TIME_TX)
++              data[i++] = survey.channel_time_tx;
++      else
++              data[i++] = -1LL;
 +
-+      /* BF capabilities */
-+      pos += sizeof(__le32);
++      mutex_unlock(&local->sta_mtx);
 +
-+      /* antenna selection */
-+      pos += sizeof(u8);
++      if (WARN_ON(i != STA_STATS_LEN))
++              return;
 +
-+      return pos;
++      drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN]));
 +}
 +
-+u8 *ieee80211_ie_build_ht_info(u8 *pos,
-+                             struct ieee80211_sta_ht_cap *ht_cap,
-+                             struct ieee80211_channel *channel,
-+                             enum nl80211_channel_type channel_type)
++static void ieee80211_get_strings(struct net_device *dev, u32 sset, u8 *data)
 +{
-+      struct ieee80211_ht_info *ht_info;
-+      /* Build HT Information */
-+      *pos++ = WLAN_EID_HT_INFORMATION;
-+      *pos++ = sizeof(struct ieee80211_ht_info);
-+      ht_info = (struct ieee80211_ht_info *)pos;
-+      ht_info->control_chan =
-+                      ieee80211_frequency_to_channel(channel->center_freq);
-+      switch (channel_type) {
-+      case NL80211_CHAN_HT40MINUS:
-+              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
-+              break;
-+      case NL80211_CHAN_HT40PLUS:
-+              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
-+              break;
-+      case NL80211_CHAN_HT20:
-+      default:
-+              ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE;
-+              break;
-+      }
-+      if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
-+              ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
-+      ht_info->operation_mode = 0x0000;
-+      ht_info->stbc_param = 0x0000;
++      struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
++      int sz_sta_stats = 0;
 +
-+      /* It seems that Basic MCS set and Supported MCS set
-+         are identical for the first 10 bytes */
-+      memset(&ht_info->basic_set, 0, 16);
-+      memcpy(&ht_info->basic_set, &ht_cap->mcs, 10);
-+
-+      return pos + sizeof(struct ieee80211_ht_info);
++      if (sset == ETH_SS_STATS) {
++              sz_sta_stats = sizeof(ieee80211_gstrings_sta_stats);
++              memcpy(data, ieee80211_gstrings_sta_stats, sz_sta_stats);
++      }
++      drv_get_et_strings(sdata, sset, &(data[sz_sta_stats]));
 +}
 +
-+enum nl80211_channel_type
-+ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info)
++static int ieee80211_get_regs_len(struct net_device *dev)
 +{
-+      enum nl80211_channel_type channel_type;
-+
-+      if (!ht_info)
-+              return NL80211_CHAN_NO_HT;
++      return 0;
++}
 +
-+      switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
-+      case IEEE80211_HT_PARAM_CHA_SEC_NONE:
-+              channel_type = NL80211_CHAN_HT20;
-+              break;
-+      case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
-+              channel_type = NL80211_CHAN_HT40PLUS;
-+              break;
-+      case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
-+              channel_type = NL80211_CHAN_HT40MINUS;
-+              break;
-+      default:
-+              channel_type = NL80211_CHAN_NO_HT;
-+      }
++static void ieee80211_get_regs(struct net_device *dev,
++                             struct ethtool_regs *regs,
++                             void *data)
++{
++      struct wireless_dev *wdev = dev->ieee80211_ptr;
 +
-+      return channel_type;
++      regs->version = wdev->wiphy->hw_version;
++      regs->len = 0;
 +}
---- a/net/mac80211/work.c
-+++ b/net/mac80211/work.c
-@@ -118,7 +118,6 @@ static void ieee80211_add_ht_ie(struct s
-       u8 *pos;
-       u32 flags = channel->flags;
-       u16 cap = sband->ht_cap.cap;
--      __le16 tmp;
-       if (!sband->ht_cap.ht_supported)
-               return;
-@@ -169,34 +168,8 @@ static void ieee80211_add_ht_ie(struct s
++
++const struct ethtool_ops ieee80211_ethtool_ops = {
++      .get_drvinfo = cfg80211_get_drvinfo,
++      .get_regs_len = ieee80211_get_regs_len,
++      .get_regs = ieee80211_get_regs,
++      .get_link = ethtool_op_get_link,
++      .get_ringparam = ieee80211_get_ringparam,
++      .set_ringparam = ieee80211_set_ringparam,
++      .get_strings = ieee80211_get_strings,
++      .get_ethtool_stats = ieee80211_get_stats,
++      .get_sset_count = ieee80211_get_sset_count,
++};
+--- a/net/mac80211/ibss.c
++++ b/net/mac80211/ibss.c
+@@ -143,7 +143,7 @@ ieee80211_ibss_build_presp(struct ieee80
+               *pos++ = csa_settings->block_tx ? 1 : 0;
+               *pos++ = ieee80211_frequency_to_channel(
+                               csa_settings->chandef.chan->center_freq);
+-              sdata->csa_counter_offset_beacon[0] = (pos - presp->head);
++              presp->csa_counter_offsets[0] = (pos - presp->head);
+               *pos++ = csa_settings->count;
        }
  
-       /* reserve and fill IE */
--
-       pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
--      *pos++ = WLAN_EID_HT_CAPABILITY;
--      *pos++ = sizeof(struct ieee80211_ht_cap);
--      memset(pos, 0, sizeof(struct ieee80211_ht_cap));
--
--      /* capability flags */
--      tmp = cpu_to_le16(cap);
--      memcpy(pos, &tmp, sizeof(u16));
--      pos += sizeof(u16);
--
--      /* AMPDU parameters */
--      *pos++ = sband->ht_cap.ampdu_factor |
--               (sband->ht_cap.ampdu_density <<
--                      IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
--
--      /* MCS set */
--      memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
--      pos += sizeof(sband->ht_cap.mcs);
--
--      /* extended capabilities */
--      pos += sizeof(__le16);
--
--      /* BF capabilities */
--      pos += sizeof(__le32);
--
--      /* antenna selection */
--      pos += sizeof(u8);
-+      ieee80211_ie_build_ht_cap(pos, sband, cap);
- }
+@@ -1677,6 +1677,7 @@ int ieee80211_ibss_join(struct ieee80211
+       sdata->u.ibss.control_port = params->control_port;
+       sdata->u.ibss.userspace_handles_dfs = params->userspace_handles_dfs;
+       sdata->u.ibss.basic_rates = params->basic_rates;
++      sdata->u.ibss.last_scan_completed = jiffies;
+       /* fix basic_rates if channel does not support these rates */
+       rate_flags = ieee80211_chandef_rate_flags(&params->chandef);
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -679,7 +679,7 @@ ieee80211_mesh_build_beacon(struct ieee8
+               *pos++ = 0x0;
+               *pos++ = ieee80211_frequency_to_channel(
+                               csa->settings.chandef.chan->center_freq);
+-              sdata->csa_counter_offset_beacon[0] = hdr_len + 6;
++              bcn->csa_counter_offsets[0] = hdr_len + 6;
+               *pos++ = csa->settings.count;
+               *pos++ = WLAN_EID_CHAN_SWITCH_PARAM;
+               *pos++ = 6;
+--- a/net/wireless/genregdb.awk
++++ b/net/wireless/genregdb.awk
+@@ -65,17 +65,7 @@ function parse_reg_rule()
+       sub(/,/, "", units)
+       dfs_cac = $9
+       if (units == "mW") {
+-              if (power == 100) {
+-                      power = 20
+-              } else if (power == 200) {
+-                      power = 23
+-              } else if (power == 500) {
+-                      power = 27
+-              } else if (power == 1000) {
+-                      power = 30
+-              } else {
+-                      print "Unknown power value in database!"
+-              }
++              power = 10 * log(power)/log(10)
+       } else {
+               dfs_cac = $8
+       }
+@@ -114,7 +104,7 @@ function parse_reg_rule()
  
- static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
-@@ -592,7 +565,7 @@ ieee80211_offchannel_tx(struct ieee80211
-               /*
-                * After this, offchan_tx.frame remains but now is no
-                * longer a valid pointer -- we still need it as the
--               * cookie for canceling this work.
-+               * cookie for canceling this work/status matching.
-                */
-               ieee80211_tx_skb(wk->sdata, wk->offchan_tx.frame);
+       }
+       flags = flags "0"
+-      printf "\t\tREG_RULE_EXT(%d, %d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, dfs_cac, flags
++      printf "\t\tREG_RULE_EXT(%d, %d, %d, %d, %.0f, %d, %s),\n", start, end, bw, gain, power, dfs_cac, flags
+       rules++
+ }
  
---- a/net/wireless/chan.c
-+++ b/net/wireless/chan.c
-@@ -44,9 +44,9 @@ rdev_freq_to_chan(struct cfg80211_regist
-       return chan;
+--- a/net/mac80211/debugfs_netdev.c
++++ b/net/mac80211/debugfs_netdev.c
+@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read(
+       ssize_t ret = -EINVAL;
+       read_lock(&dev_base_lock);
+-      if (sdata->dev->reg_state == NETREG_REGISTERED)
+-              ret = (*format)(sdata, buf, sizeof(buf));
++      ret = (*format)(sdata, buf, sizeof(buf));
+       read_unlock(&dev_base_lock);
+       if (ret >= 0)
+@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write(
+       ret = -ENODEV;
+       rtnl_lock();
+-      if (sdata->dev->reg_state == NETREG_REGISTERED)
+-              ret = (*write)(sdata, buf, count);
++      ret = (*write)(sdata, buf, count);
+       rtnl_unlock();
+       return ret;
+--- a/drivers/net/wireless/b43/xmit.c
++++ b/drivers/net/wireless/b43/xmit.c
+@@ -811,9 +811,13 @@ void b43_rx(struct b43_wldev *dev, struc
+               break;
+       case B43_PHYTYPE_G:
+               status.band = IEEE80211_BAND_2GHZ;
+-              /* chanid is the radio channel cookie value as used
+-               * to tune the radio. */
+-              status.freq = chanid + 2400;
++              /* Somewhere between 478.104 and 508.1084 firmware for G-PHY
++               * has been modified to be compatible with N-PHY and others.
++               */
++              if (dev->fw.rev >= 508)
++                      status.freq = ieee80211_channel_to_frequency(chanid, status.band);
++              else
++                      status.freq = chanid + 2400;
+               break;
+       case B43_PHYTYPE_N:
+       case B43_PHYTYPE_LP:
+--- a/drivers/net/wireless/b43/main.c
++++ b/drivers/net/wireless/b43/main.c
+@@ -5216,6 +5216,7 @@ static int b43_wireless_core_attach(stru
+       /* We don't support 5 GHz on some PHYs yet */
+       switch (dev->phy.type) {
+       case B43_PHYTYPE_A:
++      case B43_PHYTYPE_G:
+       case B43_PHYTYPE_N:
+       case B43_PHYTYPE_LP:
+       case B43_PHYTYPE_HT:
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -935,7 +935,7 @@ freq_reg_info_regd(struct wiphy *wiphy, 
+               if (!band_rule_found)
+                       band_rule_found = freq_in_rule_band(fr, center_freq);
+-              bw_fits = reg_does_bw_fit(fr, center_freq, MHZ_TO_KHZ(5));
++              bw_fits = reg_does_bw_fit(fr, center_freq, MHZ_TO_KHZ(20));
+               if (band_rule_found && bw_fits)
+                       return rr;
+@@ -1019,10 +1019,10 @@ static void chan_reg_rule_print_dbg(cons
  }
+ #endif
  
--static bool can_beacon_sec_chan(struct wiphy *wiphy,
--                              struct ieee80211_channel *chan,
--                              enum nl80211_channel_type channel_type)
-+bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
-+                                struct ieee80211_channel *chan,
-+                                enum nl80211_channel_type channel_type)
+-/* Find an ieee80211_reg_rule such that a 5MHz channel with frequency
+- * chan->center_freq fits there.
+- * If there is no such reg_rule, disable the channel, otherwise set the
+- * flags corresponding to the bandwidths allowed in the particular reg_rule
++/*
++ * Note that right now we assume the desired channel bandwidth
++ * is always 20 MHz for each individual channel (HT40 uses 20 MHz
++ * per channel, the primary and the extension channel).
+  */
+ static void handle_channel(struct wiphy *wiphy,
+                          enum nl80211_reg_initiator initiator,
+@@ -1083,12 +1083,8 @@ static void handle_channel(struct wiphy 
+       if (reg_rule->flags & NL80211_RRF_AUTO_BW)
+               max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
+-      if (max_bandwidth_khz < MHZ_TO_KHZ(10))
+-              bw_flags = IEEE80211_CHAN_NO_10MHZ;
+-      if (max_bandwidth_khz < MHZ_TO_KHZ(20))
+-              bw_flags |= IEEE80211_CHAN_NO_20MHZ;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(40))
+-              bw_flags |= IEEE80211_CHAN_NO_HT40;
++              bw_flags = IEEE80211_CHAN_NO_HT40;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(80))
+               bw_flags |= IEEE80211_CHAN_NO_80MHZ;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(160))
+@@ -1522,12 +1518,8 @@ static void handle_channel_custom(struct
+       if (reg_rule->flags & NL80211_RRF_AUTO_BW)
+               max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
+-      if (max_bandwidth_khz < MHZ_TO_KHZ(10))
+-              bw_flags = IEEE80211_CHAN_NO_10MHZ;
+-      if (max_bandwidth_khz < MHZ_TO_KHZ(20))
+-              bw_flags |= IEEE80211_CHAN_NO_20MHZ;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(40))
+-              bw_flags |= IEEE80211_CHAN_NO_HT40;
++              bw_flags = IEEE80211_CHAN_NO_HT40;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(80))
+               bw_flags |= IEEE80211_CHAN_NO_80MHZ;
+       if (max_bandwidth_khz < MHZ_TO_KHZ(160))
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -185,7 +185,8 @@ struct ath_atx_ac {
+ struct ath_frame_info {
+       struct ath_buf *bf;
+-      int framelen;
++      u16 framelen;
++      s8 txq;
+       enum ath9k_key_type keytype;
+       u8 keyix;
+       u8 rtscts_rate;
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -147,15 +147,13 @@ static void ath_set_rates(struct ieee802
+ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
+                            struct sk_buff *skb)
  {
-       struct ieee80211_channel *sec_chan;
-       int diff;
-@@ -75,6 +75,7 @@ static bool can_beacon_sec_chan(struct w
+-      int q;
+-
+-      q = skb_get_queue_mapping(skb);
+-      if (txq == sc->tx.uapsdq)
+-              txq = sc->tx.txq_map[q];
++      struct ath_frame_info *fi = get_frame_info(skb);
++      int q = fi->txq;
  
-       return true;
- }
-+EXPORT_SYMBOL(cfg80211_can_beacon_sec_chan);
- int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
-                     struct wireless_dev *wdev, int freq,
-@@ -109,8 +110,8 @@ int cfg80211_set_freq(struct cfg80211_re
-               switch (channel_type) {
-               case NL80211_CHAN_HT40PLUS:
-               case NL80211_CHAN_HT40MINUS:
--                      if (!can_beacon_sec_chan(&rdev->wiphy, chan,
--                                               channel_type)) {
-+                      if (!cfg80211_can_beacon_sec_chan(&rdev->wiphy, chan,
-+                                                        channel_type)) {
-                               printk(KERN_DEBUG
-                                      "cfg80211: Secondary channel not "
-                                      "allowed to initiate communication\n");
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -4570,13 +4570,34 @@ static int nl80211_join_ibss(struct sk_b
-               ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
+-      if (txq != sc->tx.txq_map[q])
++      if (q < 0)
+               return;
++      txq = sc->tx.txq_map[q];
+       if (WARN_ON(--txq->pending_frames < 0))
+               txq->pending_frames = 0;
+@@ -887,6 +885,15 @@ ath_tx_get_tid_subframe(struct ath_softc
+               tx_info = IEEE80211_SKB_CB(skb);
+               tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT;
++
++              /*
++               * No aggregation session is running, but there may be frames
++               * from a previous session or a failed attempt in the queue.
++               * Send them out as normal data frames
++               */
++              if (!tid->active)
++                      tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU;
++
+               if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
+                       bf->bf_state.bf_type = 0;
+                       return bf;
+@@ -1999,6 +2006,7 @@ static void setup_frame_info(struct ieee
+               an = (struct ath_node *) sta->drv_priv;
+       memset(fi, 0, sizeof(*fi));
++      fi->txq = -1;
+       if (hw_key)
+               fi->keyix = hw_key->hw_key_idx;
+       else if (an && ieee80211_is_data(hdr->frame_control) && an->ps_key > 0)
+@@ -2150,6 +2158,7 @@ int ath_tx_start(struct ieee80211_hw *hw
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+       struct ieee80211_sta *sta = txctl->sta;
+       struct ieee80211_vif *vif = info->control.vif;
++      struct ath_frame_info *fi = get_frame_info(skb);
+       struct ath_softc *sc = hw->priv;
+       struct ath_txq *txq = txctl->txq;
+       struct ath_atx_tid *tid = NULL;
+@@ -2170,11 +2179,13 @@ int ath_tx_start(struct ieee80211_hw *hw
+       q = skb_get_queue_mapping(skb);
+       ath_txq_lock(sc, txq);
+-      if (txq == sc->tx.txq_map[q] &&
+-          ++txq->pending_frames > sc->tx.txq_max_pending[q] &&
+-          !txq->stopped) {
+-              ieee80211_stop_queue(sc->hw, q);
+-              txq->stopped = true;
++      if (txq == sc->tx.txq_map[q]) {
++              fi->txq = q;
++              if (++txq->pending_frames > sc->tx.txq_max_pending[q] &&
++                  !txq->stopped) {
++                      ieee80211_stop_queue(sc->hw, q);
++                      txq->stopped = true;
++              }
        }
  
--      ibss.channel = ieee80211_get_channel(wiphy,
--              nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
-+      if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
-+              enum nl80211_channel_type channel_type;
+       if (txctl->an && ieee80211_is_data_present(hdr->frame_control))
+--- a/net/mac80211/chan.c
++++ b/net/mac80211/chan.c
+@@ -521,6 +521,8 @@ static void ieee80211_recalc_chanctx_cha
+                       continue;
+               if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
+                       continue;
++              if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++                      continue;
+               if (!compat)
+                       compat = &sdata->vif.bss_conf.chandef;
+--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+@@ -1004,9 +1004,11 @@ static bool ar5008_hw_ani_control_new(st
+       case ATH9K_ANI_FIRSTEP_LEVEL:{
+               u32 level = param;
+-              value = level;
++              value = level * 2;
+               REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
+                             AR_PHY_FIND_SIG_FIRSTEP, value);
++              REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
++                            AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
+               if (level != aniState->firstepLevel) {
+                       ath_dbg(common, ANI,
+@@ -1040,9 +1042,8 @@ static bool ar5008_hw_ani_control_new(st
+               REG_RMW_FIELD(ah, AR_PHY_TIMING5,
+                             AR_PHY_TIMING5_CYCPWR_THR1, value);
+-              if (IS_CHAN_HT40(ah->curchan))
+-                      REG_RMW_FIELD(ah, AR_PHY_EXT_CCA,
+-                                    AR_PHY_EXT_TIMING5_CYCPWR_THR1, value);
++              REG_RMW_FIELD(ah, AR_PHY_EXT_CCA,
++                                AR_PHY_EXT_TIMING5_CYCPWR_THR1, value - 1);
+               if (level != aniState->spurImmunityLevel) {
+                       ath_dbg(common, ANI,
+--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+@@ -517,6 +517,23 @@ static void ar9003_hw_spur_mitigate(stru
+       ar9003_hw_spur_mitigate_ofdm(ah, chan);
+ }
++static u32 ar9003_hw_compute_pll_control_soc(struct ath_hw *ah,
++                                           struct ath9k_channel *chan)
++{
++      u32 pll;
 +
-+              channel_type = nla_get_u32(
-+                              info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
-+              if (channel_type > NL80211_CHAN_HT40PLUS)
-+                      return -EINVAL;
-+              ibss.channel_type = channel_type;
-+      } else {
-+              ibss.channel_type = NL80211_CHAN_NO_HT;
-+      }
++      pll = SM(0x5, AR_RTC_9300_SOC_PLL_REFDIV);
 +
-+      ibss.channel = rdev_freq_to_chan(rdev,
-+              nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
-+              ibss.channel_type);
-       if (!ibss.channel ||
-+          ibss.channel->flags & IEEE80211_CHAN_RADAR ||
-           ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
-           ibss.channel->flags & IEEE80211_CHAN_DISABLED)
-               return -EINVAL;
-+      /* Both channels should be able to initiate communication */
-+      if ((ibss.channel_type == NL80211_CHAN_HT40PLUS ||
-+           ibss.channel_type == NL80211_CHAN_HT40MINUS) &&
-+          !cfg80211_can_beacon_sec_chan(&rdev->wiphy, ibss.channel,
-+                                        ibss.channel_type))
-+              return -EINVAL;
++      if (chan && IS_CHAN_HALF_RATE(chan))
++              pll |= SM(0x1, AR_RTC_9300_SOC_PLL_CLKSEL);
++      else if (chan && IS_CHAN_QUARTER_RATE(chan))
++              pll |= SM(0x2, AR_RTC_9300_SOC_PLL_CLKSEL);
++
++      pll |= SM(0x2c, AR_RTC_9300_SOC_PLL_DIV_INT);
++
++      return pll;
++}
++
+ static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah,
+                                        struct ath9k_channel *chan)
+ {
+@@ -1779,7 +1796,12 @@ void ar9003_hw_attach_phy_ops(struct ath
+       priv_ops->rf_set_freq = ar9003_hw_set_channel;
+       priv_ops->spur_mitigate_freq = ar9003_hw_spur_mitigate;
+-      priv_ops->compute_pll_control = ar9003_hw_compute_pll_control;
 +
-       ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
-       ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY];
++      if (AR_SREV_9340(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah))
++              priv_ops->compute_pll_control = ar9003_hw_compute_pll_control_soc;
++      else
++              priv_ops->compute_pll_control = ar9003_hw_compute_pll_control;
++
+       priv_ops->set_channel_regs = ar9003_hw_set_channel_regs;
+       priv_ops->init_bb = ar9003_hw_init_bb;
+       priv_ops->process_ini = ar9003_hw_process_ini;
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -702,6 +702,8 @@ static void ath9k_hw_init_pll(struct ath
+ {
+       u32 pll;
++      pll = ath9k_hw_compute_pll_control(ah, chan);
++
+       if (AR_SREV_9485(ah) || AR_SREV_9565(ah)) {
+               /* program BB PLL ki and kd value, ki=0x4, kd=0x40 */
+               REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
+@@ -752,7 +754,8 @@ static void ath9k_hw_init_pll(struct ath
+               REG_RMW_FIELD(ah, AR_CH0_DDR_DPLL3,
+                             AR_CH0_DPLL3_PHASE_SHIFT, 0x1);
+-              REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c);
++              REG_WRITE(ah, AR_RTC_PLL_CONTROL,
++                        pll | AR_RTC_9300_PLL_BYPASS);
+               udelay(1000);
+               /* program refdiv, nint, frac to RTC register */
+@@ -768,7 +771,8 @@ static void ath9k_hw_init_pll(struct ath
+       } else if (AR_SREV_9340(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah)) {
+               u32 regval, pll2_divint, pll2_divfrac, refdiv;
+-              REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c);
++              REG_WRITE(ah, AR_RTC_PLL_CONTROL,
++                        pll | AR_RTC_9300_SOC_PLL_BYPASS);
+               udelay(1000);
+               REG_SET_BIT(ah, AR_PHY_PLL_MODE, 0x1 << 16);
+@@ -840,7 +844,6 @@ static void ath9k_hw_init_pll(struct ath
+               udelay(1000);
+       }
  
+-      pll = ath9k_hw_compute_pll_control(ah, chan);
+       if (AR_SREV_9565(ah))
+               pll |= 0x40000;
+       REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
+--- a/drivers/net/wireless/ath/ath9k/reg.h
++++ b/drivers/net/wireless/ath/ath9k/reg.h
+@@ -1236,12 +1236,23 @@ enum {
+ #define AR_CH0_DPLL3_PHASE_SHIFT_S   23
+ #define AR_PHY_CCA_NOM_VAL_2GHZ      -118
++#define AR_RTC_9300_SOC_PLL_DIV_INT          0x0000003f
++#define AR_RTC_9300_SOC_PLL_DIV_INT_S        0
++#define AR_RTC_9300_SOC_PLL_DIV_FRAC         0x000fffc0
++#define AR_RTC_9300_SOC_PLL_DIV_FRAC_S       6
++#define AR_RTC_9300_SOC_PLL_REFDIV           0x01f00000
++#define AR_RTC_9300_SOC_PLL_REFDIV_S         20
++#define AR_RTC_9300_SOC_PLL_CLKSEL           0x06000000
++#define AR_RTC_9300_SOC_PLL_CLKSEL_S         25
++#define AR_RTC_9300_SOC_PLL_BYPASS           0x08000000
++
+ #define AR_RTC_9300_PLL_DIV          0x000003ff
+ #define AR_RTC_9300_PLL_DIV_S        0
+ #define AR_RTC_9300_PLL_REFDIV       0x00003C00
+ #define AR_RTC_9300_PLL_REFDIV_S     10
+ #define AR_RTC_9300_PLL_CLKSEL       0x0000C000
+ #define AR_RTC_9300_PLL_CLKSEL_S     14
++#define AR_RTC_9300_PLL_BYPASS       0x00010000
+ #define AR_RTC_9160_PLL_DIV   0x000003ff
+ #define AR_RTC_9160_PLL_DIV_S   0