提交 670ea81e 编写于 作者: C Charles Clément 提交者: Greg Kroah-Hartman

Staging: vt6655: use is_multicast_ether_addr instead of custom macro

Replace custom macro IS_MULTICAST_ADDRESS by is_multicast_ether_addr
from <linux/etherdevice.h>.
Remove linux/if_ether.h include as it is included in
linux/etherdevice.h already.
Signed-off-by: NCharles Clément <caratorn@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c92069f3
...@@ -2307,7 +2307,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { ...@@ -2307,7 +2307,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return 0; return 0;
} }
if (IS_MULTICAST_ADDRESS((PBYTE)(skb->data))) { if (is_multicast_ether_addr((PBYTE)(skb->data))) {
uNodeIndex = 0; uNodeIndex = 0;
bNodeExist = TRUE; bNodeExist = TRUE;
if (pMgmt->sNodeDBTable[0].bPSEnable) { if (pMgmt->sNodeDBTable[0].bPSEnable) {
......
...@@ -463,7 +463,7 @@ device_receive_frame ( ...@@ -463,7 +463,7 @@ device_receive_frame (
return FALSE; return FALSE;
} }
if (!IS_MULTICAST_ADDRESS(pbyFrame) && !IS_BROADCAST_ADDRESS(pbyFrame)) { if (!is_multicast_ether_addr(pbyFrame) && !IS_BROADCAST_ADDRESS(pbyFrame)) {
if (WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) (skb->data + 4))) { if (WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) (skb->data + 4))) {
pDevice->s802_11Counter.FrameDuplicateCount++; pDevice->s802_11Counter.FrameDuplicateCount++;
return FALSE; return FALSE;
...@@ -1460,7 +1460,7 @@ static BOOL s_bAPModeRxData ( ...@@ -1460,7 +1460,7 @@ static BOOL s_bAPModeRxData (
if (FrameSize > CB_MAX_BUF_SIZE) if (FrameSize > CB_MAX_BUF_SIZE)
return FALSE; return FALSE;
// check DA // check DA
if(IS_MULTICAST_ADDRESS((PBYTE)(skb->data+cbHeaderOffset))) { if(is_multicast_ether_addr((PBYTE)(skb->data+cbHeaderOffset))) {
if (pMgmt->sNodeDBTable[0].bPSEnable) { if (pMgmt->sNodeDBTable[0].bPSEnable) {
skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz); skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz);
......
...@@ -475,7 +475,7 @@ STAvUpdateTDStatCounter ( ...@@ -475,7 +475,7 @@ STAvUpdateTDStatCounter (
pStatistic->ullTxBroadcastFrames[uIdx]++; pStatistic->ullTxBroadcastFrames[uIdx]++;
pStatistic->ullTxBroadcastBytes[uIdx] += (ULONGLONG)cbFrameLength; pStatistic->ullTxBroadcastBytes[uIdx] += (ULONGLONG)cbFrameLength;
} }
else if (IS_MULTICAST_ADDRESS(pbyDestAddr)) { else if (is_multicast_ether_addr(pbyDestAddr)) {
pStatistic->ullTxMulticastFrames[uIdx]++; pStatistic->ullTxMulticastFrames[uIdx]++;
pStatistic->ullTxMulticastBytes[uIdx] += (ULONGLONG)cbFrameLength; pStatistic->ullTxMulticastBytes[uIdx] += (ULONGLONG)cbFrameLength;
} }
...@@ -497,7 +497,7 @@ STAvUpdateTDStatCounter ( ...@@ -497,7 +497,7 @@ STAvUpdateTDStatCounter (
if (IS_BROADCAST_ADDRESS(pbyDestAddr)) if (IS_BROADCAST_ADDRESS(pbyDestAddr))
pStatistic->dwTsrBroadcast[uIdx]++; pStatistic->dwTsrBroadcast[uIdx]++;
else if (IS_MULTICAST_ADDRESS(pbyDestAddr)) else if (is_multicast_ether_addr(pbyDestAddr))
pStatistic->dwTsrMulticast[uIdx]++; pStatistic->dwTsrMulticast[uIdx]++;
else else
pStatistic->dwTsrDirected[uIdx]++; pStatistic->dwTsrDirected[uIdx]++;
......
...@@ -1394,7 +1394,7 @@ s_cbFillTxBufHead ( ...@@ -1394,7 +1394,7 @@ s_cbFillTxBufHead (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
} }
...@@ -2123,7 +2123,7 @@ vGenerateFIFOHeader ( ...@@ -2123,7 +2123,7 @@ vGenerateFIFOHeader (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK); pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
...@@ -2424,7 +2424,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { ...@@ -2424,7 +2424,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
if (IS_MULTICAST_ADDRESS(&(pPacket->p80211Header->sA3.abyAddr1[0])) || if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])) ||
IS_BROADCAST_ADDRESS(&(pPacket->p80211Header->sA3.abyAddr1[0]))) { IS_BROADCAST_ADDRESS(&(pPacket->p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
} }
...@@ -2760,7 +2760,7 @@ cbGetFragCount ( ...@@ -2760,7 +2760,7 @@ cbGetFragCount (
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
} }
...@@ -2938,7 +2938,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU ...@@ -2938,7 +2938,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
if (IS_MULTICAST_ADDRESS(&(p80211Header->sA3.abyAddr1[0])) || if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0])) ||
IS_BROADCAST_ADDRESS(&(p80211Header->sA3.abyAddr1[0]))) { IS_BROADCAST_ADDRESS(&(p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
if (pDevice->bEnableHostWEP) { if (pDevice->bEnableHostWEP) {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef __TETHER_H__ #ifndef __TETHER_H__
#define __TETHER_H__ #define __TETHER_H__
#include <linux/if_ether.h> #include <linux/etherdevice.h>
#include "ttype.h" #include "ttype.h"
/*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Definitions -------------------------*/
...@@ -188,9 +188,6 @@ S802_11Header, *PS802_11Header; ...@@ -188,9 +188,6 @@ S802_11Header, *PS802_11Header;
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
// Frame type macro // Frame type macro
#define IS_MULTICAST_ADDRESS(pbyEtherAddr) \
((*(PBYTE)(pbyEtherAddr) & 0x01) == 1)
#define IS_BROADCAST_ADDRESS(pbyEtherAddr) ( \ #define IS_BROADCAST_ADDRESS(pbyEtherAddr) ( \
(*(PDWORD)(pbyEtherAddr) == 0xFFFFFFFFL) && \ (*(PDWORD)(pbyEtherAddr) == 0xFFFFFFFFL) && \
(*(PWORD)((PBYTE)(pbyEtherAddr) + 4) == 0xFFFF) \ (*(PWORD)((PBYTE)(pbyEtherAddr) + 4) == 0xFFFF) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册