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

staging: rtl8723au: issue_asocrsp23a(): Use cfg80211_find_ie() and cleanups

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0b2b676d
...@@ -2993,18 +2993,20 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status, ...@@ -2993,18 +2993,20 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status,
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct ieee80211_hdr *pwlanhdr; struct ieee80211_hdr *pwlanhdr;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pbuf, *pframe; unsigned char *pframe;
unsigned short val; unsigned short val;
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;
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network; struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
const u8 *p;
u8 *ie = pnetwork->IEs; u8 *ie = pnetwork->IEs;
DBG_8723A("%s\n", __func__); DBG_8723A("%s\n", __func__);
if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL) pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
if (!pmgntframe)
return; return;
/* update attribute */ /* update attribute */
...@@ -3024,7 +3026,7 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status, ...@@ -3024,7 +3026,7 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status,
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) if (pkt_type == WIFI_ASSOCRSP || pkt_type == WIFI_REASSOCRSP)
SetFrameSubType(pwlanhdr, pkt_type); SetFrameSubType(pwlanhdr, pkt_type);
else else
return; return;
...@@ -3060,52 +3062,53 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status, ...@@ -3060,52 +3062,53 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status,
pstat->bssrateset + 8, &pattrib->pktlen); pstat->bssrateset + 8, &pattrib->pktlen);
} }
if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) { if (pstat->flags & WLAN_STA_HT && pmlmepriv->htpriv.ht_option) {
uint ie_len = 0;
/* FILL HT CAP INFO IE */ /* FILL HT CAP INFO IE */
/* p = hostapd_eid_ht_capabilities_info(hapd, p); */ /* p = hostapd_eid_ht_capabilities_info(hapd, p); */
pbuf = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
WLAN_EID_HT_CAPABILITY, &ie_len, ie + _BEACON_IE_OFFSET_,
pnetwork->IELength - _BEACON_IE_OFFSET_); pnetwork->IELength -_BEACON_IE_OFFSET_);
if (pbuf && ie_len>0) { if (p && p[1]) {
memcpy(pframe, pbuf, ie_len + 2); memcpy(pframe, p, p[1] + 2);
pframe += (ie_len + 2); pframe += (p[1] + 2);
pattrib->pktlen += (ie_len + 2); pattrib->pktlen += (p[1] + 2);
} }
/* FILL HT ADD INFO IE */ /* FILL HT ADD INFO IE */
/* p = hostapd_eid_ht_operation(hapd, p); */ /* p = hostapd_eid_ht_operation(hapd, p); */
pbuf = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
WLAN_EID_HT_OPERATION, &ie_len, ie + _BEACON_IE_OFFSET_,
pnetwork->IELength - _BEACON_IE_OFFSET_); pnetwork->IELength - _BEACON_IE_OFFSET_);
if (pbuf && ie_len > 0) { if (p && p[1] > 0) {
memcpy(pframe, pbuf, ie_len + 2); memcpy(pframe, p, p[1] + 2);
pframe += (ie_len + 2); pframe += (p[1] + 2);
pattrib->pktlen += (ie_len + 2); pattrib->pktlen += (p[1] + 2);
} }
} }
/* FILL WMM IE */ /* FILL WMM IE */
if ((pstat->flags & WLAN_STA_WME) && pmlmepriv->qospriv.qos_option) { if (pstat->flags & WLAN_STA_WME && pmlmepriv->qospriv.qos_option) {
uint ie_len = 0;
unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02,
0x01, 0x01}; 0x01, 0x01};
int ie_len = 0;
for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) {
pbuf = rtw_get_ie23a(pbuf, WLAN_EID_VENDOR_SPECIFIC, for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
&ie_len, (pnetwork->IELength - p = cfg80211_find_ie(WLAN_EID_VENDOR_SPECIFIC, p,
_BEACON_IE_OFFSET_ - pnetwork->IELength -
(ie_len + 2))); _BEACON_IE_OFFSET_ - (ie_len + 2));
if (pbuf && !memcmp(pbuf + 2, WMM_PARA_IE, 6)) { if (p)
memcpy(pframe, pbuf, ie_len + 2); ie_len = p[1];
else
ie_len = 0;
if (p && !memcmp(p + 2, WMM_PARA_IE, 6)) {
memcpy(pframe, p, ie_len + 2);
pframe += (ie_len + 2); pframe += (ie_len + 2);
pattrib->pktlen += (ie_len + 2); pattrib->pktlen += (ie_len + 2);
break; break;
} }
if ((!pbuf) || (ie_len == 0)) if (!p || ie_len == 0)
break; break;
} }
} }
......
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