From: Jes Sorensen Date: Tue, 15 Apr 2014 17:44:50 +0000 (+0200) Subject: staging: rtl8723au: Move rtw23a_roaming() so we can declare _rtw_roaming() static X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=afa7e480a9587b1b7f35cc2d08bae7c441dc8bc8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: Move rtw23a_roaming() so we can declare _rtw_roaming() static Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 0a2141bd32d9..fcb1add545bf 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -271,6 +271,61 @@ void rtw_generate_random_ibss23a(u8* pibss) return; } +static void _rtw_roaming(struct rtw_adapter *padapter, + struct wlan_network *tgt_network) +{ + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct wlan_network *pnetwork; + int do_join_r; + + if (tgt_network) + pnetwork = tgt_network; + else + pnetwork = &pmlmepriv->cur_network; + + if (padapter->mlmepriv.to_roaming > 0) { + DBG_8723A("roaming from %s("MAC_FMT"), length:%d\n", + pnetwork->network.Ssid.ssid, + MAC_ARG(pnetwork->network.MacAddress), + pnetwork->network.Ssid.ssid_len); + memcpy(&pmlmepriv->assoc_ssid, &pnetwork->network.Ssid, + sizeof(struct cfg80211_ssid)); + + pmlmepriv->assoc_by_bssid = false; + + while (1) { + do_join_r = rtw_do_join23a(padapter); + if (do_join_r == _SUCCESS) + break; + else { + DBG_8723A("roaming do_join return %d\n", + do_join_r); + pmlmepriv->to_roaming--; + + if (padapter->mlmepriv.to_roaming > 0) + continue; + else { + DBG_8723A("%s(%d) -to roaming fail, " + "indicate_disconnect\n", + __func__, __LINE__); + rtw_indicate_disconnect23a(padapter); + break; + } + } + } + } +} + +void rtw23a_roaming(struct rtw_adapter *padapter, + struct wlan_network *tgt_network) +{ + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + + spin_lock_bh(&pmlmepriv->lock); + _rtw_roaming(padapter, tgt_network); + spin_unlock_bh(&pmlmepriv->lock); +} + u8 *rtw_get_capability23a_from_ie(u8 *ie) { return ie + 8 + 2; @@ -1475,7 +1530,7 @@ void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) } spin_unlock_bh(&pmlmepriv->scanned_queue.lock); - _rtw23a_roaming(adapter, tgt_network); + _rtw_roaming(adapter, tgt_network); } if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || @@ -2464,60 +2519,6 @@ inline void rtw_set_roaming(struct rtw_adapter *adapter, u8 to_roaming) adapter->mlmepriv.to_roaming = to_roaming; } -void rtw23a_roaming(struct rtw_adapter *padapter, - struct wlan_network *tgt_network) -{ - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - - spin_lock_bh(&pmlmepriv->lock); - _rtw23a_roaming(padapter, tgt_network); - spin_unlock_bh(&pmlmepriv->lock); -} -void _rtw23a_roaming(struct rtw_adapter *padapter, - struct wlan_network *tgt_network) -{ - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wlan_network *pnetwork; - int do_join_r; - - if (tgt_network) - pnetwork = tgt_network; - else - pnetwork = &pmlmepriv->cur_network; - - if (padapter->mlmepriv.to_roaming > 0) { - DBG_8723A("roaming from %s("MAC_FMT"), length:%d\n", - pnetwork->network.Ssid.ssid, - MAC_ARG(pnetwork->network.MacAddress), - pnetwork->network.Ssid.ssid_len); - memcpy(&pmlmepriv->assoc_ssid, &pnetwork->network.Ssid, - sizeof(struct cfg80211_ssid)); - - pmlmepriv->assoc_by_bssid = false; - - while (1) { - do_join_r = rtw_do_join23a(padapter); - if (do_join_r == _SUCCESS) - break; - else { - DBG_8723A("roaming do_join return %d\n", - do_join_r); - pmlmepriv->to_roaming--; - - if (padapter->mlmepriv.to_roaming > 0) - continue; - else { - DBG_8723A("%s(%d) -to roaming fail, " - "indicate_disconnect\n", - __func__, __LINE__); - rtw_indicate_disconnect23a(padapter); - break; - } - } - } - } -} - int rtw_linked_check(struct rtw_adapter *padapter) { if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) || diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 0af91d02976f..6036503c00ea 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -488,8 +488,6 @@ int rtw_is_same_ibss23a(struct rtw_adapter *adapter, struct wlan_network *pnetwork); int is_same_network23a(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst); -void _rtw23a_roaming(struct rtw_adapter *adapter, - struct wlan_network *tgt_network); void rtw23a_roaming(struct rtw_adapter *adapter, struct wlan_network *tgt_network); void rtw_set_roaming(struct rtw_adapter *adapter, u8 to_roaming);