mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-30 19:06:01 +00:00
rtl8188eu: Remove wrappers around spin_lock_bh and spin_unlock_bh
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
dc4dbd3a7c
commit
c0ef452bab
19 changed files with 389 additions and 604 deletions
|
@ -1502,7 +1502,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
|||
}
|
||||
|
||||
authmode = padapter->securitypriv.ndisauthtype;
|
||||
_enter_critical_bh(&queue->lock, &irqL);
|
||||
spin_lock_bh(&queue->lock);
|
||||
phead = get_list_head(queue);
|
||||
pmlmepriv->pscanned = get_next(phead);
|
||||
|
||||
|
@ -1524,7 +1524,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
|||
if(!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode))
|
||||
{
|
||||
ret = -1;
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
spin_unlock_bh(&queue->lock);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
|||
}
|
||||
|
||||
}
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
spin_unlock_bh(&queue->lock);
|
||||
|
||||
rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
/* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */
|
||||
|
@ -1721,11 +1721,11 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
DBG_871X("IW_SCAN_THIS_ESSID, ssid=%s, len=%d\n", req->essid, req->essid_len);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
||||
_status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
|
||||
}
|
||||
else if (req->scan_type == IW_SCAN_TYPE_PASSIVE)
|
||||
|
@ -1876,7 +1876,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
return -EAGAIN;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -1905,7 +1905,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
wrqu->data.length = ev-extra;
|
||||
wrqu->data.flags = 0;
|
||||
|
@ -2004,7 +2004,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
|||
src_ssid = ndis_ssid.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_bh(&queue->lock);
|
||||
phead = get_list_head(queue);
|
||||
pmlmepriv->pscanned = get_next(phead);
|
||||
|
||||
|
@ -2041,18 +2041,17 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
|||
if (rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode) == false)
|
||||
{
|
||||
ret = -1;
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
spin_unlock_bh(&queue->lock);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&queue->lock, &irqL);
|
||||
spin_unlock_bh(&queue->lock);
|
||||
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
|
||||
("set ssid: set_802_11_auth. mode=%d\n", authmode));
|
||||
rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
/* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */
|
||||
if (rtw_set_802_11_ssid(padapter, &ndis_ssid) == false) {
|
||||
ret = -1;
|
||||
goto exit;
|
||||
|
@ -3262,7 +3261,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -3279,7 +3278,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
|||
if(hwaddr_aton_i(data, bssid))
|
||||
{
|
||||
DBG_871X("Invalid BSSID '%s'.\n", (u8*)data);
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -3308,7 +3307,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if(pdata->length>=34) {
|
||||
if(copy_to_user((u8 __user *)pdata->pointer+32, (u8*)&pdata->flags, 1)) {
|
||||
|
@ -3862,7 +3861,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
|
|||
|
||||
macstr2num(peerMAC, subcmd);
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -3896,18 +3895,15 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if (!blnMatch)
|
||||
{
|
||||
sprintf(attr_content_str, "\n\nM=0000");
|
||||
}
|
||||
|
||||
wrqu->data.length = strlen(attr_content_str);
|
||||
memcpy(extra, attr_content_str, wrqu->data.length);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
|
@ -3998,7 +3994,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
|
|||
|
||||
macstr2num(peerMAC, subcmd);
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4045,13 +4041,11 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if (!blnMatch)
|
||||
{
|
||||
if (!blnMatch) {
|
||||
sprintf(go_devadd_str, "\n\ndev_add=NULL");
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
sprintf(go_devadd_str, "\n\ndev_add=%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
|
||||
attr_content[0], attr_content[1], attr_content[2], attr_content[3], attr_content[4], attr_content[5]);
|
||||
}
|
||||
|
@ -4090,7 +4084,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
|
|||
|
||||
macstr2num(peerMAC, subcmd);
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4127,18 +4121,15 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if (!blnMatch)
|
||||
{
|
||||
sprintf(dev_type_str, "\n\nN=00");
|
||||
}
|
||||
|
||||
wrqu->data.length = strlen(dev_type_str);
|
||||
memcpy(extra, dev_type_str, wrqu->data.length);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_get_device_name(struct net_device *dev,
|
||||
|
@ -4168,7 +4159,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
|
|||
|
||||
macstr2num(peerMAC, subcmd);
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4201,18 +4192,15 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if (!blnMatch)
|
||||
{
|
||||
sprintf(dev_name_str, "\n\nN=0000");
|
||||
}
|
||||
|
||||
wrqu->data.length = strlen(dev_name_str);
|
||||
memcpy(extra, dev_name_str, wrqu->data.length);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
||||
|
@ -4242,7 +4230,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
|||
|
||||
macstr2num(peerMAC, subcmd);
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4281,27 +4269,21 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if (!blnMatch)
|
||||
{
|
||||
if (!blnMatch) {
|
||||
sprintf(inv_proc_str, "\nIP=-1");
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
if (attr_content[0] && 0x20)
|
||||
{
|
||||
sprintf(inv_proc_str, "\nIP=1");
|
||||
} else
|
||||
{
|
||||
else
|
||||
sprintf(inv_proc_str, "\nIP=0");
|
||||
}
|
||||
}
|
||||
|
||||
wrqu->data.length = strlen(inv_proc_str);
|
||||
memcpy(extra, inv_proc_str, wrqu->data.length);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_connect(struct net_device *dev,
|
||||
|
@ -4347,7 +4329,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
peerMAC[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] );
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4368,7 +4350,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if ( uintPeerChannel ) {
|
||||
memset( &pwdinfo->nego_req_info, 0x00, sizeof( struct tx_nego_req_info ) );
|
||||
|
@ -4462,7 +4444,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
pinvite_req_info->peer_macaddr[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] );
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4508,7 +4490,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if ( uintPeerChannel )
|
||||
|
@ -4754,7 +4736,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
|||
peerMAC[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] );
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -4802,7 +4784,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
|||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
printk( "[%s] channel = %d\n", __FUNCTION__, uintPeerChannel );
|
||||
|
||||
if ( uintPeerChannel )
|
||||
|
@ -5087,7 +5069,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
return( ret );
|
||||
}
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
|
@ -5144,7 +5126,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
plist = get_next(plist);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||
|
||||
if ( uintPeerChannel )
|
||||
{
|
||||
|
@ -6006,7 +5988,7 @@ static int rtw_dbg_port(struct net_device *dev,
|
|||
#ifdef CONFIG_AP_MODE
|
||||
DBG_871X("sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
|
||||
#endif
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
spin_lock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
|
@ -6055,7 +6037,7 @@ static int rtw_dbg_port(struct net_device *dev,
|
|||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -6065,7 +6047,7 @@ static int rtw_dbg_port(struct net_device *dev,
|
|||
int i, j;
|
||||
_list *plist, *phead;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
spin_lock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
|
@ -6105,7 +6087,7 @@ static int rtw_dbg_port(struct net_device *dev,
|
|||
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
@ -7016,31 +6998,14 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
|
||||
if(psta)
|
||||
{
|
||||
DBG_871X("rtw_add_sta(), free has been added psta=%p\n", psta);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
|
||||
psta = NULL;
|
||||
}
|
||||
*/
|
||||
/* psta = rtw_alloc_stainfo(pstapriv, param->sta_addr); */
|
||||
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
|
||||
if(psta)
|
||||
{
|
||||
int flags = param->u.add_sta.flags;
|
||||
|
||||
/* DBG_871X("rtw_add_sta(), init sta's variables, psta=%p\n", psta); */
|
||||
|
||||
psta->aid = param->u.add_sta.aid;/* aid=1~2007 */
|
||||
|
||||
memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16);
|
||||
|
||||
|
||||
/* check wmm cap. */
|
||||
if(WLAN_STA_WME&flags)
|
||||
psta->qos_option = 1;
|
||||
|
@ -7105,17 +7070,14 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param)
|
|||
{
|
||||
u8 updated;
|
||||
|
||||
/* DBG_871X("free psta=%p, aid=%d\n", psta, psta->aid); */
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock_bh(&pstapriv->asoc_list_lock);
|
||||
if(rtw_is_list_empty(&psta->asoc_list)==false)
|
||||
{
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
pstapriv->asoc_list_cnt--;
|
||||
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
spin_lock_bh(&pstapriv->asoc_list_lock);
|
||||
|
||||
associated_clients_update(padapter, updated);
|
||||
|
||||
|
@ -9083,9 +9045,9 @@ static s32 createpseudoadhoc(struct adapter *padapter)
|
|||
rtw_update_registrypriv_dev_network(padapter);
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
|
||||
{
|
||||
struct wlan_network *pcur_network;
|
||||
|
@ -9142,9 +9104,9 @@ static struct xmit_frame* createloopbackpkt(struct adapter *padapter, u32 size)
|
|||
pframe->padapter = padapter;
|
||||
|
||||
/* 2 2. allocate xmit buffer */
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
spin_lock_bh(&pxmitpriv->lock);
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
if (pxmitbuf == NULL) {
|
||||
rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue