struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
struct HT_info_element *pht_info = NULL;
+ int bcn_fixed_size;
bcn_interval = (u16)pnetwork->BeaconPeriod;
cur_channel = pnetwork->DSConfig;
DYNAMIC_ALL_FUNC_ENABLE);
}
/* set channel, bwmode */
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
- pnetwork->IEs +
- sizeof(struct ndis_802_11_fixed_ies),
- pnetwork->IELength -
- sizeof(struct ndis_802_11_fixed_ies));
+ pnetwork->IEs + bcn_fixed_size,
+ pnetwork->IELength - bcn_fixed_size);
if (p && p[1]) {
pht_info = (struct HT_info_element *)(p + 2);
if (check_fwstate(pmlmepriv, _FW_LINKED) &&
is_same_network23a(&pmlmepriv->cur_network.network, pnetwork)) {
+ int bcn_size;
update_network23a(&pmlmepriv->cur_network.network,
pnetwork,adapter, true);
+
+ bcn_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
rtw_update_protection23a(adapter,
pmlmepriv->cur_network.network.IEs +
- sizeof (struct ndis_802_11_fixed_ies),
+ bcn_size,
pmlmepriv->cur_network.network.IELength);
}
}
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
+ int bcn_size;
DBG_8723A("%s\n", __func__);
break;
}
+ bcn_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
rtw_update_protection23a(padapter, cur_network->network.IEs +
- sizeof (struct ndis_802_11_fixed_ies),
- cur_network->network.IELength);
+ bcn_size, cur_network->network.IELength);
rtw_update_ht_cap23a(padapter, cur_network->network.IEs,
cur_network->network.IELength);
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+ int bcn_fixed_size;
if (!phtpriv->ht_option)
return;
DBG_8723A("+rtw_update_ht_cap23a()\n");
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
/* Adjust pie + ie_len for our searches */
- pie += sizeof (struct ndis_802_11_fixed_ies);
- ie_len -= sizeof (struct ndis_802_11_fixed_ies);
+ pie += bcn_fixed_size;
+ ie_len -= bcn_fixed_size;
/* maybe needs check if ap supports rx ampdu. */
if (phtpriv->ampdu_enable == false &&
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
- int bssrate_len = 0, sta_bssrate_len = 0, pie_len;
+ int bssrate_len = 0, sta_bssrate_len = 0, pie_len, bcn_fixed_size;
u8 * pie;
pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
bssrate_len, bssrate, &pattrib->pktlen);
/* RSN */
- pie = pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ies);
- pie_len = pmlmeinfo->network.IELength -
- sizeof(struct ndis_802_11_fixed_ies);
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
+ pie = pmlmeinfo->network.IEs + bcn_fixed_size;
+ pie_len = pmlmeinfo->network.IELength - bcn_fixed_size;
p = cfg80211_find_ie(WLAN_EID_RSN, pie, pie_len);
if (p)
}
/* vendor specific IE, such as WPA, WMM, WPS */
- for (i = sizeof(struct ndis_802_11_fixed_ies);
- i < pmlmeinfo->network.IELength;) {
+ for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) {
pIE = (struct ndis_802_11_var_ies *)
(pmlmeinfo->network.IEs + i);
const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
struct HT_info_element *pht_info;
u32 i;
+ int bcn_fixed_size;
/* u32 initialgain; */
/* u32 acparm; */
/* pmlmeinfo->assoc_AP_vendor = check_assoc_AP23a(pnetwork->IEs,
pnetwork->IELength); */
- for (i = sizeof(struct ndis_802_11_fixed_ies); i < pnetwork->IELength;)
- {
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
+ for (i = bcn_fixed_size; i < pnetwork->IELength;) {
pIE = (struct ndis_802_11_var_ies *)(pnetwork->IEs + i);
switch (pIE->ElementID)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
+ int bcn_fixed_size;
+
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
if (rtw_get_capability23a(cur_network) & WLAN_CAPABILITY_PRIVACY) {
- for (i = sizeof(struct ndis_802_11_fixed_ies);
- i < pmlmeinfo->network.IELength;) {
+ for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) {
pIE = (struct ndis_802_11_var_ies *)
(pmlmeinfo->network.IEs + i);
struct ndis_802_11_var_ies *pIE;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *cur_network = &pmlmepriv->cur_network.network;
+ int bcn_fixed_size;
+
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
if (rtw_get_capability23a(cur_network) & WLAN_CAPABILITY_PRIVACY) {
- for (i = sizeof(struct ndis_802_11_fixed_ies);
- i < cur_network->IELength;) {
+ for (i = bcn_fixed_size; i < cur_network->IELength;) {
pIE = (struct ndis_802_11_var_ies *)
(cur_network->IEs + i);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
+ int bcn_fixed_size;
+
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
if (rtw_get_capability23a(cur_network) & WLAN_CAPABILITY_PRIVACY) {
- for (i = sizeof(struct ndis_802_11_fixed_ies);
- i < pmlmeinfo->network.IELength;) {
+ for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) {
pIE = (struct ndis_802_11_var_ies *)
(pmlmeinfo->network.IEs + i);
unsigned char check_assoc_AP23a(u8 *pframe, uint len)
{
- unsigned int i;
+ int i, bcn_fixed_size;
struct ndis_802_11_var_ies *pIE;
u8 epigram_vendor_flag;
u8 ralink_vendor_flag;
epigram_vendor_flag = 0;
ralink_vendor_flag = 0;
- for (i = sizeof(struct ndis_802_11_fixed_ies); i < len;) {
+ bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
+ for (i = bcn_fixed_size; i < len;) {
pIE = (struct ndis_802_11_var_ies *)(pframe + i);
switch (pIE->ElementID) {
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+ int bcn_fixed_size;
/* DBG_8723A("%s\n", __FUNCTION__); */
pktlen += 2;
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+ bcn_fixed_size =
+ offsetof(struct ieee80211_mgmt, u.beacon.variable) -
+ offsetof(struct ieee80211_mgmt, u.beacon);
+
/* DBG_8723A("ie len =%d\n", cur_network->IELength); */
- pktlen += cur_network->IELength - sizeof(struct ndis_802_11_fixed_ies);
- memcpy(pframe, cur_network->IEs+sizeof(struct ndis_802_11_fixed_ies), pktlen);
+ pktlen += cur_network->IELength - bcn_fixed_size;
+ memcpy(pframe, cur_network->IEs + bcn_fixed_size, pktlen);
goto _ConstructBeacon;
}
#define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16
-struct ndis_802_11_fixed_ies {
- u8 Timestamp[8];
- u16 BeaconInterval;
- u16 Capabilities;
-};
-
struct ndis_802_11_var_ies {
u8 ElementID;
u8 Length;