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

staging: rtl8723au: Update bss beacon info in rtw_add_beacon()

Pull out the core info beacon_interval, capability, and tsf and update
cur_network.network with the info in rtw_add_beacon() instead of
relying on it being in ->IEs.

This will help later when getting rid of the beacon struct info from
->IEs and only carrying the actual IEs there.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db97812c
......@@ -798,7 +798,6 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
u8 *pHT_caps_ie = NULL;
u8 *pHT_info_ie = NULL;
struct sta_info *psta = NULL;
__le16 *pbeacon;
u16 cap, ht_cap = false;
uint ie_len = 0;
int group_cipher, pairwise_cipher;
......@@ -844,11 +843,6 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN);
/* beacon interval */
/* ie + 8; 8: TimeStamp, 2: Beacon Interval 2:Capability */
pbeacon = rtw_get_beacon_interval23a_from_ie(ie);
pbss_network->beacon_interval = get_unaligned_le16(pbeacon);
/* capability */
cap = get_unaligned_le16(ie);
......
......@@ -2915,6 +2915,8 @@ static int rtw_add_beacon(struct rtw_adapter *adapter, const u8 *head,
u8 *pbuf;
uint len, wps_ielen = 0;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct wlan_bssid_ex *bss = &pmlmepriv->cur_network.network;
const struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)head;
/* struct sta_priv *pstapriv = &padapter->stapriv; */
DBG_8723A("%s beacon_head_len =%zu, beacon_tail_len =%zu\n",
......@@ -2923,12 +2925,17 @@ static int rtw_add_beacon(struct rtw_adapter *adapter, const u8 *head,
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
return -EINVAL;
if (head_len < sizeof(struct ieee80211_hdr_3addr))
if (head_len < offsetof(struct ieee80211_mgmt, u.beacon.variable))
return -EINVAL;
pbuf = kzalloc(head_len + tail_len, GFP_KERNEL);
if (!pbuf)
return -ENOMEM;
bss->beacon_interval = get_unaligned_le16(&mgmt->u.beacon.beacon_int);
bss->capability = get_unaligned_le16(&mgmt->u.beacon.capab_info);
bss->tsf = get_unaligned_le64(&mgmt->u.beacon.timestamp);
/* 24 = beacon header len. */
memcpy(pbuf, (void *)head + sizeof(struct ieee80211_hdr_3addr),
head_len - sizeof(struct ieee80211_hdr_3addr));
......
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