summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6655
diff options
context:
space:
mode:
authorCharles Clément <caratorn@gmail.com>2010-06-30 09:46:24 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-08 13:02:56 -0700
commit388bf2e8fe0cd499e1a440648ab0d95cd66a114f (patch)
tree28f6fd520e8fb69fd8ed3179dcbd6c90b0534b89 /drivers/staging/vt6655
parent5583dcf587fa59a5de10b554815f3121919f2648 (diff)
downloadlinux-388bf2e8fe0cd499e1a440648ab0d95cd66a114f.tar.gz
linux-388bf2e8fe0cd499e1a440648ab0d95cd66a114f.tar.bz2
linux-388bf2e8fe0cd499e1a440648ab0d95cd66a114f.zip
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: Charles Clément <caratorn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r--drivers/staging/vt6655/dpc.c2
-rw-r--r--drivers/staging/vt6655/rxtx.c26
2 files changed, 9 insertions, 19 deletions
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 882c2f6c3413..c7ffdea75490 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -443,7 +443,7 @@ device_receive_frame (
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))) {
pDevice->s802_11Counter.FrameDuplicateCount++;
return FALSE;
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 870363559f85..802de278675b 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -1372,13 +1372,10 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
- is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
- bNeedACK = FALSE;
- }
- else {
+ if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
+ bNeedACK = FALSE;
+ else
bNeedACK = TRUE;
- }
bIsAdhoc = TRUE;
}
else {
@@ -2091,8 +2088,7 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
- is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
+ if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = FALSE;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
}
@@ -2392,10 +2388,8 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
- if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])) ||
- is_broadcast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0]))) {
+ if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])))
bNeedACK = FALSE;
- }
else {
bNeedACK = TRUE;
pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK;
@@ -2728,13 +2722,10 @@ cbGetFragCount (
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])) ||
- is_broadcast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
+ if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
bNeedACK = FALSE;
- }
- else {
+ else
bNeedACK = TRUE;
- }
}
else {
// MSDUs in Infra mode always need ACK
@@ -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);
- if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0])) ||
- is_broadcast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) {
+ if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = FALSE;
if (pDevice->bEnableHostWEP) {
uNodeIndex = 0;