*
* Returns: the address of the specific WPS attribute found, or NULL
*/
-u8 *rtw_get_wps_attr23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id,
- u8 *buf_attr, u32 *len_attr)
+const u8 *rtw_get_wps_attr23a(const u8 *wps_ie, uint wps_ielen,
+ u16 target_attr_id, u8 *buf_attr, u32 *len_attr)
{
- u8 *attr_ptr = NULL;
- u8 * target_attr_ptr = NULL;
+ const u8 *attr_ptr = NULL;
+ const u8 *target_attr_ptr = NULL;
u8 wps_oui[4] = {0x00, 0x50, 0xF2, 0x04};
if (len_attr)
*
* Returns: the address of the specific WPS attribute content found, or NULL
*/
-u8 *rtw_get_wps_attr_content23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id,
- u8 *buf_content, uint *len_content)
+const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen,
+ u16 target_attr_id, u8 *buf_content,
+ uint *len_content)
{
- u8 *attr_ptr;
+ const u8 *attr_ptr;
u32 attr_len;
if (len_content)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- u8 *wps_ie;
- u32 wps_ielen;
+ const u8 *wps_ie;
u8 sr = 0;
int len_diff;
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+ u8 *iebuf;
+ int buflen;
/* DBG_8723A("ie len =%d\n", cur_network->IELength); */
memcpy(pframe, cur_network->IEs, cur_network->IELength);
len_diff = update_hidden_ssid(pframe + _BEACON_IE_OFFSET_,
pframe += (cur_network->IELength+len_diff);
pattrib->pktlen += (cur_network->IELength+len_diff);
- wps_ie = rtw_get_wps_ie23a(pmgntframe->buf_addr + TXDESC_OFFSET+
- sizeof (struct ieee80211_hdr_3addr) +
- _BEACON_IE_OFFSET_, pattrib->pktlen -
- sizeof (struct ieee80211_hdr_3addr) -
- _BEACON_IE_OFFSET_, &wps_ielen);
- if (wps_ie && wps_ielen > 0) {
- rtw_get_wps_attr_content23a(wps_ie, wps_ielen,
+ iebuf = pmgntframe->buf_addr + TXDESC_OFFSET +
+ sizeof (struct ieee80211_hdr_3addr) +
+ _BEACON_IE_OFFSET_;
+ buflen = pattrib->pktlen - sizeof (struct ieee80211_hdr_3addr) -
+ _BEACON_IE_OFFSET_;
+ wps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
+ WLAN_OUI_TYPE_MICROSOFT_WPS,
+ iebuf, buflen);
+
+ if (wps_ie && wps_ie[1] > 0) {
+ rtw_get_wps_attr_content23a(wps_ie, wps_ie[1],
WPS_ATTR_SELECTED_REGISTRAR,
(u8*)&sr, NULL);
}
unsigned char *mac, *bssid;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#ifdef CONFIG_8723AU_AP_MODE
- u8 *pwps_ie;
+ const u8 *pwps_ie;
uint wps_ielen;
u8 *ssid_ie;
int ssid_ielen;
#ifdef CONFIG_8723AU_AP_MODE
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
- pwps_ie = rtw_get_wps_ie23a(cur_network->IEs +
- _FIXED_IE_LENGTH_,
- cur_network->IELength -
- _FIXED_IE_LENGTH_, &wps_ielen);
+ pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
+ WLAN_OUI_TYPE_MICROSOFT_WPS,
+ cur_network->IEs +
+ _FIXED_IE_LENGTH_,
+ cur_network->IELength -
+ _FIXED_IE_LENGTH_);
/* inerset & update wps_probe_resp_ie */
- if (pmlmepriv->wps_probe_resp_ie && pwps_ie && wps_ielen > 0) {
+ if (pmlmepriv->wps_probe_resp_ie && pwps_ie && pwps_ie[1] > 0) {
uint wps_offset, remainder_ielen;
- u8 *premainder_ie;
+ const u8 *premainder_ie;
+ wps_ielen = pwps_ie[1];
wps_offset = (uint)(pwps_ie - cur_network->IEs);
premainder_ie = pwps_ie + wps_ielen;
int rtw_get_sec_ie23a(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 *wpa_len);
u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, uint *wps_ielen);
-u8 *rtw_get_wps_attr23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_attr, u32 *len_attr);
-u8 *rtw_get_wps_attr_content23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content, uint *len_content);
+const u8 *rtw_get_wps_attr23a(const u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_attr, u32 *len_attr);
+const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content, uint *len_content);
uint rtw_get_rateset_len23a(u8 *rateset);