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

staging: rtl8723au: _issue_deauth(): Use struct ieee80211_mgmt to build frame

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c144c3bb
...@@ -3840,8 +3840,7 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da, ...@@ -3840,8 +3840,7 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da,
{ {
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pframe; struct ieee80211_mgmt *mgmt;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
...@@ -3860,27 +3859,21 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da, ...@@ -3860,27 +3859,21 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da,
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; mgmt = (struct ieee80211_mgmt *)(pmgntframe->buf_addr + TXDESC_OFFSET);
pwlanhdr = (struct ieee80211_hdr *)pframe;
pwlanhdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | mgmt->frame_control =
IEEE80211_STYPE_DEAUTH); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH);
ether_addr_copy(pwlanhdr->addr1, da); ether_addr_copy(mgmt->da, da);
ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv)); ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv));
ether_addr_copy(pwlanhdr->addr3, get_my_bssid23a(&pmlmeinfo->network)); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network));
pwlanhdr->seq_ctrl = mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq));
cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq));
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr) + 2;
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
reason = cpu_to_le16(reason); mgmt->u.deauth.reason_code = cpu_to_le16(reason);
pframe = rtw_set_fixed_ie23a(pframe, WLAN_REASON_PREV_AUTH_NOT_VALID,
(unsigned char *)&reason,
&pattrib->pktlen);
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
......
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