mirror of https://gitee.com/openkylin/linux.git
Staging:rtl888eu:include Fix CamelCase issue
This patch is created to solve the CamelCase issue. The members 'IEs' and 'IELength' of struct wlan_bssid_ex are being modified to 'ie' and 'ie_length' to solve the issue. And the places where these variables are referenced inside rtl8188eu driver are also changed. Signed-off-by: Janani Sankara Babu <jananis37@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
17f74bd38b
commit
341f27d051
|
@ -69,19 +69,19 @@ static void update_BCNTIM(struct adapter *padapter)
|
||||||
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 wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
|
struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
|
||||||
unsigned char *pie = pnetwork_mlmeext->IEs;
|
unsigned char *pie = pnetwork_mlmeext->ies;
|
||||||
u8 *p, *dst_ie, *premainder_ie = NULL;
|
u8 *p, *dst_ie, *premainder_ie = NULL;
|
||||||
u8 *pbackup_remainder_ie = NULL;
|
u8 *pbackup_remainder_ie = NULL;
|
||||||
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
|
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
|
||||||
|
|
||||||
/* update TIM IE */
|
/* update TIM IE */
|
||||||
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
|
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
|
||||||
pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
|
pnetwork_mlmeext->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && tim_ielen > 0) {
|
if (p && tim_ielen > 0) {
|
||||||
tim_ielen += 2;
|
tim_ielen += 2;
|
||||||
premainder_ie = p + tim_ielen;
|
premainder_ie = p + tim_ielen;
|
||||||
tim_ie_offset = (int)(p - pie);
|
tim_ie_offset = (int)(p - pie);
|
||||||
remainder_ielen = pnetwork_mlmeext->IELength -
|
remainder_ielen = pnetwork_mlmeext->ie_length -
|
||||||
tim_ie_offset - tim_ielen;
|
tim_ie_offset - tim_ielen;
|
||||||
/* append TIM IE from dst_ie offset */
|
/* append TIM IE from dst_ie offset */
|
||||||
dst_ie = p;
|
dst_ie = p;
|
||||||
|
@ -94,7 +94,7 @@ static void update_BCNTIM(struct adapter *padapter)
|
||||||
|
|
||||||
/* get supported rates len */
|
/* get supported rates len */
|
||||||
p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_,
|
p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_,
|
||||||
&tmp_len, (pnetwork_mlmeext->IELength -
|
&tmp_len, (pnetwork_mlmeext->ie_length -
|
||||||
_BEACON_IE_OFFSET_));
|
_BEACON_IE_OFFSET_));
|
||||||
if (p)
|
if (p)
|
||||||
offset += tmp_len+2;
|
offset += tmp_len+2;
|
||||||
|
@ -104,7 +104,7 @@ static void update_BCNTIM(struct adapter *padapter)
|
||||||
|
|
||||||
premainder_ie = pie + offset;
|
premainder_ie = pie + offset;
|
||||||
|
|
||||||
remainder_ielen = pnetwork_mlmeext->IELength -
|
remainder_ielen = pnetwork_mlmeext->ie_length -
|
||||||
offset - tim_ielen;
|
offset - tim_ielen;
|
||||||
|
|
||||||
/* append TIM IE from offset */
|
/* append TIM IE from offset */
|
||||||
|
@ -148,7 +148,7 @@ static void update_BCNTIM(struct adapter *padapter)
|
||||||
kfree(pbackup_remainder_ie);
|
kfree(pbackup_remainder_ie);
|
||||||
}
|
}
|
||||||
offset = (uint)(dst_ie - pie);
|
offset = (uint)(dst_ie - pie);
|
||||||
pnetwork_mlmeext->IELength = offset + remainder_ielen;
|
pnetwork_mlmeext->ie_length = offset + remainder_ielen;
|
||||||
|
|
||||||
set_tx_beacon_cmd(padapter);
|
set_tx_beacon_cmd(padapter);
|
||||||
}
|
}
|
||||||
|
@ -158,13 +158,13 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
{
|
{
|
||||||
struct ndis_802_11_var_ie *pIE;
|
struct ndis_802_11_var_ie *pIE;
|
||||||
u8 bmatch = false;
|
u8 bmatch = false;
|
||||||
u8 *pie = pnetwork->IEs;
|
u8 *pie = pnetwork->ies;
|
||||||
u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL;
|
u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL;
|
||||||
u8 *pbackup_remainder_ie = NULL;
|
u8 *pbackup_remainder_ie = NULL;
|
||||||
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;
|
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;
|
||||||
|
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->IELength;) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->ie_length;) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(pnetwork->IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(pnetwork->ies + i);
|
||||||
|
|
||||||
if (pIE->ElementID > index) {
|
if (pIE->ElementID > index) {
|
||||||
break;
|
break;
|
||||||
|
@ -187,7 +187,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
|
|
||||||
ie_offset = (int)(p - pie);
|
ie_offset = (int)(p - pie);
|
||||||
|
|
||||||
remainder_ielen = pnetwork->IELength - ie_offset - ielen;
|
remainder_ielen = pnetwork->ie_length - ie_offset - ielen;
|
||||||
|
|
||||||
if (bmatch)
|
if (bmatch)
|
||||||
dst_ie = p;
|
dst_ie = p;
|
||||||
|
@ -216,7 +216,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = (uint)(dst_ie - pie);
|
offset = (uint)(dst_ie - pie);
|
||||||
pnetwork->IELength = offset + remainder_ielen;
|
pnetwork->ie_length = offset + remainder_ielen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
|
@ -225,10 +225,10 @@ void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
u8 *p, *dst_ie = NULL, *premainder_ie = NULL;
|
u8 *p, *dst_ie = NULL, *premainder_ie = NULL;
|
||||||
u8 *pbackup_remainder_ie = NULL;
|
u8 *pbackup_remainder_ie = NULL;
|
||||||
uint offset, ielen, ie_offset, remainder_ielen = 0;
|
uint offset, ielen, ie_offset, remainder_ielen = 0;
|
||||||
u8 *pie = pnetwork->IEs;
|
u8 *pie = pnetwork->ies;
|
||||||
|
|
||||||
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen,
|
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen,
|
||||||
pnetwork->IELength - _FIXED_IE_LENGTH_);
|
pnetwork->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && ielen > 0) {
|
if (p && ielen > 0) {
|
||||||
ielen += 2;
|
ielen += 2;
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
|
|
||||||
ie_offset = (int)(p - pie);
|
ie_offset = (int)(p - pie);
|
||||||
|
|
||||||
remainder_ielen = pnetwork->IELength - ie_offset - ielen;
|
remainder_ielen = pnetwork->ie_length - ie_offset - ielen;
|
||||||
|
|
||||||
dst_ie = p;
|
dst_ie = p;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = (uint)(dst_ie - pie);
|
offset = (uint)(dst_ie - pie);
|
||||||
pnetwork->IELength = offset + remainder_ielen;
|
pnetwork->ie_length = offset + remainder_ielen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 chk_sta_is_alive(struct sta_info *psta)
|
static u8 chk_sta_is_alive(struct sta_info *psta)
|
||||||
|
@ -740,7 +740,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
|
||||||
* beacon twice when stating hostapd, and at first time the
|
* beacon twice when stating hostapd, and at first time the
|
||||||
* security ie (RSN/WPA IE) will not include in beacon.
|
* security ie (RSN/WPA IE) will not include in beacon.
|
||||||
*/
|
*/
|
||||||
if (!rtw_get_wps_ie(pnetwork->IEs + _FIXED_IE_LENGTH_, pnetwork->IELength - _FIXED_IE_LENGTH_, NULL, NULL))
|
if (!rtw_get_wps_ie(pnetwork->ies + _FIXED_IE_LENGTH_, pnetwork->ie_length - _FIXED_IE_LENGTH_, NULL, NULL))
|
||||||
pmlmeext->bstart_bss = true;
|
pmlmeext->bstart_bss = true;
|
||||||
|
|
||||||
/* todo: update wmm, ht cap */
|
/* todo: update wmm, ht cap */
|
||||||
|
@ -794,7 +794,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
|
||||||
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||||
}
|
}
|
||||||
/* set channel, bwmode */
|
/* set channel, bwmode */
|
||||||
p = rtw_get_ie((pnetwork->IEs + sizeof(struct ndis_802_11_fixed_ie)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(struct ndis_802_11_fixed_ie)));
|
p = rtw_get_ie((pnetwork->ies + sizeof(struct ndis_802_11_fixed_ie)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->ie_length - sizeof(struct ndis_802_11_fixed_ie)));
|
||||||
if (p && ie_len) {
|
if (p && ie_len) {
|
||||||
pht_info = (struct HT_info_element *)(p + 2);
|
pht_info = (struct HT_info_element *)(p + 2);
|
||||||
|
|
||||||
|
@ -866,7 +866,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
struct wlan_bssid_ex *pbss_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
|
struct wlan_bssid_ex *pbss_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
|
||||||
u8 *ie = pbss_network->IEs;
|
u8 *ie = pbss_network->ies;
|
||||||
|
|
||||||
/* SSID */
|
/* SSID */
|
||||||
/* Supported rates */
|
/* Supported rates */
|
||||||
|
@ -888,11 +888,11 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
if (len < 0 || len > MAX_IE_SZ)
|
if (len < 0 || len > MAX_IE_SZ)
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
|
|
||||||
pbss_network->IELength = len;
|
pbss_network->ie_length = len;
|
||||||
|
|
||||||
memset(ie, 0, MAX_IE_SZ);
|
memset(ie, 0, MAX_IE_SZ);
|
||||||
|
|
||||||
memcpy(ie, pbuf, pbss_network->IELength);
|
memcpy(ie, pbuf, pbss_network->ie_length);
|
||||||
|
|
||||||
|
|
||||||
if (pbss_network->InfrastructureMode != Ndis802_11APMode)
|
if (pbss_network->InfrastructureMode != Ndis802_11APMode)
|
||||||
|
@ -910,7 +910,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
cap = get_unaligned_le16(ie);
|
cap = get_unaligned_le16(ie);
|
||||||
|
|
||||||
/* SSID */
|
/* SSID */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0) {
|
if (p && ie_len > 0) {
|
||||||
memset(&pbss_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
|
memset(&pbss_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
|
||||||
memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
|
memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
|
||||||
|
@ -920,7 +920,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
/* channel */
|
/* channel */
|
||||||
channel = 0;
|
channel = 0;
|
||||||
pbss_network->Configuration.Length = 0;
|
pbss_network->Configuration.Length = 0;
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0)
|
if (p && ie_len > 0)
|
||||||
channel = *(p + 2);
|
channel = *(p + 2);
|
||||||
|
|
||||||
|
@ -928,14 +928,14 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
|
|
||||||
memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
|
memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
|
||||||
/* get supported rates */
|
/* get supported rates */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p) {
|
if (p) {
|
||||||
memcpy(supportRate, p + 2, ie_len);
|
memcpy(supportRate, p + 2, ie_len);
|
||||||
supportRateNum = ie_len;
|
supportRateNum = ie_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get ext_supported rates */
|
/* get ext_supported rates */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->ie_length - _BEACON_IE_OFFSET_);
|
||||||
if (p) {
|
if (p) {
|
||||||
memcpy(supportRate + supportRateNum, p + 2, ie_len);
|
memcpy(supportRate + supportRateNum, p + 2, ie_len);
|
||||||
supportRateNum += ie_len;
|
supportRateNum += ie_len;
|
||||||
|
@ -946,7 +946,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
rtw_set_supported_rate(pbss_network->SupportedRates, network_type);
|
rtw_set_supported_rate(pbss_network->SupportedRates, network_type);
|
||||||
|
|
||||||
/* parsing ERP_IE */
|
/* parsing ERP_IE */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0)
|
if (p && ie_len > 0)
|
||||||
ERP_IE_handler(padapter, (struct ndis_802_11_var_ie *)p);
|
ERP_IE_handler(padapter, (struct ndis_802_11_var_ie *)p);
|
||||||
|
|
||||||
|
@ -963,7 +963,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
pairwise_cipher = 0;
|
pairwise_cipher = 0;
|
||||||
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
||||||
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0) {
|
if (p && ie_len > 0) {
|
||||||
if (rtw_parse_wpa2_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
|
if (rtw_parse_wpa2_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||||
|
@ -983,7 +983,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
|
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
|
||||||
for (p = ie + _BEACON_IE_OFFSET_;; p += (ie_len + 2)) {
|
for (p = ie + _BEACON_IE_OFFSET_;; p += (ie_len + 2)) {
|
||||||
p = rtw_get_ie(p, _SSN_IE_1_, &ie_len,
|
p = rtw_get_ie(p, _SSN_IE_1_, &ie_len,
|
||||||
(pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
(pbss_network->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
||||||
if ((p) && (!memcmp(p + 2, OUI1, 4))) {
|
if ((p) && (!memcmp(p + 2, OUI1, 4))) {
|
||||||
if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher,
|
if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher,
|
||||||
&pairwise_cipher, NULL) == _SUCCESS) {
|
&pairwise_cipher, NULL) == _SUCCESS) {
|
||||||
|
@ -1008,7 +1008,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
if (pregistrypriv->wmm_enable) {
|
if (pregistrypriv->wmm_enable) {
|
||||||
for (p = ie + _BEACON_IE_OFFSET_;; p += (ie_len + 2)) {
|
for (p = ie + _BEACON_IE_OFFSET_;; p += (ie_len + 2)) {
|
||||||
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len,
|
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len,
|
||||||
(pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
(pbss_network->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
||||||
if ((p) && !memcmp(p + 2, WMM_PARA_IE, 6)) {
|
if ((p) && !memcmp(p + 2, WMM_PARA_IE, 6)) {
|
||||||
pmlmepriv->qospriv.qos_option = 1;
|
pmlmepriv->qospriv.qos_option = 1;
|
||||||
|
|
||||||
|
@ -1031,7 +1031,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
}
|
}
|
||||||
/* parsing HT_CAP_IE */
|
/* parsing HT_CAP_IE */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len,
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len,
|
||||||
(pbss_network->IELength - _BEACON_IE_OFFSET_));
|
(pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0) {
|
if (p && ie_len > 0) {
|
||||||
struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p + 2);
|
struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p + 2);
|
||||||
|
|
||||||
|
@ -1055,7 +1055,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
||||||
|
|
||||||
/* parsing HT_INFO_IE */
|
/* parsing HT_INFO_IE */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len,
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len,
|
||||||
(pbss_network->IELength - _BEACON_IE_OFFSET_));
|
(pbss_network->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && ie_len > 0)
|
if (p && ie_len > 0)
|
||||||
pHT_info_ie = p;
|
pHT_info_ie = p;
|
||||||
switch (network_type) {
|
switch (network_type) {
|
||||||
|
@ -1235,7 +1235,7 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter)
|
||||||
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 wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
|
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
|
||||||
unsigned char *p, *ie = pnetwork->IEs;
|
unsigned char *p, *ie = pnetwork->ies;
|
||||||
u32 len = 0;
|
u32 len = 0;
|
||||||
|
|
||||||
DBG_88E("%s, ERP_enable =%d\n", __func__, pmlmeinfo->ERP_enable);
|
DBG_88E("%s, ERP_enable =%d\n", __func__, pmlmeinfo->ERP_enable);
|
||||||
|
@ -1245,7 +1245,7 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter)
|
||||||
|
|
||||||
/* parsing ERP_IE */
|
/* parsing ERP_IE */
|
||||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len,
|
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len,
|
||||||
(pnetwork->IELength - _BEACON_IE_OFFSET_));
|
(pnetwork->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
struct ndis_802_11_var_ie *pIE = (struct ndis_802_11_var_ie *)p;
|
struct ndis_802_11_var_ie *pIE = (struct ndis_802_11_var_ie *)p;
|
||||||
|
|
||||||
|
@ -1272,8 +1272,8 @@ static void update_bcn_wps_ie(struct adapter *padapter)
|
||||||
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 wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
|
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
|
||||||
unsigned char *ie = pnetwork->IEs;
|
unsigned char *ie = pnetwork->ies;
|
||||||
u32 ielen = pnetwork->IELength;
|
u32 ielen = pnetwork->ie_length;
|
||||||
|
|
||||||
DBG_88E("%s\n", __func__);
|
DBG_88E("%s\n", __func__);
|
||||||
|
|
||||||
|
@ -1306,8 +1306,8 @@ static void update_bcn_wps_ie(struct adapter *padapter)
|
||||||
if (pbackup_remainder_ie)
|
if (pbackup_remainder_ie)
|
||||||
memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
|
memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
|
||||||
|
|
||||||
/* update IELength */
|
/* update ie_length */
|
||||||
pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
|
pnetwork->ie_length = wps_offset + (wps_ielen+2) + remainder_ielen;
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(pbackup_remainder_ie);
|
kfree(pbackup_remainder_ie);
|
||||||
|
|
|
@ -380,7 +380,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||||
res = _FAIL;
|
res = _FAIL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
/* for IEs is fix buf size */
|
/* for ies is fix buf size */
|
||||||
t_len = sizeof(struct wlan_bssid_ex);
|
t_len = sizeof(struct wlan_bssid_ex);
|
||||||
|
|
||||||
/* for hidden ap to set fw_state here */
|
/* for hidden ap to set fw_state here */
|
||||||
|
@ -415,14 +415,14 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||||
|
|
||||||
memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network));
|
memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network));
|
||||||
|
|
||||||
psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
|
psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->ie_length;
|
||||||
|
|
||||||
if ((psecnetwork->IELength-12) < (256-1))
|
if ((psecnetwork->ie_length-12) < (256-1))
|
||||||
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
|
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], psecnetwork->ie_length-12);
|
||||||
else
|
else
|
||||||
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
|
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], (256-1));
|
||||||
|
|
||||||
psecnetwork->IELength = 0;
|
psecnetwork->ie_length = 0;
|
||||||
/* Added by Albert 2009/02/18 */
|
/* Added by Albert 2009/02/18 */
|
||||||
/* If the driver wants to use the bssid to create the connection. */
|
/* If the driver wants to use the bssid to create the connection. */
|
||||||
/* If not, we have to copy the connecting AP's MAC address to it so that */
|
/* If not, we have to copy the connecting AP's MAC address to it so that */
|
||||||
|
@ -431,17 +431,17 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||||
if (!pmlmepriv->assoc_by_bssid)
|
if (!pmlmepriv->assoc_by_bssid)
|
||||||
memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.MacAddress[0], ETH_ALEN);
|
memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.MacAddress[0], ETH_ALEN);
|
||||||
|
|
||||||
psecnetwork->IELength = rtw_restruct_sec_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength);
|
psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length);
|
||||||
|
|
||||||
pqospriv->qos_option = 0;
|
pqospriv->qos_option = 0;
|
||||||
|
|
||||||
if (pregistrypriv->wmm_enable) {
|
if (pregistrypriv->wmm_enable) {
|
||||||
u32 tmp_len;
|
u32 tmp_len;
|
||||||
|
|
||||||
tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength);
|
tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length, psecnetwork->ie_length);
|
||||||
|
|
||||||
if (psecnetwork->IELength != tmp_len) {
|
if (psecnetwork->ie_length != tmp_len) {
|
||||||
psecnetwork->IELength = tmp_len;
|
psecnetwork->ie_length = tmp_len;
|
||||||
pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */
|
pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */
|
||||||
} else {
|
} else {
|
||||||
pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
|
pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
|
||||||
|
@ -460,12 +460,12 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
|
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
|
||||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
|
(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
|
||||||
/* rtw_restructure_ht_ie */
|
/* rtw_restructure_ht_ie */
|
||||||
rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
|
rtw_restructure_ht_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0],
|
||||||
pnetwork->network.IELength, &psecnetwork->IELength);
|
pnetwork->network.ie_length, &psecnetwork->ie_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.IEs, pnetwork->network.IELength);
|
pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.ies, pnetwork->network.ie_length);
|
||||||
|
|
||||||
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_TENDA)
|
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_TENDA)
|
||||||
padapter->pwrctrlpriv.smart_ps = 0;
|
padapter->pwrctrlpriv.smart_ps = 0;
|
||||||
|
|
|
@ -229,7 +229,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
||||||
int rateLen;
|
int rateLen;
|
||||||
uint sz = 0;
|
uint sz = 0;
|
||||||
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
||||||
u8 *ie = pdev_network->IEs;
|
u8 *ie = pdev_network->ies;
|
||||||
|
|
||||||
|
|
||||||
/* timestamp will be inserted by hardware */
|
/* timestamp will be inserted by hardware */
|
||||||
|
@ -590,8 +590,8 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rtw_get_wps_ie - Search WPS IE from a series of IEs
|
* rtw_get_wps_ie - Search WPS IE from a series of ies
|
||||||
* @in_ie: Address of IEs to search
|
* @in_ie: Address of ies to search
|
||||||
* @in_len: Length limit from in_ie
|
* @in_len: Length limit from in_ie
|
||||||
* @wps_ie: If not NULL and WPS IE is found, WPS IE will be copied to the buf starting from wps_ie
|
* @wps_ie: If not NULL and WPS IE is found, WPS IE will be copied to the buf starting from wps_ie
|
||||||
* @wps_ielen: If not NULL and WPS IE is found, will set to the length of the entire WPS IE
|
* @wps_ielen: If not NULL and WPS IE is found, will set to the length of the entire WPS IE
|
||||||
|
@ -798,7 +798,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ieee802_11_parse_elems - Parse information elements in management frames
|
* ieee802_11_parse_elems - Parse information elements in management frames
|
||||||
* @start: Pointer to the start of IEs
|
* @start: Pointer to the start of ies
|
||||||
* @len: Length of IE buffer in octets
|
* @len: Length of IE buffer in octets
|
||||||
* @elems: Data structure for parsed elements
|
* @elems: Data structure for parsed elements
|
||||||
* @show_errors: Whether to show parsing errors in debug log
|
* @show_errors: Whether to show parsing errors in debug log
|
||||||
|
@ -962,7 +962,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
||||||
int group_cipher = 0, pairwise_cipher = 0, is8021x = 0;
|
int group_cipher = 0, pairwise_cipher = 0, is8021x = 0;
|
||||||
int ret = _FAIL;
|
int ret = _FAIL;
|
||||||
|
|
||||||
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
|
pbuf = rtw_get_wpa_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length - 12);
|
||||||
|
|
||||||
if (pbuf && (wpa_ielen > 0)) {
|
if (pbuf && (wpa_ielen > 0)) {
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: wpa_ielen: %d", __func__, wpa_ielen));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: wpa_ielen: %d", __func__, wpa_ielen));
|
||||||
|
@ -975,7 +975,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
||||||
ret = _SUCCESS;
|
ret = _SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
|
pbuf = rtw_get_wpa2_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length - 12);
|
||||||
|
|
||||||
if (pbuf && (wpa_ielen > 0)) {
|
if (pbuf && (wpa_ielen > 0)) {
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n"));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n"));
|
||||||
|
@ -1005,7 +1005,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
||||||
uint len;
|
uint len;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|
||||||
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
|
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.ies), 2);
|
||||||
cap = le16_to_cpu(le_tmp);
|
cap = le16_to_cpu(le_tmp);
|
||||||
if (cap & WLAN_CAPABILITY_PRIVACY) {
|
if (cap & WLAN_CAPABILITY_PRIVACY) {
|
||||||
bencrypt = 1;
|
bencrypt = 1;
|
||||||
|
@ -1013,7 +1013,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
||||||
} else {
|
} else {
|
||||||
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_OPENSYS;
|
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_OPENSYS;
|
||||||
}
|
}
|
||||||
rtw_get_sec_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &rsn_len, NULL, &wpa_len);
|
rtw_get_sec_ie(pnetwork->network.ies, pnetwork->network.ie_length, NULL, &rsn_len, NULL, &wpa_len);
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: ssid =%s\n", __func__, pnetwork->network.Ssid.Ssid));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: ssid =%s\n", __func__, pnetwork->network.Ssid.Ssid));
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: wpa_len =%d rsn_len =%d\n", __func__, wpa_len, rsn_len));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: wpa_len =%d rsn_len =%d\n", __func__, wpa_len, rsn_len));
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: ssid =%s\n", __func__, pnetwork->network.Ssid.Ssid));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: ssid =%s\n", __func__, pnetwork->network.Ssid.Ssid));
|
||||||
|
@ -1035,7 +1035,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
||||||
|
|
||||||
/* get bwmode and ch_offset */
|
/* get bwmode and ch_offset */
|
||||||
/* parsing HT_CAP_IE */
|
/* parsing HT_CAP_IE */
|
||||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
struct ieee80211_ht_cap *ht_cap =
|
struct ieee80211_ht_cap *ht_cap =
|
||||||
(struct ieee80211_ht_cap *)(p + 2);
|
(struct ieee80211_ht_cap *)(p + 2);
|
||||||
|
@ -1045,7 +1045,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
||||||
pnetwork->BcnInfo.ht_cap_info = 0;
|
pnetwork->BcnInfo.ht_cap_info = 0;
|
||||||
}
|
}
|
||||||
/* parsing HT_INFO_IE */
|
/* parsing HT_INFO_IE */
|
||||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
pht_info = (struct HT_info_element *)(p + 2);
|
pht_info = (struct HT_info_element *)(p + 2);
|
||||||
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
|
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
|
||||||
|
|
|
@ -577,7 +577,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
|
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
|
||||||
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
|
p = rtw_get_ie(&pcur_bss->ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->ie_length-12);
|
||||||
if (p && ht_ielen > 0) {
|
if (p && ht_ielen > 0) {
|
||||||
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
|
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
|
||||||
bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0;
|
bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0;
|
||||||
|
|
|
@ -270,7 +270,7 @@ u16 rtw_get_capability(struct wlan_bssid_ex *bss)
|
||||||
{
|
{
|
||||||
__le16 val;
|
__le16 val;
|
||||||
|
|
||||||
memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
|
memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->ies), 2);
|
||||||
|
|
||||||
return le16_to_cpu(val);
|
return le16_to_cpu(val);
|
||||||
}
|
}
|
||||||
|
@ -318,8 +318,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst)
|
||||||
u16 s_cap, d_cap;
|
u16 s_cap, d_cap;
|
||||||
__le16 le_scap, le_dcap;
|
__le16 le_scap, le_dcap;
|
||||||
|
|
||||||
memcpy((u8 *)&le_scap, rtw_get_capability_from_ie(src->IEs), 2);
|
memcpy((u8 *)&le_scap, rtw_get_capability_from_ie(src->ies), 2);
|
||||||
memcpy((u8 *)&le_dcap, rtw_get_capability_from_ie(dst->IEs), 2);
|
memcpy((u8 *)&le_dcap, rtw_get_capability_from_ie(dst->ies), 2);
|
||||||
|
|
||||||
s_cap = le16_to_cpu(le_scap);
|
s_cap = le16_to_cpu(le_scap);
|
||||||
d_cap = le16_to_cpu(le_dcap);
|
d_cap = le16_to_cpu(le_dcap);
|
||||||
|
@ -399,8 +399,8 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
|
||||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
|
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
|
||||||
(is_same_network(&(pmlmepriv->cur_network.network), pnetwork))) {
|
(is_same_network(&(pmlmepriv->cur_network.network), pnetwork))) {
|
||||||
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true);
|
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true);
|
||||||
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(struct ndis_802_11_fixed_ie),
|
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fixed_ie),
|
||||||
pmlmepriv->cur_network.network.IELength);
|
pmlmepriv->cur_network.network.ie_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
|
||||||
pnetwork->last_scanned = jiffies;
|
pnetwork->last_scanned = jiffies;
|
||||||
|
|
||||||
/* target.Reserved[0]== 1, means that scanned network is a bcn frame. */
|
/* target.Reserved[0]== 1, means that scanned network is a bcn frame. */
|
||||||
if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == 1))
|
if ((pnetwork->network.ie_length > target->ie_length) && (target->Reserved[0] == 1))
|
||||||
update_ie = false;
|
update_ie = false;
|
||||||
|
|
||||||
update_network(&(pnetwork->network), target, adapter, update_ie);
|
update_network(&(pnetwork->network), target, adapter, update_ie);
|
||||||
|
@ -524,7 +524,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *
|
||||||
privacy = pnetwork->network.Privacy;
|
privacy = pnetwork->network.Privacy;
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
|
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
|
||||||
if (rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen))
|
if (rtw_get_wps_ie(pnetwork->network.ies+_FIXED_IE_LENGTH_, pnetwork->network.ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -576,11 +576,11 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||||
if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
|
if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
|
||||||
struct wlan_network *ibss_wlan = NULL;
|
struct wlan_network *ibss_wlan = NULL;
|
||||||
|
|
||||||
memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8);
|
memcpy(pmlmepriv->cur_network.network.ies, pnetwork->ies, 8);
|
||||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||||
ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
|
ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
|
||||||
if (ibss_wlan) {
|
if (ibss_wlan) {
|
||||||
memcpy(ibss_wlan->network.IEs, pnetwork->IEs, 8);
|
memcpy(ibss_wlan->network.ies, pnetwork->ies, 8);
|
||||||
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -947,9 +947,9 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
||||||
|
|
||||||
/* why not use ptarget_wlan?? */
|
/* why not use ptarget_wlan?? */
|
||||||
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
|
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
|
||||||
/* some IEs in pnetwork is wrong, so we should use ptarget_wlan IEs */
|
/* some ies in pnetwork is wrong, so we should use ptarget_wlan ies */
|
||||||
cur_network->network.IELength = ptarget_wlan->network.IELength;
|
cur_network->network.ie_length = ptarget_wlan->network.ie_length;
|
||||||
memcpy(&cur_network->network.IEs[0], &ptarget_wlan->network.IEs[0], MAX_IE_SZ);
|
memcpy(&cur_network->network.ies[0], &ptarget_wlan->network.ies[0], MAX_IE_SZ);
|
||||||
|
|
||||||
cur_network->aid = pnetwork->join_res;
|
cur_network->aid = pnetwork->join_res;
|
||||||
|
|
||||||
|
@ -977,10 +977,10 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtw_update_protection(padapter, (cur_network->network.IEs) +
|
rtw_update_protection(padapter, (cur_network->network.ies) +
|
||||||
sizeof(struct ndis_802_11_fixed_ie),
|
sizeof(struct ndis_802_11_fixed_ie),
|
||||||
(cur_network->network.IELength));
|
(cur_network->network.ie_length));
|
||||||
rtw_update_ht_cap(padapter, cur_network->network.IEs, cur_network->network.IELength);
|
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
||||||
|
@ -1665,7 +1665,7 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust IEs for rtw_joinbss_cmd in WMM */
|
/* adjust ies for rtw_joinbss_cmd in WMM */
|
||||||
int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len)
|
int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len)
|
||||||
{
|
{
|
||||||
unsigned int ielength = 0;
|
unsigned int ielength = 0;
|
||||||
|
@ -1861,11 +1861,11 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
|
||||||
/* 2. IE */
|
/* 2. IE */
|
||||||
|
|
||||||
sz = rtw_generate_ie(pregistrypriv);
|
sz = rtw_generate_ie(pregistrypriv);
|
||||||
pdev_network->IELength = sz;
|
pdev_network->ie_length = sz;
|
||||||
pdev_network->Length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
|
pdev_network->Length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
|
||||||
|
|
||||||
/* notes: translate IELength & Length after assign the Length to cmdsz in createbss_cmd(); */
|
/* notes: translate ie_length & Length after assign the Length to cmdsz in createbss_cmd(); */
|
||||||
/* pdev_network->IELength = cpu_to_le32(sz); */
|
/* pdev_network->ie_length = cpu_to_le32(sz); */
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter)
|
void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter)
|
||||||
|
|
|
@ -371,14 +371,14 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms)
|
||||||
uint wps_ielen;
|
uint wps_ielen;
|
||||||
u8 sr = 0;
|
u8 sr = 0;
|
||||||
|
|
||||||
memcpy(pframe, cur_network->IEs, cur_network->IELength);
|
memcpy(pframe, cur_network->ies, cur_network->ie_length);
|
||||||
len_diff = update_hidden_ssid(
|
len_diff = update_hidden_ssid(
|
||||||
pframe+_BEACON_IE_OFFSET_
|
pframe+_BEACON_IE_OFFSET_
|
||||||
, cur_network->IELength-_BEACON_IE_OFFSET_
|
, cur_network->ie_length-_BEACON_IE_OFFSET_
|
||||||
, pmlmeinfo->hidden_ssid_mode
|
, pmlmeinfo->hidden_ssid_mode
|
||||||
);
|
);
|
||||||
pframe += (cur_network->IELength+len_diff);
|
pframe += (cur_network->ie_length+len_diff);
|
||||||
pattrib->pktlen += (cur_network->IELength+len_diff);
|
pattrib->pktlen += (cur_network->ie_length+len_diff);
|
||||||
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_,
|
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_,
|
||||||
pattrib->pktlen-sizeof(struct ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen);
|
pattrib->pktlen-sizeof(struct ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen);
|
||||||
if (wps_ie && wps_ielen > 0)
|
if (wps_ie && wps_ielen > 0)
|
||||||
|
@ -399,14 +399,14 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms)
|
||||||
|
|
||||||
/* beacon interval: 2 bytes */
|
/* beacon interval: 2 bytes */
|
||||||
|
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pattrib->pktlen += 2;
|
pattrib->pktlen += 2;
|
||||||
|
|
||||||
/* capability info: 2 bytes */
|
/* capability info: 2 bytes */
|
||||||
|
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pattrib->pktlen += 2;
|
pattrib->pktlen += 2;
|
||||||
|
@ -509,25 +509,25 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)
|
||||||
pattrib->pktlen = pattrib->hdrlen;
|
pattrib->pktlen = pattrib->hdrlen;
|
||||||
pframe += pattrib->hdrlen;
|
pframe += pattrib->hdrlen;
|
||||||
|
|
||||||
if (cur_network->IELength > MAX_IE_SZ)
|
if (cur_network->ie_length > MAX_IE_SZ)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(CONFIG_88EU_AP_MODE)
|
#if defined(CONFIG_88EU_AP_MODE)
|
||||||
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
||||||
pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
|
pwps_ie = rtw_get_wps_ie(cur_network->ies+_FIXED_IE_LENGTH_, cur_network->ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
|
||||||
|
|
||||||
/* inerset & update wps_probe_resp_ie */
|
/* inerset & update wps_probe_resp_ie */
|
||||||
if ((pmlmepriv->wps_probe_resp_ie != NULL) && pwps_ie && (wps_ielen > 0)) {
|
if ((pmlmepriv->wps_probe_resp_ie != NULL) && pwps_ie && (wps_ielen > 0)) {
|
||||||
uint wps_offset, remainder_ielen;
|
uint wps_offset, remainder_ielen;
|
||||||
u8 *premainder_ie;
|
u8 *premainder_ie;
|
||||||
|
|
||||||
wps_offset = (uint)(pwps_ie - cur_network->IEs);
|
wps_offset = (uint)(pwps_ie - cur_network->ies);
|
||||||
|
|
||||||
premainder_ie = pwps_ie + wps_ielen;
|
premainder_ie = pwps_ie + wps_ielen;
|
||||||
|
|
||||||
remainder_ielen = cur_network->IELength - wps_offset - wps_ielen;
|
remainder_ielen = cur_network->ie_length - wps_offset - wps_ielen;
|
||||||
|
|
||||||
memcpy(pframe, cur_network->IEs, wps_offset);
|
memcpy(pframe, cur_network->ies, wps_offset);
|
||||||
pframe += wps_offset;
|
pframe += wps_offset;
|
||||||
pattrib->pktlen += wps_offset;
|
pattrib->pktlen += wps_offset;
|
||||||
|
|
||||||
|
@ -544,9 +544,9 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)
|
||||||
pattrib->pktlen += remainder_ielen;
|
pattrib->pktlen += remainder_ielen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
memcpy(pframe, cur_network->IEs, cur_network->IELength);
|
memcpy(pframe, cur_network->ies, cur_network->ie_length);
|
||||||
pframe += cur_network->IELength;
|
pframe += cur_network->ie_length;
|
||||||
pattrib->pktlen += cur_network->IELength;
|
pattrib->pktlen += cur_network->ie_length;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -557,14 +557,14 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)
|
||||||
|
|
||||||
/* beacon interval: 2 bytes */
|
/* beacon interval: 2 bytes */
|
||||||
|
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pattrib->pktlen += 2;
|
pattrib->pktlen += 2;
|
||||||
|
|
||||||
/* capability info: 2 bytes */
|
/* capability info: 2 bytes */
|
||||||
|
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pattrib->pktlen += 2;
|
pattrib->pktlen += 2;
|
||||||
|
@ -906,7 +906,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status,
|
||||||
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 wlan_bssid_ex *pnetwork = &(pmlmeinfo->network);
|
struct wlan_bssid_ex *pnetwork = &(pmlmeinfo->network);
|
||||||
u8 *ie = pnetwork->IEs;
|
u8 *ie = pnetwork->ies;
|
||||||
__le16 lestatus, leval;
|
__le16 lestatus, leval;
|
||||||
|
|
||||||
DBG_88E("%s\n", __func__);
|
DBG_88E("%s\n", __func__);
|
||||||
|
@ -968,7 +968,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status,
|
||||||
uint ie_len = 0;
|
uint ie_len = 0;
|
||||||
|
|
||||||
/* FILL HT CAP INFO IE */
|
/* FILL HT CAP INFO IE */
|
||||||
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
|
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (pbuf && ie_len > 0) {
|
if (pbuf && ie_len > 0) {
|
||||||
memcpy(pframe, pbuf, ie_len+2);
|
memcpy(pframe, pbuf, ie_len+2);
|
||||||
pframe += (ie_len+2);
|
pframe += (ie_len+2);
|
||||||
|
@ -976,7 +976,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FILL HT ADD INFO IE */
|
/* FILL HT ADD INFO IE */
|
||||||
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
|
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_));
|
||||||
if (pbuf && ie_len > 0) {
|
if (pbuf && ie_len > 0) {
|
||||||
memcpy(pframe, pbuf, ie_len+2);
|
memcpy(pframe, pbuf, ie_len+2);
|
||||||
pframe += (ie_len+2);
|
pframe += (ie_len+2);
|
||||||
|
@ -990,7 +990,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status,
|
||||||
unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
|
unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
|
||||||
|
|
||||||
for (pbuf = ie + _BEACON_IE_OFFSET_;; pbuf += (ie_len + 2)) {
|
for (pbuf = ie + _BEACON_IE_OFFSET_;; pbuf += (ie_len + 2)) {
|
||||||
pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
||||||
if (pbuf && !memcmp(pbuf+2, WMM_PARA_IE, 6)) {
|
if (pbuf && !memcmp(pbuf+2, WMM_PARA_IE, 6)) {
|
||||||
memcpy(pframe, pbuf, ie_len+2);
|
memcpy(pframe, pbuf, ie_len+2);
|
||||||
pframe += (ie_len+2);
|
pframe += (ie_len+2);
|
||||||
|
@ -1065,7 +1065,7 @@ static void issue_assocreq(struct adapter *padapter)
|
||||||
|
|
||||||
/* caps */
|
/* caps */
|
||||||
|
|
||||||
memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.IEs), 2);
|
memcpy(pframe, rtw_get_capability_from_ie(pmlmeinfo->network.ies), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pattrib->pktlen += 2;
|
pattrib->pktlen += 2;
|
||||||
|
@ -1132,13 +1132,13 @@ static void issue_assocreq(struct adapter *padapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RSN */
|
/* RSN */
|
||||||
p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ie)), _RSN_IE_2_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ie)));
|
p = rtw_get_ie((pmlmeinfo->network.ies + sizeof(struct ndis_802_11_fixed_ie)), _RSN_IE_2_, &ie_len, (pmlmeinfo->network.ie_length - sizeof(struct ndis_802_11_fixed_ie)));
|
||||||
if (p)
|
if (p)
|
||||||
pframe = rtw_set_ie(pframe, _RSN_IE_2_, ie_len, (p + 2), &(pattrib->pktlen));
|
pframe = rtw_set_ie(pframe, _RSN_IE_2_, ie_len, (p + 2), &(pattrib->pktlen));
|
||||||
|
|
||||||
/* HT caps */
|
/* HT caps */
|
||||||
if (padapter->mlmepriv.htpriv.ht_option) {
|
if (padapter->mlmepriv.htpriv.ht_option) {
|
||||||
p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ie)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ie)));
|
p = rtw_get_ie((pmlmeinfo->network.ies + sizeof(struct ndis_802_11_fixed_ie)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.ie_length - sizeof(struct ndis_802_11_fixed_ie)));
|
||||||
if ((p != NULL) && (!(is_ap_in_tkip(padapter)))) {
|
if ((p != NULL) && (!(is_ap_in_tkip(padapter)))) {
|
||||||
memcpy(&pmlmeinfo->HT_caps, p + 2, sizeof(struct ieee80211_ht_cap));
|
memcpy(&pmlmeinfo->HT_caps, p + 2, sizeof(struct ieee80211_ht_cap));
|
||||||
|
|
||||||
|
@ -1159,8 +1159,8 @@ static void issue_assocreq(struct adapter *padapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vendor specific IE, such as WPA, WMM, WPS */
|
/* vendor specific IE, such as WPA, WMM, WPS */
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength; i += (pIE->Length + 2)) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.ie_length; i += (pIE->Length + 2)) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.ies + i);
|
||||||
|
|
||||||
switch (pIE->ElementID) {
|
switch (pIE->ElementID) {
|
||||||
case _VENDOR_SPECIFIC_IE_:
|
case _VENDOR_SPECIFIC_IE_:
|
||||||
|
@ -1804,7 +1804,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
|
||||||
|
|
||||||
pbss_network = (struct wlan_bssid_ex *)&pnetwork->network;
|
pbss_network = (struct wlan_bssid_ex *)&pnetwork->network;
|
||||||
|
|
||||||
p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(pbss_network->ies + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if ((p == NULL) || (len == 0)) { /* non-HT */
|
if ((p == NULL) || (len == 0)) { /* non-HT */
|
||||||
if ((pbss_network->Configuration.DSConfig <= 0) || (pbss_network->Configuration.DSConfig > 14))
|
if ((pbss_network->Configuration.DSConfig <= 0) || (pbss_network->Configuration.DSConfig > 14))
|
||||||
continue;
|
continue;
|
||||||
|
@ -2080,8 +2080,8 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
|
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
|
||||||
|
|
||||||
/* below is to copy the information element */
|
/* below is to copy the information element */
|
||||||
bssid->IELength = len;
|
bssid->ie_length = len;
|
||||||
memcpy(bssid->IEs, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->IELength);
|
memcpy(bssid->ies, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->ie_length);
|
||||||
|
|
||||||
/* get the signal strength in dBM.raw data */
|
/* get the signal strength in dBM.raw data */
|
||||||
bssid->Rssi = precv_frame->attrib.phy_info.recvpower;
|
bssid->Rssi = precv_frame->attrib.phy_info.recvpower;
|
||||||
|
@ -2090,7 +2090,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna);
|
rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna);
|
||||||
|
|
||||||
/* checking SSID */
|
/* checking SSID */
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _SSID_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
DBG_88E("marc: cannot find SSID for survey event\n");
|
DBG_88E("marc: cannot find SSID for survey event\n");
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
|
@ -2111,7 +2111,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
|
|
||||||
/* checking rate info... */
|
/* checking rate info... */
|
||||||
i = 0;
|
i = 0;
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
if (len > NDIS_802_11_LENGTH_RATES_EX) {
|
if (len > NDIS_802_11_LENGTH_RATES_EX) {
|
||||||
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
|
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
|
||||||
|
@ -2121,7 +2121,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
i = len;
|
i = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
if (p) {
|
if (p) {
|
||||||
if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) {
|
if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) {
|
||||||
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
|
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
|
||||||
|
@ -2133,11 +2133,11 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
/* todo: */
|
/* todo: */
|
||||||
bssid->NetworkTypeInUse = Ndis802_11OFDM24;
|
bssid->NetworkTypeInUse = Ndis802_11OFDM24;
|
||||||
|
|
||||||
if (bssid->IELength < 12)
|
if (bssid->ie_length < 12)
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
|
|
||||||
/* Checking for DSConfig */
|
/* Checking for DSConfig */
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _DSSET_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _DSSET_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
|
|
||||||
bssid->Configuration.DSConfig = 0;
|
bssid->Configuration.DSConfig = 0;
|
||||||
bssid->Configuration.Length = 0;
|
bssid->Configuration.Length = 0;
|
||||||
|
@ -2146,7 +2146,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
bssid->Configuration.DSConfig = *(p + 2);
|
bssid->Configuration.DSConfig = *(p + 2);
|
||||||
} else {/* In 5G, some ap do not have DSSET IE */
|
} else {/* In 5G, some ap do not have DSSET IE */
|
||||||
/* checking HT info for channel */
|
/* checking HT info for channel */
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
if (p) {
|
if (p) {
|
||||||
struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2);
|
struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2);
|
||||||
|
|
||||||
|
@ -2165,7 +2165,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
}
|
}
|
||||||
|
|
||||||
bssid->Configuration.BeaconPeriod =
|
bssid->Configuration.BeaconPeriod =
|
||||||
get_unaligned_le16(rtw_get_beacon_interval_from_ie(bssid->IEs));
|
get_unaligned_le16(rtw_get_beacon_interval_from_ie(bssid->ies));
|
||||||
|
|
||||||
val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
|
val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
|
||||||
|
|
||||||
|
@ -2188,7 +2188,7 @@ static u8 collect_bss_info(struct adapter *padapter,
|
||||||
if ((pregistrypriv->wifi_spec == 1) && (!pmlmeinfo->bwmode_updated)) {
|
if ((pregistrypriv->wifi_spec == 1) && (!pmlmeinfo->bwmode_updated)) {
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
|
|
||||||
p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset);
|
p = rtw_get_ie(bssid->ies + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->ie_length - ie_offset);
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
struct ieee80211_ht_cap *pHT_caps =
|
struct ieee80211_ht_cap *pHT_caps =
|
||||||
(struct ieee80211_ht_cap *)(p + 2);
|
(struct ieee80211_ht_cap *)(p + 2);
|
||||||
|
@ -2408,7 +2408,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
|
||||||
u8 noc; /* number of channel */
|
u8 noc; /* number of channel */
|
||||||
u8 j, k;
|
u8 j, k;
|
||||||
|
|
||||||
ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _COUNTRY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
ie = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _COUNTRY_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (!ie)
|
if (!ie)
|
||||||
return;
|
return;
|
||||||
if (len < 6)
|
if (len < 6)
|
||||||
|
@ -4970,13 +4970,13 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
|
||||||
/* clear CAM */
|
/* clear CAM */
|
||||||
flush_all_cam_entry(padapter);
|
flush_all_cam_entry(padapter);
|
||||||
|
|
||||||
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, IELength));
|
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length));
|
||||||
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length;
|
||||||
|
|
||||||
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */
|
||||||
return H2C_PARAMETERS_ERROR;
|
return H2C_PARAMETERS_ERROR;
|
||||||
|
|
||||||
memcpy(pnetwork->IEs, ((struct wlan_bssid_ex *)pbuf)->IEs, pnetwork->IELength);
|
memcpy(pnetwork->ies, ((struct wlan_bssid_ex *)pbuf)->ies, pnetwork->ie_length);
|
||||||
|
|
||||||
start_create_ibss(padapter);
|
start_create_ibss(padapter);
|
||||||
}
|
}
|
||||||
|
@ -5029,18 +5029,18 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
|
||||||
pmlmeinfo->candidate_tid_bitmap = 0;
|
pmlmeinfo->candidate_tid_bitmap = 0;
|
||||||
pmlmeinfo->bwmode_updated = false;
|
pmlmeinfo->bwmode_updated = false;
|
||||||
|
|
||||||
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, IELength));
|
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length));
|
||||||
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length;
|
||||||
|
|
||||||
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */
|
||||||
return H2C_PARAMETERS_ERROR;
|
return H2C_PARAMETERS_ERROR;
|
||||||
|
|
||||||
memcpy(pnetwork->IEs, ((struct wlan_bssid_ex *)pbuf)->IEs, pnetwork->IELength);
|
memcpy(pnetwork->ies, ((struct wlan_bssid_ex *)pbuf)->ies, pnetwork->ie_length);
|
||||||
|
|
||||||
/* Check AP vendor to move rtw_joinbss_cmd() */
|
/* Check AP vendor to move rtw_joinbss_cmd() */
|
||||||
|
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->IELength;) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->ie_length;) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(pnetwork->IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(pnetwork->ies + i);
|
||||||
|
|
||||||
switch (pIE->ElementID) {
|
switch (pIE->ElementID) {
|
||||||
case _VENDOR_SPECIFIC_IE_:/* Get WMM IE. */
|
case _VENDOR_SPECIFIC_IE_:/* Get WMM IE. */
|
||||||
|
@ -5409,10 +5409,10 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_,
|
len_diff = update_hidden_ssid(ptxBeacon_parm->ies+_BEACON_IE_OFFSET_,
|
||||||
ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_,
|
ptxBeacon_parm->ie_length-_BEACON_IE_OFFSET_,
|
||||||
pmlmeinfo->hidden_ssid_mode);
|
pmlmeinfo->hidden_ssid_mode);
|
||||||
ptxBeacon_parm->IELength += len_diff;
|
ptxBeacon_parm->ie_length += len_diff;
|
||||||
|
|
||||||
init_h2fwcmd_w_parm_no_rsp(ph2c, ptxBeacon_parm, _TX_Beacon_CMD_);
|
init_h2fwcmd_w_parm_no_rsp(ph2c, ptxBeacon_parm, _TX_Beacon_CMD_);
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
|
||||||
{
|
{
|
||||||
__le16 val;
|
__le16 val;
|
||||||
|
|
||||||
memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);
|
memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->ies), 2);
|
||||||
|
|
||||||
return le16_to_cpu(val);
|
return le16_to_cpu(val);
|
||||||
}
|
}
|
||||||
|
@ -897,12 +897,12 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
|
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
|
||||||
|
|
||||||
/* below is to copy the information element */
|
/* below is to copy the information element */
|
||||||
bssid->IELength = len;
|
bssid->ie_length = len;
|
||||||
memcpy(bssid->IEs, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->IELength);
|
memcpy(bssid->ies, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->ie_length);
|
||||||
|
|
||||||
/* check bw and channel offset */
|
/* check bw and channel offset */
|
||||||
/* parsing HT_CAP_IE */
|
/* parsing HT_CAP_IE */
|
||||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
struct ieee80211_ht_cap *ht_cap =
|
struct ieee80211_ht_cap *ht_cap =
|
||||||
(struct ieee80211_ht_cap *)(p + 2);
|
(struct ieee80211_ht_cap *)(p + 2);
|
||||||
|
@ -912,7 +912,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
ht_cap_info = 0;
|
ht_cap_info = 0;
|
||||||
}
|
}
|
||||||
/* parsing HT_INFO_IE */
|
/* parsing HT_INFO_IE */
|
||||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p && len > 0) {
|
if (p && len > 0) {
|
||||||
pht_info = (struct HT_info_element *)(p + 2);
|
pht_info = (struct HT_info_element *)(p + 2);
|
||||||
ht_info_infos_0 = pht_info->infos[0];
|
ht_info_infos_0 = pht_info->infos[0];
|
||||||
|
@ -934,11 +934,11 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checking for channel */
|
/* Checking for channel */
|
||||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p) {
|
if (p) {
|
||||||
bcn_channel = *(p + 2);
|
bcn_channel = *(p + 2);
|
||||||
} else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
|
} else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
|
||||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (pht_info) {
|
if (pht_info) {
|
||||||
bcn_channel = pht_info->primary_channel;
|
bcn_channel = pht_info->primary_channel;
|
||||||
} else { /* we don't find channel IE, so don't check it */
|
} else { /* we don't find channel IE, so don't check it */
|
||||||
|
@ -954,7 +954,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
|
|
||||||
/* checking SSID */
|
/* checking SSID */
|
||||||
ssid_len = 0;
|
ssid_len = 0;
|
||||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
p = rtw_get_ie(bssid->ies + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->ie_length - _FIXED_IE_LENGTH_);
|
||||||
if (p) {
|
if (p) {
|
||||||
ssid_len = *(p + 1);
|
ssid_len = *(p + 1);
|
||||||
if (ssid_len > NDIS_802_11_LENGTH_SSID)
|
if (ssid_len > NDIS_802_11_LENGTH_SSID)
|
||||||
|
@ -992,7 +992,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
goto _mismatch;
|
goto _mismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL, &rsn_len, NULL, &wpa_len);
|
rtw_get_sec_ie(bssid->ies, bssid->ie_length, NULL, &rsn_len, NULL, &wpa_len);
|
||||||
|
|
||||||
if (rsn_len > 0) {
|
if (rsn_len > 0) {
|
||||||
encryp_protocol = ENCRYP_PROTOCOL_WPA2;
|
encryp_protocol = ENCRYP_PROTOCOL_WPA2;
|
||||||
|
@ -1009,7 +1009,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
|
if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
|
||||||
pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
|
pbuf = rtw_get_wpa_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length-12);
|
||||||
if (pbuf && (wpa_ielen > 0)) {
|
if (pbuf && (wpa_ielen > 0)) {
|
||||||
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
|
||||||
|
@ -1017,7 +1017,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||||
pairwise_cipher, group_cipher, is_8021x));
|
pairwise_cipher, group_cipher, is_8021x));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
|
pbuf = rtw_get_wpa2_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length-12);
|
||||||
|
|
||||||
if (pbuf && (wpa_ielen > 0)) {
|
if (pbuf && (wpa_ielen > 0)) {
|
||||||
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
||||||
|
@ -1088,8 +1088,8 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
|
||||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||||
|
|
||||||
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.ie_length;) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.ies + i);
|
||||||
|
|
||||||
switch (pIE->ElementID) {
|
switch (pIE->ElementID) {
|
||||||
case _VENDOR_SPECIFIC_IE_:
|
case _VENDOR_SPECIFIC_IE_:
|
||||||
|
@ -1119,8 +1119,8 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)
|
||||||
struct wlan_bssid_ex *cur_network = &pmlmepriv->cur_network.network;
|
struct wlan_bssid_ex *cur_network = &pmlmepriv->cur_network.network;
|
||||||
|
|
||||||
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->IELength;) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->ie_length;) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(cur_network->IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(cur_network->ies + i);
|
||||||
|
|
||||||
switch (pIE->ElementID) {
|
switch (pIE->ElementID) {
|
||||||
case _VENDOR_SPECIFIC_IE_:
|
case _VENDOR_SPECIFIC_IE_:
|
||||||
|
@ -1155,8 +1155,8 @@ unsigned int is_ap_in_wep(struct adapter *padapter)
|
||||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||||
|
|
||||||
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
||||||
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) {
|
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.ie_length;) {
|
||||||
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i);
|
pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.ies + i);
|
||||||
|
|
||||||
switch (pIE->ElementID) {
|
switch (pIE->ElementID) {
|
||||||
case _VENDOR_SPECIFIC_IE_:
|
case _VENDOR_SPECIFIC_IE_:
|
||||||
|
|
|
@ -249,20 +249,20 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)
|
||||||
pktlen += 8;
|
pktlen += 8;
|
||||||
|
|
||||||
/* beacon interval: 2 bytes */
|
/* beacon interval: 2 bytes */
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pktlen += 2;
|
pktlen += 2;
|
||||||
|
|
||||||
/* capability info: 2 bytes */
|
/* capability info: 2 bytes */
|
||||||
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->ies)), 2);
|
||||||
|
|
||||||
pframe += 2;
|
pframe += 2;
|
||||||
pktlen += 2;
|
pktlen += 2;
|
||||||
|
|
||||||
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
||||||
pktlen += cur_network->IELength - sizeof(struct ndis_802_11_fixed_ie);
|
pktlen += cur_network->ie_length - sizeof(struct ndis_802_11_fixed_ie);
|
||||||
memcpy(pframe, cur_network->IEs+sizeof(struct ndis_802_11_fixed_ie), pktlen);
|
memcpy(pframe, cur_network->ies+sizeof(struct ndis_802_11_fixed_ie), pktlen);
|
||||||
|
|
||||||
goto _ConstructBeacon;
|
goto _ConstructBeacon;
|
||||||
}
|
}
|
||||||
|
@ -425,12 +425,12 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u
|
||||||
pktlen = sizeof(struct ieee80211_hdr_3addr);
|
pktlen = sizeof(struct ieee80211_hdr_3addr);
|
||||||
pframe += pktlen;
|
pframe += pktlen;
|
||||||
|
|
||||||
if (cur_network->IELength > MAX_IE_SZ)
|
if (cur_network->ie_length > MAX_IE_SZ)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memcpy(pframe, cur_network->IEs, cur_network->IELength);
|
memcpy(pframe, cur_network->ies, cur_network->ie_length);
|
||||||
pframe += cur_network->IELength;
|
pframe += cur_network->ie_length;
|
||||||
pktlen += cur_network->IELength;
|
pktlen += cur_network->ie_length;
|
||||||
|
|
||||||
*pLength = pktlen;
|
*pLength = pktlen;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,9 +83,9 @@ struct ndis_802_11_var_ie {
|
||||||
* [ETH_ALEN] + 2 + sizeof (struct ndis_802_11_ssid) + sizeof (u32)
|
* [ETH_ALEN] + 2 + sizeof (struct ndis_802_11_ssid) + sizeof (u32)
|
||||||
* + sizeof (NDIS_802_11_RSSI) + sizeof (enum NDIS_802_11_NETWORK_TYPE)
|
* + sizeof (NDIS_802_11_RSSI) + sizeof (enum NDIS_802_11_NETWORK_TYPE)
|
||||||
* + sizeof (struct ndis_802_11_config)
|
* + sizeof (struct ndis_802_11_config)
|
||||||
* + NDIS_802_11_LENGTH_RATES_EX + IELength
|
* + NDIS_802_11_LENGTH_RATES_EX + ie_length
|
||||||
*
|
*
|
||||||
* Except the IELength, all other fields are fixed length.
|
* Except the ie_length, all other fields are fixed length.
|
||||||
* Therefore, we can define a macro to represent the partial sum.
|
* Therefore, we can define a macro to represent the partial sum.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -196,15 +196,15 @@ struct wlan_bssid_ex {
|
||||||
enum ndis_802_11_network_infra InfrastructureMode;
|
enum ndis_802_11_network_infra InfrastructureMode;
|
||||||
unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
|
unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
|
||||||
struct wlan_phy_info PhyInfo;
|
struct wlan_phy_info PhyInfo;
|
||||||
u32 IELength;
|
u32 ie_length;
|
||||||
u8 IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and
|
u8 ies[MAX_IE_SZ]; /* timestamp, beacon interval, and
|
||||||
* capability information)
|
* capability information)
|
||||||
*/
|
*/
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
|
static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
|
||||||
{
|
{
|
||||||
return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
|
return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->ie_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlan_network {
|
struct wlan_network {
|
||||||
|
|
|
@ -129,7 +129,7 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid);
|
start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid);
|
||||||
|
|
||||||
/* parsing HT_CAP_IE */
|
/* parsing HT_CAP_IE */
|
||||||
p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12);
|
p = rtw_get_ie(&pnetwork->network.ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.ie_length-12);
|
||||||
|
|
||||||
if (p && ht_ielen > 0) {
|
if (p && ht_ielen > 0) {
|
||||||
struct ieee80211_ht_cap *pht_capie;
|
struct ieee80211_ht_cap *pht_capie;
|
||||||
|
@ -174,7 +174,7 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
|
|
||||||
/* Add mode */
|
/* Add mode */
|
||||||
iwe.cmd = SIOCGIWMODE;
|
iwe.cmd = SIOCGIWMODE;
|
||||||
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
|
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.ies), 2);
|
||||||
|
|
||||||
cap = le16_to_cpu(le_tmp);
|
cap = le16_to_cpu(le_tmp);
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
u16 wpa_len = 0, rsn_len = 0;
|
u16 wpa_len = 0, rsn_len = 0;
|
||||||
u8 *p;
|
u8 *p;
|
||||||
|
|
||||||
rtw_get_sec_ie(pnetwork->network.IEs, pnetwork->network.IELength, rsn_ie, &rsn_len, wpa_ie, &wpa_len);
|
rtw_get_sec_ie(pnetwork->network.ies, pnetwork->network.ie_length, rsn_ie, &rsn_len, wpa_ie, &wpa_len);
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.Ssid.Ssid));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.Ssid.Ssid));
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));
|
||||||
|
|
||||||
|
@ -286,9 +286,9 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
uint cnt = 0, total_ielen;
|
uint cnt = 0, total_ielen;
|
||||||
u8 *wpsie_ptr = NULL;
|
u8 *wpsie_ptr = NULL;
|
||||||
uint wps_ielen = 0;
|
uint wps_ielen = 0;
|
||||||
u8 *ie_ptr = pnetwork->network.IEs + _FIXED_IE_LENGTH_;
|
u8 *ie_ptr = pnetwork->network.ies + _FIXED_IE_LENGTH_;
|
||||||
|
|
||||||
total_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_;
|
total_ielen = pnetwork->network.ie_length - _FIXED_IE_LENGTH_;
|
||||||
|
|
||||||
while (cnt < total_ielen) {
|
while (cnt < total_ielen) {
|
||||||
if (rtw_is_wps_ie(&ie_ptr[cnt], &wps_ielen) && (wps_ielen > 2)) {
|
if (rtw_is_wps_ie(&ie_ptr[cnt], &wps_ielen) && (wps_ielen > 2)) {
|
||||||
|
@ -644,7 +644,7 @@ static int rtw_wx_get_name(struct net_device *dev,
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
|
if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
|
||||||
/* parsing HT_CAP_IE */
|
/* parsing HT_CAP_IE */
|
||||||
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
|
p = rtw_get_ie(&pcur_bss->ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->ie_length-12);
|
||||||
if (p && ht_ielen > 0)
|
if (p && ht_ielen > 0)
|
||||||
ht_cap = true;
|
ht_cap = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue