+@@ -62,7 +62,6 @@ enum ieee80211_sta_info_flags {
+ WLAN_STA_AUTHORIZED,
+ WLAN_STA_SHORT_PREAMBLE,
+ WLAN_STA_WME,
+- WLAN_STA_WDS,
+ WLAN_STA_CLEAR_PS_FILT,
+ WLAN_STA_MFP,
+ WLAN_STA_BLOCK_BA,
+@@ -489,7 +488,7 @@ void for_each_sta_info_type_check(struct
+ nxt = _sta ? rcu_dereference(_sta->hnext) : NULL \
+ ) \
+ /* compare address and run code only if it matches */ \
+- if (memcmp(_sta->sta.addr, (_addr), ETH_ALEN) == 0)
++ if (compare_ether_addr(_sta->sta.addr, (_addr)) == 0)
+
+ /*
+ * Get STA info by index, BROKEN!
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -448,18 +448,23 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
+ struct ieee80211_local *local = tx->local;
+
+- if (unlikely(!sta ||
+- ieee80211_is_probe_resp(hdr->frame_control) ||
+- ieee80211_is_auth(hdr->frame_control) ||
+- ieee80211_is_assoc_resp(hdr->frame_control) ||
+- ieee80211_is_reassoc_resp(hdr->frame_control)))
++ if (unlikely(!sta))
+ return TX_CONTINUE;
+
+ if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) ||
+ test_sta_flag(sta, WLAN_STA_PS_DRIVER)) &&
+- !(info->flags & IEEE80211_TX_CTL_POLL_RESPONSE))) {
++ !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
+ int ac = skb_get_queue_mapping(tx->skb);
+
++ /* only deauth, disassoc and action are bufferable MMPDUs */
++ if (ieee80211_is_mgmt(hdr->frame_control) &&
++ !ieee80211_is_deauth(hdr->frame_control) &&
++ !ieee80211_is_disassoc(hdr->frame_control) &&
++ !ieee80211_is_action(hdr->frame_control)) {
++ info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
++ return TX_CONTINUE;
++ }
++
+ #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
+ printk(KERN_DEBUG "STA %pM aid %d: PS buffer for AC %d\n",
+ sta->sta.addr, sta->sta.aid, ac);
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -480,7 +480,7 @@ struct ieee80211_if_ibss {
+
+ bool control_port;
+
+- u8 bssid[ETH_ALEN];
++ u8 bssid[ETH_ALEN] __aligned(2);
+ u8 ssid[IEEE80211_MAX_SSID_LEN];
+ u8 ssid_len, ie_len;
+ u8 *ie;
+--- a/net/mac80211/ibss.c
++++ b/net/mac80211/ibss.c
+@@ -66,7 +66,7 @@ static void __ieee80211_sta_join_ibss(st
+ skb_reset_tail_pointer(skb);
+ skb_reserve(skb, sdata->local->hw.extra_tx_headroom);
+
+- if (memcmp(ifibss->bssid, bssid, ETH_ALEN))
++ if (compare_ether_addr(ifibss->bssid, bssid))
+ sta_info_flush(sdata->local, sdata);
+
+ /* if merging, indicate to driver that we leave the old IBSS */
+@@ -403,7 +403,7 @@ static void ieee80211_rx_bss_info(struct
+ return;
+
+ if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
+- memcmp(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0) {
++ compare_ether_addr(mgmt->bssid, sdata->u.ibss.bssid) == 0) {
+
+ rcu_read_lock();
+ sta = sta_info_get(sdata, mgmt->sa);
+@@ -508,7 +508,7 @@ static void ieee80211_rx_bss_info(struct
+ goto put_bss;
+
+ /* same BSSID */
+- if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0)
++ if (compare_ether_addr(cbss->bssid, sdata->u.ibss.bssid) == 0)
+ goto put_bss;
+
+ if (rx_status->flag & RX_FLAG_MACTIME_MPDU) {
+@@ -831,8 +831,8 @@ static void ieee80211_rx_mgmt_probe_req(
+ if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
+ return;
+
+- if (memcmp(mgmt->bssid, ifibss->bssid, ETH_ALEN) != 0 &&
+- memcmp(mgmt->bssid, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) != 0)
++ if (compare_ether_addr(mgmt->bssid, ifibss->bssid) != 0 &&
++ !is_broadcast_ether_addr(mgmt->bssid))
+ return;
+
+ end = ((u8 *) mgmt) + len;
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -204,7 +204,7 @@ int mesh_rmc_check(u8 *sa, struct ieee80
+ kmem_cache_free(rm_cache, p);
+ --entries;
+ } else if ((seqnum == p->seqnum) &&
+- (memcmp(sa, p->sa, ETH_ALEN) == 0))
++ (compare_ether_addr(sa, p->sa) == 0))
+ return -1;
+ }
+
+--- a/net/mac80211/mesh_hwmp.c
++++ b/net/mac80211/mesh_hwmp.c
+@@ -8,6 +8,7 @@
+ */
+
+ #include <linux/slab.h>
++#include <linux/etherdevice.h>
+ #include <asm/unaligned.h>
+ #include "wme.h"
+ #include "mesh.h"
+@@ -419,7 +420,7 @@ static u32 hwmp_route_info_get(struct ie
+ new_metric = MAX_METRIC;
+ exp_time = TU_TO_EXP_TIME(orig_lifetime);
+
+- if (memcmp(orig_addr, sdata->vif.addr, ETH_ALEN) == 0) {
++ if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0) {
+ /* This MP is the originator, we are not interested in this
+ * frame, except for updating transmitter's path info.
+ */
+@@ -469,7 +470,7 @@ static u32 hwmp_route_info_get(struct ie
+
+ /* Update and check transmitter routing info */
+ ta = mgmt->sa;
+- if (memcmp(orig_addr, ta, ETH_ALEN) == 0)
++ if (compare_ether_addr(orig_addr, ta) == 0)
+ fresh_info = false;
+ else {
+ fresh_info = true;
+@@ -529,7 +530,7 @@ static void hwmp_preq_frame_process(stru
+
+ mhwmp_dbg("received PREQ from %pM", orig_addr);
+
+- if (memcmp(target_addr, sdata->vif.addr, ETH_ALEN) == 0) {
++ if (compare_ether_addr(target_addr, sdata->vif.addr) == 0) {
+ mhwmp_dbg("PREQ is for us");
+ forward = false;
+ reply = true;
+@@ -624,7 +625,7 @@ static void hwmp_prep_frame_process(stru
+ mhwmp_dbg("received PREP from %pM", PREP_IE_ORIG_ADDR(prep_elem));
+
+ orig_addr = PREP_IE_ORIG_ADDR(prep_elem);
+- if (memcmp(orig_addr, sdata->vif.addr, ETH_ALEN) == 0)
++ if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0)
+ /* destination, no forwarding required */
+ return;
+
+@@ -694,10 +695,12 @@ static void hwmp_perr_frame_process(stru
+ rcu_read_lock();
+ mpath = mesh_path_lookup(target_addr, sdata);
+ if (mpath) {
++ struct sta_info *sta;
++
+ spin_lock_bh(&mpath->state_lock);
++ sta = next_hop_deref_protected(mpath);
+ if (mpath->flags & MESH_PATH_ACTIVE &&
+- memcmp(ta, next_hop_deref_protected(mpath)->sta.addr,
+- ETH_ALEN) == 0 &&
++ compare_ether_addr(ta, sta->sta.addr) == 0 &&
+ (!(mpath->flags & MESH_PATH_SN_VALID) ||
+ SN_GT(target_sn, mpath->sn))) {
+ mpath->flags &= ~MESH_PATH_ACTIVE;
+@@ -739,7 +742,7 @@ static void hwmp_rann_frame_process(stru
+ metric = rann->rann_metric;
+
+ /* Ignore our own RANNs */
+- if (memcmp(orig_addr, sdata->vif.addr, ETH_ALEN) == 0)
++ if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0)
+ return;
+
+ mhwmp_dbg("received RANN from %pM (is_gate=%d)", orig_addr,
+@@ -1064,7 +1067,7 @@ int mesh_nexthop_lookup(struct sk_buff *
+ if (time_after(jiffies,
+ mpath->exp_time -
+ msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) &&
+- !memcmp(sdata->vif.addr, hdr->addr4, ETH_ALEN) &&
++ !compare_ether_addr(sdata->vif.addr, hdr->addr4) &&
+ !(mpath->flags & MESH_PATH_RESOLVING) &&
+ !(mpath->flags & MESH_PATH_FIXED))
+ mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
+--- a/net/mac80211/mesh_pathtbl.c
++++ b/net/mac80211/mesh_pathtbl.c
+@@ -350,7 +350,7 @@ static struct mesh_path *mpath_lookup(st
+ hlist_for_each_entry_rcu(node, n, bucket, list) {
+ mpath = node->mpath;
+ if (mpath->sdata == sdata &&
+- memcmp(dst, mpath->dst, ETH_ALEN) == 0) {
++ compare_ether_addr(dst, mpath->dst) == 0) {
+ if (MPATH_EXPIRED(mpath)) {
+ spin_lock_bh(&mpath->state_lock);
+ mpath->flags &= ~MESH_PATH_ACTIVE;
+@@ -525,7 +525,7 @@ int mesh_path_add(u8 *dst, struct ieee80
+ int err = 0;
+ u32 hash_idx;
+
+- if (memcmp(dst, sdata->vif.addr, ETH_ALEN) == 0)
++ if (compare_ether_addr(dst, sdata->vif.addr) == 0)
+ /* never add ourselves as neighbours */
+ return -ENOTSUPP;
+
+@@ -566,7 +566,8 @@ int mesh_path_add(u8 *dst, struct ieee80
+ err = -EEXIST;
+ hlist_for_each_entry(node, n, bucket, list) {
+ mpath = node->mpath;
+- if (mpath->sdata == sdata && memcmp(dst, mpath->dst, ETH_ALEN) == 0)
++ if (mpath->sdata == sdata &&
++ compare_ether_addr(dst, mpath->dst) == 0)
+ goto err_exists;
+ }
+
+@@ -657,7 +658,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struc
+ int err = 0;
+ u32 hash_idx;
+
+- if (memcmp(dst, sdata->vif.addr, ETH_ALEN) == 0)
++ if (compare_ether_addr(dst, sdata->vif.addr) == 0)
+ /* never add ourselves as neighbours */
+ return -ENOTSUPP;
+
+@@ -694,7 +695,8 @@ int mpp_path_add(u8 *dst, u8 *mpp, struc
+ err = -EEXIST;
+ hlist_for_each_entry(node, n, bucket, list) {
+ mpath = node->mpath;
+- if (mpath->sdata == sdata && memcmp(dst, mpath->dst, ETH_ALEN) == 0)
++ if (mpath->sdata == sdata &&
++ compare_ether_addr(dst, mpath->dst) == 0)
+ goto err_exists;
+ }
+
+@@ -887,7 +889,7 @@ int mesh_path_del(u8 *addr, struct ieee8
+ hlist_for_each_entry(node, n, bucket, list) {
+ mpath = node->mpath;
+ if (mpath->sdata == sdata &&
+- memcmp(addr, mpath->dst, ETH_ALEN) == 0) {
++ compare_ether_addr(addr, mpath->dst) == 0) {
+ __mesh_path_del(tbl, node);
+ goto enddel;