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;
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);
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",
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));