rtl8188eu: Convert spin lock macros

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-11-28 17:37:57 -06:00
parent 9fe0c17a65
commit 8b76b3b701
19 changed files with 324 additions and 487 deletions

View file

@ -43,7 +43,6 @@ void init_mlme_ap_info(struct adapter *padapter)
void free_mlme_ap_info(struct adapter *padapter) void free_mlme_ap_info(struct adapter *padapter)
{ {
unsigned long irqL;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -62,9 +61,9 @@ void free_mlme_ap_info(struct adapter *padapter)
/* free bc/mc sta_info */ /* free bc/mc sta_info */
psta = rtw_get_bcmc_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); 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); _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) void expire_timeout_chk(struct adapter *padapter)
{ {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
u8 updated = 0; u8 updated = 0;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
@ -286,7 +284,7 @@ void expire_timeout_chk(struct adapter *padapter)
char chk_alive_list[NUM_STA]; char chk_alive_list[NUM_STA];
int i; int i;
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL); spin_lock(&pstapriv->auth_list_lock);
phead = &pstapriv->auth_list; phead = &pstapriv->auth_list;
plist = get_next(phead); plist = get_next(phead);
@ -305,22 +303,22 @@ void expire_timeout_chk(struct adapter *padapter)
DBG_88E("auth expire %6ph\n", DBG_88E("auth expire %6ph\n",
psta->hwaddr); 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); 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; psta = NULL;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); 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) { if (chk_alive_num) {
u8 backup_oper_channel = 0; u8 backup_oper_channel = 0;
@ -424,11 +422,11 @@ void expire_timeout_chk(struct adapter *padapter)
psta->keep_alive_trycnt = 0; psta->keep_alive_trycnt = 0;
DBG_88E("asoc expire %pM, state = 0x%x\n", (psta->hwaddr), psta->state); 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); rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); 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 */ 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) void update_bmc_sta(struct adapter *padapter)
{ {
unsigned long irqL;
u32 init_rate = 0; u32 init_rate = 0;
unsigned char network_type, raid; unsigned char network_type, raid;
int i, supportRateNum = 0; int i, supportRateNum = 0;
@ -604,9 +601,9 @@ void update_bmc_sta(struct adapter *padapter)
rtw_sta_media_status_rpt(padapter, psta, 1); rtw_sta_media_status_rpt(padapter, psta, 1);
_enter_critical_bh(&psta->lock, &irqL); spin_lock(&psta->lock);
psta->state = _FW_LINKED; psta->state = _FW_LINKED;
_exit_critical_bh(&psta->lock, &irqL); spin_unlock(&psta->lock);
} else { } else {
DBG_88E("add_RATid_bmc_sta error!\n"); 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) void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct security_priv *psecuritypriv = &padapter->securitypriv; struct security_priv *psecuritypriv = &padapter->securitypriv;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 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)); _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; psta->state |= _FW_LINKED;
_exit_critical_bh(&psta->lock, &irqL); spin_unlock(&psta->lock);
} }
static void update_hw_ht_param(struct adapter *padapter) 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) int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
{ {
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
u8 added = false; u8 added = false;
int i, ret = 0; 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) if ((NUM_ACL-1) < pacl_list->num)
return -1; return -1;
_enter_critical_bh(&(pacl_node_q->lock), &irqL); spin_lock(&pacl_node_q->lock);
phead = get_list_head(pacl_node_q); phead = get_list_head(pacl_node_q);
plist = get_next(phead); 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) if (added)
return ret; return ret;
_enter_critical_bh(&(pacl_node_q->lock), &irqL); spin_lock(&pacl_node_q->lock);
for (i = 0; i < NUM_ACL; i++) { for (i = 0; i < NUM_ACL; i++) {
paclnode = &pacl_list->aclnode[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); 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; return ret;
} }
int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
{ {
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
int ret = 0; int ret = 0;
struct rtw_wlan_acl_node *paclnode; 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)); 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); phead = get_list_head(pacl_node_q);
plist = get_next(phead); 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); DBG_88E("%s, acl_num =%d\n", __func__, pacl_list->num);
return ret; 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) void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv; struct mlme_priv *pmlmepriv;
struct mlme_ext_priv *pmlmeext; 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) if (!pmlmeext->bstart_bss)
return; return;
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); spin_lock(&pmlmepriv->bcn_update_lock);
switch (ie_id) { switch (ie_id) {
case 0xFF: case 0xFF:
@ -1416,7 +1409,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
pmlmepriv->update_bcn = true; pmlmepriv->update_bcn = true;
_exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); spin_unlock(&pmlmepriv->bcn_update_lock);
if (tx) if (tx)
set_tx_beacon_cmd(padapter); set_tx_beacon_cmd(padapter);
@ -1505,12 +1498,11 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
{ {
/* update associcated stations cap. */ /* update associcated stations cap. */
if (updated) { if (updated) {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); plist = get_next(phead);
@ -1523,7 +1515,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
VCS_update(padapter, psta); 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, u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
bool active, u16 reason) bool active, u16 reason)
{ {
unsigned long irqL;
u8 beacon_updated = false; u8 beacon_updated = false;
struct sta_priv *pstapriv = &padapter->stapriv; 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); 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; psta->state &= ~_FW_LINKED;
_exit_critical_bh(&psta->lock, &irqL); spin_unlock(&psta->lock);
rtw_indicate_sta_disassoc_event(padapter, psta); 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); 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); rtw_free_stainfo(padapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); spin_unlock(&pstapriv->sta_hash_lock);
return beacon_updated; return beacon_updated;
} }
int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset) int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
{ {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
int ret = 0; int ret = 0;
struct sta_info *psta = NULL; 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", DBG_88E(FUNC_NDEV_FMT" with ch:%u, offset:%u\n",
FUNC_NDEV_ARG(padapter->pnetdev), new_ch, ch_offset); 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; phead = &pstapriv->asoc_list;
plist = get_next(phead); 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); 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); 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); 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) int rtw_sta_flush(struct adapter *padapter)
{ {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
int ret = 0; int ret = 0;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
@ -1822,7 +1811,7 @@ int rtw_sta_flush(struct adapter *padapter)
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
return ret; return ret;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); 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); 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); 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) void stop_ap_mode(struct adapter *padapter)
{ {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
struct rtw_wlan_acl_node *paclnode; struct rtw_wlan_acl_node *paclnode;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
@ -1954,7 +1942,7 @@ void stop_ap_mode(struct adapter *padapter)
padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
/* for ACL */ /* for ACL */
_enter_critical_bh(&(pacl_node_q->lock), &irqL); spin_lock(&pacl_node_q->lock);
phead = get_list_head(pacl_node_q); phead = get_list_head(pacl_node_q);
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
@ -1969,7 +1957,7 @@ void stop_ap_mode(struct adapter *padapter)
pacl_list->num--; 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); 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); rtw_free_all_stainfo(padapter);
psta = rtw_get_bcmc_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); rtw_free_stainfo(padapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); spin_unlock(&pstapriv->sta_hash_lock);
rtw_init_bcmc_stainfo(padapter); rtw_init_bcmc_stainfo(padapter);

View file

@ -331,7 +331,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr)
static inline void __network_hash_link(struct adapter *priv, static inline void __network_hash_link(struct adapter *priv,
struct nat25_network_db_entry *ent, int hash) struct nat25_network_db_entry *ent, int hash)
{ {
/* Caller must _enter_critical_bh already! */ /* Caller must spin_lock already! */
ent->next_hash = priv->nethash[hash]; ent->next_hash = priv->nethash[hash];
if (ent->next_hash != NULL) if (ent->next_hash != NULL)
ent->next_hash->pprev_hash = &ent->next_hash; ent->next_hash->pprev_hash = &ent->next_hash;
@ -341,7 +341,7 @@ static inline void __network_hash_link(struct adapter *priv,
static inline void __network_hash_unlink(struct nat25_network_db_entry *ent) static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)
{ {
/* Caller must _enter_critical_bh already! */ /* Caller must spin_lock already! */
*(ent->pprev_hash) = ent->next_hash; *(ent->pprev_hash) = ent->next_hash;
if (ent->next_hash != NULL) if (ent->next_hash != NULL)
ent->next_hash->pprev_hash = ent->pprev_hash; ent->next_hash->pprev_hash = ent->pprev_hash;
@ -353,8 +353,8 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
struct sk_buff *skb, unsigned char *networkAddr) struct sk_buff *skb, unsigned char *networkAddr)
{ {
struct nat25_network_db_entry *db; struct nat25_network_db_entry *db;
unsigned long irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL); spin_lock(&priv->br_ext_lock);
db = priv->nethash[__nat25_network_hash(networkAddr)]; db = priv->nethash[__nat25_network_hash(networkAddr)];
while (db != NULL) { while (db != NULL) {
@ -390,12 +390,12 @@ static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
db->networkAddr[15], db->networkAddr[15],
db->networkAddr[16]); db->networkAddr[16]);
} }
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
return 1; return 1;
} }
db = db->next_hash; db = db->next_hash;
} }
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
return 0; return 0;
} }
@ -404,23 +404,22 @@ static void __nat25_db_network_insert(struct adapter *priv,
{ {
struct nat25_network_db_entry *db; struct nat25_network_db_entry *db;
int hash; int hash;
unsigned long irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL); spin_lock(&priv->br_ext_lock);
hash = __nat25_network_hash(networkAddr); hash = __nat25_network_hash(networkAddr);
db = priv->nethash[hash]; db = priv->nethash[hash];
while (db != NULL) { while (db != NULL) {
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
memcpy(db->macAddr, macAddr, ETH_ALEN); memcpy(db->macAddr, macAddr, ETH_ALEN);
db->ageing_timer = jiffies; db->ageing_timer = jiffies;
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
return; return;
} }
db = db->next_hash; db = db->next_hash;
} }
db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db)); db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db));
if (db == NULL) { if (db == NULL) {
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
return; return;
} }
memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN); memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN);
@ -430,7 +429,7 @@ static void __nat25_db_network_insert(struct adapter *priv,
__network_hash_link(priv, db, hash); __network_hash_link(priv, db, hash);
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
} }
static void __nat25_db_print(struct adapter *priv) static void __nat25_db_print(struct adapter *priv)
@ -444,8 +443,8 @@ static void __nat25_db_print(struct adapter *priv)
void nat25_db_cleanup(struct adapter *priv) void nat25_db_cleanup(struct adapter *priv)
{ {
int i; int i;
unsigned long irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL); spin_lock(&priv->br_ext_lock);
for (i = 0; i < NAT25_HASH_SIZE; i++) { for (i = 0; i < NAT25_HASH_SIZE; i++) {
struct nat25_network_db_entry *f; struct nat25_network_db_entry *f;
@ -464,14 +463,14 @@ void nat25_db_cleanup(struct adapter *priv)
f = g; f = g;
} }
} }
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
} }
void nat25_db_expire(struct adapter *priv) void nat25_db_expire(struct adapter *priv)
{ {
int i; int i;
unsigned long irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL); spin_lock(&priv->br_ext_lock);
for (i = 0; i < NAT25_HASH_SIZE; i++) { for (i = 0; i < NAT25_HASH_SIZE; i++) {
struct nat25_network_db_entry *f; struct nat25_network_db_entry *f;
@ -495,7 +494,7 @@ void nat25_db_expire(struct adapter *priv)
f = g; f = g;
} }
} }
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
} }
int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
@ -1060,8 +1059,7 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
} }
if (!priv->ethBrExtInfo.nat25_disable) { if (!priv->ethBrExtInfo.nat25_disable) {
unsigned long irqL; spin_lock(&priv->br_ext_lock);
_enter_critical_bh(&priv->br_ext_lock, &irqL);
/* /*
* This function look up the destination network address from * This function look up the destination network address from
* the NAT2.5 database. Return value = -1 means that the * the NAT2.5 database. Return value = -1 means that the
@ -1072,9 +1070,9 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
!memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) { !memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) {
memcpy(skb->data, priv->scdb_mac, ETH_ALEN); memcpy(skb->data, priv->scdb_mac, ETH_ALEN);
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
} else { } else {
_exit_critical_bh(&priv->br_ext_lock, &irqL); spin_unlock(&priv->br_ext_lock);
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP); retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
} }
@ -1178,21 +1176,17 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr,
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
struct nat25_network_db_entry *db; struct nat25_network_db_entry *db;
int hash; int hash;
/* unsigned long irqL; */
/* _enter_critical_bh(&priv->br_ext_lock, &irqL); */
__nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr); __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
hash = __nat25_network_hash(networkAddr); hash = __nat25_network_hash(networkAddr);
db = priv->nethash[hash]; db = priv->nethash[hash];
while (db != NULL) { while (db != NULL) {
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
return (void *)db; return (void *)db;
} }
db = db->next_hash; db = db->next_hash;
} }
/* _exit_critical_bh(&priv->br_ext_lock, &irqL); */
return NULL; return NULL;
} }

