mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +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
|
@ -43,7 +43,6 @@ void init_mlme_ap_info(struct adapter *padapter)
|
|||
|
||||
void free_mlme_ap_info(struct adapter *padapter)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
@ -62,9 +61,9 @@ void free_mlme_ap_info(struct adapter *padapter)
|
|||
|
||||
/* free bc/mc sta_info */
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
_rtw_spinlock_free(&pmlmepriv->bcn_update_lock);
|
||||
}
|
||||
|
@ -277,7 +276,6 @@ static u8 chk_sta_is_alive(struct sta_info *psta)
|
|||
|
||||
void expire_timeout_chk(struct adapter *padapter)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *phead, *plist;
|
||||
u8 updated = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
|
@ -286,7 +284,7 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
char chk_alive_list[NUM_STA];
|
||||
int i;
|
||||
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->auth_list_lock);
|
||||
|
||||
phead = &pstapriv->auth_list;
|
||||
plist = get_next(phead);
|
||||
|
@ -305,22 +303,22 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
DBG_88E("auth expire %6ph\n",
|
||||
psta->hwaddr);
|
||||
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->auth_list_lock);
|
||||
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->auth_list_lock);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->auth_list_lock);
|
||||
|
||||
psta = NULL;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->asoc_list_lock);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
@ -387,7 +385,7 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->asoc_list_lock);
|
||||
|
||||
if (chk_alive_num) {
|
||||
u8 backup_oper_channel = 0;
|
||||
|
@ -424,11 +422,11 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
DBG_88E("asoc expire %pM, state = 0x%x\n", (psta->hwaddr), psta->state);
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->asoc_list_lock);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
pstapriv->asoc_list_cnt--;
|
||||
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->asoc_list_lock);
|
||||
}
|
||||
|
||||
if (backup_oper_channel > 0) /* back to the original operation channel */
|
||||
|
@ -535,7 +533,6 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
|
||||
void update_bmc_sta(struct adapter *padapter)
|
||||
{
|
||||
unsigned long irqL;
|
||||
u32 init_rate = 0;
|
||||
unsigned char network_type, raid;
|
||||
int i, supportRateNum = 0;
|
||||
|
@ -604,9 +601,9 @@ void update_bmc_sta(struct adapter *padapter)
|
|||
|
||||
rtw_sta_media_status_rpt(padapter, psta, 1);
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL);
|
||||
spin_lock(&psta->lock);
|
||||
psta->state = _FW_LINKED;
|
||||
_exit_critical_bh(&psta->lock, &irqL);
|
||||
spin_unlock(&psta->lock);
|
||||
|
||||
} else {
|
||||
DBG_88E("add_RATid_bmc_sta error!\n");
|
||||
|
@ -622,7 +619,6 @@ void update_bmc_sta(struct adapter *padapter)
|
|||
|
||||
void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
|
@ -679,9 +675,9 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
_rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL);
|
||||
spin_lock(&psta->lock);
|
||||
psta->state |= _FW_LINKED;
|
||||
_exit_critical_bh(&psta->lock, &irqL);
|
||||
spin_unlock(&psta->lock);
|
||||
}
|
||||
|
||||
static void update_hw_ht_param(struct adapter *padapter)
|
||||
|
@ -1134,7 +1130,6 @@ void rtw_set_macaddr_acl(struct adapter *padapter, int mode)
|
|||
|
||||
int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *plist, *phead;
|
||||
u8 added = false;
|
||||
int i, ret = 0;
|
||||
|
@ -1148,7 +1143,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
|
|||
if ((NUM_ACL-1) < pacl_list->num)
|
||||
return -1;
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_lock(&pacl_node_q->lock);
|
||||
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
|
@ -1166,12 +1161,12 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
|
|||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_unlock(&pacl_node_q->lock);
|
||||
|
||||
if (added)
|
||||
return ret;
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_lock(&pacl_node_q->lock);
|
||||
|
||||
for (i = 0; i < NUM_ACL; i++) {
|
||||
paclnode = &pacl_list->aclnode[i];
|
||||
|
@ -1193,14 +1188,13 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
|
|||
|
||||
DBG_88E("%s, acl_num =%d\n", __func__, pacl_list->num);
|
||||
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_unlock(&pacl_node_q->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *plist, *phead;
|
||||
int ret = 0;
|
||||
struct rtw_wlan_acl_node *paclnode;
|
||||
|
@ -1210,7 +1204,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
|
|||
|
||||
DBG_88E("%s(acl_num =%d) =%pM\n", __func__, pacl_list->num, (addr));
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_lock(&pacl_node_q->lock);
|
||||
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
|
@ -1230,7 +1224,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
|
|||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_unlock(&pacl_node_q->lock);
|
||||
|
||||
DBG_88E("%s, acl_num =%d\n", __func__, pacl_list->num);
|
||||
return ret;
|
||||
|
@ -1373,7 +1367,6 @@ static void update_bcn_vendor_spec_ie(struct adapter *padapter, u8 *oui)
|
|||
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext;
|
||||
|
||||
|
@ -1386,7 +1379,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
|||
if (!pmlmeext->bstart_bss)
|
||||
return;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
|
||||
spin_lock(&pmlmepriv->bcn_update_lock);
|
||||
|
||||
switch (ie_id) {
|
||||
case 0xFF:
|
||||
|
@ -1416,7 +1409,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
|||
|
||||
pmlmepriv->update_bcn = true;
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
|
||||
spin_unlock(&pmlmepriv->bcn_update_lock);
|
||||
|
||||
if (tx)
|
||||
set_tx_beacon_cmd(padapter);
|
||||
|
@ -1505,12 +1498,11 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
|
|||
{
|
||||
/* update associcated stations cap. */
|
||||
if (updated) {
|
||||
unsigned long irqL;
|
||||
struct list_head *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->asoc_list_lock);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
@ -1523,7 +1515,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
|
|||
|
||||
VCS_update(padapter, psta);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->asoc_list_lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1731,7 +1723,6 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
|
||||
bool active, u16 reason)
|
||||
{
|
||||
unsigned long irqL;
|
||||
u8 beacon_updated = false;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
|
@ -1753,9 +1744,9 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
|
|||
rtw_clearstakey_cmd(padapter, (u8 *)psta, (u8)(psta->mac_id + 3), true);
|
||||
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL);
|
||||
spin_lock(&psta->lock);
|
||||
psta->state &= ~_FW_LINKED;
|
||||
_exit_critical_bh(&psta->lock, &irqL);
|
||||
spin_unlock(&psta->lock);
|
||||
|
||||
rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
|
||||
|
@ -1763,16 +1754,15 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
|
|||
|
||||
beacon_updated = bss_cap_update_on_sta_leave(padapter, psta);
|
||||
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
return beacon_updated;
|
||||
}
|
||||
|
||||
int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *phead, *plist;
|
||||
int ret = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
|
@ -1787,7 +1777,7 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
|
|||
DBG_88E(FUNC_NDEV_FMT" with ch:%u, offset:%u\n",
|
||||
FUNC_NDEV_ARG(padapter->pnetdev), new_ch, ch_offset);
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->asoc_list_lock);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
|
@ -1799,7 +1789,7 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
|
|||
issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset);
|
||||
psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->asoc_list_lock);
|
||||
|
||||
issue_action_spct_ch_switch(padapter, bc_addr, new_ch, ch_offset);
|
||||
|
||||
|
@ -1808,7 +1798,6 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
|
|||
|
||||
int rtw_sta_flush(struct adapter *padapter)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *phead, *plist;
|
||||
int ret = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
|
@ -1822,7 +1811,7 @@ int rtw_sta_flush(struct adapter *padapter)
|
|||
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
|
||||
return ret;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock(&pstapriv->asoc_list_lock);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
|
@ -1837,7 +1826,7 @@ int rtw_sta_flush(struct adapter *padapter)
|
|||
|
||||
ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_unlock(&pstapriv->asoc_list_lock);
|
||||
|
||||
|
||||
issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
@ -1935,7 +1924,6 @@ void start_ap_mode(struct adapter *padapter)
|
|||
|
||||
void stop_ap_mode(struct adapter *padapter)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct list_head *phead, *plist;
|
||||
struct rtw_wlan_acl_node *paclnode;
|
||||
struct sta_info *psta = NULL;
|
||||
|
@ -1954,7 +1942,7 @@ void stop_ap_mode(struct adapter *padapter)
|
|||
padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
/* for ACL */
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_lock(&pacl_node_q->lock);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false) {
|
||||
|
@ -1969,7 +1957,7 @@ void stop_ap_mode(struct adapter *padapter)
|
|||
pacl_list->num--;
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
spin_unlock(&pacl_node_q->lock);
|
||||
|
||||
DBG_88E("%s, free acl_node_queue, num =%d\n", __func__, pacl_list->num);
|
||||
|
||||
|
@ -1979,9 +1967,9 @@ void stop_ap_mode(struct adapter *padapter)
|
|||
rtw_free_all_stainfo(padapter);
|
||||
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_lock(&pstapriv->sta_hash_lock);
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
spin_unlock(&pstapriv->sta_hash_lock);
|
||||
|
||||
rtw_init_bcmc_stainfo(padapter);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue