From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 2 -- drivers/staging/rtl8723au/core/rtw_mlme.c | 46 ++++++++++++++++---------- drivers/staging/rtl8723au/include/rtw_mlme.h | 2 ++ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c index 28cfea5..d2ed9d1 100644 --- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c @@ -79,8 +79,6 @@ int rtw_do_join23a(struct rtw_adapter *padapter) select_ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv); if (select_ret == _SUCCESS) { pmlmepriv->to_join = false; - mod_timer(&pmlmepriv->assoc_timer, - jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { struct wlan_bssid_ex *pdev_network; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 9248f48..4a146fb 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -739,8 +739,6 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) if (rtw_select_and_join_from_scanned_queue23a( pmlmepriv) == _SUCCESS) { - mod_timer(&pmlmepriv->assoc_timer, - jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { pdev_network = &adapter->registrypriv.dev_network; pibss = adapter->registrypriv.dev_network.MacAddress; @@ -782,14 +780,10 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) pmlmepriv->to_join = false; ret = rtw_select_and_join_from_scanned_queue23a( pmlmepriv); - if (ret == _SUCCESS) { - unsigned long e; - e = msecs_to_jiffies(MAX_JOIN_TIMEOUT); - mod_timer(&pmlmepriv->assoc_timer, jiffies + e); - } else if (ret == 2) {/* there is no need to wait */ + if (ret == 2) {/* there is no need to wait */ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); rtw_indicate_connect23a(adapter); - } else { + } else if (ret != _SUCCESS) { DBG_8723A("try_to_join, but select scanning " "queue fail, to_roaming:%d\n", adapter->mlmepriv.to_roaming); @@ -1784,6 +1778,31 @@ exit: return candidate; } + +int rtw_do_join_network(struct rtw_adapter *adapter, + struct wlan_network *candidate) +{ + int ret; + + /* check for situation of _FW_LINKED */ + if (check_fwstate(&adapter->mlmepriv, _FW_LINKED)) { + DBG_8723A("%s: _FW_LINKED while ask_for_joinbss!\n", __func__); + + rtw_disassoc_cmd23a(adapter, 0, true); + rtw_indicate_disconnect23a(adapter); + rtw_free_assoc_resources23a(adapter, 0); + } + set_fwstate(&adapter->mlmepriv, _FW_UNDER_LINKING); + + ret = rtw_joinbss_cmd23a(adapter, candidate); + + if (ret == _SUCCESS) + mod_timer(&adapter->mlmepriv.assoc_timer, + jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); + + return ret; +} + int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv) { struct rtw_adapter *adapter; @@ -1804,16 +1823,7 @@ int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv) candidate->network.DSConfig); } - /* check for situation of _FW_LINKED */ - if (check_fwstate(pmlmepriv, _FW_LINKED)) { - DBG_8723A("%s: _FW_LINKED while ask_for_joinbss!\n", __func__); - - rtw_disassoc_cmd23a(adapter, 0, true); - rtw_indicate_disconnect23a(adapter); - rtw_free_assoc_resources23a(adapter, 0); - } - set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - ret = rtw_joinbss_cmd23a(adapter, candidate); + ret = rtw_do_join_network(adapter, candidate); exit: return ret; diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index c8e82bf..e48518f 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -240,6 +240,8 @@ int rtw_init_mlme_priv23a(struct rtw_adapter *adapter); void rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv); +int rtw_do_join_network(struct rtw_adapter *adapter, + struct wlan_network *candidate); int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv); int rtw_set_key23a(struct rtw_adapter *adapter, struct security_priv *psecuritypriv, int keyid, u8 set_tx); -- 1.9.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel