aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/agg-rx.c13
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/ht.c8
-rw-r--r--net/mac80211/ibss.c22
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/mesh.c4
-rw-r--r--net/mac80211/mesh_hwmp.c14
-rw-r--r--net/mac80211/mesh_pathtbl.c12
-rw-r--r--net/mac80211/mlme.c41
-rw-r--r--net/mac80211/rx.c50
-rw-r--r--net/mac80211/scan.c2
-rw-r--r--net/mac80211/sta_info.c8
-rw-r--r--net/mac80211/sta_info.h2
-rw-r--r--net/mac80211/status.c2
-rw-r--r--net/mac80211/tx.c28
16 files changed, 95 insertions, 117 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index a070d4f460ea..26ddb699d693 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -260,11 +260,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
260 (buf_size > IEEE80211_MAX_AMPDU_BUF)) { 260 (buf_size > IEEE80211_MAX_AMPDU_BUF)) {
261 status = WLAN_STATUS_INVALID_QOS_PARAM; 261 status = WLAN_STATUS_INVALID_QOS_PARAM;
262#ifdef CONFIG_MAC80211_HT_DEBUG 262#ifdef CONFIG_MAC80211_HT_DEBUG
263 if (net_ratelimit()) 263 net_dbg_ratelimited("AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n",
264 printk(KERN_DEBUG "AddBA Req with bad params from " 264 mgmt->sa, tid, ba_policy, buf_size);
265 "%pM on tid %u. policy %d, buffer size %d\n",
266 mgmt->sa, tid, ba_policy,
267 buf_size);
268#endif /* CONFIG_MAC80211_HT_DEBUG */ 265#endif /* CONFIG_MAC80211_HT_DEBUG */
269 goto end_no_lock; 266 goto end_no_lock;
270 } 267 }
@@ -281,10 +278,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
281 278
282 if (sta->ampdu_mlme.tid_rx[tid]) { 279 if (sta->ampdu_mlme.tid_rx[tid]) {
283#ifdef CONFIG_MAC80211_HT_DEBUG 280#ifdef CONFIG_MAC80211_HT_DEBUG
284 if (net_ratelimit()) 281 net_dbg_ratelimited("unexpected AddBA Req from %pM on tid %u\n",
285 printk(KERN_DEBUG "unexpected AddBA Req from " 282 mgmt->sa, tid);
286 "%pM on tid %u\n",
287 mgmt->sa, tid);
288#endif /* CONFIG_MAC80211_HT_DEBUG */ 283#endif /* CONFIG_MAC80211_HT_DEBUG */
289 284
290 /* delete existing Rx BA session on the same tid */ 285 /* delete existing Rx BA session on the same tid */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 0221270c0ddf..495831ee48f1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1093,7 +1093,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
1093 } else 1093 } else
1094 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1094 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1095 1095
1096 if (compare_ether_addr(mac, sdata->vif.addr) == 0) 1096 if (ether_addr_equal(mac, sdata->vif.addr))
1097 return -EINVAL; 1097 return -EINVAL;
1098 1098
1099 if (is_multicast_ether_addr(mac)) 1099 if (is_multicast_ether_addr(mac))
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 9b603366943c..6f8615c54b22 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -306,10 +306,10 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
306 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11; 306 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11;
307 307
308#ifdef CONFIG_MAC80211_HT_DEBUG 308#ifdef CONFIG_MAC80211_HT_DEBUG
309 if (net_ratelimit()) 309 net_dbg_ratelimited("delba from %pM (%s) tid %d reason code %d\n",
310 printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n", 310 mgmt->sa, initiator ? "initiator" : "recipient",
311 mgmt->sa, initiator ? "initiator" : "recipient", tid, 311 tid,
312 le16_to_cpu(mgmt->u.action.u.delba.reason_code)); 312 le16_to_cpu(mgmt->u.action.u.delba.reason_code));
313#endif /* CONFIG_MAC80211_HT_DEBUG */ 313#endif /* CONFIG_MAC80211_HT_DEBUG */
314 314
315 if (initiator == WLAN_BACK_INITIATOR) 315 if (initiator == WLAN_BACK_INITIATOR)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 11ac1ffd9570..33d9d0c3e3d0 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -66,7 +66,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
66 skb_reset_tail_pointer(skb); 66 skb_reset_tail_pointer(skb);
67 skb_reserve(skb, sdata->local->hw.extra_tx_headroom); 67 skb_reserve(skb, sdata->local->hw.extra_tx_headroom);
68 68
69 if (compare_ether_addr(ifibss->bssid, bssid)) 69 if (!ether_addr_equal(ifibss->bssid, bssid))
70 sta_info_flush(sdata->local, sdata); 70 sta_info_flush(sdata->local, sdata);
71 71
72 /* if merging, indicate to driver that we leave the old IBSS */ 72 /* if merging, indicate to driver that we leave the old IBSS */
@@ -308,9 +308,8 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
308 * allow new one to be added. 308 * allow new one to be added.
309 */ 309 */
310 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 310 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
311 if (net_ratelimit()) 311 net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
312 printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", 312 sdata->name, addr);
313 sdata->name, addr);
314 rcu_read_lock(); 313 rcu_read_lock();
315 return NULL; 314 return NULL;
316 } 315 }
@@ -320,7 +319,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
320 return NULL; 319 return NULL;
321 } 320 }
322 321
323 if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) { 322 if (!ether_addr_equal(bssid, sdata->u.ibss.bssid)) {
324 rcu_read_lock(); 323 rcu_read_lock();
325 return NULL; 324 return NULL;
326 } 325 }
@@ -406,7 +405,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
406 return; 405 return;
407 406
408 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && 407 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
409 compare_ether_addr(mgmt->bssid, sdata->u.ibss.bssid) == 0) { 408 ether_addr_equal(mgmt->bssid, sdata->u.ibss.bssid)) {
410 409
411 rcu_read_lock(); 410 rcu_read_lock();
412 sta = sta_info_get(sdata, mgmt->sa); 411 sta = sta_info_get(sdata, mgmt->sa);
@@ -511,7 +510,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
511 goto put_bss; 510 goto put_bss;
512 511
513 /* same BSSID */ 512 /* same BSSID */
514 if (compare_ether_addr(cbss->bssid, sdata->u.ibss.bssid) == 0) 513 if (ether_addr_equal(cbss->bssid, sdata->u.ibss.bssid))
515 goto put_bss; 514 goto put_bss;
516 515
517 if (rx_status->flag & RX_FLAG_MACTIME_MPDU) { 516 if (rx_status->flag & RX_FLAG_MACTIME_MPDU) {
@@ -587,16 +586,15 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
587 * allow new one to be added. 586 * allow new one to be added.
588 */ 587 */
589 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 588 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
590 if (net_ratelimit()) 589 net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
591 printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", 590 sdata->name, addr);
592 sdata->name, addr);
593 return; 591 return;
594 } 592 }
595 593
596 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH) 594 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH)
597 return; 595 return;
598 596
599 if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) 597 if (!ether_addr_equal(bssid, sdata->u.ibss.bssid))
600 return; 598 return;
601 599
602 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); 600 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
@@ -834,7 +832,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
834 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da)) 832 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
835 return; 833 return;
836 834
837 if (compare_ether_addr(mgmt->bssid, ifibss->bssid) != 0 && 835 if (!ether_addr_equal(mgmt->bssid, ifibss->bssid) &&
838 !is_broadcast_ether_addr(mgmt->bssid)) 836 !is_broadcast_ether_addr(mgmt->bssid))
839 return; 837 return;
840 838
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ae046b52d5e2..3f3cd50fff16 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1195,7 +1195,7 @@ static inline struct ieee80211_local *hw_to_local(
1195 1195
1196static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) 1196static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
1197{ 1197{
1198 return compare_ether_addr(raddr, addr) == 0 || 1198 return ether_addr_equal(raddr, addr) ||
1199 is_broadcast_ether_addr(raddr); 1199 is_broadcast_ether_addr(raddr);
1200} 1200}
1201 1201
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index c550945dd703..d4c19a7773db 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -127,7 +127,7 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
127 * The remaining checks are only performed for interfaces 127 * The remaining checks are only performed for interfaces
128 * with the same MAC address. 128 * with the same MAC address.
129 */ 129 */
130 if (compare_ether_addr(dev->dev_addr, ndev->dev_addr)) 130 if (!ether_addr_equal(dev->dev_addr, ndev->dev_addr))
131 continue; 131 continue;
132 132
133 /* 133 /*
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index d3a9a6c081e7..2913113c5833 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -217,7 +217,7 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
217 kmem_cache_free(rm_cache, p); 217 kmem_cache_free(rm_cache, p);
218 --entries; 218 --entries;
219 } else if ((seqnum == p->seqnum) && 219 } else if ((seqnum == p->seqnum) &&
220 (compare_ether_addr(sa, p->sa) == 0)) 220 (ether_addr_equal(sa, p->sa)))
221 return -1; 221 return -1;
222 } 222 }
223 223
@@ -651,7 +651,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
651 651
652 /* ignore ProbeResp to foreign address */ 652 /* ignore ProbeResp to foreign address */
653 if (stype == IEEE80211_STYPE_PROBE_RESP && 653 if (stype == IEEE80211_STYPE_PROBE_RESP &&
654 compare_ether_addr(mgmt->da, sdata->vif.addr)) 654 !ether_addr_equal(mgmt->da, sdata->vif.addr))
655 return; 655 return;
656 656
657 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; 657 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 70ac7d180077..9b59658e8650 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -422,7 +422,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
422 new_metric = MAX_METRIC; 422 new_metric = MAX_METRIC;
423 exp_time = TU_TO_EXP_TIME(orig_lifetime); 423 exp_time = TU_TO_EXP_TIME(orig_lifetime);
424 424
425 if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0) { 425 if (ether_addr_equal(orig_addr, sdata->vif.addr)) {
426 /* This MP is the originator, we are not interested in this 426 /* This MP is the originator, we are not interested in this
427 * frame, except for updating transmitter's path info. 427 * frame, except for updating transmitter's path info.
428 */ 428 */
@@ -472,7 +472,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
472 472
473 /* Update and check transmitter routing info */ 473 /* Update and check transmitter routing info */
474 ta = mgmt->sa; 474 ta = mgmt->sa;
475 if (compare_ether_addr(orig_addr, ta) == 0) 475 if (ether_addr_equal(orig_addr, ta))
476 fresh_info = false; 476 fresh_info = false;
477 else { 477 else {
478 fresh_info = true; 478 fresh_info = true;
@@ -533,7 +533,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
533 533
534 mhwmp_dbg("received PREQ from %pM", orig_addr); 534 mhwmp_dbg("received PREQ from %pM", orig_addr);
535 535
536 if (compare_ether_addr(target_addr, sdata->vif.addr) == 0) { 536 if (ether_addr_equal(target_addr, sdata->vif.addr)) {
537 mhwmp_dbg("PREQ is for us"); 537 mhwmp_dbg("PREQ is for us");
538 forward = false; 538 forward = false;
539 reply = true; 539 reply = true;
@@ -634,7 +634,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
634 mhwmp_dbg("received PREP from %pM", PREP_IE_ORIG_ADDR(prep_elem)); 634 mhwmp_dbg("received PREP from %pM", PREP_IE_ORIG_ADDR(prep_elem));
635 635
636 orig_addr = PREP_IE_ORIG_ADDR(prep_elem); 636 orig_addr = PREP_IE_ORIG_ADDR(prep_elem);
637 if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0) 637 if (ether_addr_equal(orig_addr, sdata->vif.addr))
638 /* destination, no forwarding required */ 638 /* destination, no forwarding required */
639 return; 639 return;
640 640
@@ -712,7 +712,7 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
712 spin_lock_bh(&mpath->state_lock); 712 spin_lock_bh(&mpath->state_lock);
713 sta = next_hop_deref_protected(mpath); 713 sta = next_hop_deref_protected(mpath);
714 if (mpath->flags & MESH_PATH_ACTIVE && 714 if (mpath->flags & MESH_PATH_ACTIVE &&
715 compare_ether_addr(ta, sta->sta.addr) == 0 && 715 ether_addr_equal(ta, sta->sta.addr) &&
716 (!(mpath->flags & MESH_PATH_SN_VALID) || 716 (!(mpath->flags & MESH_PATH_SN_VALID) ||
717 SN_GT(target_sn, mpath->sn))) { 717 SN_GT(target_sn, mpath->sn))) {
718 mpath->flags &= ~MESH_PATH_ACTIVE; 718 mpath->flags &= ~MESH_PATH_ACTIVE;
@@ -759,7 +759,7 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
759 metric = le32_to_cpu(rann->rann_metric); 759 metric = le32_to_cpu(rann->rann_metric);
760 760
761 /* Ignore our own RANNs */ 761 /* Ignore our own RANNs */
762 if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0) 762 if (ether_addr_equal(orig_addr, sdata->vif.addr))
763 return; 763 return;
764 764
765 mhwmp_dbg("received RANN from %pM via neighbour %pM (is_gate=%d)", 765 mhwmp_dbg("received RANN from %pM via neighbour %pM (is_gate=%d)",
@@ -1102,7 +1102,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
1102 if (time_after(jiffies, 1102 if (time_after(jiffies,
1103 mpath->exp_time - 1103 mpath->exp_time -
1104 msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && 1104 msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) &&
1105 !compare_ether_addr(sdata->vif.addr, hdr->addr4) && 1105 ether_addr_equal(sdata->vif.addr, hdr->addr4) &&
1106 !(mpath->flags & MESH_PATH_RESOLVING) && 1106 !(mpath->flags & MESH_PATH_RESOLVING) &&
1107 !(mpath->flags & MESH_PATH_FIXED)) 1107 !(mpath->flags & MESH_PATH_FIXED))
1108 mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); 1108 mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index baa6096c66b4..b39224d8255c 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -348,7 +348,7 @@ static struct mesh_path *mpath_lookup(struct mesh_table *tbl, u8 *dst,
348 hlist_for_each_entry_rcu(node, n, bucket, list) { 348 hlist_for_each_entry_rcu(node, n, bucket, list) {
349 mpath = node->mpath; 349 mpath = node->mpath;
350 if (mpath->sdata == sdata && 350 if (mpath->sdata == sdata &&
351 compare_ether_addr(dst, mpath->dst) == 0) { 351 ether_addr_equal(dst, mpath->dst)) {
352 if (MPATH_EXPIRED(mpath)) { 352 if (MPATH_EXPIRED(mpath)) {
353 spin_lock_bh(&mpath->state_lock); 353 spin_lock_bh(&mpath->state_lock);
354 mpath->flags &= ~MESH_PATH_ACTIVE; 354 mpath->flags &= ~MESH_PATH_ACTIVE;
@@ -517,7 +517,7 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
517 int err = 0; 517 int err = 0;
518 u32 hash_idx; 518 u32 hash_idx;
519 519
520 if (compare_ether_addr(dst, sdata->vif.addr) == 0) 520 if (ether_addr_equal(dst, sdata->vif.addr))
521 /* never add ourselves as neighbours */ 521 /* never add ourselves as neighbours */
522 return -ENOTSUPP; 522 return -ENOTSUPP;
523 523
@@ -561,7 +561,7 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
561 hlist_for_each_entry(node, n, bucket, list) { 561 hlist_for_each_entry(node, n, bucket, list) {
562 mpath = node->mpath; 562 mpath = node->mpath;
563 if (mpath->sdata == sdata && 563 if (mpath->sdata == sdata &&
564 compare_ether_addr(dst, mpath->dst) == 0) 564 ether_addr_equal(dst, mpath->dst))
565 goto err_exists; 565 goto err_exists;
566 } 566 }
567 567
@@ -652,7 +652,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
652 int err = 0; 652 int err = 0;
653 u32 hash_idx; 653 u32 hash_idx;
654 654
655 if (compare_ether_addr(dst, sdata->vif.addr) == 0) 655 if (ether_addr_equal(dst, sdata->vif.addr))
656 /* never add ourselves as neighbours */ 656 /* never add ourselves as neighbours */
657 return -ENOTSUPP; 657 return -ENOTSUPP;
658 658
@@ -690,7 +690,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
690 hlist_for_each_entry(node, n, bucket, list) { 690 hlist_for_each_entry(node, n, bucket, list) {
691 mpath = node->mpath; 691 mpath = node->mpath;
692 if (mpath->sdata == sdata && 692 if (mpath->sdata == sdata &&
693 compare_ether_addr(dst, mpath->dst) == 0) 693 ether_addr_equal(dst, mpath->dst))
694 goto err_exists; 694 goto err_exists;
695 } 695 }
696 696
@@ -884,7 +884,7 @@ int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata)
884 hlist_for_each_entry(node, n, bucket, list) { 884 hlist_for_each_entry(node, n, bucket, list) {
885 mpath = node->mpath; 885 mpath = node->mpath;
886 if (mpath->sdata == sdata && 886 if (mpath->sdata == sdata &&
887 compare_ether_addr(addr, mpath->dst) == 0) { 887 ether_addr_equal(addr, mpath->dst)) {
888 __mesh_path_del(tbl, node); 888 __mesh_path_del(tbl, node);
889 goto enddel; 889 goto enddel;
890 } 890 }
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index dbd4bd92c018..b3b3c264ff66 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1567,9 +1567,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
1567 } 1567 }
1568 1568
1569#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1569#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1570 if (beacon && net_ratelimit()) 1570 if (beacon)
1571 printk(KERN_DEBUG "%s: detected beacon loss from AP " 1571 net_dbg_ratelimited("%s: detected beacon loss from AP - sending probe request\n",
1572 "- sending probe request\n", sdata->name); 1572 sdata->name);
1573#endif 1573#endif
1574 1574
1575 /* 1575 /*
@@ -1776,7 +1776,7 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1776 1776
1777 memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN); 1777 memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN);
1778 1778
1779 if (compare_ether_addr(bssid, mgmt->bssid)) 1779 if (!ether_addr_equal(bssid, mgmt->bssid))
1780 return RX_MGMT_NONE; 1780 return RX_MGMT_NONE;
1781 1781
1782 auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); 1782 auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg);
@@ -1853,7 +1853,7 @@ ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1853 return RX_MGMT_NONE; 1853 return RX_MGMT_NONE;
1854 1854
1855 if (!ifmgd->associated || 1855 if (!ifmgd->associated ||
1856 compare_ether_addr(mgmt->bssid, ifmgd->associated->bssid)) 1856 !ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
1857 return RX_MGMT_NONE; 1857 return RX_MGMT_NONE;
1858 1858
1859 bssid = ifmgd->associated->bssid; 1859 bssid = ifmgd->associated->bssid;
@@ -1886,7 +1886,7 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1886 return RX_MGMT_NONE; 1886 return RX_MGMT_NONE;
1887 1887
1888 if (!ifmgd->associated || 1888 if (!ifmgd->associated ||
1889 compare_ether_addr(mgmt->bssid, ifmgd->associated->bssid)) 1889 !ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
1890 return RX_MGMT_NONE; 1890 return RX_MGMT_NONE;
1891 1891
1892 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); 1892 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
@@ -2113,7 +2113,7 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2113 2113
2114 if (!assoc_data) 2114 if (!assoc_data)
2115 return RX_MGMT_NONE; 2115 return RX_MGMT_NONE;
2116 if (compare_ether_addr(assoc_data->bss->bssid, mgmt->bssid)) 2116 if (!ether_addr_equal(assoc_data->bss->bssid, mgmt->bssid))
2117 return RX_MGMT_NONE; 2117 return RX_MGMT_NONE;
2118 2118
2119 /* 2119 /*
@@ -2193,8 +2193,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2193 bool need_ps = false; 2193 bool need_ps = false;
2194 2194
2195 if (sdata->u.mgd.associated && 2195 if (sdata->u.mgd.associated &&
2196 compare_ether_addr(mgmt->bssid, sdata->u.mgd.associated->bssid) 2196 ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) {
2197 == 0) {
2198 bss = (void *)sdata->u.mgd.associated->priv; 2197 bss = (void *)sdata->u.mgd.associated->priv;
2199 /* not previously set so we may need to recalc */ 2198 /* not previously set so we may need to recalc */
2200 need_ps = !bss->dtim_period; 2199 need_ps = !bss->dtim_period;
@@ -2249,7 +2248,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
2249 2248
2250 ASSERT_MGD_MTX(ifmgd); 2249 ASSERT_MGD_MTX(ifmgd);
2251 2250
2252 if (compare_ether_addr(mgmt->da, sdata->vif.addr)) 2251 if (!ether_addr_equal(mgmt->da, sdata->vif.addr))
2253 return; /* ignore ProbeResp to foreign address */ 2252 return; /* ignore ProbeResp to foreign address */
2254 2253
2255 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; 2254 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
@@ -2262,12 +2261,11 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
2262 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, false); 2261 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, false);
2263 2262
2264 if (ifmgd->associated && 2263 if (ifmgd->associated &&
2265 compare_ether_addr(mgmt->bssid, ifmgd->associated->bssid) == 0) 2264 ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
2266 ieee80211_reset_ap_probe(sdata); 2265 ieee80211_reset_ap_probe(sdata);
2267 2266
2268 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies && 2267 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies &&
2269 compare_ether_addr(mgmt->bssid, ifmgd->auth_data->bss->bssid) 2268 ether_addr_equal(mgmt->bssid, ifmgd->auth_data->bss->bssid)) {
2270 == 0) {
2271 /* got probe response, continue with auth */ 2269 /* got probe response, continue with auth */
2272 printk(KERN_DEBUG "%s: direct probe responded\n", sdata->name); 2270 printk(KERN_DEBUG "%s: direct probe responded\n", sdata->name);
2273 ifmgd->auth_data->tries = 0; 2271 ifmgd->auth_data->tries = 0;
@@ -2324,8 +2322,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2324 return; 2322 return;
2325 2323
2326 if (ifmgd->assoc_data && !ifmgd->assoc_data->have_beacon && 2324 if (ifmgd->assoc_data && !ifmgd->assoc_data->have_beacon &&
2327 compare_ether_addr(mgmt->bssid, ifmgd->assoc_data->bss->bssid) 2325 ether_addr_equal(mgmt->bssid, ifmgd->assoc_data->bss->bssid)) {
2328 == 0) {
2329 ieee802_11_parse_elems(mgmt->u.beacon.variable, 2326 ieee802_11_parse_elems(mgmt->u.beacon.variable,
2330 len - baselen, &elems); 2327 len - baselen, &elems);
2331 2328
@@ -2340,7 +2337,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2340 } 2337 }
2341 2338
2342 if (!ifmgd->associated || 2339 if (!ifmgd->associated ||
2343 compare_ether_addr(mgmt->bssid, ifmgd->associated->bssid)) 2340 !ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
2344 return; 2341 return;
2345 bssid = ifmgd->associated->bssid; 2342 bssid = ifmgd->associated->bssid;
2346 2343
@@ -2407,10 +2404,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2407 2404
2408 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) { 2405 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) {
2409#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2406#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
2410 if (net_ratelimit()) { 2407 net_dbg_ratelimited("%s: cancelling probereq poll due to a received beacon\n",
2411 printk(KERN_DEBUG "%s: cancelling probereq poll due " 2408 sdata->name);
2412 "to a received beacon\n", sdata->name);
2413 }
2414#endif 2409#endif
2415 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; 2410 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL;
2416 mutex_lock(&local->iflist_mtx); 2411 mutex_lock(&local->iflist_mtx);
@@ -3166,7 +3161,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3166 return err; 3161 return err;
3167 } 3162 }
3168 } else 3163 } else
3169 WARN_ON_ONCE(compare_ether_addr(ifmgd->bssid, cbss->bssid)); 3164 WARN_ON_ONCE(!ether_addr_equal(ifmgd->bssid, cbss->bssid));
3170 3165
3171 return 0; 3166 return 0;
3172} 3167}
@@ -3306,7 +3301,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3306 bool match; 3301 bool match;
3307 3302
3308 /* keep sta info, bssid if matching */ 3303 /* keep sta info, bssid if matching */
3309 match = compare_ether_addr(ifmgd->bssid, req->bss->bssid) == 0; 3304 match = ether_addr_equal(ifmgd->bssid, req->bss->bssid);
3310 ieee80211_destroy_auth_data(sdata, match); 3305 ieee80211_destroy_auth_data(sdata, match);
3311 } 3306 }
3312 3307
@@ -3466,7 +3461,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
3466 sdata->name, req->bssid, req->reason_code); 3461 sdata->name, req->bssid, req->reason_code);
3467 3462
3468 if (ifmgd->associated && 3463 if (ifmgd->associated &&
3469 compare_ether_addr(ifmgd->associated->bssid, req->bssid) == 0) 3464 ether_addr_equal(ifmgd->associated->bssid, req->bssid))
3470 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 3465 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
3471 req->reason_code, true, frame_buf); 3466 req->reason_code, true, frame_buf);
3472 else 3467 else
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 489093b08a4a..7bcecf73aafb 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -492,12 +492,12 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
492 if (ieee80211_has_tods(hdr->frame_control) || 492 if (ieee80211_has_tods(hdr->frame_control) ||
493 !ieee80211_has_fromds(hdr->frame_control)) 493 !ieee80211_has_fromds(hdr->frame_control))
494 return RX_DROP_MONITOR; 494 return RX_DROP_MONITOR;
495 if (compare_ether_addr(hdr->addr3, dev_addr) == 0) 495 if (ether_addr_equal(hdr->addr3, dev_addr))
496 return RX_DROP_MONITOR; 496 return RX_DROP_MONITOR;
497 } else { 497 } else {
498 if (!ieee80211_has_a4(hdr->frame_control)) 498 if (!ieee80211_has_a4(hdr->frame_control))
499 return RX_DROP_MONITOR; 499 return RX_DROP_MONITOR;
500 if (compare_ether_addr(hdr->addr4, dev_addr) == 0) 500 if (ether_addr_equal(hdr->addr4, dev_addr))
501 return RX_DROP_MONITOR; 501 return RX_DROP_MONITOR;
502 } 502 }
503 } 503 }
@@ -1275,7 +1275,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
1275 if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { 1275 if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) {
1276 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, 1276 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len,
1277 NL80211_IFTYPE_ADHOC); 1277 NL80211_IFTYPE_ADHOC);
1278 if (compare_ether_addr(bssid, rx->sdata->u.ibss.bssid) == 0) { 1278 if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid)) {
1279 sta->last_rx = jiffies; 1279 sta->last_rx = jiffies;
1280 if (ieee80211_is_data(hdr->frame_control)) { 1280 if (ieee80211_is_data(hdr->frame_control)) {
1281 sta->last_rx_rate_idx = status->rate_idx; 1281 sta->last_rx_rate_idx = status->rate_idx;
@@ -1438,8 +1438,8 @@ ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata,
1438 */ 1438 */
1439 if (((hdr->frame_control ^ f_hdr->frame_control) & 1439 if (((hdr->frame_control ^ f_hdr->frame_control) &
1440 cpu_to_le16(IEEE80211_FCTL_FTYPE)) || 1440 cpu_to_le16(IEEE80211_FCTL_FTYPE)) ||
1441 compare_ether_addr(hdr->addr1, f_hdr->addr1) != 0 || 1441 !ether_addr_equal(hdr->addr1, f_hdr->addr1) ||
1442 compare_ether_addr(hdr->addr2, f_hdr->addr2) != 0) 1442 !ether_addr_equal(hdr->addr2, f_hdr->addr2))
1443 continue; 1443 continue;
1444 1444
1445 if (time_after(jiffies, entry->first_frag_time + 2 * HZ)) { 1445 if (time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
@@ -1714,8 +1714,8 @@ static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc)
1714 * of whether the frame was encrypted or not. 1714 * of whether the frame was encrypted or not.
1715 */ 1715 */
1716 if (ehdr->h_proto == rx->sdata->control_port_protocol && 1716 if (ehdr->h_proto == rx->sdata->control_port_protocol &&
1717 (compare_ether_addr(ehdr->h_dest, rx->sdata->vif.addr) == 0 || 1717 (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
1718 compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0)) 1718 ether_addr_equal(ehdr->h_dest, pae_group_addr)))
1719 return true; 1719 return true;
1720 1720
1721 if (ieee80211_802_1x_port_control(rx) || 1721 if (ieee80211_802_1x_port_control(rx) ||
@@ -1752,9 +1752,9 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1752 * local net stack and back to the wireless medium 1752 * local net stack and back to the wireless medium
1753 */ 1753 */
1754 xmit_skb = skb_copy(skb, GFP_ATOMIC); 1754 xmit_skb = skb_copy(skb, GFP_ATOMIC);
1755 if (!xmit_skb && net_ratelimit()) 1755 if (!xmit_skb)
1756 printk(KERN_DEBUG "%s: failed to clone " 1756 net_dbg_ratelimited("%s: failed to clone multicast frame\n",
1757 "multicast frame\n", dev->name); 1757 dev->name);
1758 } else { 1758 } else {
1759 dsta = sta_info_get(sdata, skb->data); 1759 dsta = sta_info_get(sdata, skb->data);
1760 if (dsta) { 1760 if (dsta) {
@@ -1925,7 +1925,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1925 mpp_path_add(proxied_addr, mpp_addr, sdata); 1925 mpp_path_add(proxied_addr, mpp_addr, sdata);
1926 } else { 1926 } else {
1927 spin_lock_bh(&mppath->state_lock); 1927 spin_lock_bh(&mppath->state_lock);
1928 if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) 1928 if (!ether_addr_equal(mppath->mpp, mpp_addr))
1929 memcpy(mppath->mpp, mpp_addr, ETH_ALEN); 1929 memcpy(mppath->mpp, mpp_addr, ETH_ALEN);
1930 spin_unlock_bh(&mppath->state_lock); 1930 spin_unlock_bh(&mppath->state_lock);
1931 } 1931 }
@@ -1934,7 +1934,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1934 1934
1935 /* Frame has reached destination. Don't forward */ 1935 /* Frame has reached destination. Don't forward */
1936 if (!is_multicast_ether_addr(hdr->addr1) && 1936 if (!is_multicast_ether_addr(hdr->addr1) &&
1937 compare_ether_addr(sdata->vif.addr, hdr->addr3) == 0) 1937 ether_addr_equal(sdata->vif.addr, hdr->addr3))
1938 return RX_CONTINUE; 1938 return RX_CONTINUE;
1939 1939
1940 q = ieee80211_select_queue_80211(local, skb, hdr); 1940 q = ieee80211_select_queue_80211(local, skb, hdr);
@@ -1957,9 +1957,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1957 1957
1958 fwd_skb = skb_copy(skb, GFP_ATOMIC); 1958 fwd_skb = skb_copy(skb, GFP_ATOMIC);
1959 if (!fwd_skb) { 1959 if (!fwd_skb) {
1960 if (net_ratelimit()) 1960 net_dbg_ratelimited("%s: failed to clone mesh frame\n",
1961 printk(KERN_DEBUG "%s: failed to clone mesh frame\n", 1961 sdata->name);
1962 sdata->name);
1963 goto out; 1962 goto out;
1964 } 1963 }
1965 1964
@@ -2122,13 +2121,13 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata,
2122 struct sk_buff *skb; 2121 struct sk_buff *skb;
2123 struct ieee80211_mgmt *resp; 2122 struct ieee80211_mgmt *resp;
2124 2123
2125 if (compare_ether_addr(mgmt->da, sdata->vif.addr) != 0) { 2124 if (!ether_addr_equal(mgmt->da, sdata->vif.addr)) {
2126 /* Not to own unicast address */ 2125 /* Not to own unicast address */
2127 return; 2126 return;
2128 } 2127 }
2129 2128
2130 if (compare_ether_addr(mgmt->sa, sdata->u.mgd.bssid) != 0 || 2129 if (!ether_addr_equal(mgmt->sa, sdata->u.mgd.bssid) ||
2131 compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid) != 0) { 2130 !ether_addr_equal(mgmt->bssid, sdata->u.mgd.bssid)) {
2132 /* Not from the current AP or not associated yet. */ 2131 /* Not from the current AP or not associated yet. */
2133 return; 2132 return;
2134 } 2133 }
@@ -2338,7 +2337,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2338 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2337 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2339 break; 2338 break;
2340 2339
2341 if (compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid)) 2340 if (!ether_addr_equal(mgmt->bssid, sdata->u.mgd.bssid))
2342 break; 2341 break;
2343 2342
2344 goto queue; 2343 goto queue;
@@ -2772,7 +2771,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
2772 if (!bssid && !sdata->u.mgd.use_4addr) 2771 if (!bssid && !sdata->u.mgd.use_4addr)
2773 return 0; 2772 return 0;
2774 if (!multicast && 2773 if (!multicast &&
2775 compare_ether_addr(sdata->vif.addr, hdr->addr1) != 0) { 2774 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
2776 if (!(sdata->dev->flags & IFF_PROMISC) || 2775 if (!(sdata->dev->flags & IFF_PROMISC) ||
2777 sdata->u.mgd.use_4addr) 2776 sdata->u.mgd.use_4addr)
2778 return 0; 2777 return 0;
@@ -2790,8 +2789,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
2790 return 0; 2789 return 0;
2791 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2790 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
2792 } else if (!multicast && 2791 } else if (!multicast &&
2793 compare_ether_addr(sdata->vif.addr, 2792 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
2794 hdr->addr1) != 0) {
2795 if (!(sdata->dev->flags & IFF_PROMISC)) 2793 if (!(sdata->dev->flags & IFF_PROMISC))
2796 return 0; 2794 return 0;
2797 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2795 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
@@ -2807,8 +2805,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
2807 break; 2805 break;
2808 case NL80211_IFTYPE_MESH_POINT: 2806 case NL80211_IFTYPE_MESH_POINT:
2809 if (!multicast && 2807 if (!multicast &&
2810 compare_ether_addr(sdata->vif.addr, 2808 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
2811 hdr->addr1) != 0) {
2812 if (!(sdata->dev->flags & IFF_PROMISC)) 2809 if (!(sdata->dev->flags & IFF_PROMISC))
2813 return 0; 2810 return 0;
2814 2811
@@ -2818,8 +2815,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
2818 case NL80211_IFTYPE_AP_VLAN: 2815 case NL80211_IFTYPE_AP_VLAN:
2819 case NL80211_IFTYPE_AP: 2816 case NL80211_IFTYPE_AP:
2820 if (!bssid) { 2817 if (!bssid) {
2821 if (compare_ether_addr(sdata->vif.addr, 2818 if (!ether_addr_equal(sdata->vif.addr, hdr->addr1))
2822 hdr->addr1))
2823 return 0; 2819 return 0;
2824 } else if (!ieee80211_bssid_match(bssid, 2820 } else if (!ieee80211_bssid_match(bssid,
2825 sdata->vif.addr)) { 2821 sdata->vif.addr)) {
@@ -2841,7 +2837,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
2841 case NL80211_IFTYPE_WDS: 2837 case NL80211_IFTYPE_WDS:
2842 if (bssid || !ieee80211_is_data(hdr->frame_control)) 2838 if (bssid || !ieee80211_is_data(hdr->frame_control))
2843 return 0; 2839 return 0;
2844 if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) 2840 if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2))
2845 return 0; 2841 return 0;
2846 break; 2842 break;
2847 default: 2843 default:
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 8282284f835c..169da0742c81 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -194,7 +194,7 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
194 presp = ieee80211_is_probe_resp(fc); 194 presp = ieee80211_is_probe_resp(fc);
195 if (presp) { 195 if (presp) {
196 /* ignore ProbeResp to foreign address */ 196 /* ignore ProbeResp to foreign address */
197 if (compare_ether_addr(mgmt->da, sdata->vif.addr)) 197 if (!ether_addr_equal(mgmt->da, sdata->vif.addr))
198 return RX_DROP_MONITOR; 198 return RX_DROP_MONITOR;
199 199
200 presp = true; 200 presp = true;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 97a9d6639fb9..f5b1638fbf80 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -102,7 +102,7 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
102 lockdep_is_held(&local->sta_mtx)); 102 lockdep_is_held(&local->sta_mtx));
103 while (sta) { 103 while (sta) {
104 if (sta->sdata == sdata && 104 if (sta->sdata == sdata &&
105 compare_ether_addr(sta->sta.addr, addr) == 0) 105 ether_addr_equal(sta->sta.addr, addr))
106 break; 106 break;
107 sta = rcu_dereference_check(sta->hnext, 107 sta = rcu_dereference_check(sta->hnext,
108 lockdep_is_held(&local->sta_mtx)); 108 lockdep_is_held(&local->sta_mtx));
@@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
125 while (sta) { 125 while (sta) {
126 if ((sta->sdata == sdata || 126 if ((sta->sdata == sdata ||
127 (sta->sdata->bss && sta->sdata->bss == sdata->bss)) && 127 (sta->sdata->bss && sta->sdata->bss == sdata->bss)) &&
128 compare_ether_addr(sta->sta.addr, addr) == 0) 128 ether_addr_equal(sta->sta.addr, addr))
129 break; 129 break;
130 sta = rcu_dereference_check(sta->hnext, 130 sta = rcu_dereference_check(sta->hnext,
131 lockdep_is_held(&local->sta_mtx)); 131 lockdep_is_held(&local->sta_mtx));
@@ -302,7 +302,7 @@ static int sta_info_insert_check(struct sta_info *sta)
302 if (unlikely(!ieee80211_sdata_running(sdata))) 302 if (unlikely(!ieee80211_sdata_running(sdata)))
303 return -ENETDOWN; 303 return -ENETDOWN;
304 304
305 if (WARN_ON(compare_ether_addr(sta->sta.addr, sdata->vif.addr) == 0 || 305 if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
306 is_multicast_ether_addr(sta->sta.addr))) 306 is_multicast_ether_addr(sta->sta.addr)))
307 return -EINVAL; 307 return -EINVAL;
308 308
@@ -912,7 +912,7 @@ struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw,
912 */ 912 */
913 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) { 913 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) {
914 if (localaddr && 914 if (localaddr &&
915 compare_ether_addr(sta->sdata->vif.addr, localaddr) != 0) 915 !ether_addr_equal(sta->sdata->vif.addr, localaddr))
916 continue; 916 continue;
917 if (!sta->uploaded) 917 if (!sta->uploaded)
918 return NULL; 918 return NULL;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 663dc90c4e31..3bb24a121c95 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -502,7 +502,7 @@ void for_each_sta_info_type_check(struct ieee80211_local *local,
502 nxt = _sta ? rcu_dereference(_sta->hnext) : NULL \ 502 nxt = _sta ? rcu_dereference(_sta->hnext) : NULL \
503 ) \ 503 ) \
504 /* compare address and run code only if it matches */ \ 504 /* compare address and run code only if it matches */ \
505 if (compare_ether_addr(_sta->sta.addr, (_addr)) == 0) 505 if (ether_addr_equal(_sta->sta.addr, (_addr)))
506 506
507/* 507/*
508 * Get STA info by index, BROKEN! 508 * Get STA info by index, BROKEN!
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 05f257aa2e08..28cfa981cfb1 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -384,7 +384,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
384 384
385 for_each_sta_info(local, hdr->addr1, sta, tmp) { 385 for_each_sta_info(local, hdr->addr1, sta, tmp) {
386 /* skip wrong virtual interface */ 386 /* skip wrong virtual interface */
387 if (compare_ether_addr(hdr->addr2, sta->sdata->vif.addr)) 387 if (!ether_addr_equal(hdr->addr2, sta->sdata->vif.addr))
388 continue; 388 continue;
389 389
390 if (info->flags & IEEE80211_TX_STATUS_EOSP) 390 if (info->flags & IEEE80211_TX_STATUS_EOSP)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d67d36f57d78..5f827a6b0d8d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -413,9 +413,8 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)
413 413
414 if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= AP_MAX_BC_BUFFER) { 414 if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= AP_MAX_BC_BUFFER) {
415#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 415#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
416 if (net_ratelimit()) 416 net_dbg_ratelimited("%s: BC TX buffer full - dropping the oldest frame\n",
417 printk(KERN_DEBUG "%s: BC TX buffer full - dropping the oldest frame\n", 417 tx->sdata->name);
418 tx->sdata->name);
419#endif 418#endif
420 dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf)); 419 dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf));
421 } else 420 } else
@@ -476,10 +475,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
476 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { 475 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) {
477 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); 476 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]);
478#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 477#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
479 if (net_ratelimit()) 478 net_dbg_ratelimited("%s: STA %pM TX buffer for AC %d full - dropping oldest frame\n",
480 printk(KERN_DEBUG "%s: STA %pM TX buffer for " 479 tx->sdata->name, sta->sta.addr, ac);
481 "AC %d full - dropping oldest frame\n",
482 tx->sdata->name, sta->sta.addr, ac);
483#endif 480#endif
484 dev_kfree_skb(old); 481 dev_kfree_skb(old);
485 } else 482 } else
@@ -1665,7 +1662,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1665 skb->len >= len_rthdr + hdrlen + sizeof(rfc1042_header) + 2) { 1662 skb->len >= len_rthdr + hdrlen + sizeof(rfc1042_header) + 2) {
1666 u8 *payload = (u8 *)hdr + hdrlen; 1663 u8 *payload = (u8 *)hdr + hdrlen;
1667 1664
1668 if (compare_ether_addr(payload, rfc1042_header) == 0) 1665 if (ether_addr_equal(payload, rfc1042_header))
1669 skb->protocol = cpu_to_be16((payload[6] << 8) | 1666 skb->protocol = cpu_to_be16((payload[6] << 8) |
1670 payload[7]); 1667 payload[7]);
1671 } 1668 }
@@ -1698,7 +1695,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1698 tmp_sdata->vif.type == NL80211_IFTYPE_AP_VLAN || 1695 tmp_sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
1699 tmp_sdata->vif.type == NL80211_IFTYPE_WDS) 1696 tmp_sdata->vif.type == NL80211_IFTYPE_WDS)
1700 continue; 1697 continue;
1701 if (compare_ether_addr(tmp_sdata->vif.addr, hdr->addr2) == 0) { 1698 if (ether_addr_equal(tmp_sdata->vif.addr, hdr->addr2)) {
1702 sdata = tmp_sdata; 1699 sdata = tmp_sdata;
1703 break; 1700 break;
1704 } 1701 }
@@ -1815,9 +1812,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1815 * is being proxied by a portal (i.e. portal address 1812 * is being proxied by a portal (i.e. portal address
1816 * differs from proxied address) 1813 * differs from proxied address)
1817 */ 1814 */
1818 if (compare_ether_addr(sdata->vif.addr, 1815 if (ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN) &&
1819 skb->data + ETH_ALEN) == 0 && 1816 !(mppath && !ether_addr_equal(mppath->mpp, skb->data))) {
1820 !(mppath && compare_ether_addr(mppath->mpp, skb->data))) {
1821 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, 1817 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
1822 skb->data, skb->data + ETH_ALEN); 1818 skb->data, skb->data + ETH_ALEN);
1823 rcu_read_unlock(); 1819 rcu_read_unlock();
@@ -1964,12 +1960,10 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1964 if (unlikely(!ieee80211_vif_is_mesh(&sdata->vif) && 1960 if (unlikely(!ieee80211_vif_is_mesh(&sdata->vif) &&
1965 !is_multicast_ether_addr(hdr.addr1) && !authorized && 1961 !is_multicast_ether_addr(hdr.addr1) && !authorized &&
1966 (cpu_to_be16(ethertype) != sdata->control_port_protocol || 1962 (cpu_to_be16(ethertype) != sdata->control_port_protocol ||
1967 compare_ether_addr(sdata->vif.addr, skb->data + ETH_ALEN)))) { 1963 !ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) {
1968#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1964#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1969 if (net_ratelimit()) 1965 net_dbg_ratelimited("%s: dropped frame to %pM (unauthorized port)\n",
1970 printk(KERN_DEBUG "%s: dropped frame to %pM" 1966 dev->name, hdr.addr1);
1971 " (unauthorized port)\n", dev->name,
1972 hdr.addr1);
1973#endif 1967#endif
1974 1968
1975 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port); 1969 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);