View file

@ -146,20 +146,17 @@ ISR/Call-Back functions can't call this sub-function.
int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
{ {
unsigned long irqL; unsigned long flags;
_func_enter_; _func_enter_;
if (obj == NULL) if (obj == NULL)
goto exit; goto exit;
/* _enter_critical_bh(&queue->lock, &irqL); */ spin_lock_irqsave(&queue->lock, flags);
_enter_critical(&queue->lock, &irqL);
rtw_list_insert_tail(&obj->list, &queue->queue); rtw_list_insert_tail(&obj->list, &queue->queue);
/* _exit_critical_bh(&queue->lock, &irqL); */ spin_unlock_irqrestore(&queue->lock, flags);
_exit_critical(&queue->lock, &irqL);
exit: exit:
@ -170,13 +167,12 @@ _func_exit_;
struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue)
{ {
unsigned long irqL;
struct cmd_obj *obj; struct cmd_obj *obj;
unsigned long flags;
_func_enter_; _func_enter_;
/* _enter_critical_bh(&(queue->lock), &irqL); */ spin_lock_irqsave(&queue->lock, flags);
_enter_critical(&queue->lock, &irqL);
if (rtw_is_list_empty(&(queue->queue))) { if (rtw_is_list_empty(&(queue->queue))) {
obj = NULL; obj = NULL;
} else { } else {
@ -184,8 +180,7 @@ _func_enter_;
rtw_list_delete(&obj->list); rtw_list_delete(&obj->list);
} }
/* _exit_critical_bh(&(queue->lock), &irqL); */ spin_unlock_irqrestore(&queue->lock, flags);
_exit_critical(&queue->lock, &irqL);
_func_exit_; _func_exit_;
@ -2200,15 +2195,14 @@ _func_exit_;
} }
void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_func_enter_; _func_enter_;
if (pcmd->res != H2C_SUCCESS) { if (pcmd->res != H2C_SUCCESS) {
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
set_fwstate(pmlmepriv, _FW_LINKED); set_fwstate(pmlmepriv, _FW_LINKED);
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n.")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n."));
@ -2246,7 +2240,6 @@ _func_exit_;
void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
unsigned long irqL;
u8 timer_cancelled; u8 timer_cancelled;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct wlan_network *pwlan = NULL; struct wlan_network *pwlan = NULL;
@ -2263,7 +2256,7 @@ _func_enter_;
_cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled);
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress); psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
@ -2277,15 +2270,14 @@ _func_enter_;
rtw_indicate_connect(padapter); rtw_indicate_connect(padapter);
} else { } else {
unsigned long irqL;
pwlan = _rtw_alloc_network(pmlmepriv); pwlan = _rtw_alloc_network(pmlmepriv);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&(pmlmepriv->scanned_queue.lock));
if (pwlan == NULL) { if (pwlan == NULL) {
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue); pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
if (pwlan == NULL) { if (pwlan == NULL) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error: can't get pwlan in rtw_joinbss_event_callback\n")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error: can't get pwlan in rtw_joinbss_event_callback\n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&(pmlmepriv->scanned_queue.lock));
goto createbss_cmd_fail; goto createbss_cmd_fail;
} }
pwlan->last_scanned = rtw_get_current_time(); pwlan->last_scanned = rtw_get_current_time();
@ -2300,13 +2292,13 @@ _func_enter_;
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&(pmlmepriv->scanned_queue.lock));
/* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */ /* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */
} }
createbss_cmd_fail: createbss_cmd_fail:
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
rtw_free_cmd_obj(pcmd); rtw_free_cmd_obj(pcmd);
@ -2332,7 +2324,6 @@ _func_exit_;
void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
unsigned long irqL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct set_assocsta_parm *passocsta_parm = (struct set_assocsta_parm *)(pcmd->parmbuf); struct set_assocsta_parm *passocsta_parm = (struct set_assocsta_parm *)(pcmd->parmbuf);
@ -2349,13 +2340,13 @@ _func_enter_;
psta->aid = passocsta_rsp->cam_id; psta->aid = passocsta_rsp->cam_id;
psta->mac_id = passocsta_rsp->cam_id; psta->mac_id = passocsta_rsp->cam_id;
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true))
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
set_fwstate(pmlmepriv, _FW_LINKED); set_fwstate(pmlmepriv, _FW_LINKED);
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
exit: exit:
rtw_free_cmd_obj(pcmd); rtw_free_cmd_obj(pcmd);

View file

@ -835,7 +835,6 @@ int proc_get_all_sta_info(char *page, char **start,
off_t offset, int count, off_t offset, int count,
int *eof, void *data) int *eof, void *data)
{ {
unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
struct net_device *dev = data; struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
@ -848,7 +847,7 @@ int proc_get_all_sta_info(char *page, char **start,
len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); spin_lock(&pstapriv->sta_hash_lock);
for (i = 0; i < NUM_STA; i++) { for (i = 0; i < NUM_STA; i++) {
phead = &(pstapriv->sta_hash[i]); phead = &(pstapriv->sta_hash[i]);
@ -882,7 +881,7 @@ int proc_get_all_sta_info(char *page, char **start,
} }
} }
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); spin_unlock(&pstapriv->sta_hash_lock);
*eof = 1; *eof = 1;
return len; return len;

View file

@ -68,7 +68,6 @@ _func_exit_;
u8 rtw_do_join(struct adapter *padapter) u8 rtw_do_join(struct adapter *padapter)
{ {
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
u8 *pibss = NULL; u8 *pibss = NULL;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -77,7 +76,7 @@ u8 rtw_do_join(struct adapter *padapter)
_func_enter_; _func_enter_;
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -92,7 +91,7 @@ _func_enter_;
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
if (_rtw_queue_empty(queue)) { if (_rtw_queue_empty(queue)) {
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
/* when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty */ /* when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty */
@ -116,7 +115,7 @@ _func_enter_;
} else { } else {
int select_ret; int select_ret;
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
if (select_ret == _SUCCESS) { if (select_ret == _SUCCESS) {
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
@ -178,7 +177,6 @@ _func_exit_;
u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
{ {
unsigned long irqL;
u8 status = _SUCCESS; u8 status = _SUCCESS;
u32 cur_time = 0; u32 cur_time = 0;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -195,7 +193,7 @@ _func_enter_;
goto exit; goto exit;
} }
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
@ -253,7 +251,7 @@ handle_tkip_countermeasure:
status = rtw_do_join(padapter); status = rtw_do_join(padapter);
release_mlme_lock: release_mlme_lock:
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
exit: exit:
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
@ -266,7 +264,6 @@ _func_exit_;
u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
{ {
unsigned long irqL;
u8 status = _SUCCESS; u8 status = _SUCCESS;
u32 cur_time = 0; u32 cur_time = 0;
@ -285,7 +282,7 @@ _func_enter_;
goto exit; goto exit;
} }
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
DBG_88E("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); DBG_88E("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
@ -367,7 +364,7 @@ handle_tkip_countermeasure:
} }
release_mlme_lock: release_mlme_lock:
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
exit: exit:
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
@ -379,7 +376,6 @@ _func_exit_;
u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
enum ndis_802_11_network_infra networktype) enum ndis_802_11_network_infra networktype)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network; struct wlan_network *cur_network = &pmlmepriv->cur_network;
enum ndis_802_11_network_infra *pold_state = &(cur_network->network.InfrastructureMode); enum ndis_802_11_network_infra *pold_state = &(cur_network->network.InfrastructureMode);
@ -391,7 +387,7 @@ _func_enter_;
*pold_state, networktype, get_fwstate(pmlmepriv))); *pold_state, networktype, get_fwstate(pmlmepriv)));
if (*pold_state != networktype) { if (*pold_state != networktype) {
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, (" change mode!")); RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, (" change mode!"));
/* DBG_88E("change mode, old_mode =%d, new_mode =%d, fw_state = 0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ /* DBG_88E("change mode, old_mode =%d, new_mode =%d, fw_state = 0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */
@ -439,7 +435,7 @@ _func_enter_;
case Ndis802_11InfrastructureMax: case Ndis802_11InfrastructureMax:
break; break;
} }
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
} }
_func_exit_; _func_exit_;
@ -450,12 +446,11 @@ _func_exit_;
u8 rtw_set_802_11_disassociate(struct adapter *padapter) u8 rtw_set_802_11_disassociate(struct adapter *padapter)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_func_enter_; _func_enter_;
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, _FW_LINKED)) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
@ -467,7 +462,7 @@ _func_enter_;
rtw_pwr_wakeup(padapter); rtw_pwr_wakeup(padapter);
} }
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
_func_exit_; _func_exit_;
@ -476,7 +471,6 @@ _func_exit_;
u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
{ {
unsigned long irqL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 res = true; u8 res = true;
@ -512,11 +506,11 @@ _func_enter_;
return _SUCCESS; return _SUCCESS;
} }
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0); res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0);
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
} }
exit: exit:

View file

@ -160,18 +160,16 @@ _func_exit_;
int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork) int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork)
{ {
unsigned long irql;
_func_enter_; _func_enter_;
if (pnetwork == NULL) if (pnetwork == NULL)
goto exit; goto exit;
_enter_critical_bh(&queue->lock, &irql); spin_lock(&queue->lock);
rtw_list_insert_tail(&pnetwork->list, &queue->queue); rtw_list_insert_tail(&pnetwork->list, &queue->queue);
_exit_critical_bh(&queue->lock, &irql); spin_unlock(&queue->lock);
exit: exit:
@ -182,13 +180,11 @@ _func_exit_;
struct wlan_network *_rtw_dequeue_network(struct __queue *queue) struct wlan_network *_rtw_dequeue_network(struct __queue *queue)
{ {
unsigned long irql;
struct wlan_network *pnetwork; struct wlan_network *pnetwork;
_func_enter_; _func_enter_;
_enter_critical_bh(&queue->lock, &irql); spin_lock(&queue->lock);
if (_rtw_queue_empty(queue)) { if (_rtw_queue_empty(queue)) {
pnetwork = NULL; pnetwork = NULL;
@ -198,7 +194,7 @@ _func_enter_;
rtw_list_delete(&(pnetwork->list)); rtw_list_delete(&(pnetwork->list));
} }
_exit_critical_bh(&queue->lock, &irql); spin_unlock(&queue->lock);
_func_exit_; _func_exit_;
@ -207,14 +203,13 @@ _func_exit_;
struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */
{ {
unsigned long irql;
struct wlan_network *pnetwork; struct wlan_network *pnetwork;
struct __queue *free_queue = &pmlmepriv->free_bss_pool; struct __queue *free_queue = &pmlmepriv->free_bss_pool;
struct list_head *plist = NULL; struct list_head *plist = NULL;
_func_enter_; _func_enter_;
_enter_critical_bh(&free_queue->lock, &irql); spin_lock(&free_queue->lock);
if (_rtw_queue_empty(free_queue) == true) { if (_rtw_queue_empty(free_queue) == true) {
pnetwork = NULL; pnetwork = NULL;
@ -236,7 +231,7 @@ _func_enter_;
pmlmepriv->num_of_scanned++; pmlmepriv->num_of_scanned++;
exit: exit:
_exit_critical_bh(&free_queue->lock, &irql); spin_unlock(&free_queue->lock);
_func_exit_; _func_exit_;
@ -247,7 +242,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwo
{ {
u32 curr_time, delta_time; u32 curr_time, delta_time;
u32 lifetime = SCANQUEUE_LIFETIME; u32 lifetime = SCANQUEUE_LIFETIME;
unsigned long irql;
struct __queue *free_queue = &(pmlmepriv->free_bss_pool); struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
_func_enter_; _func_enter_;
@ -266,11 +260,11 @@ _func_enter_;
if (delta_time < lifetime)/* unit:sec */ if (delta_time < lifetime)/* unit:sec */
goto exit; goto exit;
} }
_enter_critical_bh(&free_queue->lock, &irql); spin_lock(&free_queue->lock);
rtw_list_delete(&(pnetwork->list)); rtw_list_delete(&(pnetwork->list));
rtw_list_insert_tail(&(pnetwork->list), &(free_queue->queue)); rtw_list_insert_tail(&(pnetwork->list), &(free_queue->queue));
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
_exit_critical_bh(&free_queue->lock, &irql); spin_unlock(&free_queue->lock);
exit: exit:
_func_exit_; _func_exit_;
@ -328,7 +322,6 @@ _func_exit_;
void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
{ {
unsigned long irql;
struct list_head *phead, *plist; struct list_head *phead, *plist;
struct wlan_network *pnetwork; struct wlan_network *pnetwork;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -337,7 +330,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
_func_enter_; _func_enter_;
_enter_critical_bh(&scanned_queue->lock, &irql); spin_lock(&scanned_queue->lock);
phead = get_list_head(scanned_queue); phead = get_list_head(scanned_queue);
plist = get_next(phead); plist = get_next(phead);
@ -349,7 +342,7 @@ _func_enter_;
_rtw_free_network(pmlmepriv, pnetwork, isfreeall); _rtw_free_network(pmlmepriv, pnetwork, isfreeall);
} }
_exit_critical_bh(&scanned_queue->lock, &irql); spin_unlock(&scanned_queue->lock);
_func_exit_; _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) void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
{ {
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
u32 bssid_ex_sz; u32 bssid_ex_sz;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); 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_; _func_enter_;
_enter_critical_bh(&queue->lock, &irql); spin_lock(&queue->lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -702,7 +694,7 @@ _func_enter_;
} }
exit: exit:
_exit_critical_bh(&queue->lock, &irql); spin_unlock(&queue->lock);
_func_exit_; _func_exit_;
} }
@ -791,7 +783,6 @@ _func_exit_;
void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
{ {
unsigned long irql;
u32 len; u32 len;
struct wlan_bssid_ex *pnetwork; struct wlan_bssid_ex *pnetwork;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); 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")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n****rtw_survey_event_callback: return a wrong bss ***\n"));
return; return;
} }
_enter_critical_bh(&pmlmepriv->lock, &irql); spin_lock(&pmlmepriv->lock);
/* update IBSS_network 's timestamp */ /* update IBSS_network 's timestamp */
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) { if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) {
if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) { if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL; struct wlan_network *ibss_wlan = NULL;
unsigned long irql;
memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8); 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); ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
if (ibss_wlan) { if (ibss_wlan) {
memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8); memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&pmlmepriv->scanned_queue.lock);
goto exit; goto exit;
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&(pmlmepriv->scanned_queue.lock));
} }
} }
@ -836,7 +826,7 @@ _func_enter_;
exit: exit:
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
_func_exit_; _func_exit_;
@ -847,13 +837,12 @@ _func_exit_;
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
{ {
unsigned long irql;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
struct mlme_ext_priv *pmlmeext; struct mlme_ext_priv *pmlmeext;
u8 timer_cancelled = 0; u8 timer_cancelled = 0;
_func_enter_; _func_enter_;
_enter_critical_bh(&pmlmepriv->lock, &irql); spin_lock(&pmlmepriv->lock);
if (pmlmepriv->wps_probe_req_ie) { if (pmlmepriv->wps_probe_req_ie) {
pmlmepriv->wps_probe_req_ie_len = 0; 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))); 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) if (timer_cancelled)
_cancel_timer(&pmlmepriv->scan_to_timer, &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); rtw_set_signal_stat_timer(&adapter->recvpriv);
if (pmlmepriv->to_join) { if (pmlmepriv->to_join) {
@ -939,7 +928,7 @@ _func_enter_;
indicate_wx_scan_complete_event(adapter); indicate_wx_scan_complete_event(adapter);
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0); 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) static void free_scanqueue(struct mlme_priv *pmlmepriv)
{ {
unsigned long irql, irql0;
struct __queue *free_queue = &pmlmepriv->free_bss_pool; struct __queue *free_queue = &pmlmepriv->free_bss_pool;
struct __queue *scan_queue = &pmlmepriv->scanned_queue; struct __queue *scan_queue = &pmlmepriv->scanned_queue;
struct list_head *plist, *phead, *ptemp; struct list_head *plist, *phead, *ptemp;
@ -968,8 +956,8 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
_func_enter_; _func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n"));
_enter_critical_bh(&scan_queue->lock, &irql0); spin_lock(&scan_queue->lock);
_enter_critical_bh(&free_queue->lock, &irql); spin_lock(&free_queue->lock);
phead = get_list_head(scan_queue); phead = get_list_head(scan_queue);
plist = get_next(phead); plist = get_next(phead);
@ -982,8 +970,8 @@ _func_enter_;
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
} }
_exit_critical_bh(&free_queue->lock, &irql); spin_unlock(&free_queue->lock);
_exit_critical_bh(&scan_queue->lock, &irql0); spin_unlock(&scan_queue->lock);
_func_exit_; _func_exit_;
} }
@ -993,7 +981,6 @@ _func_exit_;
*/ */
void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
{ {
unsigned long irql;
struct wlan_network *pwlan = NULL; struct wlan_network *pwlan = NULL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct sta_priv *pstapriv = &adapter->stapriv; struct sta_priv *pstapriv = &adapter->stapriv;
@ -1011,9 +998,9 @@ _func_enter_;
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress); 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); 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)) { 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); rtw_free_all_stainfo(adapter);
psta = rtw_get_bcmc_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); rtw_free_stainfo(adapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql); spin_unlock(&pstapriv->sta_hash_lock);
rtw_init_bcmc_stainfo(adapter); rtw_init_bcmc_stainfo(adapter);
} }
if (lock_scanned_queue) 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); pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan) if (pwlan)
@ -1042,7 +1029,7 @@ _func_enter_;
rtw_free_network_nolock(pmlmepriv, pwlan); rtw_free_network_nolock(pmlmepriv, pwlan);
if (lock_scanned_queue) if (lock_scanned_queue)
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&pmlmepriv->scanned_queue.lock);
pmlmepriv->key_mask = 0; pmlmepriv->key_mask = 0;
_func_exit_; _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) void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
{ {
unsigned long irql, irql2;
u8 timer_cancelled; u8 timer_cancelled;
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL; struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
struct sta_priv *pstapriv = &adapter->stapriv; struct sta_priv *pstapriv = &adapter->stapriv;
@ -1292,12 +1278,12 @@ _func_enter_;
goto ignore_nolock; 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) { 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)) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/* s1. find ptarget_wlan */ /* s1. find ptarget_wlan */
if (check_fwstate(pmlmepriv, _FW_LINKED)) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
@ -1310,9 +1296,9 @@ _func_enter_;
pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress); pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
if (pcur_sta) { if (pcur_sta) {
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql2); spin_lock(&pstapriv->sta_hash_lock);
rtw_free_stainfo(adapter, pcur_sta); 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); 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); rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
} else { } else {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't find ptarget_wlan when joinbss_event callback\n")); 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; goto ignore_joinbss_callback;
} }
@ -1344,7 +1330,7 @@ _func_enter_;
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (ptarget_sta == NULL) { if (ptarget_sta == NULL) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n")); 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; goto ignore_joinbss_callback;
} }
} }
@ -1365,11 +1351,11 @@ _func_enter_;
} else { } else {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv))); 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; goto ignore_joinbss_callback;
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&pmlmepriv->scanned_queue.lock);
} else if (pnetwork->join_res == -4) { } else if (pnetwork->join_res == -4) {
rtw_reset_securitypriv(adapter); rtw_reset_securitypriv(adapter);
@ -1385,7 +1371,7 @@ _func_enter_;
} }
ignore_joinbss_callback: ignore_joinbss_callback:
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
ignore_nolock: ignore_nolock:
_func_exit_; _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) void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
{ {
unsigned long irql;
struct sta_info *psta; struct sta_info *psta;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf; struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
@ -1494,21 +1479,21 @@ _func_enter_;
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm; psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
psta->ieee8021x_blocked = false; psta->ieee8021x_blocked = false;
_enter_critical_bh(&pmlmepriv->lock, &irql); spin_lock(&pmlmepriv->lock);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) { (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
if (adapter->stapriv.asoc_sta_count == 2) { 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); ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
pmlmepriv->cur_network_scanned = ptarget_wlan; pmlmepriv->cur_network_scanned = ptarget_wlan;
if (ptarget_wlan) if (ptarget_wlan)
ptarget_wlan->fixed = true; 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) */ /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
rtw_indicate_connect(adapter); rtw_indicate_connect(adapter);
} }
} }
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
mlmeext_sta_add_event_callback(adapter, psta); mlmeext_sta_add_event_callback(adapter, psta);
exit: exit:
_func_exit_; _func_exit_;
@ -1516,7 +1501,6 @@ _func_exit_;
void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
{ {
unsigned long irql, irql2;
int mac_id = -1; int mac_id = -1;
struct sta_info *psta; struct sta_info *psta;
struct wlan_network *pwlan = NULL; struct wlan_network *pwlan = NULL;
@ -1549,7 +1533,7 @@ _func_enter_;
mlmeext_sta_del_event_callback(adapter); mlmeext_sta_del_event_callback(adapter);
_enter_critical_bh(&pmlmepriv->lock, &irql2); spin_lock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if(adapter->registrypriv.wifi_spec == 1) if(adapter->registrypriv.wifi_spec == 1)
@ -1567,31 +1551,31 @@ _func_enter_;
rtw_free_assoc_resources(adapter, 1); rtw_free_assoc_resources(adapter, 1);
rtw_indicate_disconnect(adapter); 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 */ /* remove the network entry in scanned_queue */
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan) { if (pwlan) {
pwlan->fixed = false; pwlan->fixed = false;
rtw_free_network_nolock(pmlmepriv, pwlan); 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); _rtw_roaming(adapter, tgt_network);
} }
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_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); 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) */ 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 */ /* free old ibss network */
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress); pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan) { if (pwlan) {
pwlan->fixed = false; pwlan->fixed = false;
rtw_free_network_nolock(pmlmepriv, pwlan); rtw_free_network_nolock(pmlmepriv, pwlan);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&pmlmepriv->scanned_queue.lock);
/* re-create ibss */ /* re-create ibss */
pdev_network = &(adapter->registrypriv.dev_network); pdev_network = &(adapter->registrypriv.dev_network);
pibss = adapter->registrypriv.dev_network.MacAddress; 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 ")); 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_; _func_exit_;
} }
@ -1631,7 +1615,6 @@ _func_exit_;
*/ */
void _rtw_join_timeout_handler (struct adapter *adapter) void _rtw_join_timeout_handler (struct adapter *adapter)
{ {
unsigned long irql;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
int do_join_r; int do_join_r;
@ -1643,7 +1626,7 @@ _func_enter_;
return; return;
_enter_critical_bh(&pmlmepriv->lock, &irql); spin_lock(&pmlmepriv->lock);
if (rtw_to_roaming(adapter) > 0) { /* join timeout caused by roaming */ if (rtw_to_roaming(adapter) > 0) { /* join timeout caused by roaming */
while (1) { while (1) {
@ -1666,7 +1649,7 @@ _func_enter_;
rtw_indicate_disconnect(adapter); rtw_indicate_disconnect(adapter);
free_scanqueue(pmlmepriv);/* */ free_scanqueue(pmlmepriv);/* */
} }
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
_func_exit_; _func_exit_;
} }
@ -1676,13 +1659,12 @@ _func_exit_;
*/ */
void rtw_scan_timeout_handler (struct adapter *adapter) void rtw_scan_timeout_handler (struct adapter *adapter)
{ {
unsigned long irql;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); 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); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
rtw_indicate_scan_done(adapter, true); rtw_indicate_scan_done(adapter, true);
} }
@ -1814,7 +1796,6 @@ pmlmepriv->lock
int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
{ {
unsigned long irql;
int ret; int ret;
struct list_head *phead; struct list_head *phead;
struct adapter *adapter; struct adapter *adapter;
@ -1825,7 +1806,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
_func_enter_; _func_enter_;
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
adapter = (struct adapter *)pmlmepriv->nic_hdl; adapter = (struct adapter *)pmlmepriv->nic_hdl;
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = get_next(phead);
@ -1872,7 +1853,7 @@ _func_enter_;
ret = rtw_joinbss_cmd(adapter, candidate); ret = rtw_joinbss_cmd(adapter, candidate);
exit: exit:
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql); spin_unlock(&pmlmepriv->scanned_queue.lock);
_func_exit_; _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) void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
{ {
unsigned long irql;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_enter_critical_bh(&pmlmepriv->lock, &irql); spin_lock(&pmlmepriv->lock);
_rtw_roaming(padapter, tgt_network); _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) void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
{ {

View file

@ -754,7 +754,6 @@ _END_ONBEACON_:
unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
{ {
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
unsigned long irqL;
unsigned int auth_mode, ie_len; unsigned int auth_mode, ie_len;
u16 seq; u16 seq;
unsigned char *sa, *p; unsigned char *sa, *p;
@ -815,24 +814,24 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
pstat->state = WIFI_FW_AUTH_NULL; pstat->state = WIFI_FW_AUTH_NULL;
pstat->auth_seq = 0; pstat->auth_seq = 0;
} else { } else {
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
if (!rtw_is_list_empty(&pstat->asoc_list)) { if (!rtw_is_list_empty(&pstat->asoc_list)) {
rtw_list_delete(&pstat->asoc_list); rtw_list_delete(&pstat->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
if (seq == 1) { if (seq == 1) {
/* TODO: STA re_auth and auth timeout */ /* TODO: STA re_auth and auth timeout */
} }
} }
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL); spin_lock(&pstapriv->auth_list_lock);
if (rtw_is_list_empty(&pstat->auth_list)) { if (rtw_is_list_empty(&pstat->auth_list)) {
rtw_list_insert_tail(&pstat->auth_list, &pstapriv->auth_list); rtw_list_insert_tail(&pstat->auth_list, &pstapriv->auth_list);
pstapriv->auth_list_cnt++; pstapriv->auth_list_cnt++;
} }
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL); spin_unlock(&pstapriv->auth_list_lock);
if (pstat->auth_seq == 0) if (pstat->auth_seq == 0)
pstat->expire_to = pstapriv->auth_to; pstat->expire_to = pstapriv->auth_to;
@ -1003,7 +1002,6 @@ authclnt_fail:
unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
{ {
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
unsigned long irqL;
u16 capab_info; u16 capab_info;
struct rtw_ieee802_11_elems elems; struct rtw_ieee802_11_elems elems;
struct sta_info *pstat; struct sta_info *pstat;
@ -1406,20 +1404,20 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
pstat->state &= (~WIFI_FW_ASSOC_STATE); pstat->state &= (~WIFI_FW_ASSOC_STATE);
pstat->state |= WIFI_FW_ASSOC_SUCCESS; pstat->state |= WIFI_FW_ASSOC_SUCCESS;
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL); spin_lock(&pstapriv->auth_list_lock);
if (!rtw_is_list_empty(&pstat->auth_list)) { if (!rtw_is_list_empty(&pstat->auth_list)) {
rtw_list_delete(&pstat->auth_list); rtw_list_delete(&pstat->auth_list);
pstapriv->auth_list_cnt--; pstapriv->auth_list_cnt--;
} }
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL); spin_unlock(&pstapriv->auth_list_lock);
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
if (rtw_is_list_empty(&pstat->asoc_list)) { if (rtw_is_list_empty(&pstat->asoc_list)) {
pstat->expire_to = pstapriv->expire_to; pstat->expire_to = pstapriv->expire_to;
rtw_list_insert_tail(&pstat->asoc_list, &pstapriv->asoc_list); rtw_list_insert_tail(&pstat->asoc_list, &pstapriv->asoc_list);
pstapriv->asoc_list_cnt++; pstapriv->asoc_list_cnt++;
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
/* now the station is qualified to join our BSS... */ /* now the station is qualified to join our BSS... */
if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) { if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) {
@ -1588,7 +1586,6 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -1599,13 +1596,13 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
if (psta) { if (psta) {
u8 updated = 0; u8 updated = 0;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
if (!rtw_is_list_empty(&psta->asoc_list)) { if (!rtw_is_list_empty(&psta->asoc_list)) {
rtw_list_delete(&psta->asoc_list); rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, false, reason); updated = ap_free_sta(padapter, psta, false, reason);
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
associated_clients_update(padapter, updated); associated_clients_update(padapter, updated);
} }
@ -1670,14 +1667,9 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
/* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */
/* rtw_free_stainfo(padapter, psta); */
/* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */
DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n", DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n",
reason, GetAddr2Ptr(pframe)); reason, GetAddr2Ptr(pframe));
@ -1685,13 +1677,13 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
if (psta) { if (psta) {
u8 updated = 0; u8 updated = 0;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
if (!rtw_is_list_empty(&psta->asoc_list)) { if (!rtw_is_list_empty(&psta->asoc_list)) {
rtw_list_delete(&psta->asoc_list); rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, false, reason); updated = ap_free_sta(padapter, psta, false, reason);
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
associated_clients_update(padapter, updated); associated_clients_update(padapter, updated);
} }
@ -4503,9 +4495,6 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
__le16 *fctrl; __le16 *fctrl;
unsigned int rate_len; unsigned int rate_len;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
#if defined(CONFIG_88EU_AP_MODE)
unsigned long irqL;
#endif /* if defined (CONFIG_88EU_AP_MODE) */
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -4521,7 +4510,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
return; return;
} }
#if defined (CONFIG_88EU_AP_MODE) #if defined (CONFIG_88EU_AP_MODE)
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); spin_lock(&pmlmepriv->bcn_update_lock);
#endif /* if defined (CONFIG_88EU_AP_MODE) */ #endif /* if defined (CONFIG_88EU_AP_MODE) */
/* update attribute */ /* update attribute */
@ -4706,7 +4695,7 @@ _issue_bcn:
#if defined (CONFIG_88EU_AP_MODE) #if defined (CONFIG_88EU_AP_MODE)
pmlmepriv->update_bcn = false; pmlmepriv->update_bcn = false;
_exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); spin_unlock(&pmlmepriv->bcn_update_lock);
#endif /* if defined (CONFIG_88EU_AP_MODE) */ #endif /* if defined (CONFIG_88EU_AP_MODE) */
if ((pattrib->pktlen + TXDESC_SIZE) > 512) { if ((pattrib->pktlen + TXDESC_SIZE) > 512) {
@ -6172,7 +6161,6 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
static void issue_action_BSSCoexistPacket(struct adapter *padapter) static void issue_action_BSSCoexistPacket(struct adapter *padapter)
{ {
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
unsigned char category, action; unsigned char category, action;
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
@ -6247,7 +6235,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
if (pmlmepriv->num_sta_no_ht > 0) { if (pmlmepriv->num_sta_no_ht > 0) {
int i; int i;
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -6277,7 +6265,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
ICS[0][0] = 1; ICS[0][0] = 1;
} }
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (ICS[i][0] == 1) { if (ICS[i][0] == 1) {
@ -8376,7 +8364,6 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
} }
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
else { /* tx bc/mc frames after update TIM */ else { /* tx bc/mc frames after update TIM */
unsigned long irqL;
struct sta_info *psta_bmc; struct sta_info *psta_bmc;
struct list_head *xmitframe_plist, *xmitframe_phead; struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
@ -8389,7 +8376,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
if ((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len > 0)) { if ((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len > 0)) {
rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */ rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */
_enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); spin_lock(&psta_bmc->sleep_q.lock);
xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -8411,12 +8398,12 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
pxmitframe->attrib.qsel = 0x11;/* HIQ */ pxmitframe->attrib.qsel = 0x11;/* HIQ */
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); spin_unlock(&psta_bmc->sleep_q.lock);
if (rtw_hal_xmit(padapter, pxmitframe)) if (rtw_hal_xmit(padapter, pxmitframe))
rtw_os_xmit_complete(padapter, pxmitframe); rtw_os_xmit_complete(padapter, pxmitframe);
_enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); spin_lock(&psta_bmc->sleep_q.lock);
} }
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); spin_unlock(&psta_bmc->sleep_q.lock);
} }
} }
#endif #endif

