tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap);
- p = rtw_get_ie23a(pie + _FIXED_IE_LENGTH_, WLAN_EID_TIM, &tim_ielen,
- pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
+ p = rtw_get_ie23a(pie, WLAN_EID_TIM, &tim_ielen,
+ pnetwork_mlmeext->IELength);
if (p != NULL && tim_ielen>0) {
tim_ielen += 2;
tim_ielen = 0;
/* calulate head_len */
- offset = _FIXED_IE_LENGTH_;
+ offset = 0;
/* get ssid_ie len */
- p = rtw_get_ie23a(pie + _BEACON_IE_OFFSET_, WLAN_EID_SSID,
- &tmp_len, (pnetwork_mlmeext->IELength -
- _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(pie, WLAN_EID_SSID,
+ &tmp_len, pnetwork_mlmeext->IELength);
if (p != NULL)
offset += tmp_len+2;
/* get supported rates len */
- p = rtw_get_ie23a(pie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES,
- &tmp_len, (pnetwork_mlmeext->IELength -
- _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(pie, WLAN_EID_SUPP_RATES,
+ &tmp_len, pnetwork_mlmeext->IELength);
if (p != NULL)
offset += tmp_len+2;
/* and at first time the security ie (RSN/WPA IE) will not include in beacon. */
if (NULL == cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WPS,
- pnetwork->IEs + _FIXED_IE_LENGTH_,
- pnetwork->IELength -
- _FIXED_IE_LENGTH_))
+ pnetwork->IEs,
+ pnetwork->IELength))
pmlmeext->bstart_bss = true;
/* todo: update wmm, ht cap */
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *pbss_network = &pmlmepriv->cur_network.network;
u8 *ie = pbss_network->IEs;
- u8 *pbuf = mgmt->u.beacon.variable - _FIXED_IE_LENGTH_;
- len -= (offsetof(struct ieee80211_mgmt, u.beacon.variable) -
- _FIXED_IE_LENGTH_);
+ u8 *pbuf = mgmt->u.beacon.variable;
+ len -= offsetof(struct ieee80211_mgmt, u.beacon.variable);
/* SSID */
/* Supported rates */
/* DS Params */
memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN);
/* SSID */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &ie_len,
- (pbss_network->IELength -_BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_SSID, &ie_len, pbss_network->IELength);
if (p && ie_len > 0) {
memset(&pbss_network->Ssid, 0, sizeof(struct cfg80211_ssid));
memcpy(pbss_network->Ssid.ssid, (p + 2), ie_len);
/* chnnel */
channel = 0;
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_DS_PARAMS, &ie_len,
+ pbss_network->IELength);
if (p && ie_len > 0)
channel = *(p + 2);
memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
/* get supported rates */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_SUPP_RATES, &ie_len,
+ pbss_network->IELength);
if (p) {
memcpy(supportRate, p+2, ie_len);
supportRateNum = ie_len;
}
/* get ext_supported rates */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES,
- &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
+ p = rtw_get_ie23a(ie, WLAN_EID_EXT_SUPP_RATES,
+ &ie_len, pbss_network->IELength);
if (p) {
memcpy(supportRate+supportRateNum, p+2, ie_len);
supportRateNum += ie_len;
rtw_set_supported_rate23a(pbss_network->SupportedRates, network_type);
/* parsing ERP_IE */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_ERP_INFO, &ie_len,
+ pbss_network->IELength);
if (p && ie_len > 0)
ERP_IE_handler23a(padapter, p);
group_cipher = 0; pairwise_cipher = 0;
psecuritypriv->wpa2_group_cipher = 0;
psecuritypriv->wpa2_pairwise_cipher = 0;
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_RSN, &ie_len,
+ pbss_network->IELength);
if (p && ie_len > 0) {
if (rtw_parse_wpa2_ie23a(p, ie_len+2, &group_cipher,
&pairwise_cipher, NULL) == _SUCCESS) {
pairwise_cipher = 0;
psecuritypriv->wpa_group_cipher = 0;
psecuritypriv->wpa_pairwise_cipher = 0;
- for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2)) {
+ for (p = ie; ;p += (ie_len + 2)) {
p = rtw_get_ie23a(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_ -
- (ie_len + 2)));
+ pbss_network->IELength - (ie_len + 2));
if ((p) && (!memcmp(p+2, RTW_WPA_OUI23A_TYPE, 4))) {
if (rtw_parse_wpa_ie23a(p, ie_len+2, &group_cipher,
&pairwise_cipher, NULL) == _SUCCESS) {
ie_len = 0;
pmlmepriv->qos_option = 0;
if (pregistrypriv->wmm_enable) {
- for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2)) {
+ for (p = ie; ;p += (ie_len + 2)) {
p = rtw_get_ie23a(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len,
(pbss_network->IELength -
- _BEACON_IE_OFFSET_ - (ie_len + 2)));
+ (ie_len + 2)));
if ((p) && !memcmp(p+2, WMM_PARA_IE, 6)) {
pmlmepriv->qos_option = 1;
}
}
/* parsing HT_CAP_IE */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_HT_CAPABILITY, &ie_len,
+ pbss_network->IELength);
if (p && ie_len > 0) {
u8 rf_type;
}
/* parsing HT_INFO_IE */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len,
- (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_HT_OPERATION, &ie_len,
+ pbss_network->IELength);
if (p && ie_len > 0)
pHT_info_ie = p;
return;
/* parsing ERP_IE */
- p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie23a(ie, WLAN_EID_ERP_INFO, &len, pnetwork->IELength);
if (p && len > 0) {
if (pmlmepriv->num_sta_non_erp == 1)
p[2] |= WLAN_ERP_NON_ERP_PRESENT |
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
if (cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WPA,
- pnetwork->network.IEs +
- _FIXED_IE_LENGTH_,
- pnetwork->network.IELength -
- _FIXED_IE_LENGTH_))
+ pnetwork->network.IEs,
+ pnetwork->network.IELength))
return true;
else
return false;
unsigned int ielength = 0;
unsigned int i, j;
- i = _FIXED_IE_LENGTH_; /* after the fixed IE */
+ i = 0; /* after the fixed IE */
while (i < in_len) {
ielength = initial_out_len;
("+rtw_restruct_sec_ie23a: ndisauthmode=%d "
"ndissecuritytype=%d\n", ndisauthmode, ndissecuritytype));
- /* copy fixed ie only */
- memcpy(out_ie, in_ie, _FIXED_IE_LENGTH_);
- ielength = _FIXED_IE_LENGTH_;
+ ielength = 0;
if (ndisauthmode == Ndis802_11AuthModeWPA ||
ndisauthmode == Ndis802_11AuthModeWPAPSK)
authmode = WLAN_EID_VENDOR_SPECIFIC;
phtpriv->ht_option = false;
- p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie + _FIXED_IE_LENGTH_,
- in_len - _FIXED_IE_LENGTH_);
+ p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie, in_len);
if (p && p[1] > 0) {
u32 rx_packet_offset, max_recvbuf_sz;
phtpriv->ht_option = true;
- p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
- in_ie + _FIXED_IE_LENGTH_,
- in_len - _FIXED_IE_LENGTH_);
+ p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, in_ie, in_len);
if (p && (p[1] == sizeof(struct ieee80211_ht_operation))) {
out_len = *pout_len;
pframe = rtw_set_ie23a(out_ie + out_len,
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
u8 *iebuf;
int buflen;
- pframe -= _BEACON_IE_OFFSET_;
/* DBG_8723A("ie len =%d\n", cur_network->IELength); */
memcpy(pframe, cur_network->IEs, cur_network->IELength);
- len_diff = update_hidden_ssid(pframe + _BEACON_IE_OFFSET_,
- cur_network->IELength -
- _BEACON_IE_OFFSET_,
+ len_diff = update_hidden_ssid(pframe, cur_network->IELength,
pmlmeinfo->hidden_ssid_mode);
pframe += (cur_network->IELength+len_diff);
pattrib->pktlen += (cur_network->IELength+len_diff);
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WPS,
- cur_network->IEs +
- _FIXED_IE_LENGTH_,
- cur_network->IELength -
- _FIXED_IE_LENGTH_);
+ cur_network->IEs,
+ cur_network->IELength);
- memcpy(pframe, cur_network->IEs + _FIXED_IE_LENGTH_,
- cur_network->IELength - _FIXED_IE_LENGTH_);
+ memcpy(pframe, cur_network->IEs, cur_network->IELength);
pframe += cur_network->IELength;
pattrib->pktlen += cur_network->IELength;
if (pstat->flags & WLAN_STA_HT && pmlmepriv->htpriv.ht_option) {
/* FILL HT CAP INFO IE */
/* p = hostapd_eid_ht_capabilities_info(hapd, p); */
- p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
- ie + _BEACON_IE_OFFSET_,
- pnetwork->IELength -_BEACON_IE_OFFSET_);
+ p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, ie,
+ pnetwork->IELength);
if (p && p[1]) {
memcpy(pframe, p, p[1] + 2);
pframe += (p[1] + 2);
/* FILL HT ADD INFO IE */
/* p = hostapd_eid_ht_operation(hapd, p); */
- p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
- ie + _BEACON_IE_OFFSET_,
- pnetwork->IELength - _BEACON_IE_OFFSET_);
+ p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, ie,
+ pnetwork->IELength);
if (p && p[1] > 0) {
memcpy(pframe, p, p[1] + 2);
pframe += (p[1] + 2);
0x01, 0x01};
int ie_len = 0;
- for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
+ for (p = ie; ; p += (ie_len + 2)) {
p = cfg80211_find_ie(WLAN_EID_VENDOR_SPECIFIC, p,
- pnetwork->IELength -
- _BEACON_IE_OFFSET_ - (ie_len + 2));
+ pnetwork->IELength - (ie_len + 2));
if (p)
ie_len = p[1];
else
u8 noc; /* number of channel */
u8 j, k;
- ie = cfg80211_find_ie(WLAN_EID_COUNTRY,
- bssid->IEs + _FIXED_IE_LENGTH_,
- bssid->IELength - _FIXED_IE_LENGTH_);
+ ie = cfg80211_find_ie(WLAN_EID_COUNTRY, bssid->IEs,
+ bssid->IELength);
if (!ie || ie[1] < IEEE80211_COUNTRY_IE_MIN_LEN)
return;
memcpy(&ptxBeacon_parm->network, &pmlmeinfo->network,
sizeof(struct wlan_bssid_ex));
- len_diff = update_hidden_ssid(
- ptxBeacon_parm->network.IEs+_BEACON_IE_OFFSET_,
- ptxBeacon_parm->network.IELength-_BEACON_IE_OFFSET_,
- pmlmeinfo->hidden_ssid_mode);
+ len_diff = update_hidden_ssid(ptxBeacon_parm->network.IEs,
+ ptxBeacon_parm->network.IELength,
+ pmlmeinfo->hidden_ssid_mode);
ptxBeacon_parm->network.IELength += len_diff;
init_h2fwcmd_w_parm_no_rsp(ph2c, ptxBeacon_parm,