From: Jes Sorensen Date: Mon, 9 Jun 2014 13:17:00 +0000 (+0200) Subject: staging: rtl8723au: Move rtw_do_join23a() to rtw_mlme.c and declare it static X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e007b4c77cd70c087929c1493cc4207dd5163748;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Move rtw_do_join23a() to rtw_mlme.c and declare it static Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c index 4f6d7f542953..77835fc80a52 100644 --- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c @@ -22,39 +22,6 @@ #include #include -int rtw_do_join23a(struct rtw_adapter *padapter) -{ - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - int ret; - - pmlmepriv->cur_network.join_res = -2; - - set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - - pmlmepriv->to_join = true; - - ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv); - if (ret == _SUCCESS) { - pmlmepriv->to_join = false; - } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { - /* switch to ADHOC_MASTER */ - ret = rtw_do_join_adhoc(padapter); - if (ret != _SUCCESS) - goto exit; - } else { - /* can't associate ; reset under-linking */ - _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); - - ret = _FAIL; - pmlmepriv->to_join = false; - } - } - -exit: - return ret; -} - int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter, struct cfg80211_ssid *pssid, int ssid_max_num) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 1557088f8cee..bdebde784f16 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -29,6 +29,7 @@ static struct wlan_network * rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv); +static int rtw_do_join(struct rtw_adapter *padapter); static void rtw_init_mlme_timer(struct rtw_adapter *padapter) { @@ -280,7 +281,7 @@ static void _rtw_roaming(struct rtw_adapter *padapter, pmlmepriv->assoc_by_bssid = false; while (1) { - do_join_r = rtw_do_join23a(padapter); + do_join_r = rtw_do_join(padapter); if (do_join_r == _SUCCESS) break; else { @@ -1489,7 +1490,7 @@ void rtw23a_join_to_handler (unsigned long data) if (adapter->mlmepriv.to_roaming != 0) { /* try another */ DBG_8723A("%s try another roaming\n", __func__); - do_join_r = rtw_do_join23a(adapter); + do_join_r = rtw_do_join(adapter); if (do_join_r != _SUCCESS) { DBG_8723A("%s roaming do_join return " "%d\n", __func__ , do_join_r); @@ -1688,6 +1689,39 @@ pmlmepriv->lock */ +static int rtw_do_join(struct rtw_adapter *padapter) +{ + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + int ret; + + pmlmepriv->cur_network.join_res = -2; + + set_fwstate(pmlmepriv, _FW_UNDER_LINKING); + + pmlmepriv->to_join = true; + + ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv); + if (ret == _SUCCESS) { + pmlmepriv->to_join = false; + } else { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { + /* switch to ADHOC_MASTER */ + ret = rtw_do_join_adhoc(padapter); + if (ret != _SUCCESS) + goto exit; + } else { + /* can't associate ; reset under-linking */ + _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); + + ret = _FAIL; + pmlmepriv->to_join = false; + } + } + +exit: + return ret; +} + static struct wlan_network * rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv) { diff --git a/drivers/staging/rtl8723au/include/rtw_ioctl_set.h b/drivers/staging/rtl8723au/include/rtw_ioctl_set.h index 14a36f5049df..e84a42286400 100644 --- a/drivers/staging/rtl8723au/include/rtw_ioctl_set.h +++ b/drivers/staging/rtl8723au/include/rtw_ioctl_set.h @@ -23,6 +23,5 @@ int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter, u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter); s32 FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); -int rtw_do_join23a(struct rtw_adapter *padapter); #endif