drivers/net: Convert compare_ether_addr to ether_addr_equal
authorJoe Perches <joe@perches.com>
Wed, 9 May 2012 17:17:46 +0000 (17:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 May 2012 03:33:01 +0000 (23:33 -0400)
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>
31 files changed:
drivers/net/bonding/bond_main.c
drivers/net/ethernet/amd/depca.c
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/dec/ewrk3.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
drivers/net/ethernet/sfc/ethtool.c
drivers/net/ethernet/sun/sunvnet.c
drivers/net/ethernet/tile/tilepro.c
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
drivers/net/tun.c
drivers/net/wireless/at76c50x-usb.c
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/carl9170/rx.c
drivers/net/wireless/ipw2x00/libipw_rx.c
drivers/net/wireless/iwlegacy/3945.c
drivers/net/wireless/iwlegacy/4965-mac.c
drivers/net/wireless/iwlegacy/common.c
drivers/net/wireless/iwlwifi/iwl-agn-rx.c
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
drivers/net/wireless/mwl8k.c
drivers/net/wireless/p54/txrx.c
drivers/net/wireless/rndis_wlan.c
drivers/net/wireless/rtlwifi/base.c
drivers/net/wireless/rtlwifi/ps.c
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
drivers/net/wireless/rtlwifi/rtl8192de/trx.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c

index 16dbf53e314ba4dfd02231059fb416d99192d4a1..bbb004354bbd27afa499a5cb5255627da9d46424 100644 (file)
@@ -1961,7 +1961,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
        write_lock_bh(&bond->lock);
 
        if (!bond->params.fail_over_mac) {
-               if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
+               if (ether_addr_equal(bond_dev->dev_addr, slave->perm_hwaddr) &&
                    bond->slave_cnt > 1)
                        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",
                                   bond_dev->name, slave_dev->name,
index 86dd95766a64f6575bda9b36cfb5ff2dfbf630a6..7f7b99a5f02436664bedd47daf5e5c1c9a7d7938 100644 (file)
@@ -1079,7 +1079,8 @@ static int depca_rx(struct net_device *dev)
                                                } else {
                                                        lp->pktStats.multicast++;
                                                }
-                                       } else if (compare_ether_addr(buf, dev->dev_addr) == 0) {
+                                       } else if (ether_addr_equal(buf,
+                                                                   dev->dev_addr)) {
                                                lp->pktStats.unicast++;
                                        }
 
index d7ac6c17547c9ad8f1cacc1db6de7f1e32264bb4..8132c785cea87c6bd33c36f775fe08fe7cb3b51a 100644 (file)
@@ -944,8 +944,7 @@ static void enic_update_multicast_addr_list(struct enic *enic)
 
        for (i = 0; i < enic->mc_count; i++) {
                for (j = 0; j < mc_count; j++)
-                       if (compare_ether_addr(enic->mc_addr[i],
-                               mc_addr[j]) == 0)
+                       if (ether_addr_equal(enic->mc_addr[i], mc_addr[j]))
                                break;
                if (j == mc_count)
                        enic_dev_del_addr(enic, enic->mc_addr[i]);
@@ -953,8 +952,7 @@ static void enic_update_multicast_addr_list(struct enic *enic)
 
        for (i = 0; i < mc_count; i++) {
                for (j = 0; j < enic->mc_count; j++)
-                       if (compare_ether_addr(mc_addr[i],
-                               enic->mc_addr[j]) == 0)
+                       if (ether_addr_equal(mc_addr[i], enic->mc_addr[j]))
                                break;
                if (j == enic->mc_count)
                        enic_dev_add_addr(enic, mc_addr[i]);
@@ -999,8 +997,7 @@ static void enic_update_unicast_addr_list(struct enic *enic)
 
        for (i = 0; i < enic->uc_count; i++) {
                for (j = 0; j < uc_count; j++)
-                       if (compare_ether_addr(enic->uc_addr[i],
-                               uc_addr[j]) == 0)
+                       if (ether_addr_equal(enic->uc_addr[i], uc_addr[j]))
                                break;
                if (j == uc_count)
                        enic_dev_del_addr(enic, enic->uc_addr[i]);
@@ -1008,8 +1005,7 @@ static void enic_update_unicast_addr_list(struct enic *enic)
 
        for (i = 0; i < uc_count; i++) {
                for (j = 0; j < enic->uc_count; j++)
-                       if (compare_ether_addr(uc_addr[i],
-                               enic->uc_addr[j]) == 0)
+                       if (ether_addr_equal(uc_addr[i], enic->uc_addr[j]))
                                break;
                if (j == enic->uc_count)
                        enic_dev_add_addr(enic, uc_addr[i]);
index 1879f84a25a313efe12cecc31fac76955b123179..17ae8c61968017aa6aa6a7477ac062f8dba79669 100644 (file)
@@ -1016,7 +1016,8 @@ static int ewrk3_rx(struct net_device *dev)
                                                        } else {
                                                                lp->pktStats.multicast++;
                                                        }
-                                               } else if (compare_ether_addr(p, dev->dev_addr) == 0) {
+                                               } else if (ether_addr_equal(p,
+                                                                           dev->dev_addr)) {
                                                        lp->pktStats.unicast++;
                                                }
                                                lp->pktStats.bins[0]++;         /* Duplicates stats.rx_packets */
index 18b106cc6d2bbe3db4adcb8b37668443d3381b3d..d3cd489d11a219cd115185043aed2e85760361df 100644 (file)
@@ -1874,7 +1874,7 @@ de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len)
        } else {
            lp->pktStats.multicast++;
        }
