mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-07 05:53:06 +00:00
rtl8188eu: Convert spin lock macros
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
9fe0c17a65
commit
8b76b3b701
19 changed files with 324 additions and 487 deletions
142
core/rtw_mlme.c
142
core/rtw_mlme.c
|
@ -160,18 +160,16 @@ _func_exit_;
|
|||
|
||||
int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork)
|
||||
{
|
||||
unsigned long irql;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (pnetwork == NULL)
|
||||
goto exit;
|
||||
|
||||
_enter_critical_bh(&queue->lock, &irql);
|
||||
spin_lock(&queue->lock);
|
||||
|
||||
rtw_list_insert_tail(&pnetwork->list, &queue->queue);
|
||||
|
||||
_exit_critical_bh(&queue->lock, &irql);
|
||||
spin_unlock(&queue->lock);
|
||||
|
||||
exit:
|
||||
|
||||
|
@ -182,13 +180,11 @@ _func_exit_;
|
|||
|
||||
struct wlan_network *_rtw_dequeue_network(struct __queue *queue)
|
||||
{
|
||||
unsigned long irql;
|
||||
|
||||
struct wlan_network *pnetwork;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&queue->lock, &irql);
|
||||
spin_lock(&queue->lock);
|
||||
|
||||
if (_rtw_queue_empty(queue)) {
|
||||
pnetwork = NULL;
|
||||
|
@ -198,7 +194,7 @@ _func_enter_;
|
|||
rtw_list_delete(&(pnetwork->list));
|
||||
}
|
||||
|
||||
_exit_critical_bh(&queue->lock, &irql);
|
||||
spin_unlock(&queue->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -207,14 +203,13 @@ _func_exit_;
|
|||
|
||||
struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */
|
||||
{
|
||||
unsigned long irql;
|
||||
struct wlan_network *pnetwork;
|
||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||
struct list_head *plist = NULL;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&free_queue->lock, &irql);
|
||||
spin_lock(&free_queue->lock);
|
||||
|
||||
if (_rtw_queue_empty(free_queue) == true) {
|
||||
pnetwork = NULL;
|
||||
|
@ -236,7 +231,7 @@ _func_enter_;
|
|||
pmlmepriv->num_of_scanned++;
|
||||
|
||||
exit:
|
||||
_exit_critical_bh(&free_queue->lock, &irql);
|
||||
spin_unlock(&free_queue->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -247,7 +242,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwo
|
|||
{
|
||||
u32 curr_time, delta_time;
|
||||
u32 lifetime = SCANQUEUE_LIFETIME;
|
||||
unsigned long irql;
|
||||
struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
|
||||
|
||||
_func_enter_;
|
||||
|
@ -266,11 +260,11 @@ _func_enter_;
|
|||
if (delta_time < lifetime)/* unit:sec */
|
||||
goto exit;
|
||||
}
|
||||
_enter_critical_bh(&free_queue->lock, &irql);
|
||||
spin_lock(&free_queue->lock);
|
||||
rtw_list_delete(&(pnetwork->list));
|
||||
rtw_list_insert_tail(&(pnetwork->list), &(free_queue->queue));
|
||||
pmlmepriv->num_of_scanned--;
|
||||
_exit_critical_bh(&free_queue->lock, &irql);
|
||||
spin_unlock(&free_queue->lock);
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
|
@ -328,7 +322,6 @@ _func_exit_;
|
|||
|
||||
void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct list_head *phead, *plist;
|
||||
struct wlan_network *pnetwork;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
@ -337,7 +330,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
|
|||
_func_enter_;
|
||||
|
||||
|
||||
_enter_critical_bh(&scanned_queue->lock, &irql);
|
||||
spin_lock(&scanned_queue->lock);
|
||||
|
||||
phead = get_list_head(scanned_queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -349,7 +342,7 @@ _func_enter_;
|
|||
|
||||
_rtw_free_network(pmlmepriv, pnetwork, isfreeall);
|
||||
}
|
||||
_exit_critical_bh(&scanned_queue->lock, &irql);
|
||||
spin_unlock(&scanned_queue->lock);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
@ -608,7 +601,6 @@ Caller must hold pmlmepriv->lock first.
|
|||
*/
|
||||
void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct list_head *plist, *phead;
|
||||
u32 bssid_ex_sz;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
|
@ -621,7 +613,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
|
|||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&queue->lock, &irql);
|
||||
spin_lock(&queue->lock);
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
@ -702,7 +694,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
exit:
|
||||
_exit_critical_bh(&queue->lock, &irql);
|
||||
spin_unlock(&queue->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -791,7 +783,6 @@ _func_exit_;
|
|||
|
||||
void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
unsigned long irql;
|
||||
u32 len;
|
||||
struct wlan_bssid_ex *pnetwork;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
|
@ -807,23 +798,22 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n****rtw_survey_event_callback: return a wrong bss ***\n"));
|
||||
return;
|
||||
}
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
|
||||
/* update IBSS_network 's timestamp */
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) {
|
||||
if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
|
||||
struct wlan_network *ibss_wlan = NULL;
|
||||
unsigned long irql;
|
||||
|
||||
memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8);
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
|
||||
if (ibss_wlan) {
|
||||
memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
goto exit;
|
||||
}
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&(pmlmepriv->scanned_queue.lock));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -836,7 +826,7 @@ _func_enter_;
|
|||
|
||||
exit:
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -847,13 +837,12 @@ _func_exit_;
|
|||
|
||||
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext;
|
||||
u8 timer_cancelled = 0;
|
||||
|
||||
_func_enter_;
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
|
||||
if (pmlmepriv->wps_probe_req_ie) {
|
||||
pmlmepriv->wps_probe_req_ie_len = 0;
|
||||
|
@ -871,12 +860,12 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("nic status=%x, survey done event comes too late!\n", get_fwstate(pmlmepriv)));
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
|
||||
if (timer_cancelled)
|
||||
_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
rtw_set_signal_stat_timer(&adapter->recvpriv);
|
||||
|
||||
if (pmlmepriv->to_join) {
|
||||
|
@ -939,7 +928,7 @@ _func_enter_;
|
|||
|
||||
indicate_wx_scan_complete_event(adapter);
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0);
|
||||
|
@ -960,7 +949,6 @@ void rtw_fwdbg_event_callback(struct adapter *adapter , u8 *pbuf)
|
|||
|
||||
static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
unsigned long irql, irql0;
|
||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||
struct __queue *scan_queue = &pmlmepriv->scanned_queue;
|
||||
struct list_head *plist, *phead, *ptemp;
|
||||
|
@ -968,8 +956,8 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
|||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n"));
|
||||
_enter_critical_bh(&scan_queue->lock, &irql0);
|
||||
_enter_critical_bh(&free_queue->lock, &irql);
|
||||
spin_lock(&scan_queue->lock);
|
||||
spin_lock(&free_queue->lock);
|
||||
|
||||
phead = get_list_head(scan_queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -982,8 +970,8 @@ _func_enter_;
|
|||
pmlmepriv->num_of_scanned--;
|
||||
}
|
||||
|
||||
_exit_critical_bh(&free_queue->lock, &irql);
|
||||
_exit_critical_bh(&scan_queue->lock, &irql0);
|
||||
spin_unlock(&free_queue->lock);
|
||||
spin_unlock(&scan_queue->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -993,7 +981,6 @@ _func_exit_;
|
|||
*/
|
||||
void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct wlan_network *pwlan = NULL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
|
@ -1011,9 +998,9 @@ _func_enter_;
|
|||
|
||||
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
|
||||
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
}
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) {
|
||||
|
@ -1022,15 +1009,15 @@ _func_enter_;
|
|||
rtw_free_all_stainfo(adapter);
|
||||
|
||||
psta = rtw_get_bcmc_stainfo(adapter);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
rtw_init_bcmc_stainfo(adapter);
|
||||
}
|
||||
|
||||
if (lock_scanned_queue)
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
|
||||
if (pwlan)
|
||||
|
@ -1042,7 +1029,7 @@ _func_enter_;
|
|||
rtw_free_network_nolock(pmlmepriv, pwlan);
|
||||
|
||||
if (lock_scanned_queue)
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
pmlmepriv->key_mask = 0;
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -1262,7 +1249,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
|
||||
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
unsigned long irql, irql2;
|
||||
u8 timer_cancelled;
|
||||
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
|
@ -1292,12 +1278,12 @@ _func_enter_;
|
|||
goto ignore_nolock;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\nrtw_joinbss_event_callback!! _enter_critical\n"));
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\nrtw_joinbss_event_callback!! spin_lock_init\n"));
|
||||
|
||||
if (pnetwork->join_res > 0) {
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
|
||||
/* s1. find ptarget_wlan */
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
|
@ -1310,9 +1296,9 @@ _func_enter_;
|
|||
|
||||
pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
|
||||
if (pcur_sta) {
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql2);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(adapter, pcur_sta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql2);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
}
|
||||
|
||||
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
|
||||
|
@ -1334,7 +1320,7 @@ _func_enter_;
|
|||
rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't find ptarget_wlan when joinbss_event callback\n"));
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
goto ignore_joinbss_callback;
|
||||
}
|
||||
|
||||
|
@ -1344,7 +1330,7 @@ _func_enter_;
|
|||
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
|
||||
if (ptarget_sta == NULL) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
goto ignore_joinbss_callback;
|
||||
}
|
||||
}
|
||||
|
@ -1365,11 +1351,11 @@ _func_enter_;
|
|||
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
goto ignore_joinbss_callback;
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
} else if (pnetwork->join_res == -4) {
|
||||
rtw_reset_securitypriv(adapter);
|
||||
|
@ -1385,7 +1371,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
ignore_joinbss_callback:
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
ignore_nolock:
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -1452,7 +1438,6 @@ void rtw_sta_media_status_rpt(struct adapter *adapter,struct sta_info *psta,
|
|||
|
||||
void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct sta_info *psta;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
|
||||
|
@ -1494,21 +1479,21 @@ _func_enter_;
|
|||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
psta->ieee8021x_blocked = false;
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
|
||||
if (adapter->stapriv.asoc_sta_count == 2) {
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
|
||||
pmlmepriv->cur_network_scanned = ptarget_wlan;
|
||||
if (ptarget_wlan)
|
||||
ptarget_wlan->fixed = true;
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
|
||||
rtw_indicate_connect(adapter);
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
mlmeext_sta_add_event_callback(adapter, psta);
|
||||
exit:
|
||||
_func_exit_;
|
||||
|
@ -1516,7 +1501,6 @@ _func_exit_;
|
|||
|
||||
void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
unsigned long irql, irql2;
|
||||
int mac_id = -1;
|
||||
struct sta_info *psta;
|
||||
struct wlan_network *pwlan = NULL;
|
||||
|
@ -1549,7 +1533,7 @@ _func_enter_;
|
|||
|
||||
mlmeext_sta_del_event_callback(adapter);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql2);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
|
||||
if(adapter->registrypriv.wifi_spec == 1)
|
||||
|
@ -1567,31 +1551,31 @@ _func_enter_;
|
|||
|
||||
rtw_free_assoc_resources(adapter, 1);
|
||||
rtw_indicate_disconnect(adapter);
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
/* remove the network entry in scanned_queue */
|
||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
|
||||
if (pwlan) {
|
||||
pwlan->fixed = false;
|
||||
rtw_free_network_nolock(pmlmepriv, pwlan);
|
||||
}
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
_rtw_roaming(adapter, tgt_network);
|
||||
}
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
|
||||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_lock(&(pstapriv->sta_hash_lock));
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
if (adapter->stapriv.asoc_sta_count == 1) { /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
/* free old ibss network */
|
||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
|
||||
if (pwlan) {
|
||||
pwlan->fixed = false;
|
||||
rtw_free_network_nolock(pmlmepriv, pwlan);
|
||||
}
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
/* re-create ibss */
|
||||
pdev_network = &(adapter->registrypriv.dev_network);
|
||||
pibss = adapter->registrypriv.dev_network.MacAddress;
|
||||
|
@ -1614,7 +1598,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL***\n "));
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql2);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
@ -1631,7 +1615,6 @@ _func_exit_;
|
|||
*/
|
||||
void _rtw_join_timeout_handler (struct adapter *adapter)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
int do_join_r;
|
||||
|
||||
|
@ -1643,7 +1626,7 @@ _func_enter_;
|
|||
return;
|
||||
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
|
||||
if (rtw_to_roaming(adapter) > 0) { /* join timeout caused by roaming */
|
||||
while (1) {
|
||||
|
@ -1666,7 +1649,7 @@ _func_enter_;
|
|||
rtw_indicate_disconnect(adapter);
|
||||
free_scanqueue(pmlmepriv);/* */
|
||||
}
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
@ -1676,13 +1659,12 @@ _func_exit_;
|
|||
*/
|
||||
void rtw_scan_timeout_handler (struct adapter *adapter)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
rtw_indicate_scan_done(adapter, true);
|
||||
}
|
||||
|
||||
|
@ -1814,7 +1796,6 @@ pmlmepriv->lock
|
|||
|
||||
int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
unsigned long irql;
|
||||
int ret;
|
||||
struct list_head *phead;
|
||||
struct adapter *adapter;
|
||||
|
@ -1825,7 +1806,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_lock(&pmlmepriv->scanned_queue.lock);
|
||||
phead = get_list_head(queue);
|
||||
adapter = (struct adapter *)pmlmepriv->nic_hdl;
|
||||
pmlmepriv->pscanned = get_next(phead);
|
||||
|
@ -1872,7 +1853,7 @@ _func_enter_;
|
|||
ret = rtw_joinbss_cmd(adapter, candidate);
|
||||
|
||||
exit:
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
|
||||
spin_unlock(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -2447,12 +2428,11 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
|
||||
void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
|
||||
{
|
||||
unsigned long irql;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_lock(&pmlmepriv->lock);
|
||||
_rtw_roaming(padapter, tgt_network);
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irql);
|
||||
spin_unlock(&pmlmepriv->lock);
|
||||
}
|
||||
void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue