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

staging: rtl8723au: ioctl_cfg80211.c: Use struct ieee80211_mgmt to build mgmt frame

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e74d336
...@@ -2437,17 +2437,15 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter, ...@@ -2437,17 +2437,15 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter,
{ {
s32 freq; s32 freq;
int channel; int channel;
u8 *pmgmt_frame;
uint frame_len; uint frame_len;
struct ieee80211_hdr *pwlanhdr; struct ieee80211_mgmt mgmt;
u8 mgmt_buf[128];
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;
struct net_device *ndev = padapter->pnetdev; struct net_device *ndev = padapter->pnetdev;
DBG_8723A("%s(padapter =%p,%s)\n", __func__, padapter, ndev->name); DBG_8723A("%s(padapter =%p,%s)\n", __func__, padapter, ndev->name);
memset(mgmt_buf, 0, 128); memset(&mgmt, 0, sizeof(struct ieee80211_mgmt));
#if defined(RTW_USE_CFG80211_STA_EVENT) #if defined(RTW_USE_CFG80211_STA_EVENT)
cfg80211_del_sta(ndev, da, GFP_ATOMIC); cfg80211_del_sta(ndev, da, GFP_ATOMIC);
...@@ -2460,29 +2458,21 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter, ...@@ -2460,29 +2458,21 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter,
freq = ieee80211_channel_to_frequency(channel, freq = ieee80211_channel_to_frequency(channel,
IEEE80211_BAND_5GHZ); IEEE80211_BAND_5GHZ);
pmgmt_frame = mgmt_buf; mgmt.frame_control =
pwlanhdr = (struct ieee80211_hdr *)pmgmt_frame;
pwlanhdr->frame_control =
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH);
ether_addr_copy(pwlanhdr->addr1, myid(&padapter->eeprompriv)); ether_addr_copy(mgmt.da, myid(&padapter->eeprompriv));
ether_addr_copy(pwlanhdr->addr2, da); ether_addr_copy(mgmt.sa, da);
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++;
pmgmt_frame += sizeof(struct ieee80211_hdr_3addr); mgmt.u.disassoc.reason_code = cpu_to_le16(reason);
frame_len = sizeof(struct ieee80211_hdr_3addr);
reason = cpu_to_le16(reason); frame_len = sizeof(struct ieee80211_hdr_3addr) + 2;
pmgmt_frame = rtw_set_fixed_ie23a(pmgmt_frame,
WLAN_REASON_PREV_AUTH_NOT_VALID,
(unsigned char *)&reason, &frame_len);
cfg80211_rx_mgmt(padapter->rtw_wdev, freq, 0, mgmt_buf, frame_len, cfg80211_rx_mgmt(padapter->rtw_wdev, freq, 0, (u8 *)&mgmt, frame_len,
0, GFP_ATOMIC); 0, GFP_ATOMIC);
#endif /* defined(RTW_USE_CFG80211_STA_EVENT) */ #endif /* defined(RTW_USE_CFG80211_STA_EVENT) */
} }
......
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