#include <linux/slab.h>
 #include <linux/export.h>
 #include <linux/moduleparam.h>
+#include <linux/etherdevice.h>
 
 #include "hostap_wlan.h"
 #include "hostap.h"
 
        s = ap->sta_hash[STA_HASH(sta->addr)];
        if (s == NULL) return;
-       if (memcmp(s->addr, sta->addr, ETH_ALEN) == 0) {
+       if (ether_addr_equal(s->addr, sta->addr)) {
                ap->sta_hash[STA_HASH(sta->addr)] = s->hnext;
                return;
        }
 
-       while (s->hnext != NULL && memcmp(s->hnext->addr, sta->addr, ETH_ALEN)
-              != 0)
+       while (s->hnext != NULL && !ether_addr_equal(s->hnext->addr, sta->addr))
                s = s->hnext;
        if (s->hnext != NULL)
                s->hnext = s->hnext->hnext;
             ptr != &mac_restrictions->mac_list; ptr = ptr->next) {
                entry = list_entry(ptr, struct mac_entry, list);
 
-               if (memcmp(entry->addr, mac, ETH_ALEN) == 0) {
+               if (ether_addr_equal(entry->addr, mac)) {
                        list_del(ptr);
                        kfree(entry);
                        mac_restrictions->entries--;
 
        spin_lock_bh(&mac_restrictions->lock);
        list_for_each_entry(entry, &mac_restrictions->mac_list, list) {
-               if (memcmp(entry->addr, mac, ETH_ALEN) == 0) {
+               if (ether_addr_equal(entry->addr, mac)) {
                        found = 1;
                        break;
                }
        struct sta_info *s;
 
        s = ap->sta_hash[STA_HASH(sta)];
-       while (s != NULL && memcmp(s->addr, sta, ETH_ALEN) != 0)
+       while (s != NULL && !ether_addr_equal(s->addr, sta))
                s = s->hnext;
        return s;
 }
        status_code = __le16_to_cpu(*pos);
        pos++;
 
-       if (memcmp(dev->dev_addr, hdr->addr2, ETH_ALEN) == 0 ||
+       if (ether_addr_equal(dev->dev_addr, hdr->addr2) ||
            ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) {
                txt = "authentication denied";
                resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
        PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%pM, TA=%pM PWRMGT=%d\n",
               hdr->addr1, hdr->addr2, !!ieee80211_has_pm(hdr->frame_control));
 
-       if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
+       if (!ether_addr_equal(hdr->addr1, dev->dev_addr)) {
                PDEBUG(DEBUG_AP,
                       "handle_pspoll - addr1(BSSID)=%pM not own MAC\n",
                       hdr->addr1);
                        goto done;
                }
 
-               if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
+               if (!ether_addr_equal(hdr->addr1, dev->dev_addr)) {
                        PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=%pM"
                               " not own MAC\n", hdr->addr1);
                        goto done;
                goto done;
        }
 
-       if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
+       if (!ether_addr_equal(hdr->addr1, dev->dev_addr)) {
                PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%pM"
                       " not own MAC\n", hdr->addr1);
                goto done;
        }
 
-       if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
+       if (!ether_addr_equal(hdr->addr3, dev->dev_addr)) {
                PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%pM"
                       " not own MAC\n", hdr->addr3);
                goto done;
                if (!wds) {
                        /* FromDS frame - not for us; probably
                         * broadcast/multicast in another BSS - drop */
-                       if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) {
+                       if (ether_addr_equal(hdr->addr1, dev->dev_addr)) {
                                printk(KERN_DEBUG "Odd.. FromDS packet "
                                       "received with own BSSID\n");
                                hostap_dump_rx_80211(dev->name, skb, rx_stats);
                        goto out;
                }
        } else if (stype == IEEE80211_STYPE_NULLFUNC && sta == NULL &&
-                  memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) {
+                  ether_addr_equal(hdr->addr1, dev->dev_addr)) {
 
                if (local->hostapd) {
                        prism2_rx_80211(local->apdev, skb, rx_stats,
                /* If BSSID (Addr3) is foreign, this frame is a normal
                 * broadcast frame from an IBSS network. Drop it silently.
                 * If BSSID is own, report the dropping of this frame. */
-               if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
+               if (ether_addr_equal(hdr->addr3, dev->dev_addr)) {
                        printk(KERN_DEBUG "%s: dropped received packet from %pM"
                               " with no ToDS flag "
                               "(type=0x%02x, subtype=0x%02x)\n", dev->name,