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 = pframe + i;
switch (p[0]) p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
{ pmgmt->u.assoc_resp.variable, pielen);
case WLAN_EID_VENDOR_SPECIFIC: if (p && p[1])
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, p); HT_caps_handler23a(padapter, p);
break;
case WLAN_EID_HT_OPERATION: /* HT info */ p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
pmgmt->u.assoc_resp.variable, pielen);
if (p && p[1])
HT_info_handler23a(padapter, p); HT_info_handler23a(padapter, p);
break;
case WLAN_EID_ERP_INFO: p = cfg80211_find_ie(WLAN_EID_ERP_INFO,
pmgmt->u.assoc_resp.variable, pielen);
if (p && p[1])
ERP_IE_handler23a(padapter, p); ERP_IE_handler23a(padapter, p);
default: 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;
}
i += (p[1] + 2); pie = p + p[1] + 2;
/* 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;
} }
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