diff options
author | Joe Perches <joe@perches.com> | 2010-12-13 19:57:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:21:27 -0500 |
commit | ed9568687e82c56017ca1aacf6eda9902939bf4a (patch) | |
tree | 4a666c802bd51aeac289905d0b4ce023dfe37b0b | |
parent | 47c6de7d37619d105de0367aece9ab10288225bc (diff) |
staging: brcm80211: Convert ETHER_IS<FOO> to is_<foo>_ether_addr
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>
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_iw.c | 3 | ||||
-rw-r--r-- | drivers/staging/brcm80211/include/proto/ethernet.h | 13 | ||||
-rw-r--r-- | drivers/staging/brcm80211/sys/wlc_bmac.c | 5 | ||||
-rw-r--r-- | drivers/staging/brcm80211/sys/wlc_mac80211.c | 6 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/bcmsrom.c | 4 |
5 files changed, 10 insertions, 21 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index 2e0eab121e97..abf5d743b373 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c | |||
@@ -772,7 +772,8 @@ wl_iw_set_wap(struct net_device *dev, | |||
772 | return -EINVAL; | 772 | return -EINVAL; |
773 | } | 773 | } |
774 | 774 | ||
775 | if (ETHER_ISBCAST(awrq->sa_data) || ETHER_ISNULLADDR(awrq->sa_data)) { | 775 | if (is_broadcast_ether_addr(awrq->sa_data) || |
776 | is_zero_ether_addr(awrq->sa_data)) { | ||
776 | scb_val_t scbval; | 777 | scb_val_t scbval; |
777 | memset(&scbval, 0, sizeof(scb_val_t)); | 778 | memset(&scbval, 0, sizeof(scb_val_t)); |
778 | (void)dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval, | 779 | (void)dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval, |
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h index 1b352c5e29b8..086b9b962125 100644 --- a/drivers/staging/brcm80211/include/proto/ethernet.h +++ b/drivers/staging/brcm80211/include/proto/ethernet.h | |||
@@ -66,19 +66,6 @@ BWL_PRE_PACKED_STRUCT struct ether_addr { | |||
66 | 66 | ||
67 | static const struct ether_addr ether_bcast = { {255, 255, 255, 255, 255, 255} }; | 67 | static const struct ether_addr ether_bcast = { {255, 255, 255, 255, 255, 255} }; |
68 | 68 | ||
69 | #define ETHER_ISBCAST(ea) ((((u8 *)(ea))[0] & \ | ||
70 | ((u8 *)(ea))[1] & \ | ||
71 | ((u8 *)(ea))[2] & \ | ||
72 | ((u8 *)(ea))[3] & \ | ||
73 | ((u8 *)(ea))[4] & \ | ||
74 | ((u8 *)(ea))[5]) == 0xff) | ||
75 | #define ETHER_ISNULLADDR(ea) ((((u8 *)(ea))[0] | \ | ||
76 | ((u8 *)(ea))[1] | \ | ||
77 | ((u8 *)(ea))[2] | \ | ||
78 | ((u8 *)(ea))[3] | \ | ||
79 | ((u8 *)(ea))[4] | \ | ||
80 | ((u8 *)(ea))[5]) == 0) | ||
81 | |||
82 | #define ETHER_MOVE_HDR(d, s) \ | 69 | #define ETHER_MOVE_HDR(d, s) \ |
83 | do { \ | 70 | do { \ |
84 | struct ether_header t; \ | 71 | struct ether_header t; \ |
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c index dff4f6bf77e2..2baacfd3ba91 100644 --- a/drivers/staging/brcm80211/sys/wlc_bmac.c +++ b/drivers/staging/brcm80211/sys/wlc_bmac.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
23 | #include <linux/etherdevice.h> | ||
23 | #include <bcmdefs.h> | 24 | #include <bcmdefs.h> |
24 | #include <osl.h> | 25 | #include <osl.h> |
25 | #include <proto/802.11.h> | 26 | #include <proto/802.11.h> |
@@ -1022,8 +1023,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, | |||
1022 | goto fail; | 1023 | goto fail; |
1023 | } | 1024 | } |
1024 | bcm_ether_atoe(macaddr, &wlc_hw->etheraddr); | 1025 | bcm_ether_atoe(macaddr, &wlc_hw->etheraddr); |
1025 | if (ETHER_ISBCAST((char *)&wlc_hw->etheraddr) || | 1026 | if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) || |
1026 | ETHER_ISNULLADDR((char *)&wlc_hw->etheraddr)) { | 1027 | is_zero_ether_addr(wlc_hw->etheraddr.octet)) { |
1027 | WL_ERROR(("wl%d: wlc_bmac_attach: bad macaddr %s\n", unit, | 1028 | WL_ERROR(("wl%d: wlc_bmac_attach: bad macaddr %s\n", unit, |
1028 | macaddr)); | 1029 | macaddr)); |
1029 | err = 22; | 1030 | err = 22; |
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index 24bf64d66227..daa67c9641a8 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c | |||
@@ -3633,8 +3633,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, | |||
3633 | u16 lo; | 3633 | u16 lo; |
3634 | u32 hi; | 3634 | u32 hi; |
3635 | /* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */ | 3635 | /* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */ |
3636 | if ((bsscfg->WPA_auth & WPA_AUTH_NONE) | 3636 | if ((bsscfg->WPA_auth & WPA_AUTH_NONE) && |
3637 | && ETHER_ISNULLADDR(&key->ea)) { | 3637 | is_zero_ether_addr(key->ea.octet)) { |
3638 | lo = bsscfg->wpa_none_txiv.lo; | 3638 | lo = bsscfg->wpa_none_txiv.lo; |
3639 | hi = bsscfg->wpa_none_txiv.hi; | 3639 | hi = bsscfg->wpa_none_txiv.hi; |
3640 | } else { | 3640 | } else { |
@@ -7026,7 +7026,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) | |||
7026 | if (!is_amsdu) { | 7026 | if (!is_amsdu) { |
7027 | /* CTS and ACK CTL frames are w/o a2 */ | 7027 | /* CTS and ACK CTL frames are w/o a2 */ |
7028 | if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) { | 7028 | if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) { |
7029 | if ((ETHER_ISNULLADDR(&h->a2) || | 7029 | if ((is_zero_ether_addr(h->a2.octet) || |
7030 | is_multicast_ether_addr(h->a2.octet))) { | 7030 | is_multicast_ether_addr(h->a2.octet))) { |
7031 | WL_ERROR(("wl%d: %s: dropping a frame with " | 7031 | WL_ERROR(("wl%d: %s: dropping a frame with " |
7032 | "invalid src mac address, a2: %pM\n", | 7032 | "invalid src mac address, a2: %pM\n", |
diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c index 8393d58bab57..668dac6d4415 100644 --- a/drivers/staging/brcm80211/util/bcmsrom.c +++ b/drivers/staging/brcm80211/util/bcmsrom.c | |||
@@ -502,7 +502,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, | |||
502 | /* set macaddr if HNBU_MACADDR not seen yet */ | 502 | /* set macaddr if HNBU_MACADDR not seen yet */ |
503 | if (eabuf[0] == '\0' && | 503 | if (eabuf[0] == '\0' && |
504 | cis[i] == LAN_NID && | 504 | cis[i] == LAN_NID && |
505 | !(ETHER_ISNULLADDR(&cis[i + 2])) && | 505 | !is_zero_ether_addr(&cis[i + 2]) && |
506 | !is_multicast_ether_addr(&cis[i + 2])) { | 506 | !is_multicast_ether_addr(&cis[i + 2])) { |
507 | ASSERT(cis[i + 1] == | 507 | ASSERT(cis[i + 1] == |
508 | ETHER_ADDR_LEN); | 508 | ETHER_ADDR_LEN); |
@@ -974,7 +974,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, | |||
974 | break; | 974 | break; |
975 | 975 | ||
976 | case HNBU_MACADDR: | 976 | case HNBU_MACADDR: |
977 | if (!(ETHER_ISNULLADDR(&cis[i + 1])) && | 977 | if (!is_zero_ether_addr(&cis[i + 1]) && |
978 | !is_multicast_ether_addr(&cis[i + 1])) { | 978 | !is_multicast_ether_addr(&cis[i + 1])) { |
979 | snprintf(eabuf, sizeof(eabuf), | 979 | snprintf(eabuf, sizeof(eabuf), |
980 | "%pM", &cis[i + 1]); | 980 | "%pM", &cis[i + 1]); |