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

staging: rtl8723au: OnAssocRsp23a(): Use cfg80211_* to parse IEs

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3cdf2773
...@@ -1805,11 +1805,12 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1805,11 +1805,12 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct sk_buff *skb = precv_frame->pkt; struct sk_buff *skb = precv_frame->pkt;
struct ieee80211_mgmt *pmgmt = (struct ieee80211_mgmt *) skb->data; struct ieee80211_mgmt *pmgmt = (struct ieee80211_mgmt *) skb->data;
int res, i; int res;
unsigned short status; unsigned short status;
u8 *p; const u8 *p, *pie;
u8 *pframe = skb->data; u8 *pframe = skb->data;
int pkt_len = skb->len; int pkt_len = skb->len;
int pielen;
DBG_8723A("%s\n", __func__); DBG_8723A("%s\n", __func__);
...@@ -1843,38 +1844,45 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1843,38 +1844,45 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
/* AID */ /* AID */
res = pmlmeinfo->aid = le16_to_cpu(pmgmt->u.assoc_resp.aid) & 0x3fff; res = pmlmeinfo->aid = le16_to_cpu(pmgmt->u.assoc_resp.aid) & 0x3fff;
/* following are moved to join event callback function */ pie = pframe + offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
/* to handle HT, WMM, rate adaptive, update MAC reg */ pielen = pkt_len -
/* for not to handle the synchronous IO in the tasklet */ offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
for (i = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
i < pkt_len;) { p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
p = pframe + i; pmgmt->u.assoc_resp.variable, pielen);
if (p && p[1])
switch (p[0]) HT_caps_handler23a(padapter, p);
{
case WLAN_EID_VENDOR_SPECIFIC: p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
if (!memcmp(p + 2, WMM_PARA_OUI23A, 6))/* WMM */ pmgmt->u.assoc_resp.variable, pielen);
WMM_param_handler23a(padapter, p); if (p && p[1])
break; HT_info_handler23a(padapter, p);
case WLAN_EID_HT_CAPABILITY: /* HT caps */ p = cfg80211_find_ie(WLAN_EID_ERP_INFO,
HT_caps_handler23a(padapter, p); pmgmt->u.assoc_resp.variable, pielen);
if (p && p[1])
ERP_IE_handler23a(padapter, p);
pie = pframe + offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
while (true) {
p = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WMM,
pie, pframe + pkt_len - pie);
if (!p)
break; break;
case WLAN_EID_HT_OPERATION: /* HT info */ pie = p + p[1] + 2;
HT_info_handler23a(padapter, p); /* if this IE is too short, try the next */
if (p[1] <= 4)
continue;
/* if this IE is WMM params, we found what we wanted */
if (p[6] == 1)
break; break;
case WLAN_EID_ERP_INFO:
ERP_IE_handler23a(padapter, p);
default:
break;
}
i += (p[1] + 2);
} }
if (p && p[1])
WMM_param_handler23a(padapter, p);
pmlmeinfo->state &= ~WIFI_FW_ASSOC_STATE; pmlmeinfo->state &= ~WIFI_FW_ASSOC_STATE;
pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS;
......
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