View file

@ -323,10 +323,7 @@ s32 mp_start_test(struct adapter *padapter)
struct sta_info *psta; struct sta_info *psta;
u32 length; u32 length;
u8 val8; u8 val8;
unsigned long irqL;
s32 res = _SUCCESS; s32 res = _SUCCESS;
struct mp_priv *pmppriv = &padapter->mppriv; struct mp_priv *pmppriv = &padapter->mppriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *tgt_network = &pmlmepriv->cur_network; struct wlan_network *tgt_network = &pmlmepriv->cur_network;
@ -379,7 +376,7 @@ s32 mp_start_test(struct adapter *padapter)
else else
bssid.Length = length; bssid.Length = length;
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
goto end_of_mp_start_test; goto end_of_mp_start_test;
@ -420,7 +417,7 @@ s32 mp_start_test(struct adapter *padapter)
end_of_mp_start_test: end_of_mp_start_test:
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
if (res == _SUCCESS) { if (res == _SUCCESS) {
/* set MSR to WIFI_FW_ADHOC_STATE */ /* set MSR to WIFI_FW_ADHOC_STATE */
@ -439,11 +436,9 @@ void mp_stop_test(struct adapter *padapter)
struct wlan_network *tgt_network = &pmlmepriv->cur_network; struct wlan_network *tgt_network = &pmlmepriv->cur_network;
struct sta_info *psta; struct sta_info *psta;
unsigned long irqL;
if (pmppriv->mode == MP_ON) { if (pmppriv->mode == MP_ON) {
pmppriv->bSetTxPower = 0; pmppriv->bSetTxPower = 0;
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false) if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)
goto end_of_mp_stop_test; goto end_of_mp_stop_test;
@ -465,7 +460,7 @@ void mp_stop_test(struct adapter *padapter)
end_of_mp_stop_test: end_of_mp_stop_test:
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
} }
} }

View file

@ -40,7 +40,6 @@ static int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
{ {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
u32 len = 0; u32 len = 0;
u16 attr_len = 0; u16 attr_len = 0;
@ -56,7 +55,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
pstart = pdata_attr; pstart = pdata_attr;
pcur = pdata_attr; pcur = pdata_attr;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); plist = get_next(phead);
@ -120,7 +119,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
pstart = pcur; pstart = pcur;
} }
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
if (attr_len > 0) if (attr_len > 0)
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr); len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
@ -977,10 +976,9 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
_rtw_memcmp(pwdinfo->p2p_group_ssid, groupid+ETH_ALEN, pwdinfo->p2p_group_ssid_len)) { _rtw_memcmp(pwdinfo->p2p_group_ssid, groupid+ETH_ALEN, pwdinfo->p2p_group_ssid_len)) {
attr_contentlen = 0; attr_contentlen = 0;
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) {
unsigned long irqL;
struct list_head *phead, *plist; struct list_head *phead, *plist;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); plist = get_next(phead);
@ -1000,7 +998,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
status = P2P_STATUS_FAIL_INFO_UNAVAILABLE; status = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
} }
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_unlock(&pstapriv->asoc_list_lock);
} else { } else {
status = P2P_STATUS_FAIL_INVALID_PARAM; status = P2P_STATUS_FAIL_INVALID_PARAM;
} }
@ -1499,7 +1497,6 @@ static void find_phase_handler(struct adapter *padapter)
struct wifidirect_info *pwdinfo = &padapter->wdinfo; struct wifidirect_info *pwdinfo = &padapter->wdinfo;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ndis_802_11_ssid ssid; struct ndis_802_11_ssid ssid;
unsigned long irqL;
_func_enter_; _func_enter_;
@ -1509,8 +1506,8 @@ _func_enter_;
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
_func_exit_; _func_exit_;
@ -1833,13 +1830,12 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
{ {
struct adapter *adapter = (struct adapter *)FunctionContext; struct adapter *adapter = (struct adapter *)FunctionContext;
struct wifidirect_info *pwdinfo = &adapter->wdinfo; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
unsigned long irqL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return; return;
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) {
if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */
@ -1857,7 +1853,7 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
DBG_88E("[%s] p2p_state is %d, ignore!!\n", __func__, rtw_p2p_state(pwdinfo)); DBG_88E("[%s] p2p_state is %d, ignore!!\n", __func__, rtw_p2p_state(pwdinfo));
} }
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
} }
static void find_phase_timer_process(void *FunctionContext) static void find_phase_timer_process(void *FunctionContext)

View file

