From: Jes Sorensen Date: Sat, 21 Jun 2014 14:50:09 +0000 (+0200) Subject: staging: rtl8723au: struct mlme_priv->wps_beacon_ie is never set X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2331ef89ef249b3e07594252eaec1bf1a483c1f1;p=linux-beck.git staging: rtl8723au: struct mlme_priv->wps_beacon_ie is never set Remove all code trying to use it Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 2a960b1ba066..8ba346f54bbb 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -1227,60 +1227,9 @@ static void update_bcn_wmm_ie(struct rtw_adapter *padapter) static void update_bcn_wps_ie(struct rtw_adapter *padapter) { - const u8 *pwps_ie, *premainder_ie; - u8 *pwps_ie_src, *pbackup_remainder_ie = NULL; - uint wps_ielen = 0, wps_offset, remainder_ielen; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; - struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network; - unsigned char *ie = pnetwork->IEs; - u32 ielen = pnetwork->IELength; - DBG_8723A("%s\n", __func__); - pwps_ie_src = pmlmepriv->wps_beacon_ie; - if (pwps_ie_src == NULL) - return; - - pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, - WLAN_OUI_TYPE_MICROSOFT_WPS, - ie + _FIXED_IE_LENGTH_, - ielen - _FIXED_IE_LENGTH_); - - if (pwps_ie == NULL || pwps_ie[1] == 0) - return; - - wps_ielen = pwps_ie[1]; - wps_offset = (uint)(pwps_ie-ie); - - premainder_ie = pwps_ie + wps_ielen; - - remainder_ielen = ielen - wps_offset - wps_ielen; - - if (remainder_ielen > 0) { - pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_ATOMIC); - if (pbackup_remainder_ie) - memcpy(pbackup_remainder_ie, premainder_ie, - remainder_ielen); - } - - wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */ - if ((wps_offset+wps_ielen+2+remainder_ielen)<= MAX_IE_SZ) - { - memcpy(ie + wps_offset, pwps_ie_src, wps_ielen + 2); - pwps_ie += (wps_ielen+2); - - if (pbackup_remainder_ie) - memcpy(ie + wps_offset + wps_ielen + 2, - pbackup_remainder_ie, remainder_ielen); - - /* update IELength */ - pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; - } - - if (pbackup_remainder_ie) - kfree(pbackup_remainder_ie); + return; } static void update_bcn_p2p_ie(struct rtw_adapter *padapter) @@ -1966,7 +1915,6 @@ void start_ap_mode23a(struct rtw_adapter *padapter) for (i = 0; ista_aid[i] = NULL; - pmlmepriv->wps_beacon_ie = NULL; pmlmepriv->wps_probe_resp_ie = NULL; pmlmepriv->wps_assoc_resp_ie = NULL; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 9a8c9ffd1837..eefe40a7a564 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -87,8 +87,6 @@ void rtw23a_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) #ifdef CONFIG_8723AU_AP_MODE kfree(pmlmepriv->assoc_req); kfree(pmlmepriv->assoc_rsp); - rtw_free_mlme_ie_data(&pmlmepriv->wps_beacon_ie, - &pmlmepriv->wps_beacon_ie_len); rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_req_ie, &pmlmepriv->wps_probe_req_ie_len); rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_resp_ie, diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 4047f6dadff2..8590faa483fa 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -1534,31 +1534,6 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) "Association Request - possible WPS use\n"); pstat->flags |= WLAN_STA_MAYBE_WPS; } - - /* AP support WPA/RSN, and sta is going to do WPS, but AP - is not ready */ - /* that the selected registrar of AP is _FLASE */ - if (psecuritypriv->wpa_psk > 0 && - pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS)) { - if (pmlmepriv->wps_beacon_ie) { - u8 selected_registrar = 0; - - rtw_get_wps_attr_content23a( - pmlmepriv->wps_beacon_ie, - pmlmepriv->wps_beacon_ie_len, - WPS_ATTR_SELECTED_REGISTRAR, - &selected_registrar, NULL); - - if (!selected_registrar) { - DBG_8723A("selected_registrar is false," - "or AP is not ready to do " - "WPS\n"); - - status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; - goto OnAssocReq23aFail; - } - } - } } else { int copy_len; diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index a67954569d3e..6dccfb045ffe 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -167,8 +167,6 @@ struct mlme_priv { u8 *wps_assoc_resp_ie; u8 *wps_probe_resp_ie; u32 wps_probe_resp_ie_len; - u8 *wps_beacon_ie; - u32 wps_beacon_ie_len; u32 p2p_go_probe_resp_ie_len; /* for GO */ u32 p2p_assoc_req_ie_len; u8 *p2p_beacon_ie;