staging: brcm80211: Convert ETHER_IS<FOO> to is_<foo>_ether_addr
authorJoe Perches <joe@perches.com>
Tue, 14 Dec 2010 00:57:00 +0000 (16:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Dec 2010 20:21:27 +0000 (12:21 -0800)
Use the normal kernel calls and remove the #defines
for ETHER_IS_BCAST and ETHER_IS_NULLADDR.

Add #include for etherdevice.h where necessary.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/wl_iw.c
drivers/staging/brcm80211/include/proto/ethernet.h
drivers/staging/brcm80211/sys/wlc_bmac.c
drivers/staging/brcm80211/sys/wlc_mac80211.c
drivers/staging/brcm80211/util/bcmsrom.c

index 2e0eab121e97385fd8422e0b7399b5f187dd5273..abf5d743b373ede388dcb27486c165d9c6103ae3 100644 (file)
@@ -772,7 +772,8 @@ wl_iw_set_wap(struct net_device *dev,
                return -EINVAL;
        }
 
-       if (ETHER_ISBCAST(awrq->sa_data) || ETHER_ISNULLADDR(awrq->sa_data)) {
+       if (is_broadcast_ether_addr(awrq->sa_data) ||
+           is_zero_ether_addr(awrq->sa_data)) {
                scb_val_t scbval;
                memset(&scbval, 0, sizeof(scb_val_t));
                (void)dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval,
index 1b352c5e29b812340fb41b715e225c98b456f6e6..086b9b96212530a74ac6ae6e297d7dab94c4ef82 100644 (file)
@@ -66,19 +66,6 @@ BWL_PRE_PACKED_STRUCT struct ether_addr {
 
 static const struct ether_addr ether_bcast = { {255, 255, 255, 255, 255, 255} };
 
-#define ETHER_ISBCAST(ea)      ((((u8 *)(ea))[0] &             \
-       ((u8 *)(ea))[1] &               \
-       ((u8 *)(ea))[2] &               \
-       ((u8 *)(ea))[3] &               \
-       ((u8 *)(ea))[4] &               \
-       ((u8 *)(ea))[5]) == 0xff)
-#define ETHER_ISNULLADDR(ea)   ((((u8 *)(ea))[0] |             \
-       ((u8 *)(ea))[1] |               \
-       ((u8 *)(ea))[2] |               \
-       ((u8 *)(ea))[3] |               \
-       ((u8 *)(ea))[4] |               \
-       ((u8 *)(ea))[5]) == 0)
-
 #define ETHER_MOVE_HDR(d, s) \
 do { \
        struct ether_header t; \
index dff4f6bf77e282fb407250c5cf21bc8109599219..2baacfd3ba914b3b9fdfa07df7c1676ce4c07844 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
+#include <linux/etherdevice.h>
 #include <bcmdefs.h>
 #include <osl.h>
 #include <proto/802.11.h>
@@ -1022,8 +1023,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
                goto fail;
        }
        bcm_ether_atoe(macaddr, &wlc_hw->etheraddr);
-       if (ETHER_ISBCAST((char *)&wlc_hw->etheraddr) ||
-           ETHER_ISNULLADDR((char *)&wlc_hw->etheraddr)) {
+       if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) ||
+           is_zero_ether_addr(wlc_hw->etheraddr.octet)) {
                WL_ERROR(("wl%d: wlc_bmac_attach: bad macaddr %s\n", unit,
                          macaddr));
                err = 22;
index 24bf64d66227e4edb89be21c6603c82d710e3069..daa67c9641a84c9695e4632403e9ecb12045df73 100644 (file)
@@ -3633,8 +3633,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
                                u16 lo;
                                u32 hi;
                                /* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */
-                               if ((bsscfg->WPA_auth & WPA_AUTH_NONE)
-                                   && ETHER_ISNULLADDR(&key->ea)) {
+                               if ((bsscfg->WPA_auth & WPA_AUTH_NONE) &&
+                                   is_zero_ether_addr(key->ea.octet)) {
                                        lo = bsscfg->wpa_none_txiv.lo;
                                        hi = bsscfg->wpa_none_txiv.hi;
                                } else {
@@ -7026,7 +7026,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
        if (!is_amsdu) {
                /* CTS and ACK CTL frames are w/o a2 */
                if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
-                       if ((ETHER_ISNULLADDR(&h->a2) ||
+                       if ((is_zero_ether_addr(h->a2.octet) ||
                             is_multicast_ether_addr(h->a2.octet))) {
                                WL_ERROR(("wl%d: %s: dropping a frame with "
                                        "invalid src mac address, a2: %pM\n",
index 8393d58bab578c15b10101fa70440b9c739195c6..668dac6d44150e2c3a8a6736bdff8e0e42e35b0a 100644 (file)
@@ -502,7 +502,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars,
                                        /* set macaddr if HNBU_MACADDR not seen yet */
                                        if (eabuf[0] == '\0' &&
                                            cis[i] == LAN_NID &&
-                                           !(ETHER_ISNULLADDR(&cis[i + 2])) &&
+                                           !is_zero_ether_addr(&cis[i + 2]) &&
                                            !is_multicast_ether_addr(&cis[i + 2])) {
                                                ASSERT(cis[i + 1] ==
                                                       ETHER_ADDR_LEN);
@@ -974,7 +974,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars,
                                        break;
 
                                case HNBU_MACADDR:
-                                       if (!(ETHER_ISNULLADDR(&cis[i + 1])) &&
+                                       if (!is_zero_ether_addr(&cis[i + 1]) &&
                                            !is_multicast_ether_addr(&cis[i + 1])) {
                                                snprintf(eabuf, sizeof(eabuf),
                                                        "%pM", &cis[i + 1]);