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

staging: rtl8723au: Get rid of struct ndis_802_11_var_ies

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c164bcff
...@@ -889,7 +889,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, ...@@ -889,7 +889,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len, p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)); (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) if (p && ie_len > 0)
ERP_IE_handler23a(padapter, (struct ndis_802_11_var_ies *)p); ERP_IE_handler23a(padapter, p);
/* update privacy/security */ /* update privacy/security */
if (cap & BIT(4)) if (cap & BIT(4))
...@@ -1024,9 +1024,9 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, ...@@ -1024,9 +1024,9 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
if (pregistrypriv->ampdu_enable == 1) if (pregistrypriv->ampdu_enable == 1)
pmlmepriv->htpriv.ampdu_enable = true; pmlmepriv->htpriv.ampdu_enable = true;
HT_caps_handler23a(padapter, (struct ndis_802_11_var_ies *)pHT_caps_ie); HT_caps_handler23a(padapter, pHT_caps_ie);
HT_info_handler23a(padapter, (struct ndis_802_11_var_ies *)pHT_info_ie); HT_info_handler23a(padapter, pHT_info_ie);
} }
pbss_network->Length = get_wlan_bssid_ex_sz(pbss_network); pbss_network->Length = get_wlan_bssid_ex_sz(pbss_network);
...@@ -1182,23 +1182,20 @@ static void update_bcn_erpinfo_ie(struct rtw_adapter *padapter) ...@@ -1182,23 +1182,20 @@ static void update_bcn_erpinfo_ie(struct rtw_adapter *padapter)
/* parsing ERP_IE */ /* 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 + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
if (p && len>0) if (p && len > 0) {
{
struct ndis_802_11_var_ies * pIE = (struct ndis_802_11_var_ies *)p;
if (pmlmepriv->num_sta_non_erp == 1) if (pmlmepriv->num_sta_non_erp == 1)
pIE->data[0] |= WLAN_ERP_NON_ERP_PRESENT | p[2] |= WLAN_ERP_NON_ERP_PRESENT |
WLAN_ERP_USE_PROTECTION; WLAN_ERP_USE_PROTECTION;
else else
pIE->data[0] &= ~(WLAN_ERP_NON_ERP_PRESENT | p[2] &= ~(WLAN_ERP_NON_ERP_PRESENT |
WLAN_ERP_USE_PROTECTION); WLAN_ERP_USE_PROTECTION);
if (pmlmepriv->num_sta_no_short_preamble > 0) if (pmlmepriv->num_sta_no_short_preamble > 0)
pIE->data[0] |= WLAN_ERP_BARKER_PREAMBLE; p[2] |= WLAN_ERP_BARKER_PREAMBLE;
else else
pIE->data[0] &= ~(WLAN_ERP_BARKER_PREAMBLE); p[2] &= ~(WLAN_ERP_BARKER_PREAMBLE);
ERP_IE_handler23a(padapter, pIE); ERP_IE_handler23a(padapter, p);
} }
} }
......
...@@ -1735,7 +1735,6 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1735,7 +1735,6 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
static int static int
OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
{ {
struct ndis_802_11_var_ies *pIE;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
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;
...@@ -1743,6 +1742,7 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1743,6 +1742,7 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
struct ieee80211_mgmt *pmgmt = (struct ieee80211_mgmt *) skb->data; struct ieee80211_mgmt *pmgmt = (struct ieee80211_mgmt *) skb->data;
int res, i; int res, i;
unsigned short status; unsigned short status;
u8 *p;
u8 *pframe = skb->data; u8 *pframe = skb->data;
int pkt_len = skb->len; int pkt_len = skb->len;
...@@ -1783,31 +1783,31 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1783,31 +1783,31 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
/* for not to handle the synchronous IO in the tasklet */ /* for not to handle the synchronous IO in the tasklet */
for (i = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); for (i = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
i < pkt_len;) { i < pkt_len;) {
pIE = (struct ndis_802_11_var_ies *)(pframe + i); p = pframe + i;
switch (pIE->ElementID) switch (p[0])
{ {
case WLAN_EID_VENDOR_SPECIFIC: case WLAN_EID_VENDOR_SPECIFIC:
if (!memcmp(pIE->data, WMM_PARA_OUI23A, 6))/* WMM */ if (!memcmp(p + 2, WMM_PARA_OUI23A, 6))/* WMM */
WMM_param_handler23a(padapter, pIE); WMM_param_handler23a(padapter, p);
break; break;
case WLAN_EID_HT_CAPABILITY: /* HT caps */ case WLAN_EID_HT_CAPABILITY: /* HT caps */
HT_caps_handler23a(padapter, pIE); HT_caps_handler23a(padapter, p);
break; break;
case WLAN_EID_HT_OPERATION: /* HT info */ case WLAN_EID_HT_OPERATION: /* HT info */
HT_info_handler23a(padapter, pIE); HT_info_handler23a(padapter, p);
break; break;
case WLAN_EID_ERP_INFO: case WLAN_EID_ERP_INFO:
ERP_IE_handler23a(padapter, pIE); ERP_IE_handler23a(padapter, p);
default: default:
break; break;
} }
i += (pIE->Length + 2); i += (p[1] + 2);
} }
pmlmeinfo->state &= ~WIFI_FW_ASSOC_STATE; pmlmeinfo->state &= ~WIFI_FW_ASSOC_STATE;
...@@ -3272,14 +3272,13 @@ void issue_assocreq23a(struct rtw_adapter *padapter) ...@@ -3272,14 +3272,13 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
__le16 *fctrl; __le16 *fctrl;
unsigned int i, j, index = 0; unsigned int i, j, index = 0;
unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates]; unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates];
struct ndis_802_11_var_ies *pIE;
struct registry_priv *pregpriv = &padapter->registrypriv; struct registry_priv *pregpriv = &padapter->registrypriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
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;
int bssrate_len = 0, sta_bssrate_len = 0, pie_len, bcn_fixed_size; int bssrate_len = 0, sta_bssrate_len = 0, pie_len, bcn_fixed_size;
u8 * pie; u8 *pie;
pmgntframe = alloc_mgtxmitframe23a(pxmitpriv); pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
if (!pmgntframe) if (!pmgntframe)
...@@ -3474,26 +3473,25 @@ void issue_assocreq23a(struct rtw_adapter *padapter) ...@@ -3474,26 +3473,25 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
/* vendor specific IE, such as WPA, WMM, WPS */ /* vendor specific IE, such as WPA, WMM, WPS */
for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) { for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) {
pIE = (struct ndis_802_11_var_ies *) p = pmlmeinfo->network.IEs + i;
(pmlmeinfo->network.IEs + i);
switch (pIE->ElementID) switch (p[0]) {
{
case WLAN_EID_VENDOR_SPECIFIC: case WLAN_EID_VENDOR_SPECIFIC:
if (!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4) || if (!memcmp(p + 2, RTW_WPA_OUI23A_TYPE, 4) ||
!memcmp(pIE->data, WMM_OUI23A, 4) || !memcmp(p + 2, WMM_OUI23A, 4) ||
!memcmp(pIE->data, WPS_OUI23A, 4)) { !memcmp(p + 2, WPS_OUI23A, 4)) {
u8 plen = p[1];
if (!padapter->registrypriv.wifi_spec) { if (!padapter->registrypriv.wifi_spec) {
/* Commented by Kurt 20110629 */ /* Commented by Kurt 20110629 */
/* In some older APs, WPS handshake */ /* In some older APs, WPS handshake */
/* would be fail if we append vender /* would be fail if we append vender
extensions informations to AP */ extensions informations to AP */
if (!memcmp(pIE->data, WPS_OUI23A, 4)) if (!memcmp(p + 2, WPS_OUI23A, 4))
pIE->Length = 14; plen = 14;
} }
pframe = rtw_set_ie23a(pframe, pframe = rtw_set_ie23a(pframe,
WLAN_EID_VENDOR_SPECIFIC, WLAN_EID_VENDOR_SPECIFIC,
pIE->Length, pIE->data, plen, p + 2,
&pattrib->pktlen); &pattrib->pktlen);
} }
break; break;
...@@ -3502,7 +3500,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter) ...@@ -3502,7 +3500,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
break; break;
} }
i += pIE->Length + 2; i += p[1] + 2;
} }
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK)
...@@ -5893,7 +5891,6 @@ int createbss_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -5893,7 +5891,6 @@ int createbss_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{ {
struct ndis_802_11_var_ies * pIE;
struct registry_priv *pregpriv = &padapter->registrypriv; struct registry_priv *pregpriv = &padapter->registrypriv;
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;
...@@ -5902,6 +5899,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -5902,6 +5899,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
struct HT_info_element *pht_info; struct HT_info_element *pht_info;
u32 i; u32 i;
int bcn_fixed_size; int bcn_fixed_size;
u8 *p;
/* u32 initialgain; */ /* u32 initialgain; */
/* u32 acparm; */ /* u32 acparm; */
...@@ -5951,12 +5949,11 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -5951,12 +5949,11 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
offsetof(struct ieee80211_mgmt, u.beacon); offsetof(struct ieee80211_mgmt, u.beacon);
for (i = bcn_fixed_size; i < pnetwork->IELength;) { for (i = bcn_fixed_size; i < pnetwork->IELength;) {
pIE = (struct ndis_802_11_var_ies *)(pnetwork->IEs + i); p = pnetwork->IEs + i;
switch (pIE->ElementID) switch (p[0]) {
{
case WLAN_EID_VENDOR_SPECIFIC:/* Get WMM IE. */ case WLAN_EID_VENDOR_SPECIFIC:/* Get WMM IE. */
if (!memcmp(pIE->data, WMM_OUI23A, 4)) if (!memcmp(p + 2, WMM_OUI23A, 4))
pmlmeinfo->WMM_enable = 1; pmlmeinfo->WMM_enable = 1;
break; break;
...@@ -5969,7 +5966,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -5969,7 +5966,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
/* spec case only for cisco's ap because cisco's ap /* spec case only for cisco's ap because cisco's ap
* issue assoc rsp using mcs rate @40MHz or @20MHz */ * issue assoc rsp using mcs rate @40MHz or @20MHz */
pht_info = (struct HT_info_element *)(pIE->data); pht_info = (struct HT_info_element *)(p + 2);
if ((pregpriv->cbw40_enable) && if ((pregpriv->cbw40_enable) &&
(pht_info->infos[0] & BIT(2))) { (pht_info->infos[0] & BIT(2))) {
...@@ -6001,7 +5998,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -6001,7 +5998,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
break; break;
} }
i += (pIE->Length + 2); i += (p[1] + 2);
} }
hw_var_set_bssid(padapter, pmlmeinfo->network.MacAddress); hw_var_set_bssid(padapter, pmlmeinfo->network.MacAddress);
......
...@@ -514,18 +514,14 @@ bool is_IBSS_empty23a(struct rtw_adapter *padapter); ...@@ -514,18 +514,14 @@ bool is_IBSS_empty23a(struct rtw_adapter *padapter);
unsigned char check_assoc_AP23a(u8 *pframe, uint len); unsigned char check_assoc_AP23a(u8 *pframe, uint len);
int WMM_param_handler23a(struct rtw_adapter *padapter, int WMM_param_handler23a(struct rtw_adapter *padapter, u8 *p);
struct ndis_802_11_var_ies *pIE);
void WMMOnAssocRsp23a(struct rtw_adapter *padapter); void WMMOnAssocRsp23a(struct rtw_adapter *padapter);
void HT_caps_handler23a(struct rtw_adapter *padapter, void HT_caps_handler23a(struct rtw_adapter *padapter, u8 *p);
struct ndis_802_11_var_ies *pIE); void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p);
void HT_info_handler23a(struct rtw_adapter *padapter,
struct ndis_802_11_var_ies *pIE);
void HTOnAssocRsp23a(struct rtw_adapter *padapter); void HTOnAssocRsp23a(struct rtw_adapter *padapter);
void ERP_IE_handler23a(struct rtw_adapter *padapter, void ERP_IE_handler23a(struct rtw_adapter *padapter, u8 *p);
struct ndis_802_11_var_ies *pIE);
void VCS_update23a(struct rtw_adapter *padapter, struct sta_info *psta); void VCS_update23a(struct rtw_adapter *padapter, struct sta_info *psta);
void update_beacon23a_info(struct rtw_adapter *padapter, u8 *pframe, uint len, void update_beacon23a_info(struct rtw_adapter *padapter, u8 *pframe, uint len,
......
...@@ -22,12 +22,6 @@ ...@@ -22,12 +22,6 @@
#define NDIS_802_11_LENGTH_RATES 8 #define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16 #define NDIS_802_11_LENGTH_RATES_EX 16
struct ndis_802_11_var_ies {
u8 ElementID;
u8 Length;
u8 data[1];
};
/* Length is the 4 bytes multiples of the sum of /* Length is the 4 bytes multiples of the sum of
* sizeof(6 * sizeof(unsigned char)) + 2 + sizeof(struct ndis_802_11_ssid) + * sizeof(6 * sizeof(unsigned char)) + 2 + sizeof(struct ndis_802_11_ssid) +
* sizeof(u32) + sizeof(long) + sizeof(enum ndis_802_11_net_type) + * sizeof(u32) + sizeof(long) + sizeof(enum ndis_802_11_net_type) +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment