diff options
author | Joe Perches <joe@perches.com> | 2012-05-09 13:17:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:33:01 -0400 |
commit | 2e42e4747ea72943c21551d8a206b51a9893b1e0 (patch) | |
tree | a92473c485911b51e1d960c9c8fa34dfc9be0a46 /drivers | |
parent | 39f1d94d300a58eb3e9b851d077cada4e2fa9d46 (diff) |
drivers/net: Convert compare_ether_addr to ether_addr_equal
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.
Done via cocci script:
$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
31 files changed, 85 insertions, 86 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 16dbf53e314b..bbb004354bbd 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1961,7 +1961,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1961 | write_lock_bh(&bond->lock); | 1961 | write_lock_bh(&bond->lock); |
1962 | 1962 | ||
1963 | if (!bond->params.fail_over_mac) { | 1963 | if (!bond->params.fail_over_mac) { |
1964 | if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && | 1964 | if (ether_addr_equal(bond_dev->dev_addr, slave->perm_hwaddr) && |
1965 | bond->slave_cnt > 1) | 1965 | bond->slave_cnt > 1) |
1966 | pr_warning("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s. Set the HWaddr of %s to a different address to avoid conflicts.\n", | 1966 | pr_warning("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s. Set the HWaddr of %s to a different address to avoid conflicts.\n", |
1967 | bond_dev->name, slave_dev->name, | 1967 | bond_dev->name, slave_dev->name, |
diff --git a/drivers/net/ethernet/amd/depca.c b/drivers/net/ethernet/amd/depca.c index 86dd95766a64..7f7b99a5f024 100644 --- a/drivers/net/ethernet/amd/depca.c +++ b/drivers/net/ethernet/amd/depca.c | |||
@@ -1079,7 +1079,8 @@ static int depca_rx(struct net_device *dev) | |||
1079 | } else { | 1079 | } else { |
1080 | lp->pktStats.multicast++; | 1080 | lp->pktStats.multicast++; |
1081 | } | 1081 | } |
1082 | } else if (compare_ether_addr(buf, dev->dev_addr) == 0) { | 1082 | } else if (ether_addr_equal(buf, |
1083 | dev->dev_addr)) { | ||
1083 | lp->pktStats.unicast++; | 1084 | lp->pktStats.unicast++; |
1084 | } | 1085 | } |
1085 | 1086 | ||
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index d7ac6c17547c..8132c785cea8 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -944,8 +944,7 @@ static void enic_update_multicast_addr_list(struct enic *enic) | |||
944 | 944 | ||
945 | for (i = 0; i < enic->mc_count; i++) { | 945 | for (i = 0; i < enic->mc_count; i++) { |
946 | for (j = 0; j < mc_count; j++) | 946 | for (j = 0; j < mc_count; j++) |
947 | if (compare_ether_addr(enic->mc_addr[i], | 947 | if (ether_addr_equal(enic->mc_addr[i], mc_addr[j])) |
948 | mc_addr[j]) == 0) | ||
949 | break; | 948 | break; |
950 | if (j == mc_count) | 949 | if (j == mc_count) |
951 | enic_dev_del_addr(enic, enic->mc_addr[i]); | 950 | enic_dev_del_addr(enic, enic->mc_addr[i]); |
@@ -953,8 +952,7 @@ static void enic_update_multicast_addr_list(struct enic *enic) | |||
953 | 952 | ||
954 | for (i = 0; i < mc_count; i++) { | 953 | for (i = 0; i < mc_count; i++) { |
955 | for (j = 0; j < enic->mc_count; j++) | 954 | for (j = 0; j < enic->mc_count; j++) |
956 | if (compare_ether_addr(mc_addr[i], | 955 | if (ether_addr_equal(mc_addr[i], enic->mc_addr[j])) |
957 | enic->mc_addr[j]) == 0) | ||
958 | break; | 956 | break; |
959 | if (j == enic->mc_count) | 957 | if (j == enic->mc_count) |
960 | enic_dev_add_addr(enic, mc_addr[i]); | 958 | enic_dev_add_addr(enic, mc_addr[i]); |
@@ -999,8 +997,7 @@ static void enic_update_unicast_addr_list(struct enic *enic) | |||
999 | 997 | ||
1000 | for (i = 0; i < enic->uc_count; i++) { | 998 | for (i = 0; i < enic->uc_count; i++) { |
1001 | for (j = 0; j < uc_count; j++) | 999 | for (j = 0; j < uc_count; j++) |
1002 | if (compare_ether_addr(enic->uc_addr[i], | 1000 | if (ether_addr_equal(enic->uc_addr[i], uc_addr[j])) |
1003 | uc_addr[j]) == 0) | ||
1004 | break; | 1001 | break; |
1005 | if (j == uc_count) | 1002 | if (j == uc_count) |
1006 | enic_dev_del_addr(enic, enic->uc_addr[i]); | 1003 | enic_dev_del_addr(enic, enic->uc_addr[i]); |
@@ -1008,8 +1005,7 @@ static void enic_update_unicast_addr_list(struct enic *enic) | |||
1008 | 1005 | ||
1009 | for (i = 0; i < uc_count; i++) { | 1006 | for (i = 0; i < uc_count; i++) { |
1010 | for (j = 0; j < enic->uc_count; j++) | 1007 | for (j = 0; j < enic->uc_count; j++) |
1011 | if (compare_ether_addr(uc_addr[i], | 1008 | if (ether_addr_equal(uc_addr[i], enic->uc_addr[j])) |
1012 | enic->uc_addr[j]) == 0) | ||
1013 | break; | 1009 | break; |
1014 | if (j == enic->uc_count) | 1010 | if (j == enic->uc_count) |
1015 | enic_dev_add_addr(enic, uc_addr[i]); | 1011 | enic_dev_add_addr(enic, uc_addr[i]); |
diff --git a/drivers/net/ethernet/dec/ewrk3.c b/drivers/net/ethernet/dec/ewrk3.c index 1879f84a25a3..17ae8c619680 100644 --- a/drivers/net/ethernet/dec/ewrk3.c +++ b/drivers/net/ethernet/dec/ewrk3.c | |||
@@ -1016,7 +1016,8 @@ static int ewrk3_rx(struct net_device *dev) | |||
1016 | } else { | 1016 | } else { |
1017 | lp->pktStats.multicast++; | 1017 | lp->pktStats.multicast++; |
1018 | } | 1018 | } |
1019 | } else if (compare_ether_addr(p, dev->dev_addr) == 0) { | 1019 | } else if (ether_addr_equal(p, |
1020 | dev->dev_addr)) { | ||
1020 | lp->pktStats.unicast++; | 1021 | lp->pktStats.unicast++; |
1021 | } | 1022 | } |
1022 | lp->pktStats.bins[0]++; /* Duplicates stats.rx_packets */ | 1023 | lp->pktStats.bins[0]++; /* Duplicates stats.rx_packets */ |
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c index 18b106cc6d2b..d3cd489d11a2 100644 --- a/drivers/net/ethernet/dec/tulip/de4x5.c +++ b/drivers/net/ethernet/dec/tulip/de4x5.c | |||
@@ -1874,7 +1874,7 @@ de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len) | |||
1874 | } else { | 1874 | } else { |
1875 | lp->pktStats.multicast++; | 1875 | lp->pktStats.multicast++; |
1876 | } | 1876 | } |
1877 | } else if (compare_ether_addr(buf, dev->dev_addr) == 0) { | 1877 | } else if (ether_addr_equal(buf, dev->dev_addr)) { |
1878 | lp->pktStats.unicast++; | 1878 | lp->pktStats.unicast++; |
1879 | } | 1879 | } |
1880 | 1880 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 5c4713521d4c..46e77a2c5121 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -1965,7 +1965,7 @@ qlcnic_send_filter(struct qlcnic_adapter *adapter, | |||
1965 | __le16 vlan_id = 0; | 1965 | __le16 vlan_id = 0; |
1966 | u8 hindex; | 1966 | u8 hindex; |
1967 | 1967 | ||
1968 | if (!compare_ether_addr(phdr->h_source, adapter->mac_addr)) | 1968 | if (ether_addr_equal(phdr->h_source, adapter->mac_addr)) |
1969 | return; | 1969 | return; |
1970 | 1970 | ||
1971 | if (adapter->fhash.fnum >= adapter->fhash.fmax) | 1971 | if (adapter->fhash.fnum >= adapter->fhash.fmax) |
@@ -2235,8 +2235,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2235 | 2235 | ||
2236 | if (adapter->flags & QLCNIC_MACSPOOF) { | 2236 | if (adapter->flags & QLCNIC_MACSPOOF) { |
2237 | phdr = (struct ethhdr *)skb->data; | 2237 | phdr = (struct ethhdr *)skb->data; |
2238 | if (compare_ether_addr(phdr->h_source, | 2238 | if (!ether_addr_equal(phdr->h_source, adapter->mac_addr)) |
2239 | adapter->mac_addr)) | ||
2240 | goto drop_packet; | 2239 | goto drop_packet; |
2241 | } | 2240 | } |
2242 | 2241 | ||
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index b0a4558de248..03ded364c8da 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -1023,7 +1023,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx, | |||
1023 | return -EINVAL; | 1023 | return -EINVAL; |
1024 | 1024 | ||
1025 | /* Is it a default UC or MC filter? */ | 1025 | /* Is it a default UC or MC filter? */ |
1026 | if (!compare_ether_addr(mac_mask->h_dest, mac_addr_mc_mask) && | 1026 | if (ether_addr_equal(mac_mask->h_dest, mac_addr_mc_mask) && |
1027 | vlan_tag_mask == 0) { | 1027 | vlan_tag_mask == 0) { |
1028 | if (is_multicast_ether_addr(mac_entry->h_dest)) | 1028 | if (is_multicast_ether_addr(mac_entry->h_dest)) |
1029 | rc = efx_filter_set_mc_def(&spec); | 1029 | rc = efx_filter_set_mc_def(&spec); |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 38e3ae9155b7..a108db35924e 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -618,7 +618,7 @@ struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) | |||
618 | struct vnet_port *port; | 618 | struct vnet_port *port; |
619 | 619 | ||
620 | hlist_for_each_entry(port, n, hp, hash) { | 620 | hlist_for_each_entry(port, n, hp, hash) { |
621 | if (!compare_ether_addr(port->raddr, skb->data)) | 621 | if (ether_addr_equal(port->raddr, skb->data)) |
622 | return port; | 622 | return port; |
623 | } | 623 | } |
624 | port = NULL; | 624 | port = NULL; |
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 3d501ec7fad7..96070e9b50dc 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -843,7 +843,7 @@ static bool tile_net_poll_aux(struct tile_net_cpu *info, int index) | |||
843 | if (!is_multicast_ether_addr(buf)) { | 843 | if (!is_multicast_ether_addr(buf)) { |
844 | /* Filter packets not for our address. */ | 844 | /* Filter packets not for our address. */ |
845 | const u8 *mine = dev->dev_addr; | 845 | const u8 *mine = dev->dev_addr; |
846 | filter = compare_ether_addr(mine, buf); | 846 | filter = !ether_addr_equal(mine, buf); |
847 | } | 847 | } |
848 | } | 848 | } |
849 | 849 | ||
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c index 5c14f82c4954..961c8321451f 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | |||
@@ -1590,8 +1590,8 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) | |||
1590 | found = 0; | 1590 | found = 0; |
1591 | oldest = NULL; | 1591 | oldest = NULL; |
1592 | list_for_each_entry(target, &wl->network_list, list) { | 1592 | list_for_each_entry(target, &wl->network_list, list) { |
1593 | if (!compare_ether_addr(&target->hwinfo->bssid[2], | 1593 | if (ether_addr_equal(&target->hwinfo->bssid[2], |
1594 | &scan_info->bssid[2])) { | 1594 | &scan_info->bssid[2])) { |
1595 | found = 1; | 1595 | found = 1; |
1596 | pr_debug("%s: same BBS found scanned list\n", | 1596 | pr_debug("%s: same BBS found scanned list\n", |
1597 | __func__); | 1597 | __func__); |
@@ -1691,8 +1691,8 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl) | |||
1691 | 1691 | ||
1692 | /* If bss specified, check it only */ | 1692 | /* If bss specified, check it only */ |
1693 | if (test_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat)) { | 1693 | if (test_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat)) { |
1694 | if (!compare_ether_addr(&scan_info->hwinfo->bssid[2], | 1694 | if (ether_addr_equal(&scan_info->hwinfo->bssid[2], |
1695 | wl->bssid)) { | 1695 | wl->bssid)) { |
1696 | best_bss = scan_info; | 1696 | best_bss = scan_info; |
1697 | pr_debug("%s: bssid matched\n", __func__); | 1697 | pr_debug("%s: bssid matched\n", __func__); |
1698 | break; | 1698 | break; |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index bb8c72c79c6f..987aeefbc774 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -313,7 +313,7 @@ static int run_filter(struct tap_filter *filter, const struct sk_buff *skb) | |||
313 | 313 | ||
314 | /* Exact match */ | 314 | /* Exact match */ |
315 | for (i = 0; i < filter->count; i++) | 315 | for (i = 0; i < filter->count; i++) |
316 | if (!compare_ether_addr(eh->h_dest, filter->addr[i])) | 316 | if (ether_addr_equal(eh->h_dest, filter->addr[i])) |
317 | return 1; | 317 | return 1; |
318 | 318 | ||
319 | /* Inexact match (multicast only) */ | 319 | /* Inexact match (multicast only) */ |
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index faa8bcb4aac1..5ad74c85a038 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -1751,7 +1751,7 @@ static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1751 | * following workaround is necessary. If the TX frame is an | 1751 | * following workaround is necessary. If the TX frame is an |
1752 | * authentication frame extract the bssid and send the CMD_JOIN. */ | 1752 | * authentication frame extract the bssid and send the CMD_JOIN. */ |
1753 | if (mgmt->frame_control & cpu_to_le16(IEEE80211_STYPE_AUTH)) { | 1753 | if (mgmt->frame_control & cpu_to_le16(IEEE80211_STYPE_AUTH)) { |
1754 | if (compare_ether_addr(priv->bssid, mgmt->bssid)) { | 1754 | if (!ether_addr_equal(priv->bssid, mgmt->bssid)) { |
1755 | memcpy(priv->bssid, mgmt->bssid, ETH_ALEN); | 1755 | memcpy(priv->bssid, mgmt->bssid, ETH_ALEN); |
1756 | ieee80211_queue_work(hw, &priv->work_join_bssid); | 1756 | ieee80211_queue_work(hw, &priv->work_join_bssid); |
1757 | dev_kfree_skb_any(skb); | 1757 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 49e3b19cf781..0ba81a66061f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -462,7 +462,7 @@ void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
462 | } | 462 | } |
463 | 463 | ||
464 | if (iter_data->need_set_hw_addr && iter_data->hw_macaddr) | 464 | if (iter_data->need_set_hw_addr && iter_data->hw_macaddr) |
465 | if (compare_ether_addr(iter_data->hw_macaddr, mac) == 0) | 465 | if (ether_addr_equal(iter_data->hw_macaddr, mac)) |
466 | iter_data->need_set_hw_addr = false; | 466 | iter_data->need_set_hw_addr = false; |
467 | 467 | ||
468 | if (!iter_data->any_assoc) { | 468 | if (!iter_data->any_assoc) { |
@@ -1170,7 +1170,7 @@ ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1170 | 1170 | ||
1171 | if (ieee80211_is_beacon(mgmt->frame_control) && | 1171 | if (ieee80211_is_beacon(mgmt->frame_control) && |
1172 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && | 1172 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && |
1173 | compare_ether_addr(mgmt->bssid, common->curbssid) == 0) { | 1173 | ether_addr_equal(mgmt->bssid, common->curbssid)) { |
1174 | /* | 1174 | /* |
1175 | * Received an IBSS beacon with the same BSSID. Hardware *must* | 1175 | * Received an IBSS beacon with the same BSSID. Hardware *must* |
1176 | * have updated the local TSF. We have to work around various | 1176 | * have updated the local TSF. We have to work around various |
@@ -1234,7 +1234,7 @@ ath5k_update_beacon_rssi(struct ath5k_hw *ah, struct sk_buff *skb, int rssi) | |||
1234 | 1234 | ||
1235 | /* only beacons from our BSSID */ | 1235 | /* only beacons from our BSSID */ |
1236 | if (!ieee80211_is_beacon(mgmt->frame_control) || | 1236 | if (!ieee80211_is_beacon(mgmt->frame_control) || |
1237 | compare_ether_addr(mgmt->bssid, common->curbssid) != 0) | 1237 | !ether_addr_equal(mgmt->bssid, common->curbssid)) |
1238 | return; | 1238 | return; |
1239 | 1239 | ||
1240 | ewma_add(&ah->ah_beacon_rssi_avg, rssi); | 1240 | ewma_add(&ah->ah_beacon_rssi_avg, rssi); |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 544e5490ca2e..e1fcc68124dc 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1833,7 +1833,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1833 | if (ieee80211_is_beacon(hdr->frame_control)) { | 1833 | if (ieee80211_is_beacon(hdr->frame_control)) { |
1834 | RX_STAT_INC(rx_beacons); | 1834 | RX_STAT_INC(rx_beacons); |
1835 | if (!is_zero_ether_addr(common->curbssid) && | 1835 | if (!is_zero_ether_addr(common->curbssid) && |
1836 | !compare_ether_addr(hdr->addr3, common->curbssid)) | 1836 | ether_addr_equal(hdr->addr3, common->curbssid)) |
1837 | rs.is_mybeacon = true; | 1837 | rs.is_mybeacon = true; |
1838 | else | 1838 | else |
1839 | rs.is_mybeacon = false; | 1839 | rs.is_mybeacon = false; |
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c index dc99030ea8b6..84b22eec7abd 100644 --- a/drivers/net/wireless/ath/carl9170/rx.c +++ b/drivers/net/wireless/ath/carl9170/rx.c | |||
@@ -538,7 +538,7 @@ static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len) | |||
538 | return; | 538 | return; |
539 | 539 | ||
540 | /* and only beacons from the associated BSSID, please */ | 540 | /* and only beacons from the associated BSSID, please */ |
541 | if (compare_ether_addr(hdr->addr3, ar->common.curbssid) || | 541 | if (!ether_addr_equal(hdr->addr3, ar->common.curbssid) || |
542 | !ar->common.curaid) | 542 | !ar->common.curaid) |
543 | return; | 543 | return; |
544 | 544 | ||
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c index c4955d25a19a..02e057923236 100644 --- a/drivers/net/wireless/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/ipw2x00/libipw_rx.c | |||
@@ -77,8 +77,8 @@ static struct libipw_frag_entry *libipw_frag_cache_find(struct | |||
77 | 77 | ||
78 | if (entry->skb != NULL && entry->seq == seq && | 78 | if (entry->skb != NULL && entry->seq == seq && |
79 | (entry->last_frag + 1 == frag || frag == -1) && | 79 | (entry->last_frag + 1 == frag || frag == -1) && |
80 | !compare_ether_addr(entry->src_addr, src) && | 80 | ether_addr_equal(entry->src_addr, src) && |
81 | !compare_ether_addr(entry->dst_addr, dst)) | 81 | ether_addr_equal(entry->dst_addr, dst)) |
82 | return entry; | 82 | return entry; |
83 | } | 83 | } |
84 | 84 | ||
@@ -245,12 +245,12 @@ static int libipw_is_eapol_frame(struct libipw_device *ieee, | |||
245 | /* check that the frame is unicast frame to us */ | 245 | /* check that the frame is unicast frame to us */ |
246 | if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == | 246 | if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == |
247 | IEEE80211_FCTL_TODS && | 247 | IEEE80211_FCTL_TODS && |
248 | !compare_ether_addr(hdr->addr1, dev->dev_addr) && | 248 | ether_addr_equal(hdr->addr1, dev->dev_addr) && |
249 | !compare_ether_addr(hdr->addr3, dev->dev_addr)) { | 249 | ether_addr_equal(hdr->addr3, dev->dev_addr)) { |
250 | /* ToDS frame with own addr BSSID and DA */ | 250 | /* ToDS frame with own addr BSSID and DA */ |
251 | } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == | 251 | } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == |
252 | IEEE80211_FCTL_FROMDS && | 252 | IEEE80211_FCTL_FROMDS && |
253 | !compare_ether_addr(hdr->addr1, dev->dev_addr)) { | 253 | ether_addr_equal(hdr->addr1, dev->dev_addr)) { |
254 | /* FromDS frame with own addr as DA */ | 254 | /* FromDS frame with own addr as DA */ |
255 | } else | 255 | } else |
256 | return 0; | 256 | return 0; |
@@ -523,8 +523,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb, | |||
523 | 523 | ||
524 | if (ieee->iw_mode == IW_MODE_MASTER && !wds && | 524 | if (ieee->iw_mode == IW_MODE_MASTER && !wds && |
525 | (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == | 525 | (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == |
526 | IEEE80211_FCTL_FROMDS && ieee->stadev | 526 | IEEE80211_FCTL_FROMDS && ieee->stadev && |
527 | && !compare_ether_addr(hdr->addr2, ieee->assoc_ap_addr)) { | 527 | ether_addr_equal(hdr->addr2, ieee->assoc_ap_addr)) { |
528 | /* Frame from BSSID of the AP for which we are a client */ | 528 | /* Frame from BSSID of the AP for which we are a client */ |
529 | skb->dev = dev = ieee->stadev; | 529 | skb->dev = dev = ieee->stadev; |
530 | stats = hostap_get_stats(dev); | 530 | stats = hostap_get_stats(dev); |
@@ -1468,7 +1468,7 @@ static inline int is_same_network(struct libipw_network *src, | |||
1468 | * as one network */ | 1468 | * as one network */ |
1469 | return ((src->ssid_len == dst->ssid_len) && | 1469 | return ((src->ssid_len == dst->ssid_len) && |
1470 | (src->channel == dst->channel) && | 1470 | (src->channel == dst->channel) && |
1471 | !compare_ether_addr(src->bssid, dst->bssid) && | 1471 | ether_addr_equal(src->bssid, dst->bssid) && |
1472 | !memcmp(src->ssid, dst->ssid, src->ssid_len)); | 1472 | !memcmp(src->ssid, dst->ssid, src->ssid_len)); |
1473 | } | 1473 | } |
1474 | 1474 | ||
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c index b25c01be0d90..87e539894330 100644 --- a/drivers/net/wireless/iwlegacy/3945.c +++ b/drivers/net/wireless/iwlegacy/3945.c | |||
@@ -453,10 +453,10 @@ il3945_is_network_packet(struct il_priv *il, struct ieee80211_hdr *header) | |||
453 | switch (il->iw_mode) { | 453 | switch (il->iw_mode) { |
454 | case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ | 454 | case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ |
455 | /* packets to our IBSS update information */ | 455 | /* packets to our IBSS update information */ |
456 | return !compare_ether_addr(header->addr3, il->bssid); | 456 | return ether_addr_equal(header->addr3, il->bssid); |
457 | case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ | 457 | case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ |
458 | /* packets to our IBSS update information */ | 458 | /* packets to our IBSS update information */ |
459 | return !compare_ether_addr(header->addr2, il->bssid); | 459 | return ether_addr_equal(header->addr2, il->bssid); |
460 | default: | 460 | default: |
461 | return 1; | 461 | return 1; |
462 | } | 462 | } |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index f2baf94f069c..509301a5e7e2 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -2565,7 +2565,7 @@ il4965_find_station(struct il_priv *il, const u8 *addr) | |||
2565 | spin_lock_irqsave(&il->sta_lock, flags); | 2565 | spin_lock_irqsave(&il->sta_lock, flags); |
2566 | for (i = start; i < il->hw_params.max_stations; i++) | 2566 | for (i = start; i < il->hw_params.max_stations; i++) |
2567 | if (il->stations[i].used && | 2567 | if (il->stations[i].used && |
2568 | (!compare_ether_addr(il->stations[i].sta.sta.addr, addr))) { | 2568 | ether_addr_equal(il->stations[i].sta.sta.addr, addr)) { |
2569 | ret = i; | 2569 | ret = i; |
2570 | goto out; | 2570 | goto out; |
2571 | } | 2571 | } |
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index eaf249452e51..cbf2dc18341f 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -1896,8 +1896,8 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap, | |||
1896 | sta_id = il->hw_params.bcast_id; | 1896 | sta_id = il->hw_params.bcast_id; |
1897 | else | 1897 | else |
1898 | for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) { | 1898 | for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) { |
1899 | if (!compare_ether_addr | 1899 | if (ether_addr_equal(il->stations[i].sta.sta.addr, |
1900 | (il->stations[i].sta.sta.addr, addr)) { | 1900 | addr)) { |
1901 | sta_id = i; | 1901 | sta_id = i; |
1902 | break; | 1902 | break; |
1903 | } | 1903 | } |
@@ -1926,7 +1926,7 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap, | |||
1926 | 1926 | ||
1927 | if ((il->stations[sta_id].used & IL_STA_DRIVER_ACTIVE) && | 1927 | if ((il->stations[sta_id].used & IL_STA_DRIVER_ACTIVE) && |
1928 | (il->stations[sta_id].used & IL_STA_UCODE_ACTIVE) && | 1928 | (il->stations[sta_id].used & IL_STA_UCODE_ACTIVE) && |
1929 | !compare_ether_addr(il->stations[sta_id].sta.sta.addr, addr)) { | 1929 | ether_addr_equal(il->stations[sta_id].sta.sta.addr, addr)) { |
1930 | D_ASSOC("STA %d (%pM) already added, not adding again.\n", | 1930 | D_ASSOC("STA %d (%pM) already added, not adding again.\n", |
1931 | sta_id, addr); | 1931 | sta_id, addr); |
1932 | return sta_id; | 1932 | return sta_id; |
@@ -3744,10 +3744,10 @@ il_full_rxon_required(struct il_priv *il) | |||
3744 | 3744 | ||
3745 | /* These items are only settable from the full RXON command */ | 3745 | /* These items are only settable from the full RXON command */ |
3746 | CHK(!il_is_associated(il)); | 3746 | CHK(!il_is_associated(il)); |
3747 | CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr)); | 3747 | CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr)); |
3748 | CHK(compare_ether_addr(staging->node_addr, active->node_addr)); | 3748 | CHK(!ether_addr_equal(staging->node_addr, active->node_addr)); |
3749 | CHK(compare_ether_addr | 3749 | CHK(!ether_addr_equal(staging->wlap_bssid_addr, |
3750 | (staging->wlap_bssid_addr, active->wlap_bssid_addr)); | 3750 | active->wlap_bssid_addr)); |
3751 | CHK_NEQ(staging->dev_type, active->dev_type); | 3751 | CHK_NEQ(staging->dev_type, active->dev_type); |
3752 | CHK_NEQ(staging->channel, active->channel); | 3752 | CHK_NEQ(staging->channel, active->channel); |
3753 | CHK_NEQ(staging->air_propagation, active->air_propagation); | 3753 | CHK_NEQ(staging->air_propagation, active->air_propagation); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index 0c252c5d8bf1..779f819cc8cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -779,8 +779,8 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
779 | */ | 779 | */ |
780 | if (unlikely(ieee80211_is_beacon(fc) && priv->passive_no_rx)) { | 780 | if (unlikely(ieee80211_is_beacon(fc) && priv->passive_no_rx)) { |
781 | for_each_context(priv, ctx) { | 781 | for_each_context(priv, ctx) { |
782 | if (compare_ether_addr(hdr->addr3, | 782 | if (!ether_addr_equal(hdr->addr3, |
783 | ctx->active.bssid_addr)) | 783 | ctx->active.bssid_addr)) |
784 | continue; | 784 | continue; |
785 | iwlagn_lift_passive_no_rx(priv); | 785 | iwlagn_lift_passive_no_rx(priv); |
786 | } | 786 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index 0f7c444f2440..74fbee627306 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | |||
@@ -881,10 +881,10 @@ int iwl_full_rxon_required(struct iwl_priv *priv, | |||
881 | 881 | ||
882 | /* These items are only settable from the full RXON command */ | 882 | /* These items are only settable from the full RXON command */ |
883 | CHK(!iwl_is_associated_ctx(ctx)); | 883 | CHK(!iwl_is_associated_ctx(ctx)); |
884 | CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr)); | 884 | CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr)); |
885 | CHK(compare_ether_addr(staging->node_addr, active->node_addr)); | 885 | CHK(!ether_addr_equal(staging->node_addr, active->node_addr)); |
886 | CHK(compare_ether_addr(staging->wlap_bssid_addr, | 886 | CHK(!ether_addr_equal(staging->wlap_bssid_addr, |
887 | active->wlap_bssid_addr)); | 887 | active->wlap_bssid_addr)); |
888 | CHK_NEQ(staging->dev_type, active->dev_type); | 888 | CHK_NEQ(staging->dev_type, active->dev_type); |
889 | CHK_NEQ(staging->channel, active->channel); | 889 | CHK_NEQ(staging->channel, active->channel); |
890 | CHK_NEQ(staging->air_propagation, active->air_propagation); | 890 | CHK_NEQ(staging->air_propagation, active->air_propagation); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index 67e6f1d2a08b..b31584e87bc7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -322,8 +322,8 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
322 | sta_id = ctx->bcast_sta_id; | 322 | sta_id = ctx->bcast_sta_id; |
323 | else | 323 | else |
324 | for (i = IWL_STA_ID; i < IWLAGN_STATION_COUNT; i++) { | 324 | for (i = IWL_STA_ID; i < IWLAGN_STATION_COUNT; i++) { |
325 | if (!compare_ether_addr(priv->stations[i].sta.sta.addr, | 325 | if (ether_addr_equal(priv->stations[i].sta.sta.addr, |
326 | addr)) { | 326 | addr)) { |
327 | sta_id = i; | 327 | sta_id = i; |
328 | break; | 328 | break; |
329 | } | 329 | } |
@@ -353,7 +353,7 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
353 | 353 | ||
354 | if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) && | 354 | if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) && |
355 | (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) && | 355 | (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) && |
356 | !compare_ether_addr(priv->stations[sta_id].sta.sta.addr, addr)) { | 356 | ether_addr_equal(priv->stations[sta_id].sta.sta.addr, addr)) { |
357 | IWL_DEBUG_ASSOC(priv, "STA %d (%pM) already added, not " | 357 | IWL_DEBUG_ASSOC(priv, "STA %d (%pM) already added, not " |
358 | "adding again.\n", sta_id, addr); | 358 | "adding again.\n", sta_id, addr); |
359 | return sta_id; | 359 | return sta_id; |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index e30cc32f8279..cf7bdc66f822 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -1235,7 +1235,7 @@ mwl8k_capture_bssid(struct mwl8k_priv *priv, struct ieee80211_hdr *wh) | |||
1235 | { | 1235 | { |
1236 | return priv->capture_beacon && | 1236 | return priv->capture_beacon && |
1237 | ieee80211_is_beacon(wh->frame_control) && | 1237 | ieee80211_is_beacon(wh->frame_control) && |
1238 | !compare_ether_addr(wh->addr3, priv->capture_bssid); | 1238 | ether_addr_equal(wh->addr3, priv->capture_bssid); |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | static inline void mwl8k_save_beacon(struct ieee80211_hw *hw, | 1241 | static inline void mwl8k_save_beacon(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c index 7c8f118c2b09..82a1cac920bd 100644 --- a/drivers/net/wireless/p54/txrx.c +++ b/drivers/net/wireless/p54/txrx.c | |||
@@ -308,7 +308,7 @@ static void p54_pspoll_workaround(struct p54_common *priv, struct sk_buff *skb) | |||
308 | return; | 308 | return; |
309 | 309 | ||
310 | /* only consider beacons from the associated BSSID */ | 310 | /* only consider beacons from the associated BSSID */ |
311 | if (compare_ether_addr(hdr->addr3, priv->bssid)) | 311 | if (!ether_addr_equal(hdr->addr3, priv->bssid)) |
312 | return; | 312 | return; |
313 | 313 | ||
314 | tim = p54_find_ie(skb, WLAN_EID_TIM); | 314 | tim = p54_find_ie(skb, WLAN_EID_TIM); |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index d66e2980bc27..dcf0e7e25ab0 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -1801,8 +1801,8 @@ static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev, | |||
1801 | count = max_pmkids; | 1801 | count = max_pmkids; |
1802 | 1802 | ||
1803 | for (i = 0; i < count; i++) | 1803 | for (i = 0; i < count; i++) |
1804 | if (!compare_ether_addr(pmkids->bssid_info[i].bssid, | 1804 | if (ether_addr_equal(pmkids->bssid_info[i].bssid, |
1805 | pmksa->bssid)) | 1805 | pmksa->bssid)) |
1806 | break; | 1806 | break; |
1807 | 1807 | ||
1808 | /* pmkid not found */ | 1808 | /* pmkid not found */ |
@@ -1843,8 +1843,8 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev, | |||
1843 | 1843 | ||
1844 | /* update with new pmkid */ | 1844 | /* update with new pmkid */ |
1845 | for (i = 0; i < count; i++) { | 1845 | for (i = 0; i < count; i++) { |
1846 | if (compare_ether_addr(pmkids->bssid_info[i].bssid, | 1846 | if (!ether_addr_equal(pmkids->bssid_info[i].bssid, |
1847 | pmksa->bssid)) | 1847 | pmksa->bssid)) |
1848 | continue; | 1848 | continue; |
1849 | 1849 | ||
1850 | memcpy(pmkids->bssid_info[i].pmkid, pmksa->pmkid, | 1850 | memcpy(pmkids->bssid_info[i].pmkid, pmksa->pmkid, |
@@ -2139,7 +2139,7 @@ resize_buf: | |||
2139 | while (check_bssid_list_item(bssid, bssid_len, buf, len)) { | 2139 | while (check_bssid_list_item(bssid, bssid_len, buf, len)) { |
2140 | if (rndis_bss_info_update(usbdev, bssid) && match_bssid && | 2140 | if (rndis_bss_info_update(usbdev, bssid) && match_bssid && |
2141 | matched) { | 2141 | matched) { |
2142 | if (compare_ether_addr(bssid->mac, match_bssid)) | 2142 | if (!ether_addr_equal(bssid->mac, match_bssid)) |
2143 | *matched = true; | 2143 | *matched = true; |
2144 | } | 2144 | } |
2145 | 2145 | ||
@@ -2531,7 +2531,7 @@ static int rndis_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
2531 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 2531 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
2532 | struct usbnet *usbdev = priv->usbdev; | 2532 | struct usbnet *usbdev = priv->usbdev; |
2533 | 2533 | ||
2534 | if (compare_ether_addr(priv->bssid, mac)) | 2534 | if (!ether_addr_equal(priv->bssid, mac)) |
2535 | return -ENOENT; | 2535 | return -ENOENT; |
2536 | 2536 | ||
2537 | rndis_fill_station_info(usbdev, sinfo); | 2537 | rndis_fill_station_info(usbdev, sinfo); |
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index e54488db0e10..f4c852c6749b 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -1460,7 +1460,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len) | |||
1460 | return; | 1460 | return; |
1461 | 1461 | ||
1462 | /* and only beacons from the associated BSSID, please */ | 1462 | /* and only beacons from the associated BSSID, please */ |
1463 | if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid)) | 1463 | if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) |
1464 | return; | 1464 | return; |
1465 | 1465 | ||
1466 | if (rtl_find_221_ie(hw, data, len)) | 1466 | if (rtl_find_221_ie(hw, data, len)) |
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index 5b9c3b5e8c92..5ae26647f340 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -480,7 +480,7 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len) | |||
480 | return; | 480 | return; |
481 | 481 | ||
482 | /* and only beacons from the associated BSSID, please */ | 482 | /* and only beacons from the associated BSSID, please */ |
483 | if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid)) | 483 | if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) |
484 | return; | 484 | return; |
485 | 485 | ||
486 | rtlpriv->psc.last_beacon = jiffies; | 486 | rtlpriv->psc.last_beacon = jiffies; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c index 37b13636a778..3af874e69595 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | |||
@@ -508,14 +508,14 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, | |||
508 | 508 | ||
509 | packet_matchbssid = | 509 | packet_matchbssid = |
510 | ((IEEE80211_FTYPE_CTL != type) && | 510 | ((IEEE80211_FTYPE_CTL != type) && |
511 | (!compare_ether_addr(mac->bssid, | 511 | ether_addr_equal(mac->bssid, |
512 | (c_fc & IEEE80211_FCTL_TODS) ? | 512 | (c_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : |
513 | hdr->addr1 : (c_fc & IEEE80211_FCTL_FROMDS) ? | 513 | (c_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : |
514 | hdr->addr2 : hdr->addr3)) && | 514 | hdr->addr3) && |
515 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); | 515 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); |
516 | 516 | ||
517 | packet_toself = packet_matchbssid && | 517 | packet_toself = packet_matchbssid && |
518 | (!compare_ether_addr(praddr, rtlefuse->dev_addr)); | 518 | ether_addr_equal(praddr, rtlefuse->dev_addr); |
519 | 519 | ||
520 | if (ieee80211_is_beacon(fc)) | 520 | if (ieee80211_is_beacon(fc)) |
521 | packet_beacon = true; | 521 | packet_beacon = true; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c index 025bdc2eba44..7e91c76582ec 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c | |||
@@ -1099,14 +1099,14 @@ void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw, | |||
1099 | praddr = hdr->addr1; | 1099 | praddr = hdr->addr1; |
1100 | packet_matchbssid = | 1100 | packet_matchbssid = |
1101 | ((IEEE80211_FTYPE_CTL != type) && | 1101 | ((IEEE80211_FTYPE_CTL != type) && |
1102 | (!compare_ether_addr(mac->bssid, | 1102 | ether_addr_equal(mac->bssid, |
1103 | (cpu_fc & IEEE80211_FCTL_TODS) ? | 1103 | (cpu_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : |
1104 | hdr->addr1 : (cpu_fc & IEEE80211_FCTL_FROMDS) ? | 1104 | (cpu_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : |
1105 | hdr->addr2 : hdr->addr3)) && | 1105 | hdr->addr3) && |
1106 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); | 1106 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); |
1107 | 1107 | ||
1108 | packet_toself = packet_matchbssid && | 1108 | packet_toself = packet_matchbssid && |
1109 | (!compare_ether_addr(praddr, rtlefuse->dev_addr)); | 1109 | ether_addr_equal(praddr, rtlefuse->dev_addr); |
1110 | if (ieee80211_is_beacon(fc)) | 1110 | if (ieee80211_is_beacon(fc)) |
1111 | packet_beacon = true; | 1111 | packet_beacon = true; |
1112 | _rtl92c_query_rxphystatus(hw, pstats, pdesc, p_drvinfo, | 1112 | _rtl92c_query_rxphystatus(hw, pstats, pdesc, p_drvinfo, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c index a7f6126e2f86..1666ef7fd87b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c | |||
@@ -466,12 +466,13 @@ static void _rtl92de_translate_rx_signal_stuff(struct ieee80211_hw *hw, | |||
466 | type = WLAN_FC_GET_TYPE(fc); | 466 | type = WLAN_FC_GET_TYPE(fc); |
467 | praddr = hdr->addr1; | 467 | praddr = hdr->addr1; |
468 | packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && | 468 | packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && |
469 | (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ? | 469 | ether_addr_equal(mac->bssid, |
470 | hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ? | 470 | (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 : |
471 | hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) && | 471 | (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : |
472 | (!pstats->crc) && (!pstats->icv)); | 472 | hdr->addr3) && |
473 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); | ||
473 | packet_toself = packet_matchbssid && | 474 | packet_toself = packet_matchbssid && |
474 | (!compare_ether_addr(praddr, rtlefuse->dev_addr)); | 475 | ether_addr_equal(praddr, rtlefuse->dev_addr); |
475 | if (ieee80211_is_beacon(fc)) | 476 | if (ieee80211_is_beacon(fc)) |
476 | packet_beacon = true; | 477 | packet_beacon = true; |
477 | _rtl92de_query_rxphystatus(hw, pstats, pdesc, p_drvinfo, | 478 | _rtl92de_query_rxphystatus(hw, pstats, pdesc, p_drvinfo, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index 2fd3d13b7ced..812b5858f14a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -492,13 +492,14 @@ static void _rtl92se_translate_rx_signal_stuff(struct ieee80211_hw *hw, | |||
492 | praddr = hdr->addr1; | 492 | praddr = hdr->addr1; |
493 | 493 | ||
494 | packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && | 494 | packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && |
495 | (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ? | 495 | ether_addr_equal(mac->bssid, |
496 | hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ? | 496 | (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 : |
497 | hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) && | 497 | (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : |
498 | (!pstats->crc) && (!pstats->icv)); | 498 | hdr->addr3) && |
499 | (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); | ||
499 | 500 | ||
500 | packet_toself = packet_matchbssid && | 501 | packet_toself = packet_matchbssid && |
501 | (!compare_ether_addr(praddr, rtlefuse->dev_addr)); | 502 | ether_addr_equal(praddr, rtlefuse->dev_addr); |
502 | 503 | ||
503 | if (ieee80211_is_beacon(fc)) | 504 | if (ieee80211_is_beacon(fc)) |
504 | packet_beacon = true; | 505 | packet_beacon = true; |