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

staging: rtl8723au: OnDeAuth23a() use ieee80211 header defines

Use the proper ieee80211.h structs to parse the response instead of
hard coded offsets.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7a15995
......@@ -1702,19 +1702,18 @@ unsigned int OnAssocRsp23a(struct rtw_adapter *padapter,
unsigned int OnDeAuth23a(struct rtw_adapter *padapter,
struct recv_frame *precv_frame)
{
unsigned short reason;
unsigned short reason;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct sk_buff *skb = precv_frame->pkt;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
u8 *pframe = skb->data;
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) skb->data;
/* check A3 */
if (!ether_addr_equal(hdr->addr3, get_my_bssid23a(&pmlmeinfo->network)))
if (!ether_addr_equal(mgmt->bssid,
get_my_bssid23a(&pmlmeinfo->network)))
return _SUCCESS;
reason = le16_to_cpu(*(unsigned short *)(pframe + sizeof(struct ieee80211_hdr_3addr)));
reason = le16_to_cpu(mgmt->u.deauth.reason_code);
DBG_8723A("%s Reason code(%d)\n", __func__, reason);
......@@ -1724,9 +1723,9 @@ unsigned int OnDeAuth23a(struct rtw_adapter *padapter,
struct sta_priv *pstapriv = &padapter->stapriv;
DBG_8723A_LEVEL(_drv_always_, "ap recv deauth reason code(%d) "
"sta:%pM\n", reason, hdr->addr2);
"sta:%pM\n", reason, mgmt->sa);
psta = rtw_get_stainfo23a(pstapriv, hdr->addr2);
psta = rtw_get_stainfo23a(pstapriv, mgmt->sa);
if (psta) {
u8 updated = 0;
......@@ -1743,16 +1742,16 @@ unsigned int OnDeAuth23a(struct rtw_adapter *padapter,
}
return _SUCCESS;
}
else
} else
#endif
{
DBG_8723A_LEVEL(_drv_always_, "sta recv deauth reason code(%d) "
"sta:%pM\n", reason, hdr->addr3);
"sta:%pM\n", reason, mgmt->bssid);
receive_disconnect23a(padapter, hdr->addr3, reason);
receive_disconnect23a(padapter, mgmt->bssid, reason);
}
pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
return _SUCCESS;
}
......
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