@ -181,14 +181,13 @@ _func_exit_;
union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue) union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
{ {
unsigned long irqL;
union recv_frame *precvframe; union recv_frame *precvframe;
_enter_critical_bh(&pfree_recv_queue->lock, &irqL); spin_lock(&pfree_recv_queue->lock);
precvframe = _rtw_alloc_recvframe(pfree_recv_queue); precvframe = _rtw_alloc_recvframe(pfree_recv_queue);
_exit_critical_bh(&pfree_recv_queue->lock, &irqL); spin_unlock(&pfree_recv_queue->lock);
return precvframe; return precvframe;
} }
@ -203,7 +202,6 @@ void rtw_init_recvframe(union recv_frame *precvframe, struct recv_priv *precvpri
int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue) int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue)
{ {
unsigned long irqL;
struct adapter *padapter; struct adapter *padapter;
struct recv_priv *precvpriv; struct recv_priv *precvpriv;
@ -217,7 +215,7 @@ _func_enter_;
precvframe->u.hdr.pkt = NULL; precvframe->u.hdr.pkt = NULL;
} }
_enter_critical_bh(&pfree_recv_queue->lock, &irqL); spin_lock(&pfree_recv_queue->lock);
rtw_list_delete(&(precvframe->u.hdr.list)); rtw_list_delete(&(precvframe->u.hdr.list));
@ -230,7 +228,7 @@ _func_enter_;
precvpriv->free_recvframe_cnt++; precvpriv->free_recvframe_cnt++;
} }
_exit_critical_bh(&pfree_recv_queue->lock, &irqL); spin_unlock(&pfree_recv_queue->lock);
_func_exit_; _func_exit_;
@ -260,11 +258,10 @@ _func_exit_;
int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue) int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue)
{ {
int ret; int ret;
unsigned long irqL;
_enter_critical_bh(&queue->lock, &irqL); spin_lock(&queue->lock);
ret = _rtw_enqueue_recvframe(precvframe, queue); ret = _rtw_enqueue_recvframe(precvframe, queue);
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
return ret; return ret;
} }
@ -316,37 +313,36 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter)
int rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue) int rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue)
{ {
unsigned long irqL; spin_lock(&queue->lock);
_enter_critical_bh(&queue->lock, &irqL);
rtw_list_delete(&precvbuf->list); rtw_list_delete(&precvbuf->list);
rtw_list_insert_head(&precvbuf->list, get_list_head(queue)); rtw_list_insert_head(&precvbuf->list, get_list_head(queue));
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
return _SUCCESS; return _SUCCESS;
} }
int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue) int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue)
{ {
unsigned long irqL; unsigned long flags;
_enter_critical_ex(&queue->lock, &irqL);
spin_lock_irqsave(&queue->lock, flags);
rtw_list_delete(&precvbuf->list); rtw_list_delete(&precvbuf->list);
rtw_list_insert_tail(&precvbuf->list, get_list_head(queue)); rtw_list_insert_tail(&precvbuf->list, get_list_head(queue));
_exit_critical_ex(&queue->lock, &irqL); spin_unlock_irqrestore(&queue->lock, flags);
return _SUCCESS; return _SUCCESS;
} }
struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue) struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue)
{ {
unsigned long irqL;
struct recv_buf *precvbuf; struct recv_buf *precvbuf;
struct list_head *plist, *phead; struct list_head *plist, *phead;
unsigned long flags;
_enter_critical_ex(&queue->lock, &irqL); spin_lock_irqsave(&queue->lock, flags);
if (_rtw_queue_empty(queue)) { if (_rtw_queue_empty(queue)) {
precvbuf = NULL; precvbuf = NULL;
@ -360,7 +356,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue)
rtw_list_delete(&precvbuf->list); rtw_list_delete(&precvbuf->list);
} }
_exit_critical_ex(&queue->lock, &irqL); spin_unlock_irqrestore(&queue->lock, flags);
return precvbuf; return precvbuf;
} }
@ -1112,12 +1108,11 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
} }
if ((psta->state&WIFI_SLEEP_STATE) && (pstapriv->sta_dz_bitmap&BIT(psta->aid))) { if ((psta->state&WIFI_SLEEP_STATE) && (pstapriv->sta_dz_bitmap&BIT(psta->aid))) {
unsigned long irqL;
struct list_head *xmitframe_plist, *xmitframe_phead; struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
_enter_critical_bh(&pxmitpriv->lock, &irqL); spin_lock(&pxmitpriv->lock);
xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_phead = get_list_head(&psta->sleep_q);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -1166,7 +1161,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
update_beacon(padapter, _TIM_IE_, NULL, false); update_beacon(padapter, _TIM_IE_, NULL, false);
} }
} }
_exit_critical_bh(&pxmitpriv->lock, &irqL); spin_unlock(&pxmitpriv->lock);
} }
} }
@ -1944,7 +1939,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe) static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe)
{ {
unsigned long irql;
int retval = _SUCCESS; int retval = _SUCCESS;
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl; struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
@ -1985,7 +1979,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
} }
} }
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_lock(&ppending_recvframe_queue->lock);
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
("recv_indicatepkt_reorder: indicate=%d seq=%d\n", ("recv_indicatepkt_reorder: indicate=%d seq=%d\n",
@ -2012,9 +2006,9 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
/* recv_indicatepkts_in_order(padapter, preorder_ctrl, true); */ /* recv_indicatepkts_in_order(padapter, preorder_ctrl, true); */
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, false)) { if (recv_indicatepkts_in_order(padapter, preorder_ctrl, false)) {
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_unlock(&ppending_recvframe_queue->lock);
} else { } else {
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_unlock(&ppending_recvframe_queue->lock);
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer); _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
} }
@ -2024,14 +2018,13 @@ _success_exit:
_err_exit: _err_exit:
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_unlock(&ppending_recvframe_queue->lock);
return _FAIL; return _FAIL;
} }
void rtw_reordering_ctrl_timeout_handler(void *pcontext) void rtw_reordering_ctrl_timeout_handler(void *pcontext)
{ {
unsigned long irql;
struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)pcontext; struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)pcontext;
struct adapter *padapter = preorder_ctrl->padapter; struct adapter *padapter = preorder_ctrl->padapter;
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
@ -2039,12 +2032,12 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
return; return;
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_lock(&ppending_recvframe_queue->lock);
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true) if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true)
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_unlock(&ppending_recvframe_queue->lock);
} }
static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe) static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe)

View file

@ -191,13 +191,12 @@ _func_exit_;
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv); void rtw_mfree_all_stainfo(struct sta_priv *pstapriv);
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
{ {
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
_func_enter_; _func_enter_;
_enter_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_lock(&pstapriv->sta_hash_lock);
phead = get_list_head(&pstapriv->free_sta_queue); phead = get_list_head(&pstapriv->free_sta_queue);
plist = get_next(phead); plist = get_next(phead);
@ -209,7 +208,7 @@ _func_enter_;
rtw_mfree_stainfo(psta); rtw_mfree_stainfo(psta);
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_unlock(&pstapriv->sta_hash_lock);
_func_exit_; _func_exit_;
} }
@ -237,7 +236,6 @@ static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
{ {
unsigned long irql;
struct list_head *phead, *plist; struct list_head *phead, *plist;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct recv_reorder_ctrl *preorder_ctrl; struct recv_reorder_ctrl *preorder_ctrl;
@ -246,7 +244,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
_func_enter_; _func_enter_;
if (pstapriv) { if (pstapriv) {
/* delete all reordering_ctrl_timer */ /* delete all reordering_ctrl_timer */
_enter_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_lock(&pstapriv->sta_hash_lock);
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead); plist = get_next(phead);
@ -262,7 +260,7 @@ _func_enter_;
} }
} }
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_unlock(&pstapriv->sta_hash_lock);
/*===============================*/ /*===============================*/
rtw_mfree_sta_priv_lock(pstapriv); rtw_mfree_sta_priv_lock(pstapriv);
@ -277,7 +275,6 @@ _func_exit_;
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
{ {
unsigned long irql, irql2;
s32 index; s32 index;
struct list_head *phash_list; struct list_head *phash_list;
struct sta_info *psta; struct sta_info *psta;
@ -290,15 +287,15 @@ _func_enter_;
pfree_sta_queue = &pstapriv->free_sta_queue; pfree_sta_queue = &pstapriv->free_sta_queue;
_enter_critical_bh(&(pfree_sta_queue->lock), &irql); spin_lock(&pfree_sta_queue->lock);
if (_rtw_queue_empty(pfree_sta_queue) == true) { if (_rtw_queue_empty(pfree_sta_queue) == true) {
_exit_critical_bh(&(pfree_sta_queue->lock), &irql); spin_unlock(&pfree_sta_queue->lock);
psta = NULL; psta = NULL;
} else { } else {
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list); psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
rtw_list_delete(&(psta->list)); rtw_list_delete(&(psta->list));
_exit_critical_bh(&(pfree_sta_queue->lock), &irql); spin_unlock(&pfree_sta_queue->lock);
_rtw_init_stainfo(psta); _rtw_init_stainfo(psta);
memcpy(psta->hwaddr, hwaddr, ETH_ALEN); memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
index = wifi_mac_hash(hwaddr); index = wifi_mac_hash(hwaddr);
@ -310,13 +307,13 @@ _func_enter_;
} }
phash_list = &(pstapriv->sta_hash[index]); phash_list = &(pstapriv->sta_hash[index]);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql2); spin_lock(&pstapriv->sta_hash_lock);
rtw_list_insert_tail(&psta->hash_list, phash_list); rtw_list_insert_tail(&psta->hash_list, phash_list);
pstapriv->asoc_sta_count++ ; pstapriv->asoc_sta_count++ ;
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql2); spin_unlock(&pstapriv->sta_hash_lock);
/* Commented by Albert 2009/08/13 */ /* Commented by Albert 2009/08/13 */
/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */ /* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */
@ -368,7 +365,6 @@ _func_exit_;
u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
{ {
int i; int i;
unsigned long irql0;
struct __queue *pfree_sta_queue; struct __queue *pfree_sta_queue;
struct recv_reorder_ctrl *preorder_ctrl; struct recv_reorder_ctrl *preorder_ctrl;
struct sta_xmit_priv *pstaxmitpriv; struct sta_xmit_priv *pstaxmitpriv;
@ -384,7 +380,7 @@ _func_enter_;
pstaxmitpriv = &psta->sta_xmitpriv; pstaxmitpriv = &psta->sta_xmitpriv;
_enter_critical_bh(&pxmitpriv->lock, &irql0); spin_lock(&pxmitpriv->lock);
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q); rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
psta->sleepq_len = 0; psta->sleepq_len = 0;
@ -405,7 +401,7 @@ _func_enter_;
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
_exit_critical_bh(&pxmitpriv->lock, &irql0); spin_unlock(&pxmitpriv->lock);
rtw_list_delete(&psta->hash_list); rtw_list_delete(&psta->hash_list);
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("\n free number_%d stainfo with hwaddr=0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2], psta->hwaddr[3], psta->hwaddr[4], psta->hwaddr[5])); RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("\n free number_%d stainfo with hwaddr=0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2], psta->hwaddr[3], psta->hwaddr[4], psta->hwaddr[5]));
@ -419,7 +415,6 @@ _func_enter_;
/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */ /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
for (i = 0; i < 16 ; i++) { for (i = 0; i < 16 ; i++) {
unsigned long irql;
struct list_head *phead, *plist; struct list_head *phead, *plist;
union recv_frame *prframe; union recv_frame *prframe;
struct __queue *ppending_recvframe_queue; struct __queue *ppending_recvframe_queue;
@ -431,7 +426,7 @@ _func_enter_;
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_lock(&ppending_recvframe_queue->lock);
phead = get_list_head(ppending_recvframe_queue); phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead); plist = get_next(phead);
@ -446,7 +441,7 @@ _func_enter_;
rtw_free_recvframe(prframe, pfree_recv_queue); rtw_free_recvframe(prframe, pfree_recv_queue);
} }
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); spin_unlock(&ppending_recvframe_queue->lock);
} }
if (!(psta->state & WIFI_AP_STATE)) if (!(psta->state & WIFI_AP_STATE))
@ -454,12 +449,12 @@ _func_enter_;
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
_enter_critical_bh(&pstapriv->auth_list_lock, &irql0); spin_lock(&pstapriv->auth_list_lock);
if (!rtw_is_list_empty(&psta->auth_list)) { if (!rtw_is_list_empty(&psta->auth_list)) {
rtw_list_delete(&psta->auth_list); rtw_list_delete(&psta->auth_list);
pstapriv->auth_list_cnt--; pstapriv->auth_list_cnt--;
} }
_exit_critical_bh(&pstapriv->auth_list_lock, &irql0); spin_unlock(&pstapriv->auth_list_lock);
psta->expire_to = 0; psta->expire_to = 0;
@ -485,9 +480,9 @@ _func_enter_;
#endif /* CONFIG_88EU_AP_MODE */ #endif /* CONFIG_88EU_AP_MODE */
_enter_critical_bh(&(pfree_sta_queue->lock), &irql0); spin_lock(&pfree_sta_queue->lock);
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue)); rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
_exit_critical_bh(&(pfree_sta_queue->lock), &irql0); spin_unlock(&pfree_sta_queue->lock);
exit: exit:
@ -499,7 +494,6 @@ _func_exit_;
/* free all stainfo which in sta_hash[all] */ /* free all stainfo which in sta_hash[all] */
void rtw_free_all_stainfo(struct adapter *padapter) void rtw_free_all_stainfo(struct adapter *padapter)
{ {
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
s32 index; s32 index;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
@ -511,7 +505,7 @@ _func_enter_;
if (pstapriv->asoc_sta_count == 1) if (pstapriv->asoc_sta_count == 1)
goto exit; goto exit;
_enter_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_lock(&pstapriv->sta_hash_lock);
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
@ -527,7 +521,7 @@ _func_enter_;
} }
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_unlock(&pstapriv->sta_hash_lock);
exit: exit:
@ -537,7 +531,6 @@ _func_exit_;
/* any station allocated can be searched by hash list */ /* any station allocated can be searched by hash list */
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
{ {
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
u32 index; u32 index;
@ -556,7 +549,7 @@ _func_enter_;
index = wifi_mac_hash(addr); index = wifi_mac_hash(addr);
_enter_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_lock(&pstapriv->sta_hash_lock);
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead); plist = get_next(phead);
@ -572,7 +565,7 @@ _func_enter_;
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irql); spin_unlock(&pstapriv->sta_hash_lock);
_func_exit_; _func_exit_;
return psta; return psta;
} }
@ -617,7 +610,6 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
{ {
u8 res = true; u8 res = true;
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct rtw_wlan_acl_node *paclnode; struct rtw_wlan_acl_node *paclnode;
u8 match = false; u8 match = false;
@ -625,7 +617,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
struct __queue *pacl_node_q = &pacl_list->acl_node_q; struct __queue *pacl_node_q = &pacl_list->acl_node_q;
_enter_critical_bh(&(pacl_node_q->lock), &irql); spin_lock(&pacl_node_q->lock);
phead = get_list_head(pacl_node_q); phead = get_list_head(pacl_node_q);
plist = get_next(phead); plist = get_next(phead);
while ((!rtw_end_of_queue_search(phead, plist))) { while ((!rtw_end_of_queue_search(phead, plist))) {
@ -639,7 +631,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
} }
} }
} }
_exit_critical_bh(&(pacl_node_q->lock), &irql); spin_unlock(&pacl_node_q->lock);
if (pacl_list->mode == 1)/* accept unless in deny list */ if (pacl_list->mode == 1)/* accept unless in deny list */
res = (match) ? false : true; res = (match) ? false : true;

View file

@ -1266,14 +1266,14 @@ void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe,
struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
{ {
unsigned long irql;
struct xmit_buf *pxmitbuf = NULL; struct xmit_buf *pxmitbuf = NULL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue; struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
unsigned long flags;
_func_enter_; _func_enter_;
_enter_critical(&pfree_queue->lock, &irql); spin_lock_irqsave(&pfree_queue->lock, flags);
if (_rtw_queue_empty(pfree_queue) == true) { if (_rtw_queue_empty(pfree_queue) == true) {
pxmitbuf = NULL; pxmitbuf = NULL;
@ -1299,7 +1299,7 @@ _func_enter_;
} }
} }
_exit_critical(&pfree_queue->lock, &irql); spin_unlock_irqrestore(&pfree_queue->lock, flags);
_func_exit_; _func_exit_;
@ -1308,22 +1308,22 @@ _func_exit_;
s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
{ {
unsigned long irql;
struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue; struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
unsigned long flags;
_func_enter_; _func_enter_;
if (pxmitbuf == NULL) if (pxmitbuf == NULL)
return _FAIL; return _FAIL;
_enter_critical(&pfree_queue->lock, &irql); spin_lock_irqsave(&pfree_queue->lock, flags);
rtw_list_delete(&pxmitbuf->list); rtw_list_delete(&pxmitbuf->list);
rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_queue)); rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_queue));
pxmitpriv->free_xmit_extbuf_cnt++; pxmitpriv->free_xmit_extbuf_cnt++;
_exit_critical(&pfree_queue->lock, &irql); spin_unlock_irqrestore(&pfree_queue->lock, flags);
_func_exit_; _func_exit_;
@ -1332,16 +1332,16 @@ _func_exit_;
struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
{ {
unsigned long irql;
struct xmit_buf *pxmitbuf = NULL; struct xmit_buf *pxmitbuf = NULL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
unsigned long flags;
_func_enter_; _func_enter_;
/* DBG_88E("+rtw_alloc_xmitbuf\n"); */ /* DBG_88E("+rtw_alloc_xmitbuf\n"); */
_enter_critical(&pfree_xmitbuf_queue->lock, &irql); spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);
if (_rtw_queue_empty(pfree_xmitbuf_queue) == true) { if (_rtw_queue_empty(pfree_xmitbuf_queue) == true) {
pxmitbuf = NULL; pxmitbuf = NULL;
@ -1363,7 +1363,7 @@ _func_enter_;
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
} }
} }
_exit_critical(&pfree_xmitbuf_queue->lock, &irql); spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, flags);
_func_exit_; _func_exit_;
@ -1372,8 +1372,8 @@ _func_exit_;
s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
{ {
unsigned long irql;
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
unsigned long flags;
_func_enter_; _func_enter_;
if (pxmitbuf == NULL) if (pxmitbuf == NULL)
@ -1387,14 +1387,14 @@ _func_enter_;
if (pxmitbuf->ext_tag) { if (pxmitbuf->ext_tag) {
rtw_free_xmitbuf_ext(pxmitpriv, pxmitbuf); rtw_free_xmitbuf_ext(pxmitpriv, pxmitbuf);
} else { } else {
_enter_critical(&pfree_xmitbuf_queue->lock, &irql); spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);
rtw_list_delete(&pxmitbuf->list); rtw_list_delete(&pxmitbuf->list);
rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue)); rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue));
pxmitpriv->free_xmitbuf_cnt++; pxmitpriv->free_xmitbuf_cnt++;
_exit_critical(&pfree_xmitbuf_queue->lock, &irql); spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, flags);
} }
_func_exit_; _func_exit_;
@ -1422,14 +1422,13 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf
pfree_xmit_queue pfree_xmit_queue
*/ */
unsigned long irql;
struct xmit_frame *pxframe = NULL; struct xmit_frame *pxframe = NULL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
_func_enter_; _func_enter_;
_enter_critical_bh(&pfree_xmit_queue->lock, &irql); spin_lock(&pfree_xmit_queue->lock);
if (_rtw_queue_empty(pfree_xmit_queue) == true) { if (_rtw_queue_empty(pfree_xmit_queue) == true) {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt)); RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt));
@ -1464,7 +1463,7 @@ _func_enter_;
pxframe->ack_report = 0; pxframe->ack_report = 0;
} }
_exit_critical_bh(&pfree_xmit_queue->lock, &irql); spin_unlock(&pfree_xmit_queue->lock);
_func_exit_; _func_exit_;
@ -1473,7 +1472,6 @@ _func_exit_;
s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe) s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe)
{ {
unsigned long irql;
struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
struct adapter *padapter = pxmitpriv->adapter; struct adapter *padapter = pxmitpriv->adapter;
struct sk_buff *pndis_pkt = NULL; struct sk_buff *pndis_pkt = NULL;
@ -1485,7 +1483,7 @@ _func_enter_;
goto exit; goto exit;
} }
_enter_critical_bh(&pfree_xmit_queue->lock, &irql); spin_lock(&pfree_xmit_queue->lock);
rtw_list_delete(&pxmitframe->list); rtw_list_delete(&pxmitframe->list);
@ -1499,7 +1497,7 @@ _func_enter_;
pxmitpriv->free_xmitframe_cnt++; pxmitpriv->free_xmitframe_cnt++;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt)); RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt));
_exit_critical_bh(&pfree_xmit_queue->lock, &irql); spin_unlock(&pfree_xmit_queue->lock);
if (pndis_pkt) if (pndis_pkt)
rtw_os_pkt_complete(padapter, pndis_pkt); rtw_os_pkt_complete(padapter, pndis_pkt);
@ -1513,13 +1511,12 @@ _func_exit_;
void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue) void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue)
{ {
unsigned long irql;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct xmit_frame *pxmitframe; struct xmit_frame *pxmitframe;
_func_enter_; _func_enter_;
_enter_critical_bh(&(pframequeue->lock), &irql); spin_lock(&pframequeue->lock);
phead = get_list_head(pframequeue); phead = get_list_head(pframequeue);
plist = get_next(phead); plist = get_next(phead);
@ -1531,7 +1528,7 @@ _func_enter_;
rtw_free_xmitframe(pxmitpriv, pxmitframe); rtw_free_xmitframe(pxmitpriv, pxmitframe);
} }
_exit_critical_bh(&(pframequeue->lock), &irql); spin_unlock(&pframequeue->lock);
_func_exit_; _func_exit_;
} }
@ -1570,7 +1567,6 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, int entry) struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, int entry)
{ {
unsigned long irql0;
struct list_head *sta_plist, *sta_phead; struct list_head *sta_plist, *sta_phead;
struct hw_xmit *phwxmit; struct hw_xmit *phwxmit;
struct tx_servq *ptxservq = NULL; struct tx_servq *ptxservq = NULL;
@ -1591,7 +1587,7 @@ _func_enter_;
inx[j] = pxmitpriv->wmm_para_seq[j]; inx[j] = pxmitpriv->wmm_para_seq[j];
} }
_enter_critical_bh(&pxmitpriv->lock, &irql0); spin_lock(&pxmitpriv->lock);
for (i = 0; i < entry; i++) { for (i = 0; i < entry; i++) {
phwxmit = phwxmit_i + inx[i]; phwxmit = phwxmit_i + inx[i];
@ -1619,7 +1615,7 @@ _func_enter_;
} }
} }
exit: exit:
_exit_critical_bh(&pxmitpriv->lock, &irql0); spin_unlock(&pxmitpriv->lock);
_func_exit_; _func_exit_;
return pxmitframe; return pxmitframe;
} }
@ -1668,7 +1664,6 @@ _func_exit_;
*/ */
s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
{ {
/* unsigned long irql0; */
u8 ac_index; u8 ac_index;
struct sta_info *psta; struct sta_info *psta;
struct tx_servq *ptxservq; struct tx_servq *ptxservq;
@ -1754,7 +1749,6 @@ _func_exit_;
static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
{ {
struct sk_buff *skb = *pskb; struct sk_buff *skb = *pskb;
unsigned long irql;
int res, is_vlan_tag = 0, i, do_nat25 = 1; int res, is_vlan_tag = 0, i, do_nat25 = 1;
unsigned short vlan_hdr = 0; unsigned short vlan_hdr = 0;
void *br_port = NULL; void *br_port = NULL;
@ -1766,7 +1760,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
br_port = rcu_dereference(padapter->pnetdev->br_port); br_port = rcu_dereference(padapter->pnetdev->br_port);
#endif #endif
rcu_read_unlock(); rcu_read_unlock();
_enter_critical_bh(&padapter->br_ext_lock, &irql); spin_lock(&padapter->br_ext_lock);
if (!(skb->data[0] & 1) && br_port && if (!(skb->data[0] & 1) && br_port &&
memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
*((__be16 *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) && *((__be16 *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) &&
@ -1774,7 +1768,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
!memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) { !memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) {
memcpy(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); memcpy(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN);
padapter->scdb_entry->ageing_timer = jiffies; padapter->scdb_entry->ageing_timer = jiffies;
_exit_critical_bh(&padapter->br_ext_lock, &irql); spin_unlock(&padapter->br_ext_lock);
} else { } else {
if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) { if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) {
is_vlan_tag = 1; is_vlan_tag = 1;
@ -1807,7 +1801,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
} }
} }
} }
_exit_critical_bh(&padapter->br_ext_lock, &irql); spin_unlock(&padapter->br_ext_lock);
if (do_nat25) { if (do_nat25) {
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) { if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {
struct sk_buff *newskb; struct sk_buff *newskb;
@ -1934,9 +1928,6 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib
*/ */
s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
{ {
#ifdef CONFIG_88EU_AP_MODE
unsigned long irql0;
#endif
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -1980,12 +1971,12 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
do_queue_select(padapter, &pxmitframe->attrib); do_queue_select(padapter, &pxmitframe->attrib);
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
_enter_critical_bh(&pxmitpriv->lock, &irql0); spin_lock(&pxmitpriv->lock);
if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe)) { if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe)) {
_exit_critical_bh(&pxmitpriv->lock, &irql0); spin_unlock(&pxmitpriv->lock);
return 1; return 1;
} }
_exit_critical_bh(&pxmitpriv->lock, &irql0); spin_unlock(&pxmitpriv->lock);
#endif #endif
if (rtw_hal_xmit(padapter, pxmitframe) == false) if (rtw_hal_xmit(padapter, pxmitframe) == false)
@ -1998,7 +1989,6 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe) int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe)
{ {
unsigned long irql;
int ret = false; int ret = false;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -2024,7 +2014,7 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
} }
if (bmcst) { if (bmcst) {
_enter_critical_bh(&psta->sleep_q.lock, &irql); spin_lock(&psta->sleep_q.lock);
if (pstapriv->sta_dz_bitmap) {/* if any one sta is in ps mode */ if (pstapriv->sta_dz_bitmap) {/* if any one sta is in ps mode */
rtw_list_delete(&pxmitframe->list); rtw_list_delete(&pxmitframe->list);
@ -2041,12 +2031,12 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
ret = true; ret = true;
} }
_exit_critical_bh(&psta->sleep_q.lock, &irql); spin_unlock(&psta->sleep_q.lock);
return ret; return ret;
} }
_enter_critical_bh(&psta->sleep_q.lock, &irql); spin_lock(&psta->sleep_q.lock);
if (psta->state&WIFI_SLEEP_STATE) { if (psta->state&WIFI_SLEEP_STATE) {
u8 wmmps_ac = 0; u8 wmmps_ac = 0;
@ -2094,7 +2084,7 @@ int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fra
} }
} }
_exit_critical_bh(&psta->sleep_q.lock, &irql); spin_unlock(&psta->sleep_q.lock);
return ret; return ret;
} }
@ -2129,7 +2119,6 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc
void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta) void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
{ {
unsigned long irql0;
struct sta_info *psta_bmc; struct sta_info *psta_bmc;
struct sta_xmit_priv *pstaxmitpriv; struct sta_xmit_priv *pstaxmitpriv;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -2140,7 +2129,7 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
/* for BC/MC Frames */ /* for BC/MC Frames */
psta_bmc = rtw_get_bcmc_stainfo(padapter); psta_bmc = rtw_get_bcmc_stainfo(padapter);
_enter_critical_bh(&pxmitpriv->lock, &irql0); spin_lock(&pxmitpriv->lock);
psta->state |= WIFI_SLEEP_STATE; psta->state |= WIFI_SLEEP_STATE;
@ -2163,19 +2152,18 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending); dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending);
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending)); rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
_exit_critical_bh(&pxmitpriv->lock, &irql0); spin_unlock(&pxmitpriv->lock);
} }
void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
{ {
unsigned long irql;
u8 update_mask = 0, wmmps_ac = 0; u8 update_mask = 0, wmmps_ac = 0;
struct sta_info *psta_bmc; struct sta_info *psta_bmc;
struct list_head *xmitframe_plist, *xmitframe_phead; struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
_enter_critical_bh(&psta->sleep_q.lock, &irql); spin_lock(&psta->sleep_q.lock);
xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_phead = get_list_head(&psta->sleep_q);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -2226,10 +2214,10 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
_exit_critical_bh(&psta->sleep_q.lock, &irql); spin_unlock(&psta->sleep_q.lock);
if (rtw_hal_xmit(padapter, pxmitframe)) if (rtw_hal_xmit(padapter, pxmitframe))
rtw_os_xmit_complete(padapter, pxmitframe); rtw_os_xmit_complete(padapter, pxmitframe);
_enter_critical_bh(&psta->sleep_q.lock, &irql); spin_lock(&psta->sleep_q.lock);
} }
if (psta->sleepq_len == 0) { if (psta->sleepq_len == 0) {
@ -2248,7 +2236,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); pstapriv->sta_dz_bitmap &= ~BIT(psta->aid);
} }
_exit_critical_bh(&psta->sleep_q.lock, &irql); spin_unlock(&psta->sleep_q.lock);
/* for BC/MC Frames */ /* for BC/MC Frames */
psta_bmc = rtw_get_bcmc_stainfo(padapter); psta_bmc = rtw_get_bcmc_stainfo(padapter);
@ -2256,7 +2244,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
return; return;
if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0) { /* no any sta in ps mode */ if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0) { /* no any sta in ps mode */
_enter_critical_bh(&psta_bmc->sleep_q.lock, &irql); spin_lock(&psta_bmc->sleep_q.lock);
xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -2276,10 +2264,10 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irql); spin_unlock(&psta_bmc->sleep_q.lock);
if (rtw_hal_xmit(padapter, pxmitframe)) if (rtw_hal_xmit(padapter, pxmitframe))
rtw_os_xmit_complete(padapter, pxmitframe); rtw_os_xmit_complete(padapter, pxmitframe);
_enter_critical_bh(&psta_bmc->sleep_q.lock, &irql); spin_lock(&psta_bmc->sleep_q.lock);
} }
if (psta_bmc->sleepq_len == 0) { if (psta_bmc->sleepq_len == 0) {
@ -2289,7 +2277,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
update_mask |= BIT(1); update_mask |= BIT(1);
} }
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irql); spin_unlock(&psta_bmc->sleep_q.lock);
} }
if (update_mask) if (update_mask)
@ -2298,13 +2286,12 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta) void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta)
{ {
unsigned long irql;
u8 wmmps_ac = 0; u8 wmmps_ac = 0;
struct list_head *xmitframe_plist, *xmitframe_phead; struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
_enter_critical_bh(&psta->sleep_q.lock, &irql); spin_lock(&psta->sleep_q.lock);
xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_phead = get_list_head(&psta->sleep_q);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -2363,7 +2350,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
} }
} }
_exit_critical_bh(&psta->sleep_q.lock, &irql); spin_unlock(&psta->sleep_q.lock);
} }
#endif #endif

View file

@ -444,8 +444,6 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
struct hw_xmit *phwxmit; struct hw_xmit *phwxmit;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct tx_servq *ptxservq = NULL; struct tx_servq *ptxservq = NULL;
unsigned long irql;
struct list_head *xmitframe_plist = NULL, *xmitframe_phead = NULL; struct list_head *xmitframe_plist = NULL, *xmitframe_phead = NULL;
u32 pbuf; /* next pkt address */ u32 pbuf; /* next pkt address */
@ -535,7 +533,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
phwxmit = pxmitpriv->hwxmits + 2; phwxmit = pxmitpriv->hwxmits + 2;
break; break;
} }
_enter_critical_bh(&pxmitpriv->lock, &irql); spin_lock(&pxmitpriv->lock);
xmitframe_phead = get_list_head(&ptxservq->sta_pending); xmitframe_phead = get_list_head(&ptxservq->sta_pending);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
@ -591,7 +589,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
if (_rtw_queue_empty(&ptxservq->sta_pending) == true) if (_rtw_queue_empty(&ptxservq->sta_pending) == true)
rtw_list_delete(&ptxservq->tx_pending); rtw_list_delete(&ptxservq->tx_pending);
_exit_critical_bh(&pxmitpriv->lock, &irql); spin_unlock(&pxmitpriv->lock);
if ((pfirstframe->attrib.ether_type != 0x0806) && if ((pfirstframe->attrib.ether_type != 0x0806) &&
(pfirstframe->attrib.ether_type != 0x888e) && (pfirstframe->attrib.ether_type != 0x888e) &&
(pfirstframe->attrib.ether_type != 0x88b4) && (pfirstframe->attrib.ether_type != 0x88b4) &&
@ -641,14 +639,13 @@ static s32 xmitframe_direct(struct adapter *adapt, struct xmit_frame *pxmitframe
*/ */
static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe) static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
{ {
unsigned long irql;
s32 res; s32 res;
struct xmit_buf *pxmitbuf = NULL; struct xmit_buf *pxmitbuf = NULL;
struct xmit_priv *pxmitpriv = &adapt->xmitpriv; struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
struct pkt_attrib *pattrib = &pxmitframe->attrib; struct pkt_attrib *pattrib = &pxmitframe->attrib;
struct mlme_priv *pmlmepriv = &adapt->mlmepriv; struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
_enter_critical_bh(&pxmitpriv->lock, &irql); spin_lock(&pxmitpriv->lock);
if (rtw_txframes_sta_ac_pending(adapt, pattrib) > 0) if (rtw_txframes_sta_ac_pending(adapt, pattrib) > 0)
goto enqueue; goto enqueue;
@ -660,7 +657,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
if (pxmitbuf == NULL) if (pxmitbuf == NULL)
goto enqueue; goto enqueue;
_exit_critical_bh(&pxmitpriv->lock, &irql); spin_unlock(&pxmitpriv->lock);
pxmitframe->pxmitbuf = pxmitbuf; pxmitframe->pxmitbuf = pxmitbuf;
pxmitframe->buf_addr = pxmitbuf->pbuf; pxmitframe->buf_addr = pxmitbuf->pbuf;
@ -675,7 +672,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
enqueue: enqueue:
res = rtw_xmitframe_enqueue(adapt, pxmitframe); res = rtw_xmitframe_enqueue(adapt, pxmitframe);
_exit_critical_bh(&pxmitpriv->lock, &irql); spin_unlock(&pxmitpriv->lock);
if (res != _SUCCESS) { if (res != _SUCCESS) {
RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("pre_xmitframe: enqueue xmitframe fail\n")); RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("pre_xmitframe: enqueue xmitframe fail\n"));

View file

@ -80,36 +80,6 @@ static inline struct list_head *get_list_head(struct __queue *queue)
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member))) ((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
static inline void _enter_critical(spinlock_t *plock, unsigned long *pirqL)
{
spin_lock_irqsave(plock, *pirqL);
}
static inline void _exit_critical(spinlock_t *plock, unsigned long *pirqL)
{
spin_unlock_irqrestore(plock, *pirqL);
}
static inline void _enter_critical_ex(spinlock_t *plock, unsigned long *pirqL)
{
spin_lock_irqsave(plock, *pirqL);
}
static inline void _exit_critical_ex(spinlock_t *plock, unsigned long *pirqL)
{
spin_unlock_irqrestore(plock, *pirqL);
}
static inline void _enter_critical_bh(spinlock_t *plock, unsigned long *pirqL)
{
spin_lock_bh(plock);
}
static inline void _exit_critical_bh(spinlock_t *plock, unsigned long *pirqL)
{
spin_unlock_bh(plock);
}
static inline int _enter_critical_mutex(struct mutex *pmutex, unsigned long *pirqL) static inline int _enter_critical_mutex(struct mutex *pmutex, unsigned long *pirqL)
{ {
int ret; int ret;

View file

@ -527,48 +527,38 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
*/ */
static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state) static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
{ {
unsigned long irql; spin_lock(&pmlmepriv->lock);
_enter_critical_bh(&pmlmepriv->lock, &irql);
if (check_fwstate(pmlmepriv, state) == true) if (check_fwstate(pmlmepriv, state) == true)
pmlmepriv->fw_state ^= state; pmlmepriv->fw_state ^= state;
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
} }
static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state) static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state)
{ {
unsigned long irql; spin_lock(&pmlmepriv->lock);
_enter_critical_bh(&pmlmepriv->lock, &irql);
_clr_fwstate_(pmlmepriv, state); _clr_fwstate_(pmlmepriv, state);
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
} }
static inline void up_scanned_network(struct mlme_priv *pmlmepriv) static inline void up_scanned_network(struct mlme_priv *pmlmepriv)
{ {
unsigned long irql; spin_lock(&pmlmepriv->lock);
_enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned++; pmlmepriv->num_of_scanned++;
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
} }
static inline void down_scanned_network(struct mlme_priv *pmlmepriv) static inline void down_scanned_network(struct mlme_priv *pmlmepriv)
{ {
unsigned long irql; spin_lock(&pmlmepriv->lock);
_enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
} }
static inline void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val) static inline void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val)
{ {
unsigned long irql; spin_lock(&pmlmepriv->lock);
_enter_critical_bh(&pmlmepriv->lock, &irql);
pmlmepriv->num_of_scanned = val; pmlmepriv->num_of_scanned = val;
_exit_critical_bh(&pmlmepriv->lock, &irql); spin_unlock(&pmlmepriv->lock);
} }
u16 rtw_get_capability(struct wlan_bssid_ex *bss); u16 rtw_get_capability(struct wlan_bssid_ex *bss);

View file

