---- a/drivers/net/wireless/b43/main.c
-+++ b/drivers/net/wireless/b43/main.c
-@@ -320,6 +320,10 @@ static void b43_wireless_core_exit(struc
- static int b43_wireless_core_init(struct b43_wldev *dev);
- static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev);
- static int b43_wireless_core_start(struct b43_wldev *dev);
-+static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
-+ struct ieee80211_vif *vif,
-+ struct ieee80211_bss_conf *conf,
-+ u32 changed);
-
- static int b43_ratelimit(struct b43_wl *wl)
- {
-@@ -3754,14 +3758,24 @@ static int b43_op_config(struct ieee8021
- struct ieee80211_conf *conf = &hw->conf;
- int antenna;
- int err = 0;
-+ bool reload_bss = false;
-
- mutex_lock(&wl->mutex);
-
-+ dev = wl->current_dev;
-+
- /* Switch the band (if necessary). This might change the active core. */
- err = b43_switch_band(wl, conf->channel);
- if (err)
- goto out_unlock_mutex;
-- dev = wl->current_dev;
-+
-+ /* Need to reload all settings if the core changed */
-+ if (dev != wl->current_dev) {
-+ dev = wl->current_dev;
-+ changed = ~0;
-+ reload_bss = true;
-+ }
-+
- phy = &dev->phy;
-
- if (conf_is_ht(conf))
-@@ -3822,6 +3836,9 @@ out_mac_enable:
- out_unlock_mutex:
- mutex_unlock(&wl->mutex);
-
-+ if (wl->vif && reload_bss)
-+ b43_op_bss_info_changed(hw, wl->vif, &wl->vif->bss_conf, ~0);
-+
- return err;
- }
-
-@@ -3910,7 +3927,8 @@ static void b43_op_bss_info_changed(stru
- if (changed & BSS_CHANGED_BEACON_INT &&
- (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
- b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
-- b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
-+ b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) &&
-+ conf->beacon_int)
- b43_set_beacon_int(dev, conf->beacon_int);
-
- if (changed & BSS_CHANGED_BASIC_RATES)
-@@ -4691,6 +4709,9 @@ static int b43_op_add_interface(struct i
- out_mutex_unlock:
- mutex_unlock(&wl->mutex);
-
-+ if (err == 0)
-+ b43_op_bss_info_changed(hw, vif, &vif->bss_conf, ~0);
-+
- return err;
- }
-
-@@ -4761,6 +4782,9 @@ static int b43_op_start(struct ieee80211
- out_mutex_unlock:
- mutex_unlock(&wl->mutex);
-
-+ /* reload configuration */
-+ b43_op_config(hw, ~0);
-+
- return err;
- }
-
-@@ -4917,10 +4941,18 @@ out:
- if (err)
- wl->current_dev = NULL; /* Failed to init the dev. */
- mutex_unlock(&wl->mutex);
-- if (err)
-+
-+ if (err) {
- b43err(wl, "Controller restart FAILED\n");
-- else
-- b43info(wl, "Controller restarted\n");
-+ return;
-+ }
-+
-+ /* reload configuration */
-+ b43_op_config(wl->hw, ~0);
-+ if (wl->vif)
-+ b43_op_bss_info_changed(wl->hw, wl->vif, &wl->vif->bss_conf, ~0);
-+
-+ b43info(wl, "Controller restarted\n");
- }
-
- static int b43_setup_bands(struct b43_wldev *dev,
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -184,6 +184,8 @@ static void ieee80211_send_addba_resp(st
break;
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -2147,7 +2147,8 @@ ieee80211_rx_h_action(struct ieee80211_r
+@@ -2160,7 +2160,8 @@ ieee80211_rx_h_action(struct ieee80211_r
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
break;
/* verify action_code is present */
-@@ -2345,13 +2346,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
+@@ -2375,13 +2376,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
if (!ieee80211_vif_is_mesh(&sdata->vif) &&
sdata->vif.type != NL80211_IFTYPE_ADHOC &&
break;
case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
-@@ -2692,10 +2694,16 @@ static int prepare_for_handlers(struct i
+@@ -2724,10 +2726,16 @@ static int prepare_for_handlers(struct i
}
break;
case NL80211_IFTYPE_WDS:
WLAN_STA_CLEAR_PS_FILT = 1<<9,
WLAN_STA_MFP = 1<<10,
WLAN_STA_BLOCK_BA = 1<<11,
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -551,7 +551,8 @@ static void ath_tx_complete_aggr(struct
- if (clear_filter)
- tid->ac->clear_ps_filter = true;
- list_splice(&bf_pending, &tid->buf_q);
-- ath_tx_queue_tid(txq, tid);
-+ if (!an->sleeping)
-+ ath_tx_queue_tid(txq, tid);
- spin_unlock_bh(&txq->axq_lock);
- }
+--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+@@ -671,7 +671,7 @@ static int ar9003_hw_process_ini(struct
+ REG_WRITE_ARRAY(&ah->iniModesAdditional,
+ modesIndex, regWrites);
-@@ -1413,7 +1414,8 @@ static void ath_tx_send_ampdu(struct ath
- */
- TX_STAT_INC(txctl->txq->axq_qnum, a_queued_sw);
- list_add_tail(&bf->list, &tid->buf_q);
-- ath_tx_queue_tid(txctl->txq, tid);
-+ if (!txctl->an || !txctl->an->sleeping)
-+ ath_tx_queue_tid(txctl->txq, tid);
- return;
- }
+- if (AR_SREV_9300(ah))
++ if (AR_SREV_9330(ah))
+ REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -421,6 +421,7 @@ struct station_parameters {
- * @STATION_INFO_RX_BITRATE: @rxrate fields are filled
- * @STATION_INFO_BSS_PARAM: @bss_param filled
- * @STATION_INFO_CONNECTED_TIME: @connected_time filled
-+ * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
- */
- enum station_info_flags {
- STATION_INFO_INACTIVE_TIME = 1<<0,
-@@ -439,7 +440,8 @@ enum station_info_flags {
- STATION_INFO_SIGNAL_AVG = 1<<13,
- STATION_INFO_RX_BITRATE = 1<<14,
- STATION_INFO_BSS_PARAM = 1<<15,
-- STATION_INFO_CONNECTED_TIME = 1<<16
-+ STATION_INFO_CONNECTED_TIME = 1<<16,
-+ STATION_INFO_ASSOC_REQ_IES = 1<<17
- };
+ if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -997,8 +997,14 @@ void ath9k_hw_init_global_settings(struc
+ slottime = 21;
+ sifstime = 64;
+ } else {
+- eifs = REG_READ(ah, AR_D_GBL_IFS_EIFS)/common->clockrate;
+- reg = REG_READ(ah, AR_USEC);
++ if (AR_SREV_9287(ah) && AR_SREV_9287_13_OR_LATER(ah)) {
++ eifs = AR_D_GBL_IFS_EIFS_ASYNC_FIFO;
++ reg = AR_USEC_ASYNC_FIFO;
++ } else {
++ eifs = REG_READ(ah, AR_D_GBL_IFS_EIFS)/
++ common->clockrate;
++ reg = REG_READ(ah, AR_USEC);
++ }
+ rx_lat = MS(reg, AR_USEC_RX_LAT);
+ tx_lat = MS(reg, AR_USEC_TX_LAT);
- /**
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -2236,7 +2236,7 @@ static int nl80211_send_station(struct s
- }
- nla_nest_end(msg, sinfoattr);
+--- a/drivers/net/wireless/ath/ath9k/reg.h
++++ b/drivers/net/wireless/ath/ath9k/reg.h
+@@ -619,6 +619,7 @@
+ #define AR_D_GBL_IFS_EIFS 0x10b0
+ #define AR_D_GBL_IFS_EIFS_M 0x0000FFFF
+ #define AR_D_GBL_IFS_EIFS_RESV0 0xFFFF0000
++#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO 363
+
+ #define AR_D_GBL_IFS_MISC 0x10f0
+ #define AR_D_GBL_IFS_MISC_LFSR_SLICE_SEL 0x00000007
+@@ -1503,6 +1504,7 @@ enum {
+ #define AR_USEC_TX_LAT_S 14
+ #define AR_USEC_RX_LAT 0x1F800000
+ #define AR_USEC_RX_LAT_S 23
++#define AR_USEC_ASYNC_FIFO 0x12E00074
-- if (sinfo->assoc_req_ies)
-+ if (sinfo->filled & STATION_INFO_ASSOC_REQ_IES)
- NLA_PUT(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
- sinfo->assoc_req_ies);
+ #define AR_RESET_TSF 0x8020
+ #define AR_RESET_TSF_ONCE 0x01000000
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath
+ tx_info = IEEE80211_SKB_CB(skb);
+ rates = tx_info->control.rates;
+- for (i = 3; i >= 0; i--) {
++ for (i = 0; i < 4; i++) {
++ if (!rates[i].count || rates[i].idx < 0)
++ break;
++
+ if (!(rates[i].flags & IEEE80211_TX_RC_MCS))
+ return true;
+ }