-    } else if (compare_ether_addr(buf, dev->dev_addr) == 0) {
+    } else if (ether_addr_equal(buf, dev->dev_addr)) {
         lp->pktStats.unicast++;
     }
 
index 5c4713521d4cde15d7a13edecf0ce5d0709dbe12..46e77a2c51219223909f40d6fb223c0981d37a26 100644 (file)
@@ -1965,7 +1965,7 @@ qlcnic_send_filter(struct qlcnic_adapter *adapter,
        __le16 vlan_id = 0;
        u8 hindex;
 
-       if (!compare_ether_addr(phdr->h_source, adapter->mac_addr))
+       if (ether_addr_equal(phdr->h_source, adapter->mac_addr))
                return;
 
        if (adapter->fhash.fnum >= adapter->fhash.fmax)
@@ -2235,8 +2235,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 
        if (adapter->flags & QLCNIC_MACSPOOF) {
                phdr = (struct ethhdr *)skb->data;
-               if (compare_ether_addr(phdr->h_source,
-                                       adapter->mac_addr))
+               if (!ether_addr_equal(phdr->h_source, adapter->mac_addr))
                        goto drop_packet;
        }
 
index b0a4558de248eef0273ca8458e42931fd7a65351..03ded364c8dab234f43437b629659821c3aa41b4 100644 (file)
@@ -1023,7 +1023,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
                        return -EINVAL;
 
                /* Is it a default UC or MC filter? */
-               if (!compare_ether_addr(mac_mask->h_dest, mac_addr_mc_mask) &&
+               if (ether_addr_equal(mac_mask->h_dest, mac_addr_mc_mask) &&
                    vlan_tag_mask == 0) {
                        if (is_multicast_ether_addr(mac_entry->h_dest))
                                rc = efx_filter_set_mc_def(&spec);
index 38e3ae9155b7080fc6d0baf5c7b84eadb9f4723d..a108db35924ed9f0aa943db43e94b2a5fac33f50 100644 (file)
@@ -618,7 +618,7 @@ struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb)
        struct vnet_port *port;
 
        hlist_for_each_entry(port, n, hp, hash) {
-               if (!compare_ether_addr(port->raddr, skb->data))
+               if (ether_addr_equal(port->raddr, skb->data))
                        return port;
        }
        port = NULL;
index 3d501ec7fad7f67775ca1f11fe4c3870db4f61d7..96070e9b50dc26bae301e9f9918219dbe5812e69 100644 (file)
@@ -843,7 +843,7 @@ static bool tile_net_poll_aux(struct tile_net_cpu *info, int index)
                if (!is_multicast_ether_addr(buf)) {
                        /* Filter packets not for our address. */
                        const u8 *mine = dev->dev_addr;
-                       filter = compare_ether_addr(mine, buf);
+                       filter = !ether_addr_equal(mine, buf);
                }
        }
 
index 5c14f82c49549ca2089c5b2d3af1a84519a2bf4c..961c8321451f5551e85847076dcdfb845c51342a 100644 (file)
@@ -1590,8 +1590,8 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
                found = 0;
                oldest = NULL;
                list_for_each_entry(target, &wl->network_list, list) {
-                       if (!compare_ether_addr(&target->hwinfo->bssid[2],
-                                               &scan_info->bssid[2])) {
+                       if (ether_addr_equal(&target->hwinfo->bssid[2],
+                                            &scan_info->bssid[2])) {
                                found = 1;
                                pr_debug("%s: same BBS found scanned list\n",
                                         __func__);
@@ -1691,8 +1691,8 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl)
 
                /* If bss specified, check it only */
                if (test_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat)) {
-                       if (!compare_ether_addr(&scan_info->hwinfo->bssid[2],
-                                               wl->bssid)) {
+                       if (ether_addr_equal(&scan_info->hwinfo->bssid[2],
+                                            wl->bssid)) {
                                best_bss = scan_info;
                                pr_debug("%s: bssid matched\n", __func__);
                                break;
index bb8c72c79c6f31c9c932b2960df6a2c2f009a08e..987aeefbc774e9c8ad869e0dc3ac11d5819dbb53 100644 (file)
@@ -313,7 +313,7 @@ static int run_filter(struct tap_filter *filter, const struct sk_buff *skb)
 
        /* Exact match */
        for (i = 0; i < filter->count; i++)
-               if (!compare_ether_addr(eh->h_dest, filter->addr[i]))
+               if (ether_addr_equal(eh->h_dest, filter->addr[i]))
                        return 1;
 
        /* Inexact match (multicast only) */
index faa8bcb4aac1efe6bd9d62242176b71f4544a254..5ad74c85a0385294f2c64b2015b2d2f707ae771a 100644 (file)
@@ -1751,7 +1751,7 @@ static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
         * following workaround is necessary. If the TX frame is an
         * authentication frame extract the bssid and send the CMD_JOIN. */
        if (mgmt->frame_control & cpu_to_le16(IEEE80211_STYPE_AUTH)) {
-               if (compare_ether_addr(priv->bssid, mgmt->bssid)) {
+               if (!ether_addr_equal(priv->bssid, mgmt->bssid)) {
                        memcpy(priv->bssid, mgmt->bssid, ETH_ALEN);
                        ieee80211_queue_work(hw, &priv->work_join_bssid);
                        dev_kfree_skb_any(skb);
index 49e3b19cf781bbe123e8f7837ed1fe99ae97a2de..0ba81a66061fca201ae7917e21b1ffd6c703a91d 100644 (file)
@@ -462,7 +462,7 @@ void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
        }
 
        if (iter_data->need_set_hw_addr && iter_data->hw_macaddr)
-               if (compare_ether_addr(iter_data->hw_macaddr, mac) == 0)
+               if (ether_addr_equal(iter_data->hw_macaddr, mac))
                        iter_data->need_set_hw_addr = false;
 
        if (!iter_data->any_assoc) {
@@ -1170,7 +1170,7 @@ ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb,
 
        if (ieee80211_is_beacon(mgmt->frame_control) &&
            le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS &&
-           compare_ether_addr(mgmt->bssid, common->curbssid) == 0) {
+           ether_addr_equal(mgmt->bssid, common->curbssid)) {
                /*
                 * Received an IBSS beacon with the same BSSID. Hardware *must*
                 * 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)
 
        /* only beacons from our BSSID */
        if (!ieee80211_is_beacon(mgmt->frame_control) ||
-           compare_ether_addr(mgmt->bssid, common->curbssid) != 0)
+           !ether_addr_equal(mgmt->bssid, common->curbssid))
                return;
 
        ewma_add(&ah->ah_beacon_rssi_avg, rssi);
index 544e5490ca2e7f734a1a5694bd66d8bf8acd0bbc..e1fcc68124dc3bc78359cf72e2da459ddf9c4560 100644 (file)
@@ -1833,7 +1833,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
                if (ieee80211_is_beacon(hdr->frame_control)) {
                        RX_STAT_INC(rx_beacons);
                        if (!is_zero_ether_addr(common->curbssid) &&
-                           !compare_ether_addr(hdr->addr3, common->curbssid))
+                           ether_addr_equal(hdr->addr3, common->curbssid))
                                rs.is_mybeacon = true;
                        else
                                rs.is_mybeacon = false;
index dc99030ea8b67f07c1d28b7e1b8d3c6b8f564a14..84b22eec7abd77e8bb1ab38fd68c81930f77d487 100644 (file)
@@ -538,7 +538,7 @@ static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len)
                return;
 
        /* and only beacons from the associated BSSID, please */
-       if (compare_ether_addr(hdr->addr3, ar->common.curbssid) ||
+       if (!ether_addr_equal(hdr->addr3, ar->common.curbssid) ||
            !ar->common.curaid)
                return;
 
index c4955d25a19a7a27602427c7d2b73a16639a903c..02e057923236bd6133f5008d1c01feb7c911fcda 100644 (file)
@@ -77,8 +77,8 @@ static struct libipw_frag_entry *libipw_frag_cache_find(struct
 
                if (entry->skb != NULL && entry->seq == seq &&
                    (entry->last_frag + 1 == frag || frag == -1) &&
-                   !compare_ether_addr(entry->src_addr, src) &&
-                   !compare_ether_addr(entry->dst_addr, dst))
+                   ether_addr_equal(entry->src_addr, src) &&
+                   ether_addr_equal(entry->dst_addr, dst))
                        return entry;
        }
 
@@ -245,12 +245,12 @@ static int libipw_is_eapol_frame(struct libipw_device *ieee,
        /* check that the frame is unicast frame to us */
        if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
            IEEE80211_FCTL_TODS &&
-           !compare_ether_addr(hdr->addr1, dev->dev_addr) &&
-           !compare_ether_addr(hdr->addr3, dev->dev_addr)) {
+           ether_addr_equal(hdr->addr1, dev->dev_addr) &&
+           ether_addr_equal(hdr->addr3, dev->dev_addr)) {
                /* ToDS frame with own addr BSSID and DA */
        } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
                   IEEE80211_FCTL_FROMDS &&
-                  !compare_ether_addr(hdr->addr1, dev->dev_addr)) {
+                  ether_addr_equal(hdr->addr1, dev->dev_addr)) {
                /* FromDS frame with own addr as DA */
        } else
                return 0;
@@ -523,8 +523,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 
        if (ieee->iw_mode == IW_MODE_MASTER && !wds &&
            (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
-           IEEE80211_FCTL_FROMDS && ieee->stadev
-           && !compare_ether_addr(hdr->addr2, ieee->assoc_ap_addr)) {
+           IEEE80211_FCTL_FROMDS && ieee->stadev &&
+           ether_addr_equal(hdr->addr2, ieee->assoc_ap_addr)) {
                /* Frame from BSSID of the AP for which we are a client */
                skb->dev = dev = ieee->stadev;
                stats = hostap_get_stats(dev);
@@ -1468,7 +1468,7 @@ static inline int is_same_network(struct libipw_network *src,
         * as one network */
        return ((src->ssid_len == dst->ssid_len) &&
                (src->channel == dst->channel) &&
-               !compare_ether_addr(src->bssid, dst->bssid) &&
+               ether_addr_equal(src->bssid, dst->bssid) &&
                !memcmp(src->ssid, dst->ssid, src->ssid_len));
 }
 
index b25c01be0d90c4ad06b833d00bf2d3a5132273e3..87e5398943308665618cc85a78aa933fa5d7df48 100644 (file)
@@ -453,10 +453,10 @@ il3945_is_network_packet(struct il_priv *il, struct ieee80211_hdr *header)
        switch (il->iw_mode) {
        case NL80211_IFTYPE_ADHOC:      /* Header: Dest. | Source    | BSSID */
                /* packets to our IBSS update information */
-               return !compare_ether_addr(header->addr3, il->bssid);
+               return ether_addr_equal(header->addr3, il->bssid);
        case NL80211_IFTYPE_STATION:    /* Header: Dest. | AP{BSSID} | Source */
                /* packets to our IBSS update information */
-               return !compare_ether_addr(header->addr2, il->bssid);
+               return ether_addr_equal(header->addr2, il->bssid);
        default:
                return 1;
        }
index f2baf94f069c3b787b16b807e62ee3a8b6741f4b..509301a5e7e264ae079201a246ded0252582308a 100644 (file)
@@ -2565,7 +2565,7 @@ il4965_find_station(struct il_priv *il, const u8 *addr)
        spin_lock_irqsave(&il->sta_lock, flags);
        for (i = start; i < il->hw_params.max_stations; i++)
                if (il->stations[i].used &&
-                   (!compare_ether_addr(il->stations[i].sta.sta.addr, addr))) {
+                   ether_addr_equal(il->stations[i].sta.sta.addr, addr)) {
                        ret = i;
                        goto out;
                }
index eaf249452e51713f91fe7067a6fa804d7f6ea1d0..cbf2dc18341f58eec6141158e0c6d3aaad02d12b 100644 (file)
@@ -1896,8 +1896,8 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
                sta_id = il->hw_params.bcast_id;
        else
                for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) {
-                       if (!compare_ether_addr
-                           (il->stations[i].sta.sta.addr, addr)) {
+                       if (ether_addr_equal(il->stations[i].sta.sta.addr,
+                                            addr)) {
                                sta_id = i;
                                break;
                        }
@@ -1926,7 +1926,7 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
 
        if ((il->stations[sta_id].used & IL_STA_DRIVER_ACTIVE) &&
            (il->stations[sta_id].used & IL_STA_UCODE_ACTIVE) &&
-           !compare_ether_addr(il->stations[sta_id].sta.sta.addr, addr)) {
+           ether_addr_equal(il->stations[sta_id].sta.sta.addr, addr)) {
                D_ASSOC("STA %d (%pM) already added, not adding again.\n",
                        sta_id, addr);
                return sta_id;
@@ -3744,10 +3744,10 @@ il_full_rxon_required(struct il_priv *il)
 
        /* These items are only settable from the full RXON command */
        CHK(!il_is_associated(il));
-       CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr));
-       CHK(compare_ether_addr(staging->node_addr, active->node_addr));
-       CHK(compare_ether_addr
-           (staging->wlap_bssid_addr, active->wlap_bssid_addr));
+       CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr));
+       CHK(!ether_addr_equal(staging->node_addr, active->node_addr));
+       CHK(!ether_addr_equal(staging->wlap_bssid_addr,
+                             active->wlap_bssid_addr));
        CHK_NEQ(staging->dev_type, active->dev_type);
        CHK_NEQ(staging->channel, active->channel);
        CHK_NEQ(staging->air_propagation, active->air_propagation);
index 0c252c5d8bf13543f3f40121ce671812b6559c95..779f819cc8cbbddf4ceaab08cce450083c81254e 100644 (file)
@@ -779,8 +779,8 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
        */
        if (unlikely(ieee80211_is_beacon(fc) && priv->passive_no_rx)) {
                for_each_context(priv, ctx) {
-                       if (compare_ether_addr(hdr->addr3,
-                                              ctx->active.bssid_addr))
+                       if (!ether_addr_equal(hdr->addr3,
+                                             ctx->active.bssid_addr))
                                continue;
                        iwlagn_lift_passive_no_rx(priv);
                }
index 0f7c444f2440e54e46bd6296e25a83e033f68036..74fbee627306289978eb9f3fd2dc1d018abf660a 100644 (file)
@@ -881,10 +881,10 @@ int iwl_full_rxon_required(struct iwl_priv *priv,
 
        /* These items are only settable from the full RXON command */
        CHK(!iwl_is_associated_ctx(ctx));
-       CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr));
-       CHK(compare_ether_addr(staging->node_addr, active->node_addr));
-       CHK(compare_ether_addr(staging->wlap_bssid_addr,
-                               active->wlap_bssid_addr));
+       CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr));
+       CHK(!ether_addr_equal(staging->node_addr, active->node_addr));
+       CHK(!ether_addr_equal(staging->wlap_bssid_addr,
+                             active->wlap_bssid_addr));
        CHK_NEQ(staging->dev_type, active->dev_type);
        CHK_NEQ(staging->channel, active->channel);
        CHK_NEQ(staging->air_propagation, active->air_propagation);
index 67e6f1d2a08bf3f59a7dd2a4f620a40b169269b8..b31584e87bc7f4d03f2d3d2ba727879979b19156 100644 (file)
@@ -322,8 +322,8 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
                sta_id = ctx->bcast_sta_id;
        else
                for (i = IWL_STA_ID; i < IWLAGN_STATION_COUNT; i++) {
-                       if (!compare_ether_addr(priv->stations[i].sta.sta.addr,
-                                               addr)) {
+                       if (ether_addr_equal(priv->stations[i].sta.sta.addr,
+                                            addr)) {
                                sta_id = i;
                                break;
                        }
@@ -353,7 +353,7 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
 
        if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) &&
            (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) &&
-           !compare_ether_addr(priv->stations[sta_id].sta.sta.addr, addr)) {
+           ether_addr_equal(priv->stations[sta_id].sta.sta.addr, addr)) {
                IWL_DEBUG_ASSOC(priv, "STA %d (%pM) already added, not "
                                "adding again.\n", sta_id, addr);
                return sta_id;
index e30cc32f82791a69a910ab79dfc8bc8541c60bab..cf7bdc66f8225b6a850eafe5845e1fcb43474d80 100644 (file)
@@ -1235,7 +1235,7 @@ mwl8k_capture_bssid(struct mwl8k_priv *priv, struct ieee80211_hdr *wh)
 {
        return priv->capture_beacon &&
                ieee80211_is_beacon(wh->frame_control) &&
-               !compare_ether_addr(wh->addr3, priv->capture_bssid);
+               ether_addr_equal(wh->addr3, priv->capture_bssid);
 }
 
 static inline void mwl8k_save_beacon(struct ieee80211_hw *hw,
index 7c8f118c2b09bc3cabb1005a781bd76314892257..82a1cac920bd82446297bbe8666922705fb6549f 100644 (file)
@@ -308,7 +308,7 @@ static void p54_pspoll_workaround(struct p54_common *priv, struct sk_buff *skb)
                return;
 
        /* only consider beacons from the associated BSSID */
-       if (compare_ether_addr(hdr->addr3, priv->bssid))
+       if (!ether_addr_equal(hdr->addr3, priv->bssid))
                return;
 
        tim = p54_find_ie(skb, WLAN_EID_TIM);
index d66e2980bc27bab54ddd06867a8fccd50f6cfb0c..dcf0e7e25ab01ff819304b702c0d2c496f9ad5f9 100644 (file)
@@ -1801,8 +1801,8 @@ static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev,
                count = max_pmkids;
 
        for (i = 0; i < count; i++)
-               if (!compare_ether_addr(pmkids->bssid_info[i].bssid,
-                                                       pmksa->bssid))
+               if (ether_addr_equal(pmkids->bssid_info[i].bssid,
+                                    pmksa->bssid))
                        break;
 
        /* pmkid not found */
@@ -1843,8 +1843,8 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
 
        /* update with new pmkid */
        for (i = 0; i < count; i++) {
-               if (compare_ether_addr(pmkids->bssid_info[i].bssid,
-                                                       pmksa->bssid))
+               if (!ether_addr_equal(pmkids->bssid_info[i].bssid,
+                                     pmksa->bssid))
                        continue;
 
                memcpy(pmkids->bssid_info[i].pmkid, pmksa->pmkid,
@@ -2139,7 +2139,7 @@ resize_buf:
        while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
                if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
                    matched) {
-                       if (compare_ether_addr(bssid->mac, match_bssid))
+                       if (!ether_addr_equal(bssid->mac, match_bssid))
                                *matched = true;
                }
 
@@ -2531,7 +2531,7 @@ static int rndis_get_station(struct wiphy *wiphy, struct net_device *dev,
        struct rndis_wlan_private *priv = wiphy_priv(wiphy);
        struct usbnet *usbdev = priv->usbdev;
 
-       if (compare_ether_addr(priv->bssid, mac))
+       if (!ether_addr_equal(priv->bssid, mac))
                return -ENOENT;
 
        rndis_fill_station_info(usbdev, sinfo);
index e54488db0e10178bfb820da5d23eb0e2a54591f8..f4c852c6749bea3e770dd79c707a609ad2072ebd 100644 (file)
@@ -1460,7 +1460,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len)
                return;
 
        /* and only beacons from the associated BSSID, please */
-       if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid))
+       if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid))
                return;
 
        if (rtl_find_221_ie(hw, data, len))
index 5b9c3b5e8c928e9efe03176df1720d1f65df8aba..5ae26647f340aaa44f4ae622e3ce274e7146d03f 100644 (file)
@@ -480,7 +480,7 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
                return;
 
        /* and only beacons from the associated BSSID, please */
-       if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid))
+       if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid))
                return;
 
        rtlpriv->psc.last_beacon = jiffies;