@ -1108,7 +1108,6 @@ static int rtw_wx_set_wap(struct net_device *dev,
union iwreq_data *awrq, union iwreq_data *awrq,
char *extra) char *extra)
{ {
unsigned long irqL;
uint ret = 0; uint ret = 0;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct sockaddr *temp = (struct sockaddr *)awrq; struct sockaddr *temp = (struct sockaddr *)awrq;
@ -1137,7 +1136,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
} }
authmode = padapter->securitypriv.ndisauthtype; authmode = padapter->securitypriv.ndisauthtype;
_enter_critical_bh(&queue->lock, &irqL); spin_lock(&queue->lock);
phead = get_list_head(queue); phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = get_next(phead);
@ -1156,14 +1155,14 @@ static int rtw_wx_set_wap(struct net_device *dev,
if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN))) { if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN))) {
if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) { if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) {
ret = -1; ret = -1;
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
goto exit; goto exit;
} }
break; break;
} }
} }
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
rtw_set_802_11_authentication_mode(padapter, authmode); rtw_set_802_11_authentication_mode(padapter, authmode);
/* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */ /* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */
@ -1248,7 +1247,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT]; struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
unsigned long irqL;
#ifdef CONFIG_88EU_P2P #ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_88EU_P2P */ #endif /* CONFIG_88EU_P2P */
@ -1321,11 +1319,11 @@ _func_enter_;
DBG_88E("IW_SCAN_THIS_ESSID, ssid =%s, len =%d\n", req->essid, req->essid_len); DBG_88E("IW_SCAN_THIS_ESSID, ssid =%s, len =%d\n", req->essid, req->essid_len);
_enter_critical_bh(&pmlmepriv->lock, &irqL); spin_lock(&pmlmepriv->lock);
_status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0); _status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
_exit_critical_bh(&pmlmepriv->lock, &irqL); spin_unlock(&pmlmepriv->lock);
} else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
DBG_88E("rtw_wx_set_scan, req->scan_type == IW_SCAN_TYPE_PASSIVE\n"); DBG_88E("rtw_wx_set_scan, req->scan_type == IW_SCAN_TYPE_PASSIVE\n");
} }
@ -1392,7 +1390,6 @@ _func_exit_;
static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -1440,7 +1437,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
break; break;
} }
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -1463,7 +1460,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
wrqu->data.length = ev-extra; wrqu->data.length = ev-extra;
wrqu->data.flags = 0; wrqu->data.flags = 0;
@ -1482,7 +1479,6 @@ static int rtw_wx_set_essid(struct net_device *dev,
struct iw_request_info *a, struct iw_request_info *a,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
unsigned long irqL;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct __queue *queue = &pmlmepriv->scanned_queue; struct __queue *queue = &pmlmepriv->scanned_queue;
@ -1532,7 +1528,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
src_ssid = ndis_ssid.Ssid; src_ssid = ndis_ssid.Ssid;
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid)); RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid));
_enter_critical_bh(&queue->lock, &irqL); spin_lock(&queue->lock);
phead = get_list_head(queue); phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = get_next(phead);
@ -1566,14 +1562,14 @@ static int rtw_wx_set_essid(struct net_device *dev,
if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) { if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) {
ret = -1; ret = -1;
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
goto exit; goto exit;
} }
break; break;
} }
} }
_exit_critical_bh(&queue->lock, &irqL); spin_unlock(&queue->lock);
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
("set ssid: set_802_11_auth. mode =%d\n", authmode)); ("set ssid: set_802_11_auth. mode =%d\n", authmode));
rtw_set_802_11_authentication_mode(padapter, authmode); rtw_set_802_11_authentication_mode(padapter, authmode);
@ -2574,7 +2570,6 @@ static int rtw_get_ap_info(struct net_device *dev,
{ {
int ret = 0; int ret = 0;
u32 cnt = 0, wpa_ielen; u32 cnt = 0, wpa_ielen;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
unsigned char *pbuf; unsigned char *pbuf;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
@ -2609,7 +2604,7 @@ static int rtw_get_ap_info(struct net_device *dev,
goto exit; goto exit;
} }
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -2622,7 +2617,7 @@ static int rtw_get_ap_info(struct net_device *dev,
if (hwaddr_aton_i(data, bssid)) { if (hwaddr_aton_i(data, bssid)) {
DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data); DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
return -EINVAL; return -EINVAL;
} }
@ -2646,7 +2641,7 @@ static int rtw_get_ap_info(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (pdata->length >= 34) { if (pdata->length >= 34) {
if (copy_to_user(pdata->pointer+32, (u8 *)&pdata->flags, 1)) { if (copy_to_user(pdata->pointer+32, (u8 *)&pdata->flags, 1)) {
@ -3091,7 +3086,6 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
int jj, kk; int jj, kk;
u8 peerMACStr[17] = {0x00}; u8 peerMACStr[17] = {0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3113,7 +3107,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]); peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3143,7 +3137,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (!blnMatch) if (!blnMatch)
sprintf(attr_content_str, "\n\nM = 0000"); sprintf(attr_content_str, "\n\nM = 0000");
@ -3163,7 +3157,6 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
int jj, kk; int jj, kk;
u8 peerMACStr[17] = {0x00}; u8 peerMACStr[17] = {0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3186,7 +3179,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]); peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3227,7 +3220,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (!blnMatch) if (!blnMatch)
sprintf(go_devadd_str, "\n\ndev_add = NULL"); sprintf(go_devadd_str, "\n\ndev_add = NULL");
@ -3250,7 +3243,6 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
int jj, kk; int jj, kk;
u8 peerMACStr[17] = {0x00}; u8 peerMACStr[17] = {0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3271,7 +3263,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]); peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3308,7 +3300,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (!blnMatch) if (!blnMatch)
sprintf(dev_type_str, "\n\nN = 00"); sprintf(dev_type_str, "\n\nN = 00");
@ -3330,7 +3322,6 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
int jj, kk; int jj, kk;
u8 peerMACStr[17] = {0x00}; u8 peerMACStr[17] = {0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3351,7 +3342,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]); peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3380,7 +3371,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (!blnMatch) if (!blnMatch)
sprintf(dev_name_str, "\n\nN = 0000"); sprintf(dev_name_str, "\n\nN = 0000");
@ -3400,7 +3391,6 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
int jj, kk; int jj, kk;
u8 peerMACStr[17] = {0x00}; u8 peerMACStr[17] = {0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3423,7 +3413,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]); peerMAC[jj] = key_2char2num(peerMACStr[kk], peerMACStr[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3455,7 +3445,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (!blnMatch) { if (!blnMatch) {
sprintf(inv_proc_str, "\nIP =-1"); sprintf(inv_proc_str, "\nIP =-1");
@ -3480,7 +3470,6 @@ static int rtw_p2p_connect(struct net_device *dev,
u8 peerMAC[ETH_ALEN] = {0x00}; u8 peerMAC[ETH_ALEN] = {0x00};
int jj, kk; int jj, kk;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long irqL;
struct list_head *plist, *phead; struct list_head *plist, *phead;
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
@ -3506,7 +3495,7 @@ static int rtw_p2p_connect(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(extra[kk], extra[kk + 1]); peerMAC[jj] = key_2char2num(extra[kk], extra[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3524,7 +3513,7 @@ static int rtw_p2p_connect(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (uintPeerChannel) { if (uintPeerChannel) {
_rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); _rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info));
@ -3569,7 +3558,6 @@ static int rtw_p2p_invite_req(struct net_device *dev,
u8 attr_content[50] = {0x00}; u8 attr_content[50] = {0x00};
u8 *p2pie; u8 *p2pie;
uint p2pielen = 0, attr_contentlen = 0; uint p2pielen = 0, attr_contentlen = 0;
unsigned long irqL;
struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info; struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info;
/* The input data contains two informations. */ /* The input data contains two informations. */
@ -3602,7 +3590,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
pinvite_req_info->peer_macaddr[jj] = key_2char2num(extra[kk], extra[kk + 1]); pinvite_req_info->peer_macaddr[jj] = key_2char2num(extra[kk], extra[kk + 1]);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3639,7 +3627,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (uintPeerChannel) { if (uintPeerChannel) {
/* Store the GO's bssid */ /* Store the GO's bssid */
@ -3712,7 +3700,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
u8 attr_content[100] = {0x00}; u8 attr_content[100] = {0x00};
u8 *p2pie; u8 *p2pie;
uint p2pielen = 0, attr_contentlen = 0; uint p2pielen = 0, attr_contentlen = 0;
unsigned long irqL;
/* The input data contains two informations. */ /* The input data contains two informations. */
/* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */ /* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */
@ -3753,7 +3740,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
return ret; return ret;
} }
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_lock(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = get_next(phead);
@ -3799,7 +3786,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
plist = get_next(plist); plist = get_next(plist);
} }
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); spin_unlock(&pmlmepriv->scanned_queue.lock);
if (uintPeerChannel) { if (uintPeerChannel) {
DBG_88E("[%s] peer channel: %d!\n", __func__, uintPeerChannel); DBG_88E("[%s] peer channel: %d!\n", __func__, uintPeerChannel);
@ -4132,7 +4119,6 @@ static int rtw_dbg_port(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
unsigned long irqL;
int ret = 0; int ret = 0;
u8 major_cmd, minor_cmd; u8 major_cmd, minor_cmd;
u16 arg; u16 arg;
@ -4448,7 +4434,7 @@ static int rtw_dbg_port(struct net_device *dev,
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
DBG_88E("sta_dz_bitmap = 0x%x, tim_bitmap = 0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); DBG_88E("sta_dz_bitmap = 0x%x, tim_bitmap = 0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
#endif #endif
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); spin_lock(&pstapriv->sta_hash_lock);
for (i = 0; i < NUM_STA; i++) { for (i = 0; i < NUM_STA; i++) {
phead = &(pstapriv->sta_hash[i]); phead = &(pstapriv->sta_hash[i]);
@ -4486,7 +4472,7 @@ static int rtw_dbg_port(struct net_device *dev,
} }
} }
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); spin_unlock(&pstapriv->sta_hash_lock);
} }
break; break;
case 0x0c:/* dump rx/tx packet */ case 0x0c:/* dump rx/tx packet */
@ -5251,7 +5237,6 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) static int rtw_del_sta(struct net_device *dev, struct ieee_param *param)
{ {
unsigned long irqL;
int ret = 0; int ret = 0;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
@ -5271,13 +5256,13 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param)
psta = rtw_get_stainfo(pstapriv, param->sta_addr); psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (psta) { if (psta) {
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); spin_lock(&pstapriv->asoc_list_lock);
if (!rtw_is_list_empty(&psta->asoc_list)) { if (!rtw_is_list_empty(&psta->asoc_list)) {
rtw_list_delete(&psta->asoc_list); rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); 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);
associated_clients_update(padapter, updated); associated_clients_update(padapter, updated);
psta = NULL; psta = NULL;
} else { } else {

View file

@ -866,6 +866,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
u8 rtw_init_drv_sw(struct adapter *padapter) u8 rtw_init_drv_sw(struct adapter *padapter)
{ {
u8 ret8 = _SUCCESS; u8 ret8 = _SUCCESS;
unsigned long flags;
_func_enter_; _func_enter_;

View file

@ -186,7 +186,7 @@ _func_enter_;
goto exit; goto exit;
} }
_enter_critical(&pxmitpriv->lock, &irqL); spin_lock_irqsave(&pxmitpriv->lock, irqL);
switch (addr) { switch (addr) {
case VO_QUEUE_INX: case VO_QUEUE_INX:
@ -213,7 +213,7 @@ _func_enter_;
break; break;
} }
_exit_critical(&pxmitpriv->lock, &irqL); spin_unlock_irqrestore(&pxmitpriv->lock, irqL);
purb = pxmitbuf->pxmit_urb[0]; purb = pxmitbuf->pxmit_urb[0];

View file

@ -156,7 +156,6 @@ void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
void rtw_os_xmit_schedule(struct adapter *padapter) void rtw_os_xmit_schedule(struct adapter *padapter)
{ {
unsigned long irql;
struct xmit_priv *pxmitpriv; struct xmit_priv *pxmitpriv;
if (!padapter) if (!padapter)
@ -164,12 +163,12 @@ void rtw_os_xmit_schedule(struct adapter *padapter)
pxmitpriv = &padapter->xmitpriv; pxmitpriv = &padapter->xmitpriv;
_enter_critical_bh(&pxmitpriv->lock, &irql); spin_lock(&pxmitpriv->lock);
if (rtw_txframes_pending(padapter)) if (rtw_txframes_pending(padapter))
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
_exit_critical_bh(&pxmitpriv->lock, &irql); spin_unlock(&pxmitpriv->lock);
} }
static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pkt) static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pkt)
@ -194,13 +193,12 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
{ {
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
unsigned long irql;
struct list_head *phead, *plist; struct list_head *phead, *plist;
struct sk_buff *newskb; struct sk_buff *newskb;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
s32 res; s32 res;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irql); spin_lock(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list; phead = &pstapriv->asoc_list;
plist = get_next(phead); plist = get_next(phead);
@ -230,12 +228,12 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
DBG_88E("%s-%d: skb_copy() failed!\n", __func__, __LINE__); DBG_88E("%s-%d: skb_copy() failed!\n", __func__, __LINE__);
pxmitpriv->tx_drop++; pxmitpriv->tx_drop++;
_exit_critical_bh(&pstapriv->asoc_list_lock, &irql); spin_unlock(&pstapriv->asoc_list_lock);
return false; /* Caller shall tx this multicast frame via normal way. */ return false; /* Caller shall tx this multicast frame via normal way. */
} }
} }
_exit_critical_bh(&pstapriv->asoc_list_lock, &irql); spin_unlock(&pstapriv->asoc_list_lock);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return true; return true;
} }