diff options
author | Joe Perches <joe@perches.com> | 2010-12-13 19:56:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:21:27 -0500 |
commit | 3ca5ada504a41d9a8afd1e25f85f11d1761efa5f (patch) | |
tree | 02d7c55f00d2276e47347fca3d770878cf7b82d8 | |
parent | ee417a79567030ce726e9627aa52779e47c49ff0 (diff) |
staging: brcm80211: Convert ETHER_IS_MULTI to is_multicast_ether_addr
Use the standard kernel function.
Change callers to add .octet to addressing to avoid warnings.
Add #include <linux/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/dhd_linux.c | 2 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 2 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_iw.c | 2 | ||||
-rw-r--r-- | drivers/staging/brcm80211/include/proto/ethernet.h | 2 | ||||
-rw-r--r-- | drivers/staging/brcm80211/sys/wlc_mac80211.c | 16 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/bcmsrom.c | 11 |
6 files changed, 19 insertions, 16 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index a114deed3134..b37539cd2902 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -1032,7 +1032,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf) | |||
1032 | u8 *pktdata = (u8 *) (pktbuf->data); | 1032 | u8 *pktdata = (u8 *) (pktbuf->data); |
1033 | struct ether_header *eh = (struct ether_header *)pktdata; | 1033 | struct ether_header *eh = (struct ether_header *)pktdata; |
1034 | 1034 | ||
1035 | if (ETHER_ISMULTI(eh->ether_dhost)) | 1035 | if (is_multicast_ether_addr(eh->ether_dhost)) |
1036 | dhdp->tx_multicast++; | 1036 | dhdp->tx_multicast++; |
1037 | if (ntoh16(eh->ether_type) == ETHER_TYPE_802_1X) | 1037 | if (ntoh16(eh->ether_type) == ETHER_TYPE_802_1X) |
1038 | atomic_inc(&dhd->pend_8021x_cnt); | 1038 | atomic_inc(&dhd->pend_8021x_cnt); |
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index edf300d4ae70..59f7ca53364b 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -1532,7 +1532,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev, | |||
1532 | key.index = (u32) key_idx; | 1532 | key.index = (u32) key_idx; |
1533 | /* Instead of bcast for ea address for default wep keys, | 1533 | /* Instead of bcast for ea address for default wep keys, |
1534 | driver needs it to be Null */ | 1534 | driver needs it to be Null */ |
1535 | if (!ETHER_ISMULTI(mac_addr)) | 1535 | if (!is_multicast_ether_addr(mac_addr)) |
1536 | memcpy((char *)&key.ea, (void *)mac_addr, ETHER_ADDR_LEN); | 1536 | memcpy((char *)&key.ea, (void *)mac_addr, ETHER_ADDR_LEN); |
1537 | key.len = (u32) params->key_len; | 1537 | key.len = (u32) params->key_len; |
1538 | /* check for key index change */ | 1538 | /* check for key index change */ |
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index d8600bfc304e..2e0eab121e97 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c | |||
@@ -2548,7 +2548,7 @@ wl_iw_set_encodeext(struct net_device *dev, | |||
2548 | 2548 | ||
2549 | key.len = iwe->key_len; | 2549 | key.len = iwe->key_len; |
2550 | 2550 | ||
2551 | if (!ETHER_ISMULTI(iwe->addr.sa_data)) | 2551 | if (!is_multicast_ether_addr(iwe->addr.sa_data)) |
2552 | bcopy((void *)&iwe->addr.sa_data, (char *)&key.ea, | 2552 | bcopy((void *)&iwe->addr.sa_data, (char *)&key.ea, |
2553 | ETHER_ADDR_LEN); | 2553 | ETHER_ADDR_LEN); |
2554 | 2554 | ||
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h index a8981f610347..a2353a50874e 100644 --- a/drivers/staging/brcm80211/include/proto/ethernet.h +++ b/drivers/staging/brcm80211/include/proto/ethernet.h | |||
@@ -64,8 +64,6 @@ BWL_PRE_PACKED_STRUCT struct ether_addr { | |||
64 | 64 | ||
65 | #define ETHER_SET_UNICAST(ea) (((u8 *)(ea))[0] = (((u8 *)(ea))[0] & ~1)) | 65 | #define ETHER_SET_UNICAST(ea) (((u8 *)(ea))[0] = (((u8 *)(ea))[0] & ~1)) |
66 | 66 | ||
67 | #define ETHER_ISMULTI(ea) (((const u8 *)(ea))[0] & 1) | ||
68 | |||
69 | #define ether_cmp(a, b) (!(((short *)a)[0] == ((short *)b)[0]) | \ | 67 | #define ether_cmp(a, b) (!(((short *)a)[0] == ((short *)b)[0]) | \ |
70 | !(((short *)a)[1] == ((short *)b)[1]) | \ | 68 | !(((short *)a)[1] == ((short *)b)[1]) | \ |
71 | !(((short *)a)[2] == ((short *)b)[2])) | 69 | !(((short *)a)[2] == ((short *)b)[2])) |
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index e4a4365f4bf7..24bf64d66227 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/ctype.h> | 17 | #include <linux/ctype.h> |
18 | #include <linux/etherdevice.h> | ||
18 | #include <bcmdefs.h> | 19 | #include <bcmdefs.h> |
19 | #include <bcmdevs.h> | 20 | #include <bcmdevs.h> |
20 | #include <wlc_cfg.h> | 21 | #include <wlc_cfg.h> |
@@ -5802,7 +5803,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, | |||
5802 | ASSERT(RSPEC_ACTIVE(rspec[k])); | 5803 | ASSERT(RSPEC_ACTIVE(rspec[k])); |
5803 | rspec[k] = WLC_RATE_1M; | 5804 | rspec[k] = WLC_RATE_1M; |
5804 | } else { | 5805 | } else { |
5805 | if (WLANTSEL_ENAB(wlc) && !ETHER_ISMULTI(&h->a1)) { | 5806 | if (WLANTSEL_ENAB(wlc) && |
5807 | !is_multicast_ether_addr(h->a1.octet)) { | ||
5806 | /* set tx antenna config */ | 5808 | /* set tx antenna config */ |
5807 | wlc_antsel_antcfg_get(wlc->asi, false, false, 0, | 5809 | wlc_antsel_antcfg_get(wlc->asi, false, false, 0, |
5808 | 0, &antcfg, &fbantcfg); | 5810 | 0, &antcfg, &fbantcfg); |
@@ -5963,7 +5965,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, | |||
5963 | plcp[0]; | 5965 | plcp[0]; |
5964 | 5966 | ||
5965 | /* DUR field for main rate */ | 5967 | /* DUR field for main rate */ |
5966 | if ((fc != FC_PS_POLL) && !ETHER_ISMULTI(&h->a1) && !use_rifs) { | 5968 | if ((fc != FC_PS_POLL) && |
5969 | !is_multicast_ether_addr(h->a1.octet) && !use_rifs) { | ||
5967 | durid = | 5970 | durid = |
5968 | wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0], | 5971 | wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0], |
5969 | next_frag_len); | 5972 | next_frag_len); |
@@ -5981,7 +5984,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, | |||
5981 | /* DUR field for fallback rate */ | 5984 | /* DUR field for fallback rate */ |
5982 | if (fc == FC_PS_POLL) | 5985 | if (fc == FC_PS_POLL) |
5983 | txh->FragDurFallback = h->durid; | 5986 | txh->FragDurFallback = h->durid; |
5984 | else if (ETHER_ISMULTI(&h->a1) || use_rifs) | 5987 | else if (is_multicast_ether_addr(h->a1.octet) || use_rifs) |
5985 | txh->FragDurFallback = 0; | 5988 | txh->FragDurFallback = 0; |
5986 | else { | 5989 | else { |
5987 | durid = wlc_compute_frame_dur(wlc, rspec[1], | 5990 | durid = wlc_compute_frame_dur(wlc, rspec[1], |
@@ -5993,7 +5996,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, | |||
5993 | if (frag == 0) | 5996 | if (frag == 0) |
5994 | mcl |= TXC_STARTMSDU; | 5997 | mcl |= TXC_STARTMSDU; |
5995 | 5998 | ||
5996 | if (!ETHER_ISMULTI(&h->a1)) | 5999 | if (!is_multicast_ether_addr(h->a1.octet)) |
5997 | mcl |= TXC_IMMEDACK; | 6000 | mcl |= TXC_IMMEDACK; |
5998 | 6001 | ||
5999 | if (BAND_5G(wlc->band->bandtype)) | 6002 | if (BAND_5G(wlc->band->bandtype)) |
@@ -6222,7 +6225,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, | |||
6222 | if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) { | 6225 | if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) { |
6223 | uint frag_dur, dur, dur_fallback; | 6226 | uint frag_dur, dur, dur_fallback; |
6224 | 6227 | ||
6225 | ASSERT(!ETHER_ISMULTI(&h->a1)); | 6228 | ASSERT(!is_multicast_ether_addr(h->a1.octet)); |
6226 | 6229 | ||
6227 | /* WME: Update TXOP threshold */ | 6230 | /* WME: Update TXOP threshold */ |
6228 | if ((!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) && (frag == 0)) { | 6231 | if ((!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) && (frag == 0)) { |
@@ -7023,7 +7026,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) | |||
7023 | if (!is_amsdu) { | 7026 | if (!is_amsdu) { |
7024 | /* CTS and ACK CTL frames are w/o a2 */ | 7027 | /* CTS and ACK CTL frames are w/o a2 */ |
7025 | 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) { |
7026 | if ((ETHER_ISNULLADDR(&h->a2) || ETHER_ISMULTI(&h->a2))) { | 7029 | if ((ETHER_ISNULLADDR(&h->a2) || |
7030 | is_multicast_ether_addr(h->a2.octet))) { | ||
7027 | WL_ERROR(("wl%d: %s: dropping a frame with " | 7031 | WL_ERROR(("wl%d: %s: dropping a frame with " |
7028 | "invalid src mac address, a2: %pM\n", | 7032 | "invalid src mac address, a2: %pM\n", |
7029 | wlc->pub->unit, __func__, &h->a2)); | 7033 | wlc->pub->unit, __func__, &h->a2)); |
diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c index 3a0beb93c0b6..8393d58bab57 100644 --- a/drivers/staging/brcm80211/util/bcmsrom.c +++ b/drivers/staging/brcm80211/util/bcmsrom.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <linux/etherdevice.h> | ||
18 | #include <bcmdefs.h> | 19 | #include <bcmdefs.h> |
19 | #include <osl.h> | 20 | #include <osl.h> |
20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
@@ -499,10 +500,10 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, | |||
499 | break; | 500 | break; |
500 | default: | 501 | default: |
501 | /* set macaddr if HNBU_MACADDR not seen yet */ | 502 | /* set macaddr if HNBU_MACADDR not seen yet */ |
502 | if (eabuf[0] == '\0' | 503 | if (eabuf[0] == '\0' && |
503 | && cis[i] == LAN_NID | 504 | cis[i] == LAN_NID && |
504 | && !(ETHER_ISNULLADDR(&cis[i + 2])) | 505 | !(ETHER_ISNULLADDR(&cis[i + 2])) && |
505 | && !(ETHER_ISMULTI(&cis[i + 2]))) { | 506 | !is_multicast_ether_addr(&cis[i + 2])) { |
506 | ASSERT(cis[i + 1] == | 507 | ASSERT(cis[i + 1] == |
507 | ETHER_ADDR_LEN); | 508 | ETHER_ADDR_LEN); |
508 | snprintf(eabuf, sizeof(eabuf), | 509 | snprintf(eabuf, sizeof(eabuf), |
@@ -974,7 +975,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, | |||
974 | 975 | ||
975 | case HNBU_MACADDR: | 976 | case HNBU_MACADDR: |
976 | if (!(ETHER_ISNULLADDR(&cis[i + 1])) && | 977 | if (!(ETHER_ISNULLADDR(&cis[i + 1])) && |
977 | !(ETHER_ISMULTI(&cis[i + 1]))) { | 978 | !is_multicast_ether_addr(&cis[i + 1])) { |
978 | snprintf(eabuf, sizeof(eabuf), | 979 | snprintf(eabuf, sizeof(eabuf), |
979 | "%pM", &cis[i + 1]); | 980 | "%pM", &cis[i + 1]); |
980 | 981 | ||