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,
p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0)
ERP_IE_handler23a(padapter, (struct ndis_802_11_var_ies *)p);
ERP_IE_handler23a(padapter, p);
/* update privacy/security */
if (cap & BIT(4))
......@@ -1024,9 +1024,9 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
if (pregistrypriv->ampdu_enable == 1)
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);
......@@ -1182,23 +1182,20 @@ static void update_bcn_erpinfo_ie(struct rtw_adapter *padapter)
/* parsing ERP_IE */
p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
if (p && len>0)
{
struct ndis_802_11_var_ies * pIE = (struct ndis_802_11_var_ies *)p;
if (p && len > 0) {
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;
else
pIE->data[0] &= ~(WLAN_ERP_NON_ERP_PRESENT |
WLAN_ERP_USE_PROTECTION);
p[2] &= ~(WLAN_ERP_NON_ERP_PRESENT |
WLAN_ERP_USE_PROTECTION);
if (pmlmepriv->num_sta_no_short_preamble > 0)
pIE->data[0] |= WLAN_ERP_BARKER_PREAMBLE;
p[2] |= WLAN_ERP_BARKER_PREAMBLE;
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)
static int
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_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
......@@ -1743,6 +1742,7 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
struct ieee80211_mgmt *pmgmt = (struct ieee80211_mgmt *) skb->data;
int res, i;
unsigned short status;
u8 *p;
u8 *pframe = skb->data;
int pkt_len = skb->len;
......@@ -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 (i = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
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:
if (!memcmp(pIE->data, WMM_PARA_OUI23A, 6))/* WMM */
WMM_param_handler23a(padapter, pIE);
if (!memcmp(p + 2, WMM_PARA_OUI23A, 6))/* WMM */
WMM_param_handler23a(padapter, p);
break;
case WLAN_EID_HT_CAPABILITY: /* HT caps */
HT_caps_handler23a(padapter, pIE);
HT_caps_handler23a(padapter, p);
break;
case WLAN_EID_HT_OPERATION: /* HT info */
HT_info_handler23a(padapter, pIE);
HT_info_handler23a(padapter, p);
break;
case WLAN_EID_ERP_INFO:
ERP_IE_handler23a(padapter, pIE);
ERP_IE_handler23a(padapter, p);
default:
break;
}
i += (pIE->Length + 2);
i += (p[1] + 2);
}
pmlmeinfo->state &= ~WIFI_FW_ASSOC_STATE;
......@@ -3272,14 +3272,13 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
__le16 *fctrl;
unsigned int i, j, index = 0;
unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates];
struct ndis_802_11_var_ies *pIE;
struct registry_priv *pregpriv = &padapter->registrypriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
int bssrate_len = 0, sta_bssrate_len = 0, pie_len, bcn_fixed_size;
u8 * pie;
u8 *pie;
pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
if (!pmgntframe)
......@@ -3474,26 +3473,25 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
/* vendor specific IE, such as WPA, WMM, WPS */
for (i = bcn_fixed_size; i < pmlmeinfo->network.IELength;) {
pIE = (struct ndis_802_11_var_ies *)
(pmlmeinfo->network.IEs + i);
p = pmlmeinfo->network.IEs + i;
switch (pIE->ElementID)
{
switch (p[0]) {
case WLAN_EID_VENDOR_SPECIFIC:
if (!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4) ||
!memcmp(pIE->data, WMM_OUI23A, 4) ||
!memcmp(pIE->data, WPS_OUI23A, 4)) {
if (!memcmp(p + 2, RTW_WPA_OUI23A_TYPE, 4) ||
!memcmp(p + 2, WMM_OUI23A, 4) ||
!memcmp(p + 2, WPS_OUI23A, 4)) {
u8 plen = p[1];
if (!padapter->registrypriv.wifi_spec) {
/* Commented by Kurt 20110629 */
/* In some older APs, WPS handshake */
/* would be fail if we append vender
extensions informations to AP */
if (!memcmp(pIE->data, WPS_OUI23A, 4))
pIE->Length = 14;
if (!memcmp(p + 2, WPS_OUI23A, 4))
plen = 14;
}
pframe = rtw_set_ie23a(pframe,
WLAN_EID_VENDOR_SPECIFIC,
pIE->Length, pIE->data,
plen, p + 2,
&pattrib->pktlen);
}
break;
......@@ -3502,7 +3500,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
break;
}
i += pIE->Length + 2;
i += p[1] + 2;
}
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK)
......@@ -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)
{
struct ndis_802_11_var_ies * pIE;
struct registry_priv *pregpriv = &padapter->registrypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
......@@ -5902,6 +5899,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
struct HT_info_element *pht_info;
u32 i;
int bcn_fixed_size;
u8 *p;
/* u32 initialgain; */
/* u32 acparm; */
......@@ -5951,12 +5949,11 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
offsetof(struct ieee80211_mgmt, u.beacon);
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. */
if (!memcmp(pIE->data, WMM_OUI23A, 4))
if (!memcmp(p + 2, WMM_OUI23A, 4))
pmlmeinfo->WMM_enable = 1;
break;
......@@ -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
* 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) &&
(pht_info->infos[0] & BIT(2))) {
......@@ -6001,7 +5998,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
break;
}
i += (pIE->Length + 2);
i += (p[1] + 2);
}
hw_var_set_bssid(padapter, pmlmeinfo->network.MacAddress);
......
......@@ -514,18 +514,14 @@ bool is_IBSS_empty23a(struct rtw_adapter *padapter);
unsigned char check_assoc_AP23a(u8 *pframe, uint len);
int WMM_param_handler23a(struct rtw_adapter *padapter,
struct ndis_802_11_var_ies *pIE);
int WMM_param_handler23a(struct rtw_adapter *padapter, u8 *p);
void WMMOnAssocRsp23a(struct rtw_adapter *padapter);
void HT_caps_handler23a(struct rtw_adapter *padapter,
struct ndis_802_11_var_ies *pIE);
void HT_info_handler23a(struct rtw_adapter *padapter,
struct ndis_802_11_var_ies *pIE);
void HT_caps_handler23a(struct rtw_adapter *padapter, u8 *p);
void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p);
void HTOnAssocRsp23a(struct rtw_adapter *padapter);
void ERP_IE_handler23a(struct rtw_adapter *padapter,
struct ndis_802_11_var_ies *pIE);
void ERP_IE_handler23a(struct rtw_adapter *padapter, u8 *p);
void VCS_update23a(struct rtw_adapter *padapter, struct sta_info *psta);
void update_beacon23a_info(struct rtw_adapter *padapter, u8 *pframe, uint len,
......
......@@ -22,12 +22,6 @@
#define NDIS_802_11_LENGTH_RATES 8
#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
* sizeof(6 * sizeof(unsigned char)) + 2 + sizeof(struct ndis_802_11_ssid) +
* 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