diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2014-06-09 15:16:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-18 14:03:49 -0700 |
commit | b66dad2d502080d05320b74f38d247bf1a9993fa (patch) | |
tree | 8656c7ed30396ad55ad3c34333bad2ff0367322b /drivers/staging/rtl8723au | |
parent | 0e634a029b4397c5a045f1d26fad6b7458386738 (diff) | |
download | op-kernel-dev-b66dad2d502080d05320b74f38d247bf1a9993fa.zip op-kernel-dev-b66dad2d502080d05320b74f38d247bf1a9993fa.tar.gz |
staging: rtl8723au: Introduce rtw_do_join_network()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723au')
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_mlme.c | 46 | ||||
-rw-r--r-- | 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); |