Commit 9c4a961d authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Fold get_hdr_bssid() into update_recvframe_phyinfo()

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3071081
......@@ -201,14 +201,36 @@ void update_recvframe_phyinfo(struct recv_frame *precvframe,
struct sta_info *psta;
struct sk_buff *skb = precvframe->pkt;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
u8 *wlanhdr = skb->data;
pkt_info.bPacketMatchBSSID =
(!ieee80211_is_ctl(hdr->frame_control) &&
!pattrib->icv_err &&
!pattrib->crc_err &&
!memcmp(get_hdr_bssid(wlanhdr),
get_bssid(&padapter->mlmepriv), ETH_ALEN));
bool matchbssid = false;
u8 *bssid;
matchbssid = (!ieee80211_is_ctl(hdr->frame_control) &&
!pattrib->icv_err && !pattrib->crc_err);
if (matchbssid) {
switch (hdr->frame_control &
cpu_to_le16(IEEE80211_FCTL_TODS |
IEEE80211_FCTL_FROMDS)) {
case cpu_to_le16(IEEE80211_FCTL_TODS):
bssid = hdr->addr1;
break;
case cpu_to_le16(IEEE80211_FCTL_FROMDS):
bssid = hdr->addr2;
break;
case cpu_to_le16(0):
bssid = hdr->addr3;
break;
default:
bssid = NULL;
matchbssid = false;
}
if (bssid)
matchbssid = ether_addr_equal(
get_bssid(&padapter->mlmepriv), bssid);
}
pkt_info.bPacketMatchBSSID = matchbssid;
da = ieee80211_get_DA(hdr);
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
......
......@@ -158,35 +158,6 @@ enum WIFI_REG_DOMAIN {
(((ieee80211_has_tods(pbuf)<<1) | \
ieee80211_has_fromds(pbuf)) == 3 ? 30 : 24))) & 0x000f)
static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
{
unsigned char *sa;
unsigned int to_fr_ds;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) pframe;
to_fr_ds = (ieee80211_has_tods(hdr->frame_control) << 1) |
ieee80211_has_fromds(hdr->frame_control);
switch (to_fr_ds) {
case 0x00: /* ToDs=0, FromDs=0 */
sa = hdr->addr3;
break;
case 0x01: /* ToDs=0, FromDs=1 */
sa = hdr->addr2;
break;
case 0x02: /* ToDs=1, FromDs=0 */
sa = hdr->addr1;
break;
case 0x03: /* ToDs=1, FromDs=1 */
sa = hdr->addr1;
break;
default:
sa = NULL; /* */
break;
}
return sa;
}
/*-----------------------------------------------------------------------------
Below is for the security related definition
------------------------------------------------------------------------------*/
......
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