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

staging: rtl8723au: rtw_ap.c: Convert from rtw_get_wps_ie23a() to cfg80211_find_vendor_ie()

Some of this is hackish, but so was the original code. This needs to
be cleaned up eventually.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3797af4
...@@ -660,9 +660,11 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) ...@@ -660,9 +660,11 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)
/* check if there is wps ie, */ /* check if there is wps ie, */
/* if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, */ /* if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, */
/* and at first time the security ie (RSN/WPA IE) will not include in beacon. */ /* and at first time the security ie (RSN/WPA IE) will not include in beacon. */
if (NULL == rtw_get_wps_ie23a(pnetwork->IEs + _FIXED_IE_LENGTH_, if (NULL == cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
pnetwork->IELength - _FIXED_IE_LENGTH_, WLAN_OUI_TYPE_MICROSOFT_WPS,
NULL)) pnetwork->IEs + _FIXED_IE_LENGTH_,
pnetwork->IELength -
_FIXED_IE_LENGTH_))
pmlmeext->bstart_bss = true; pmlmeext->bstart_bss = true;
/* todo: update wmm, ht cap */ /* todo: update wmm, ht cap */
...@@ -1226,7 +1228,8 @@ static void update_bcn_wmm_ie(struct rtw_adapter *padapter) ...@@ -1226,7 +1228,8 @@ static void update_bcn_wmm_ie(struct rtw_adapter *padapter)
static void update_bcn_wps_ie(struct rtw_adapter *padapter) static void update_bcn_wps_ie(struct rtw_adapter *padapter)
{ {
u8 *pwps_ie = NULL, *pwps_ie_src, *premainder_ie, *pbackup_remainder_ie = NULL; const u8 *pwps_ie, *premainder_ie;
u8 *pwps_ie_src, *pbackup_remainder_ie = NULL;
uint wps_ielen = 0, wps_offset, remainder_ielen; uint wps_ielen = 0, wps_offset, remainder_ielen;
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;
...@@ -1241,12 +1244,15 @@ static void update_bcn_wps_ie(struct rtw_adapter *padapter) ...@@ -1241,12 +1244,15 @@ static void update_bcn_wps_ie(struct rtw_adapter *padapter)
if (pwps_ie_src == NULL) if (pwps_ie_src == NULL)
return; return;
pwps_ie = rtw_get_wps_ie23a(ie + _FIXED_IE_LENGTH_, pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
ielen - _FIXED_IE_LENGTH_, &wps_ielen); WLAN_OUI_TYPE_MICROSOFT_WPS,
ie + _FIXED_IE_LENGTH_,
ielen - _FIXED_IE_LENGTH_);
if (pwps_ie == NULL || wps_ielen == 0) if (pwps_ie == NULL || pwps_ie[1] == 0)
return; return;
wps_ielen = pwps_ie[1];
wps_offset = (uint)(pwps_ie-ie); wps_offset = (uint)(pwps_ie-ie);
premainder_ie = pwps_ie + wps_ielen; premainder_ie = pwps_ie + wps_ielen;
...@@ -1263,11 +1269,12 @@ static void update_bcn_wps_ie(struct rtw_adapter *padapter) ...@@ -1263,11 +1269,12 @@ static void update_bcn_wps_ie(struct rtw_adapter *padapter)
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */ wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
if ((wps_offset+wps_ielen+2+remainder_ielen)<= MAX_IE_SZ) if ((wps_offset+wps_ielen+2+remainder_ielen)<= MAX_IE_SZ)
{ {
memcpy(pwps_ie, pwps_ie_src, wps_ielen+2); memcpy(ie + wps_offset, pwps_ie_src, wps_ielen + 2);
pwps_ie += (wps_ielen+2); pwps_ie += (wps_ielen+2);
if (pbackup_remainder_ie) if (pbackup_remainder_ie)
memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen); memcpy(ie + wps_offset + wps_ielen + 2,
pbackup_remainder_ie, remainder_ielen);
/* update IELength */ /* update IELength */
pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
......
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