/* if join_res > 0, for (fw_state ==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */
/* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan != NULL). */
/* */
-/* define REJOIN */
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
{
- static u8 __maybe_unused retry;
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
struct sta_priv *pstapriv = &adapter->stapriv;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
if (pnetwork->join_res > 0) {
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
- retry = 0;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/* s1. find ptarget_wlan */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
} else {/* if join_res < 0 (join fails), then try again */
-
- #ifdef REJOIN
- res = _FAIL;
- if (retry < 2)
- res = rtw_select_and_join_from_scanned_queue(pmlmepriv);
-
- if (res == _SUCCESS) {
- /* extend time of assoc_timer */
- _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
- retry++;
- } else if (res == 2) {/* there is no need to wait for join */
- _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
- rtw_indicate_connect(adapter);
- } else {
- #endif
-
- _set_timer(&pmlmepriv->assoc_timer, 1);
- _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-
- #ifdef REJOIN
- retry = 0;
- }
- #endif
+ _set_timer(&pmlmepriv->assoc_timer, 1);
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
}
ignore_joinbss_callback: