当前位置: 首页>>代码示例>>C++>>正文


C++ rtw_disassoc_cmd函数代码示例

本文整理汇总了C++中rtw_disassoc_cmd函数的典型用法代码示例。如果您正苦于以下问题:C++ rtw_disassoc_cmd函数的具体用法?C++ rtw_disassoc_cmd怎么用?C++ rtw_disassoc_cmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rtw_disassoc_cmd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rtw_set_802_11_disassociate

u8 rtw_set_802_11_disassociate(_adapter *padapter)
{
	_irqL irqL;
	struct mlme_priv * pmlmepriv = &padapter->mlmepriv;

_func_enter_;

	_enter_critical_bh(&pmlmepriv->lock, &irqL);

	if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
	{
		RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));

		rtw_disassoc_cmd(padapter, 0, true);
		rtw_indicate_disconnect(padapter);
		rtw_free_assoc_resources(padapter, 1);
		rtw_pwr_wakeup(padapter);
	}

	_exit_critical_bh(&pmlmepriv->lock, &irqL);

_func_exit_;

	return true;
}
开发者ID:tivolist,项目名称:rtl8188eu,代码行数:25,代码来源:rtw_ioctl_set.c

示例2: rtw_set_802_11_disassociate

u8 rtw_set_802_11_disassociate(_adapter *padapter)
{
	_irqL irqL;
	struct mlme_priv * pmlmepriv = &padapter->mlmepriv;

_func_enter_;

	_enter_critical_bh(&pmlmepriv->lock, &irqL);

	if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
	{
		RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));

		rtw_disassoc_cmd(padapter, 0, _TRUE);
		rtw_indicate_disconnect(padapter);
		//modify for CONFIG_IEEE80211W, none 11w can use it
		rtw_free_assoc_resources_cmd(padapter);
	}

	_exit_critical_bh(&pmlmepriv->lock, &irqL);
	
_func_exit_;

	return _TRUE;	
}
开发者ID:digetx,项目名称:rtl8192cu-fixes,代码行数:25,代码来源:rtw_ioctl_set.c

示例3: rtw_usb_if1_deinit

static void rtw_usb_if1_deinit(struct adapter *if1)
{
    struct net_device *pnetdev = if1->pnetdev;
    struct mlme_priv *pmlmepriv = &if1->mlmepriv;

    if (check_fwstate(pmlmepriv, _FW_LINKED))
        rtw_disassoc_cmd(if1, 0, false);

#ifdef CONFIG_88EU_AP_MODE
    free_mlme_ap_info(if1);
#endif

    if (pnetdev) {
        /* will call netdev_close() */
        unregister_netdev(pnetdev);
        rtw_proc_remove_one(pnetdev);
    }
    rtw_cancel_all_timer(if1);

    rtw_dev_unload(if1);
    DBG_88E("+r871xu_dev_remove, hw_init_completed=%d\n",
            if1->hw_init_completed);
    rtw_free_drv_sw(if1);
    if (pnetdev)
        rtw_free_netdev(pnetdev);
}
开发者ID:mikemvk,项目名称:linux-at91,代码行数:26,代码来源:usb_intf.c

示例4: rtw_gspi_if1_deinit

static void rtw_gspi_if1_deinit(PADAPTER if1)
{
	struct net_device *pnetdev = if1->pnetdev;
	struct mlme_priv *pmlmepriv = &if1->mlmepriv;

	if (check_fwstate(pmlmepriv, _FW_LINKED))
		rtw_disassoc_cmd(if1, 0, _FALSE);

#ifdef CONFIG_AP_MODE
	free_mlme_ap_info(if1);
	#ifdef CONFIG_HOSTAPD_MLME
	hostapd_mode_unload(if1);
#endif
#endif

	rtw_cancel_all_timer(if1);

	rtw_dev_unload(if1);
	DBG_871X("+r871xu_dev_remove, hw_init_completed=%d\n", if1->hw_init_completed);

	rtw_handle_dualmac(if1, 0);

#ifdef CONFIG_IOCTL_CFG80211
	if (if1->rtw_wdev)
	{
		//rtw_wdev_unregister(if1->rtw_wdev);
		rtw_wdev_free(if1->rtw_wdev);
	}
#endif

	rtw_free_drv_sw(if1);

	if(pnetdev)
		rtw_free_netdev(pnetdev);
}
开发者ID:KuronekoDungeon,项目名称:stock_firefly-rk3288-kernel,代码行数:35,代码来源:gspi_intf.c

示例5: netdev_close

static int netdev_close(struct net_device *pnetdev)
{
	_adapter *padapter = (_adapter *)netdev_priv(pnetdev);
		
	RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - drv_close\n"));	

	if(padapter->pwrctrlpriv.bInternalAutoSuspend == _TRUE)
	{
		rfpwrstate_check(padapter);
	}

	padapter->net_closed = _TRUE;
/*	if(!padapter->hw_init_completed)
	{
		printk("(1)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);

	padapter->bDriverStopped = _TRUE;   

	rtw_dev_unload(padapter);	
	}
	else*/
	{
		printk("(2)8192cu_drv - drv_close, bup=%d, hw_init_completed=%d\n"
			, padapter->bup
			, padapter->hw_init_completed);

		//s1.
		if(pnetdev)   
     		{
			if (!netif_queue_stopped(pnetdev))
				netif_stop_queue(pnetdev);
     		}
		
#ifndef CONFIG_PLATFORM_ANDROID	
		
		//s2.	
		//s2-1.  issue rtw_disassoc_cmd to fw
		rtw_disassoc_cmd(padapter);	
		//s2-2.  indicate disconnect to os
		rtw_indicate_disconnect(padapter);
		//s2-3. 
	       rtw_free_assoc_resources(padapter);	
		//s2-4.
		rtw_free_network_queue(padapter,_TRUE);	
#endif

	}

	// Close LED
	padapter->ledpriv.LedControlHandler(padapter, LED_CTL_POWER_OFF);

	RT_TRACE(_module_os_intfs_c_,_drv_info_,("-871x_drv - drv_close\n"));
	printk("-871x_drv - drv_close, bup=%d\n", padapter->bup);
	   
	return 0;
	
}
开发者ID:FFTEAM,项目名称:open-duckbox-project-sh4-pingulux-git,代码行数:57,代码来源:os_intfs.c

示例6: netdev_close

int netdev_close(struct net_device *ndev)
{
	struct rtl_priv *rtlpriv = rtl_priv(ndev);
	struct rtl_hal *rtlhal = rtl_hal(rtlpriv);	

	if (rtlpriv->pwrctrlpriv.bInternalAutoSuspend == _TRUE) {
		/*rtw_pwr_wakeup(rtlpriv); */
		if (rtlpriv->pwrctrlpriv.rf_pwrstate == rf_off)
			rtlpriv->pwrctrlpriv.ps_flag = _TRUE;
	}
	rtlpriv->net_closed = _TRUE;

/*	if (!rtlpriv->hw_init_completed)
	{
		DBG_871X("(1)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", rtlpriv->bup, rtlpriv->hw_init_completed);

		rtlpriv->bDriverStopped = _TRUE;

		rtw_dev_unload(rtlpriv);
	}
	else*/
	if (rtlpriv->pwrctrlpriv.rf_pwrstate == rf_on) {
		DBG_871X("(2)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", rtlpriv->bup, rtlpriv->hw_init_completed);

		/* s1. */
		if (ndev) {
			if (!rtw_netif_queue_stopped(ndev))
				rtw_netif_stop_queue(ndev);
		}

		/* s2. */
		LeaveAllPowerSaveMode(rtlpriv);
		rtw_disassoc_cmd(rtlpriv, 500, _FALSE);
		/* s2-2.  indicate disconnect to os */
		rtw_indicate_disconnect(rtlpriv);
		/* s2-3. */
		rtw_free_assoc_resources(rtlpriv, 1);
		/* s2-4. */
		rtw_free_network_queue(rtlpriv, _TRUE);
		/* Close LED */
		rtw_hal_led_control(rtlpriv, LED_CTL_POWER_OFF);
	}

	kfree(rtlhal->pfirmware);
	rtlhal->pfirmware = NULL;

	DBG_871X("-871x_drv - drv_close, bup=%d\n", rtlpriv->bup);

	return 0;

}
开发者ID:directhex,项目名称:rtl8821au-dkms,代码行数:51,代码来源:os_intfs.c

示例7: netdev_close

int netdev_close(struct net_device *pnetdev)
{
	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
	struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);

	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n"));

	if (padapter->pwrctrlpriv.bInternalAutoSuspend) {
		if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
			padapter->pwrctrlpriv.ps_flag = true;
	}
	padapter->net_closed = true;

	if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
		DBG_88E("(2)88eu_drv - drv_close, bup =%d, hw_init_completed =%d\n",
			padapter->bup, padapter->hw_init_completed);

		/* s1. */
		if (pnetdev) {
			if (!rtw_netif_queue_stopped(pnetdev))
				rtw_netif_stop_queue(pnetdev);
		}

		/* s2. */
		LeaveAllPowerSaveMode(padapter);
		rtw_disassoc_cmd(padapter, 500, false);
		/* s2-2.  indicate disconnect to os */
		rtw_indicate_disconnect(padapter);
		/* s2-3. */
		rtw_free_assoc_resources(padapter, 1);
		/* s2-4. */
		rtw_free_network_queue(padapter, true);
		/*  Close LED */
		rtw_led_control(padapter, LED_CTL_POWER_OFF);
	}

	nat25_db_cleanup(padapter);

#ifdef CONFIG_88EU_P2P
	rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);
#endif /* CONFIG_88EU_P2P */

	kfree(dvobj->firmware.szFwBuffer);
	dvobj->firmware.szFwBuffer = NULL;

	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n"));
	DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup);
	return 0;
}
开发者ID:arm13,项目名称:rtl8188eu,代码行数:49,代码来源:os_intfs.c

示例8: netdev_close

int netdev_close(struct net_device *pnetdev)
{
	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
	struct hal_data_8188e *rtlhal = GET_HAL_DATA(padapter);

	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n"));

	if (padapter->pwrctrlpriv.bInternalAutoSuspend) {
		if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
			padapter->pwrctrlpriv.ps_flag = true;
	}
	padapter->net_closed = true;

	if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
		DBG_88E("(2)88eu_drv - drv_close, bup =%d, hw_init_completed =%d\n",
			padapter->bup, padapter->hw_init_completed);

		/* s1. */
		if (pnetdev) {
			if (!rtw_netif_queue_stopped(pnetdev))
				netif_tx_stop_all_queues(pnetdev);
		}

		/* s2. */
		LeaveAllPowerSaveMode(padapter);
		rtw_disassoc_cmd(padapter, 500, false);
		/* s2-2.  indicate disconnect to os */
		rtw_indicate_disconnect(padapter);
		/* s2-3. */
		rtw_free_assoc_resources(padapter, 1);
		/* s2-4. */
		rtw_free_network_queue(padapter, true);
		/*  Close LED */
		rtw_led_control(padapter, LED_CTL_POWER_OFF);
	}

	kfree(rtlhal->pfirmware);
	rtlhal->pfirmware = NULL;

	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n"));
	DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup);
	return 0;
}
开发者ID:383530895,项目名称:linux,代码行数:43,代码来源:os_intfs.c

示例9: rtw_set_802_11_disassociate

u8 rtw_set_802_11_disassociate(struct adapter *padapter)
{
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	spin_lock_bh(&pmlmepriv->lock);

	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
			 ("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));

		rtw_disassoc_cmd(padapter, 0, true);
		rtw_indicate_disconnect(padapter);
		rtw_free_assoc_resources(padapter, 1);
		rtw_pwr_wakeup(padapter);
	}

	spin_unlock_bh(&pmlmepriv->lock);

	return true;
}
开发者ID:Igoretc,项目名称:rtl8188eu,代码行数:20,代码来源:rtw_ioctl_set.c

示例10: rtw_set_802_11_disassociate

u8 rtw_set_802_11_disassociate(struct adapter *padapter)
{
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	spin_lock_bh(&pmlmepriv->lock);

	if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));

		rtw_disassoc_cmd(padapter, 0, true);
		rtw_indicate_disconnect(padapter);
		/* modify for CONFIG_IEEE80211W, none 11w can use it */
		rtw_free_assoc_resources_cmd(padapter);
		if (_FAIL == rtw_pwr_wakeup(padapter))
			DBG_871X("%s(): rtw_pwr_wakeup fail !!!\n", __func__);
	}

	spin_unlock_bh(&pmlmepriv->lock);

	return true;
}
开发者ID:Lyude,项目名称:linux,代码行数:21,代码来源:rtw_ioctl_set.c

示例11: rtw_set_802_11_disassociate

uint8_t rtw_set_802_11_disassociate(struct rtl_priv *rtlpriv)
{
	struct mlme_priv * pmlmepriv = &rtlpriv->mlmepriv;



	spin_lock_bh(&pmlmepriv->lock);

	if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
	{
		rtw_disassoc_cmd(rtlpriv, 0, _TRUE);
		rtw_indicate_disconnect(rtlpriv);
		rtw_free_assoc_resources(rtlpriv, 1);
		rtw_pwr_wakeup(rtlpriv);
	}

	spin_unlock_bh(&pmlmepriv->lock);



	return _TRUE;
}
开发者ID:ssurba,项目名称:rtl8821au,代码行数:22,代码来源:rtw_ioctl_set.c

示例12: rtw_set_802_11_ssid

u8 rtw_set_802_11_ssid(_adapter* padapter, NDIS_802_11_SSID *ssid)
{	
	_irqL irqL;
	u8 status = _TRUE;

	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct wlan_network *pnetwork = &pmlmepriv->cur_network;
	_queue *queue = &pmlmepriv->scanned_queue;

#ifdef PLATFORM_WINDOWS
	LARGE_INTEGER	sys_time;
	u32  diff_time,cur_time ;
#endif

	
_func_enter_;
	
	RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
		 ("+rtw_set_802_11_ssid: ssid=[%s] fw_state=0x%08x\n",
		  ssid->Ssid, get_fwstate(pmlmepriv)));

	if(padapter->hw_init_completed==_FALSE){
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
			 ("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
		return _FALSE;
	}
		
	_enter_critical_bh(&pmlmepriv->lock, &irqL);

	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE) {
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
			 ("Set SSID is not allowed under surveying || adhoc master || under linking\n"));
		status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING);
		goto _Abort_Set_SSID;
	}

	if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == _TRUE)
	{
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
			 ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));

		if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
		    (_rtw_memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) == _TRUE))
		{			
			if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
			{
				RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
					 ("Set SSID is the same ssid, fw_state=0x%08x\n",
					  get_fwstate(pmlmepriv)));

				if(rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
				{				
					//if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again
					rtw_disassoc_cmd(padapter);

					if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
						rtw_indicate_disconnect(padapter);
						
					rtw_free_assoc_resources(padapter);

					if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
						_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
						set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
					}
				}
				else
				{
				       goto _Abort_Set_SSID;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again.
			        }			
			}			
#ifdef CONFIG_LPS
			else {
				lps_ctrl_wk_cmd(padapter, LPS_CTRL_JOINBSS, 1);
			}
#endif
		}
		else
		{
			RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("Set SSID not the same ssid\n"));
			RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_ssid=[%s] len=0x%x\n", ssid->Ssid, (unsigned int)ssid->SsidLength));
			RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("assoc_ssid=[%s] len=0x%x\n", pmlmepriv->assoc_ssid.Ssid, (unsigned int)pmlmepriv->assoc_ssid.SsidLength));

			rtw_disassoc_cmd(padapter);

			if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
				rtw_indicate_disconnect(padapter);
			
			rtw_free_assoc_resources(padapter);

			if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
				_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
				set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
			}
		}		
	}

#ifdef PLATFORM_WINDOWS
	if (padapter->securitypriv.btkip_countermeasure==_TRUE)
	{
		RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_ssid:padapter->securitypriv.btkip_countermeasure==_TRUE\n"));
//.........这里部分代码省略.........
开发者ID:WayWingsDev,项目名称:Gplus_2159_0801,代码行数:101,代码来源:rtw_ioctl_set.c

示例13: rtw_suspend

static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
{
    struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
    struct adapter *padapter = dvobj->if1;
    struct net_device *pnetdev = padapter->pnetdev;
    struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
    struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;

    int ret = 0;
    u32 start_time = jiffies;


    DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);

    if ((!padapter->bup) || (padapter->bDriverStopped) ||
            (padapter->bSurpriseRemoved)) {
        DBG_88E("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
                padapter->bup, padapter->bDriverStopped,
                padapter->bSurpriseRemoved);
        goto exit;
    }

    pwrpriv->bInSuspend = true;
    rtw_cancel_all_timer(padapter);
    LeaveAllPowerSaveMode(padapter);

    _enter_pwrlock(&pwrpriv->lock);
    /* s1. */
    if (pnetdev) {
        netif_carrier_off(pnetdev);
        netif_tx_stop_all_queues(pnetdev);
    }

    /* s2. */
    rtw_disassoc_cmd(padapter, 0, false);

    if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
            check_fwstate(pmlmepriv, _FW_LINKED)) {
        DBG_88E("%s:%d %s(%pM), length:%d assoc_ssid.length:%d\n",
                __func__, __LINE__,
                pmlmepriv->cur_network.network.Ssid.Ssid,
                pmlmepriv->cur_network.network.MacAddress,
                pmlmepriv->cur_network.network.Ssid.SsidLength,
                pmlmepriv->assoc_ssid.SsidLength);

        pmlmepriv->to_roaming = 1;
    }
    /* s2-2.  indicate disconnect to os */
    rtw_indicate_disconnect(padapter);
    /* s2-3. */
    rtw_free_assoc_resources(padapter, 1);
    /* s2-4. */
    rtw_free_network_queue(padapter, true);

    rtw_dev_unload(padapter);
    _exit_pwrlock(&pwrpriv->lock);

    if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
        rtw_indicate_scan_done(padapter, 1);

    if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
        rtw_indicate_disconnect(padapter);

exit:
    DBG_88E("<===  %s return %d.............. in %dms\n", __func__
            , ret, rtw_get_passing_time_ms(start_time));

    return ret;
}
开发者ID:mikemvk,项目名称:linux-at91,代码行数:69,代码来源:usb_intf.c

示例14: rtw_set_802_11_bssid

uint8_t rtw_set_802_11_bssid(struct rtl_priv* rtlpriv, uint8_t *bssid)
{
	uint8_t status=_SUCCESS;

	struct mlme_priv *pmlmepriv = &rtlpriv->mlmepriv;



	DBG_871X_LEVEL(_drv_always_, "set bssid:%pM\n", bssid);

	if ((bssid[0]==0x00 && bssid[1]==0x00 && bssid[2]==0x00 && bssid[3]==0x00 && bssid[4]==0x00 &&bssid[5]==0x00) ||
	    (bssid[0]==0xFF && bssid[1]==0xFF && bssid[2]==0xFF && bssid[3]==0xFF && bssid[4]==0xFF &&bssid[5]==0xFF))
	{
		status = _FAIL;
		goto exit;
	}

	spin_lock_bh(&pmlmepriv->lock);


	DBG_871X("Set BSSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv));
	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
		goto handle_tkip_countermeasure;
	} else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE) {
		goto release_mlme_lock;
	}

	if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == _TRUE)
	{

		if (_rtw_memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) == _TRUE)
		{
			if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE)
				goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again.
		} else {
			rtw_disassoc_cmd(rtlpriv, 0, _TRUE);

			if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
				rtw_indicate_disconnect(rtlpriv);

			rtw_free_assoc_resources(rtlpriv, 1);

			if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
				_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
				set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
			}
		}
	}

handle_tkip_countermeasure:
	//should we add something here...?
	if((status=rtw_handle_tkip_countermeasure(rtlpriv)) == _FAIL)
		goto release_mlme_lock;

	memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
	pmlmepriv->assoc_by_bssid=_TRUE;

	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
		pmlmepriv->to_join = _TRUE;
	}
	else {
		status = rtw_do_join(rtlpriv);
	}

release_mlme_lock:
	spin_unlock_bh(&pmlmepriv->lock);

exit:



	return status;
}
开发者ID:ssurba,项目名称:rtl8821au,代码行数:73,代码来源:rtw_ioctl_set.c

示例15: rtw_set_802_11_infrastructure_mode

/*
rtw_set_802_11_infrastructure_mode(~)
	### NOTE:#### (!!!!)
	MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock and scanned_queue->lock in sequence
*/
u8 rtw_set_802_11_infrastructure_mode(_adapter* padapter, 
	NDIS_802_11_NETWORK_INFRASTRUCTURE networktype)
{
	_irqL irqL;
	struct	mlme_priv	*pmlmepriv = &padapter->mlmepriv;
	struct	wlan_network	*cur_network = &pmlmepriv->cur_network;
	NDIS_802_11_NETWORK_INFRASTRUCTURE* pold_state = &(cur_network->network.InfrastructureMode);
	
_func_enter_;

	RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_notice_,
		 ("+rtw_set_802_11_infrastructure_mode: old=%d new=%d fw_state=0x%08x\n",
		  *pold_state, networktype, get_fwstate(pmlmepriv)));
	
	if(*pold_state != networktype)
	{
		
		RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!"));
		//DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv));

		if(*pold_state==Ndis802_11APMode)
		{		
			//change to other mode from Ndis802_11APMode			
			cur_network->join_res = -1;
			
#ifdef CONFIG_NATIVEAP_MLME
			stop_ap_mode(padapter);
#endif
		}	

		if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
			rtw_disassoc_cmd(padapter, 0, _TRUE);

		if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||
			(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)== _TRUE) )
			rtw_free_assoc_resources(padapter, 0);

		if((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
	       {
			if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
			{		
				rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether  issue dis-assoc_cmd or not
			}
	       }

		*pold_state = networktype;

		_clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
				
		switch(networktype)
		{
			case Ndis802_11IBSS:
				set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
				break;
				
			case Ndis802_11Infrastructure:
				set_fwstate(pmlmepriv, WIFI_STATION_STATE);
				break;
				
			case Ndis802_11APMode:
				set_fwstate(pmlmepriv, WIFI_AP_STATE);
#ifdef CONFIG_NATIVEAP_MLME
				start_ap_mode(padapter);
				//rtw_indicate_connect(padapter);
#endif				
				
				break;

			case Ndis802_11AutoUnknown:
			case Ndis802_11InfrastructureMax:
				break;                        				
		}

		//SecClearAllKeys(adapter);
		
		//RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n",
		//									get_fwstate(pmlmepriv) ));

	}

_func_exit_;

	return _TRUE;
}
开发者ID:digetx,项目名称:rtl8192cu-fixes,代码行数:89,代码来源:rtw_ioctl_set.c


注:本文中的rtw_disassoc_cmd函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。