Commit b66dad2d authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Introduce rtw_do_join_network()

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e634a02
...@@ -79,8 +79,6 @@ int rtw_do_join23a(struct rtw_adapter *padapter) ...@@ -79,8 +79,6 @@ int rtw_do_join23a(struct rtw_adapter *padapter)
select_ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv); select_ret = rtw_select_and_join_from_scanned_queue23a(pmlmepriv);
if (select_ret == _SUCCESS) { if (select_ret == _SUCCESS) {
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
mod_timer(&pmlmepriv->assoc_timer,
jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
} else { } else {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
struct wlan_bssid_ex *pdev_network; struct wlan_bssid_ex *pdev_network;
......
...@@ -739,8 +739,6 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) ...@@ -739,8 +739,6 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf)
if (rtw_select_and_join_from_scanned_queue23a( if (rtw_select_and_join_from_scanned_queue23a(
pmlmepriv) == _SUCCESS) { pmlmepriv) == _SUCCESS) {
mod_timer(&pmlmepriv->assoc_timer,
jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
} else { } else {
pdev_network = &adapter->registrypriv.dev_network; pdev_network = &adapter->registrypriv.dev_network;
pibss = adapter->registrypriv.dev_network.MacAddress; pibss = adapter->registrypriv.dev_network.MacAddress;
...@@ -782,14 +780,10 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) ...@@ -782,14 +780,10 @@ rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf)
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
ret = rtw_select_and_join_from_scanned_queue23a( ret = rtw_select_and_join_from_scanned_queue23a(
pmlmepriv); pmlmepriv);
if (ret == _SUCCESS) { if (ret == 2) {/* there is no need to wait */
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 */
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
rtw_indicate_connect23a(adapter); rtw_indicate_connect23a(adapter);
} else { } else if (ret != _SUCCESS) {
DBG_8723A("try_to_join, but select scanning " DBG_8723A("try_to_join, but select scanning "
"queue fail, to_roaming:%d\n", "queue fail, to_roaming:%d\n",
adapter->mlmepriv.to_roaming); adapter->mlmepriv.to_roaming);
...@@ -1784,6 +1778,31 @@ rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv) ...@@ -1784,6 +1778,31 @@ rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv)
return candidate; 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) int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv)
{ {
struct rtw_adapter *adapter; struct rtw_adapter *adapter;
...@@ -1804,16 +1823,7 @@ int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv) ...@@ -1804,16 +1823,7 @@ int rtw_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv)
candidate->network.DSConfig); candidate->network.DSConfig);
} }
/* check for situation of _FW_LINKED */ ret = rtw_do_join_network(adapter, candidate);
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);
exit: exit:
return ret; return ret;
......
...@@ -240,6 +240,8 @@ int rtw_init_mlme_priv23a(struct rtw_adapter *adapter); ...@@ -240,6 +240,8 @@ int rtw_init_mlme_priv23a(struct rtw_adapter *adapter);
void rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv); 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_select_and_join_from_scanned_queue23a(struct mlme_priv *pmlmepriv);
int rtw_set_key23a(struct rtw_adapter *adapter, int rtw_set_key23a(struct rtw_adapter *adapter,
struct security_priv *psecuritypriv, int keyid, u8 set_tx); struct security_priv *psecuritypriv, int keyid, u8 set_tx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment