Commit 14fc4235 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: Remove test of is_broadcast with is_multicast

A broadcast packet is a multicast packet, no need to test twice.

Reorder one defective test in rtl_core of is_multi_ether_addr
before is_broadcast_ether_addr as the is_multi returns true for
broadcast frames.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 82a74d4a
...@@ -413,10 +413,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, ...@@ -413,10 +413,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
/* Determine fragmentation size based on destination (multicast /* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */ * and broadcast are not fragmented) */
// if (is_multicast_ether_addr(dest) || if (is_multicast_ether_addr(header.addr1)) {
// is_broadcast_ether_addr(dest)) {
if (is_multicast_ether_addr(header.addr1) ||
is_broadcast_ether_addr(header.addr1)) {
frag_size = MAX_FRAG_THRESHOLD; frag_size = MAX_FRAG_THRESHOLD;
qos_ctl = QOS_CTL_NOTCONTAIN_ACK; qos_ctl = QOS_CTL_NOTCONTAIN_ACK;
} }
......
...@@ -2003,8 +2003,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority, ...@@ -2003,8 +2003,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
} }
memcpy(&dest, frag_hdr->addr1, ETH_ALEN); memcpy(&dest, frag_hdr->addr1, ETH_ALEN);
if (is_multicast_ether_addr(dest) || if (is_multicast_ether_addr(dest)) {
is_broadcast_ether_addr(dest)) {
Duration = 0; Duration = 0;
RtsDur = 0; RtsDur = 0;
bRTSEnable = 0; bRTSEnable = 0;
......
...@@ -2024,10 +2024,10 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) ...@@ -2024,10 +2024,10 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
stype = WLAN_FC_GET_STYPE(fc); stype = WLAN_FC_GET_STYPE(fc);
pda_addr = header->addr1; pda_addr = header->addr1;
if (is_multicast_ether_addr(pda_addr)) if (is_broadcast_ether_addr(pda_addr))
multi_addr = true;
else if (is_broadcast_ether_addr(pda_addr))
broad_addr = true; broad_addr = true;
else if (is_multicast_ether_addr(pda_addr))
multi_addr = true;
else else
uni_addr = true; uni_addr = true;
...@@ -2358,8 +2358,7 @@ static void rtl8192_rx_normal(struct net_device *dev) ...@@ -2358,8 +2358,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
stats.RxBufShift); stats.RxBufShift);
skb_trim(skb, skb->len - 4/*sCrcLng*/); skb_trim(skb, skb->len - 4/*sCrcLng*/);
rtllib_hdr = (struct rtllib_hdr_1addr *)skb->data; rtllib_hdr = (struct rtllib_hdr_1addr *)skb->data;
if (!is_broadcast_ether_addr(rtllib_hdr->addr1) && if (!is_multicast_ether_addr(rtllib_hdr->addr1)) {
!is_multicast_ether_addr(rtllib_hdr->addr1)) {
/* unicast packet */ /* unicast packet */
unicast_packet = true; unicast_packet = true;
} }
......
...@@ -310,7 +310,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -310,7 +310,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{ {
u8 UP = 0; u8 UP = 0;
if (is_broadcast_ether_addr(Addr) || is_multicast_ether_addr(Addr)) { if (is_multicast_ether_addr(Addr)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! get TS for Broadcast or " RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! get TS for Broadcast or "
"Multicast\n"); "Multicast\n");
return false; return false;
......
...@@ -1000,7 +1000,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, ...@@ -1000,7 +1000,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc,
return -1; return -1;
/* {broad,multi}cast packets to our BSS go through */ /* {broad,multi}cast packets to our BSS go through */
if (is_multicast_ether_addr(dst) || is_broadcast_ether_addr(dst)) { if (is_multicast_ether_addr(dst)) {
if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN)) if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN))
return -1; return -1;
} }
...@@ -1269,7 +1269,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -1269,7 +1269,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
sc = le16_to_cpu(hdr->seq_ctl); sc = le16_to_cpu(hdr->seq_ctl);
/*Filter pkt not to me*/ /*Filter pkt not to me*/
multicast = is_multicast_ether_addr(hdr->addr1)|is_broadcast_ether_addr(hdr->addr1); multicast = is_multicast_ether_addr(hdr->addr1);
unicast = !multicast; unicast = !multicast;
if (unicast && (compare_ether_addr(dev->dev_addr, hdr->addr1) != 0)) { if (unicast && (compare_ether_addr(dev->dev_addr, hdr->addr1) != 0)) {
if (ieee->bNetPromiscuousMode) if (ieee->bNetPromiscuousMode)
...@@ -1350,7 +1350,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -1350,7 +1350,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
/* Get TS for Rx Reorder */ /* Get TS for Rx Reorder */
hdr = (struct rtllib_hdr_4addr *) skb->data; hdr = (struct rtllib_hdr_4addr *) skb->data;
if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
&& !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1) && !is_multicast_ether_addr(hdr->addr1)
&& (!bToOtherSTA)) { && (!bToOtherSTA)) {
TID = Frame_QoSTID(skb->data); TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc); SeqNum = WLAN_GET_SEQ_SEQ(sc);
......
...@@ -296,8 +296,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, ...@@ -296,8 +296,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee,
return; return;
if (!IsQoSDataFrame(skb->data)) if (!IsQoSDataFrame(skb->data))
return; return;
if (is_multicast_ether_addr(hdr->addr1) || if (is_multicast_ether_addr(hdr->addr1))
is_broadcast_ether_addr(hdr->addr1))
return; return;
if (tcb_desc->bdhcp || ieee->CntAfterLink < 2) if (tcb_desc->bdhcp || ieee->CntAfterLink < 2)
...@@ -515,7 +514,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -515,7 +514,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb,
{ {
u16 seqnum = 0; u16 seqnum = 0;
if (is_multicast_ether_addr(dst) || is_broadcast_ether_addr(dst)) if (is_multicast_ether_addr(dst))
return 0; return 0;
if (IsQoSDataFrame(skb->data)) { if (IsQoSDataFrame(skb->data)) {
struct tx_ts_record *pTS = NULL; struct tx_ts_record *pTS = NULL;
...@@ -698,8 +697,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) ...@@ -698,8 +697,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
ETH_ALEN); ETH_ALEN);
} }
bIsMulticast = is_broadcast_ether_addr(header.addr1) || bIsMulticast = is_multicast_ether_addr(header.addr1);
is_multicast_ether_addr(header.addr1);
header.frame_ctl = cpu_to_le16(fc); header.frame_ctl = cpu_to_le16(fc);
......
...@@ -1285,7 +1285,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1285,7 +1285,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
*/ */
//added by amy for reorder //added by amy for reorder
if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
&& !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1)) && !is_multicast_ether_addr(hdr->addr1))
{ {
TID = Frame_QoSTID(skb->data); TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc); SeqNum = WLAN_GET_SEQ_SEQ(sc);
......
...@@ -314,7 +314,7 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s ...@@ -314,7 +314,7 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s
if (!IsQoSDataFrame(skb->data)) if (!IsQoSDataFrame(skb->data))
return; return;
if (is_multicast_ether_addr(hdr->addr1) || is_broadcast_ether_addr(hdr->addr1)) if (is_multicast_ether_addr(hdr->addr1))
return; return;
//check packet and mode later //check packet and mode later
#ifdef TO_DO_LIST #ifdef TO_DO_LIST
...@@ -575,7 +575,7 @@ void ieee80211_txrate_selectmode(struct ieee80211_device* ieee, cb_desc* tcb_des ...@@ -575,7 +575,7 @@ void ieee80211_txrate_selectmode(struct ieee80211_device* ieee, cb_desc* tcb_des
void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u8* dst) void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u8* dst)
{ {
if (is_multicast_ether_addr(dst) || is_broadcast_ether_addr(dst)) if (is_multicast_ether_addr(dst))
return; return;
if (IsQoSDataFrame(skb->data)) //we deal qos data only if (IsQoSDataFrame(skb->data)) //we deal qos data only
{ {
...@@ -693,8 +693,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -693,8 +693,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
/* Determine fragmentation size based on destination (multicast /* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */ * and broadcast are not fragmented) */
if (is_multicast_ether_addr(header.addr1) || if (is_multicast_ether_addr(header.addr1)) {
is_broadcast_ether_addr(header.addr1)) {
frag_size = MAX_FRAG_THRESHOLD; frag_size = MAX_FRAG_THRESHOLD;
qos_ctl |= QOS_CTL_NOTCONTAIN_ACK; qos_ctl |= QOS_CTL_NOTCONTAIN_ACK;
} }
......
...@@ -350,7 +350,7 @@ bool GetTs( ...@@ -350,7 +350,7 @@ bool GetTs(
// We do not build any TS for Broadcast or Multicast stream. // We do not build any TS for Broadcast or Multicast stream.
// So reject these kinds of search here. // So reject these kinds of search here.
// //
if(is_broadcast_ether_addr(Addr) || is_multicast_ether_addr(Addr)) if (is_multicast_ether_addr(Addr))
{ {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n"); IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n");
return false; return false;
......
...@@ -452,7 +452,7 @@ RXbBulkInProcessData ( ...@@ -452,7 +452,7 @@ RXbBulkInProcessData (
} }
} }
if (!is_multicast_ether_addr(pMACHeader->abyAddr1) && !is_broadcast_ether_addr(pMACHeader->abyAddr1)) { if (!is_multicast_ether_addr(pMACHeader->abyAddr1)) {
if ( WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) pbyFrame) ) { if ( WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) pbyFrame) ) {
pDevice->s802_11Counter.FrameDuplicateCount++; pDevice->s802_11Counter.FrameDuplicateCount++;
return FALSE; return FALSE;
......
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