index 37b13636a7786c4a66fc7397116e389e2801a90f..3af874e6959558ed45face6a1ae5eb10cc7b4e04 100644 (file)
@@ -508,14 +508,14 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw,
 
        packet_matchbssid =
            ((IEEE80211_FTYPE_CTL != type) &&
-            (!compare_ether_addr(mac->bssid,
-                                 (c_fc & IEEE80211_FCTL_TODS) ?
-                                 hdr->addr1 : (c_fc & IEEE80211_FCTL_FROMDS) ?
-                                 hdr->addr2 : hdr->addr3)) &&
+            ether_addr_equal(mac->bssid,
+                             (c_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 :
+                             (c_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 :
+                             hdr->addr3) &&
             (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
 
        packet_toself = packet_matchbssid &&
-           (!compare_ether_addr(praddr, rtlefuse->dev_addr));
+            ether_addr_equal(praddr, rtlefuse->dev_addr);
 
        if (ieee80211_is_beacon(fc))
                packet_beacon = true;
index 025bdc2eba44868d0f84caeed607b45c82fccee9..7e91c76582ec3c5078858a087bfd74422ad95b08 100644 (file)
@@ -1099,14 +1099,14 @@ void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw,
        praddr = hdr->addr1;
        packet_matchbssid =
            ((IEEE80211_FTYPE_CTL != type) &&
-            (!compare_ether_addr(mac->bssid,
-                         (cpu_fc & IEEE80211_FCTL_TODS) ?
-                         hdr->addr1 : (cpu_fc & IEEE80211_FCTL_FROMDS) ?
-                         hdr->addr2 : hdr->addr3)) &&
+            ether_addr_equal(mac->bssid,
+                             (cpu_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 :
+                             (cpu_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 :
+                             hdr->addr3) &&
             (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
 
        packet_toself = packet_matchbssid &&
-           (!compare_ether_addr(praddr, rtlefuse->dev_addr));
+           ether_addr_equal(praddr, rtlefuse->dev_addr);
        if (ieee80211_is_beacon(fc))
                packet_beacon = true;
        _rtl92c_query_rxphystatus(hw, pstats, pdesc, p_drvinfo,
index a7f6126e2f861f970c0e0f1c63a27021b649be36..1666ef7fd87bdaa7e5238f1e6c5f66a5da390ff9 100644 (file)
@@ -466,12 +466,13 @@ static void _rtl92de_translate_rx_signal_stuff(struct ieee80211_hw *hw,
        type = WLAN_FC_GET_TYPE(fc);
        praddr = hdr->addr1;
        packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) &&
-            (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ?
-                 hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ?
-                 hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) &&
-                 (!pstats->crc) && (!pstats->icv));
+            ether_addr_equal(mac->bssid,
+                             (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 :
+                             (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 :
+                             hdr->addr3) &&
+            (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
        packet_toself = packet_matchbssid &&
-                       (!compare_ether_addr(praddr, rtlefuse->dev_addr));
+                       ether_addr_equal(praddr, rtlefuse->dev_addr);
        if (ieee80211_is_beacon(fc))
                packet_beacon = true;
        _rtl92de_query_rxphystatus(hw, pstats, pdesc, p_drvinfo,
index 2fd3d13b7ced311fd1607f5c4bc437cdc98029f5..812b5858f14abfbf8d4ce2401f40c67a2ba75715 100644 (file)
@@ -492,13 +492,14 @@ static void _rtl92se_translate_rx_signal_stuff(struct ieee80211_hw *hw,
        praddr = hdr->addr1;
 
        packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) &&
-            (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ?
-                       hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ?
-                       hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) &&
-                       (!pstats->crc) && (!pstats->icv));
+            ether_addr_equal(mac->bssid,
+                             (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 :
+                             (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 :
+                             hdr->addr3) &&
+            (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
 
        packet_toself = packet_matchbssid &&
-           (!compare_ether_addr(praddr, rtlefuse->dev_addr));
+           ether_addr_equal(praddr, rtlefuse->dev_addr);
 
        if (ieee80211_is_beacon(fc))
                packet_beacon = true;