Commit 388bf2e8 authored by Charles Clément's avatar Charles Clément Committed by Greg Kroah-Hartman

Staging: vt6655: simplify broadcast and multicast ethernet address test

A broadcast address is also a multicast address so simplify test cases where
possible.

As suggested by Joe Perches.
Signed-off-by: default avatarCharles Clément <caratorn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5583dcf5
...@@ -443,7 +443,7 @@ device_receive_frame ( ...@@ -443,7 +443,7 @@ device_receive_frame (
return FALSE; return FALSE;
} }
if (!is_multicast_ether_addr(pbyFrame) && !is_broadcast_ether_addr(pbyFrame)) { if (!is_multicast_ether_addr(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;
......
...@@ -1372,13 +1372,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ...@@ -1372,13 +1372,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
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_ether_addr(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
} else
else {
bNeedACK = TRUE; bNeedACK = TRUE;
}
bIsAdhoc = TRUE; bIsAdhoc = TRUE;
} }
else { else {
...@@ -2091,8 +2088,7 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb ...@@ -2091,8 +2088,7 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
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_ether_addr(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK); pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
} }
...@@ -2392,10 +2388,8 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { ...@@ -2392,10 +2388,8 @@ 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_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])) || if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])))
is_broadcast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
}
else { else {
bNeedACK = TRUE; bNeedACK = TRUE;
pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK; pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK;
...@@ -2728,14 +2722,11 @@ cbGetFragCount ( ...@@ -2728,14 +2722,11 @@ 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_ether_addr(&(psEthHeader->abyDstAddr[0])) || if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
} else
else {
bNeedACK = TRUE; bNeedACK = TRUE;
} }
}
else { else {
// MSDUs in Infra mode always need ACK // MSDUs in Infra mode always need ACK
bNeedACK = TRUE; bNeedACK = TRUE;
...@@ -2906,8 +2897,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un ...@@ -2906,8 +2897,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0])) || if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) {
is_broadcast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = FALSE; bNeedACK = FALSE;
if (pDevice->bEnableHostWEP) { if (pDevice->bEnableHostWEP) {
uNodeIndex = 0; uNodeIndex = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment