int  ips_netdrv_open(_adapter *padapter)
{
	int status = _SUCCESS;
	padapter->net_closed = _FALSE;
	DBG_8192C("===> %s.........\n",__FUNCTION__);


	padapter->bDriverStopped = _FALSE;
	padapter->bSurpriseRemoved = _FALSE;
	padapter->bCardDisableWOHSM = _FALSE;
	padapter->bup = _TRUE;

	status = rtw_hal_init(padapter);
	if (status ==_FAIL)
	{
		RT_TRACE(_module_os_intfs_c_,_drv_err_,("ips_netdrv_open(): Can't init h/w!\n"));
		goto netdev_open_error;
	}

	if(padapter->intf_start)
	{
		padapter->intf_start(padapter);
	}

	_set_timer(&padapter->pwrctrlpriv.pwr_state_check_timer, padapter->pwrctrlpriv.pwr_state_check_inverval);
  	_set_timer(&padapter->mlmepriv.dynamic_chk_timer,5000);

	 return _SUCCESS;

netdev_open_error:
	padapter->bup = _FALSE;
	DBG_8192C("-ips_netdrv_open - drv_open failure, bup=%d\n", padapter->bup);

	return _FAIL;
}
Ejemplo n.º 2
0
void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
{
	unsigned long irqL;
	struct mlme_priv *pmlmepriv = &adapter->mlmepriv;

	spin_lock_irqsave(&pmlmepriv->lock, irqL);

	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
		u8 timer_cancelled;

		_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled);

		_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
	}

	if (pmlmepriv->to_join == true) {
		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);

				if (r8712_select_and_join_from_scan(pmlmepriv)
				    == _SUCCESS)
					_set_timer(&pmlmepriv->assoc_timer,
						   MAX_JOIN_TIMEOUT);
				else {
					struct wlan_bssid_ex *pdev_network =
					  &(adapter->registrypriv.dev_network);
					u8 *pibss =
						 adapter->registrypriv.
							dev_network.MacAddress;
					pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
					memset(&pdev_network->Ssid, 0,
						sizeof(struct
						       ndis_802_11_ssid));
					memcpy(&pdev_network->Ssid,
						&pmlmepriv->assoc_ssid,
						sizeof(struct
							 ndis_802_11_ssid));
					r8712_update_registrypriv_dev_network
						(adapter);
					r8712_generate_random_ibss(pibss);
					pmlmepriv->fw_state =
						 WIFI_ADHOC_MASTER_STATE;
					pmlmepriv->to_join = false;
				}
			}
		} else {
			pmlmepriv->to_join = false;
			set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
			if (r8712_select_and_join_from_scan(pmlmepriv) ==
			    _SUCCESS)
				_set_timer(&pmlmepriv->assoc_timer,
					   MAX_JOIN_TIMEOUT);
			else
				_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
		}
	}
	spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
}
static void SwLedBlink5(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	u8 bStopBlinking = false;

	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		SwLedOff(padapter, pLed);
	switch (pLed->CurrLedState) {
	case LED_SCAN_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->CurrLedState = LED_ON;
			pLed->BlinkingLedState = LED_ON;
			if (!pLed->bLedOn)
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_FASTER_INTERVAL_ALPHA);
			pLed->bLedScanBlinkInProgress = false;
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SCAN_INTERVAL_ALPHA);
		}
		break;
	case LED_TXRX_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->CurrLedState = LED_ON;
			pLed->BlinkingLedState = LED_ON;
			if (!pLed->bLedOn)
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_FASTER_INTERVAL_ALPHA);
			pLed->bLedBlinkInProgress = false;
		} else {
			 if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_FASTER_INTERVAL_ALPHA);
		}
		break;
	default:
		break;
	}
}
Ejemplo n.º 4
0
void sreset_start_adapter(_adapter *padapter)
{
	struct mlme_priv	*pmlmepriv = &(padapter->mlmepriv);
	struct xmit_priv	*pxmitpriv = &padapter->xmitpriv;

	if (padapter == NULL)
		return;

	DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));

	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
		sreset_restore_network_status(padapter);
	}

	/* TODO: OS and HCI independent */
	#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI)
	tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
	#endif

	_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);

	if (rtw_netif_queue_stopped(padapter->pnetdev))
		rtw_netif_wake_queue(padapter->pnetdev);

}
Ejemplo n.º 5
0
/*
r8712_sitesurvey_cmd(~)
	### NOTE:#### (!!!!)
	MUST TAKE CARE THAT BEFORE CALLING THIS FUNC,
	 YOU SHOULD HAVE LOCKED pmlmepriv->lock
*/
u8 r8712_sitesurvey_cmd(struct _adapter *padapter,
			struct ndis_802_11_ssid *pssid)
{
	struct cmd_obj	*ph2c;
	struct sitesurvey_parm	*psurveyPara;
	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
	if (ph2c == NULL)
		return _FAIL;
	psurveyPara = kmalloc(sizeof(*psurveyPara), GFP_ATOMIC);
	if (psurveyPara == NULL) {
		kfree(ph2c);
		return _FAIL;
	}
	init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara,
				   GEN_CMD_CODE(_SiteSurvey));
	psurveyPara->bsslimit = cpu_to_le32(48);
	psurveyPara->passive_mode = cpu_to_le32(pmlmepriv->passive_mode);
	psurveyPara->ss_ssidlen = 0;
	memset(psurveyPara->ss_ssid, 0, IW_ESSID_MAX_SIZE + 1);
	if ((pssid != NULL) && (pssid->SsidLength)) {
		memcpy(psurveyPara->ss_ssid, pssid->Ssid, pssid->SsidLength);
		psurveyPara->ss_ssidlen = cpu_to_le32(pssid->SsidLength);
	}
	set_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
	r8712_enqueue_cmd(pcmdpriv, ph2c);
	_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);
	padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY);
	padapter->blnEnableRxFF0Filter = 0;
	return _SUCCESS;
}
Ejemplo n.º 6
0
int  ips_netdrv_open(struct rtl_priv *rtlpriv)
{
	int status = _SUCCESS;
	rtlpriv->net_closed = _FALSE;

	DBG_871X("===> %s.........\n", __FUNCTION__);

	rtlpriv->bDriverStopped = _FALSE;
	rtlpriv->bSurpriseRemoved = _FALSE;
	rtlpriv->bCardDisableWOHSM = _FALSE;
	/* rtlpriv->bup = _TRUE; */

	status = rtw_hal_init(rtlpriv);
	if (status == _FAIL) {
		goto netdev_open_error;
	}

	if (rtlpriv->intf_start) {
		rtlpriv->intf_start(rtlpriv);
	}

	rtw_set_pwr_state_check_timer(&rtlpriv->pwrctrlpriv);
	_set_timer(&rtlpriv->mlmepriv.dynamic_chk_timer, 5000);

	 return _SUCCESS;

netdev_open_error:
	/* rtlpriv->bup = _FALSE; */
	DBG_871X("-ips_netdrv_open - drv_open failure, bup=%d\n", rtlpriv->bup);

	return _FAIL;
}
Ejemplo n.º 7
0
static int  ips_netdrv_open(struct adapter *padapter)
{
	int status = _SUCCESS;
	padapter->net_closed = false;
	DBG_88E("===> %s.........\n", __func__);

	padapter->bDriverStopped = false;
	padapter->bSurpriseRemoved = false;

	status = rtw_hal_init(padapter);
	if (status == _FAIL) {
		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("ips_netdrv_open(): Can't init h/w!\n"));
		goto netdev_open_error;
	}

	if (padapter->intf_start)
		padapter->intf_start(padapter);

	rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
	_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 5000);

	 return _SUCCESS;

netdev_open_error:
	DBG_88E("-ips_netdrv_open - drv_open failure, bup =%d\n", padapter->bup);

	return _FAIL;
}
Ejemplo n.º 8
0
static void _dynamic_check_timer_handlder(void *FunctionContext)
{
	struct adapter *adapter = (struct adapter *)FunctionContext;

	rtw_dynamic_check_timer_handlder(adapter);

	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 9
0
void wdg_timeout_handler (void *FunctionContext)
{
    _adapter *adapter = (_adapter *)FunctionContext;

    _wdg_timeout_handler(adapter);

    _set_timer(&adapter->mlmepriv.wdg_timer, 2000);
}
Ejemplo n.º 10
0
static void wdg_timeout_handler (void *FunctionContext)
{
	struct _adapter *adapter = (struct _adapter *)FunctionContext;

	_r8712_wdg_timeout_handler(adapter);

	_set_timer(&adapter->mlmepriv.wdg_timer, 2000);
}
Ejemplo n.º 11
0
static void sitesurvey_ctrl_handler(void *FunctionContext)
{
	struct _adapter *adapter = (struct _adapter *)FunctionContext;

	_r8712_sitesurvey_ctrl_handler(adapter);
	_set_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
		   3000);
}
Ejemplo n.º 12
0
void __stdcall 
_timer_handle(
		HWND     hwnd,
		UINT     msg,
		UINT_PTR id,
		DWORD    tickcount
	)
{
	int j = 0;
	switch ( id - IDC_TIMER )
	{
		case PROC_TIMER :
		{		
			_update_info_table( FALSE );
		}
		break;

		case MAIN_TIMER :
		{
			EnterCriticalSection( &crit_sect );

			_load_diskdrives( hwnd, &__drives, _list_volumes(0) );
			_update_info_table( FALSE );

			_set_timer( PROC_TIMER, IsWindowVisible(__dlg_act_info), FALSE );
			_refresh_menu( );

			LeaveCriticalSection( &crit_sect );
		}
		break;

		case RAND_TIMER : 
		{
			rnd_reseed_now( );
			_tray_icon(TRUE);
		}
		break;

		case POST_TIMER :
		{
			_set_timer( POST_TIMER, FALSE, FALSE );
			_is_breaking_action( );
		}
		break;
	}
}
Ejemplo n.º 13
0
void _rtw_event_polling_timer_hdl(void *FunctionContext)
{
	_adapter *adapter = (_adapter *)FunctionContext;

	rtw_event_polling_timer_hdl(adapter);
	
	_set_timer(&adapter->mlmepriv.event_polling_timer, 200);
}
Ejemplo n.º 14
0
void r8712_joinbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd)
{
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	if (pcmd->res != H2C_SUCCESS)
		_set_timer(&pmlmepriv->assoc_timer, 1);
	r8712_free_cmd_obj(pcmd);
}
Ejemplo n.º 15
0
void sitesurvey_ctrl_handler(void *FunctionContext)
{
    _adapter *adapter = (_adapter *)FunctionContext;

    _sitesurvey_ctrl_handler(adapter);

    _set_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer, 3000);
}
Ejemplo n.º 16
0
void _dynamic_check_timer_handlder (void *FunctionContext)
{
	_adapter *adapter = (_adapter *)FunctionContext;
		 
	dynamic_check_timer_handlder(adapter);
	
	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 17
0
/*
 *
 * Parameters
 *	rtlpriv
 *	pslv			power state level, only could be PS_STATE_S0 ~ PS_STATE_S4
 *
 */
void rtw_set_rpwm(struct rtl_priv *rtlpriv, uint8_t pslv)
{
	uint8_t	rpwm;
	struct pwrctrl_priv *pwrpriv = &rtlpriv->pwrctrlpriv;



	pslv = PS_STATE(pslv);

	if (_TRUE == pwrpriv->btcoex_rfon) {
		if (pslv < PS_STATE_S4)
			pslv = PS_STATE_S3;
	}

#ifdef CONFIG_LPS_RPWM_TIMER
	if (pwrpriv->brpwmtimeout == _TRUE) {
		DBG_871X("%s: RPWM timeout, force to set RPWM(0x%02X) again!\n", __FUNCTION__, pslv);
	} else
#endif // CONFIG_LPS_RPWM_TIMER
	{
	if ( (pwrpriv->rpwm == pslv)
		)
	{
		return;
	}
	}

	if ((rtlpriv->bSurpriseRemoved == _TRUE)
	   || (rtlpriv->hw_init_completed == _FALSE)) {

		pwrpriv->cpwm = PS_STATE_S4;
		return;
	}

	if (rtlpriv->bDriverStopped == _TRUE) {

		if (pslv < PS_STATE_S2) {
			return;
		}
	}

	rpwm = pslv | pwrpriv->tog;

	pwrpriv->rpwm = pslv;

#ifdef CONFIG_LPS_RPWM_TIMER
	if (rpwm & PS_ACK)
		_set_timer(&pwrpriv->pwr_rpwm_timer, LPS_RPWM_WAIT_MS);
#endif // CONFIG_LPS_RPWM_TIMER

	pwrpriv->tog += 0x80;

	{
		pwrpriv->cpwm = pslv;
	}


}
void pwr_state_check_handler(void *FunctionContext)
{
	_adapter *padapter = (_adapter *)FunctionContext;
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;

#ifdef SUPPORT_HW_RFOFF_DETECTED
	//DBG_8192C("%s...bHWPwrPindetect(%d)\n",__FUNCTION__,padapter->pwrctrlpriv.bHWPwrPindetect);
	if(padapter->pwrctrlpriv.bHWPwrPindetect)
	{
		rtw_ps_cmd(padapter);		
		_set_timer(&padapter->pwrctrlpriv.pwr_state_check_timer, padapter->pwrctrlpriv.pwr_state_check_inverval);
	}	
	else	
#endif
	{
		if(padapter->net_closed == _TRUE)		return;
		//DBG_8192C("%s\n",__FUNCTION__);
		if (	(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) ||
			(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) ||
			(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) ||	
			(check_fwstate(pmlmepriv, _FW_LINKED|_FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)  ||
			(padapter->net_closed == _TRUE)|| (padapter->bup == _FALSE)		
			)
		{	
			//other pwr ctrl....	
			_set_timer(&padapter->pwrctrlpriv.pwr_state_check_timer, padapter->pwrctrlpriv.pwr_state_check_inverval);
		}
		else
		{	
			if((pwrpriv->current_rfpwrstate == rf_on) &&(_FALSE == pwrpriv->bips_processing))
			{	
				pwrpriv->change_rfpwrstate = rf_off;
				pwrctrlpriv->pwr_state_check_cnts = 0;
				DBG_8192C("==>pwr_state_check_handler .fw_state(%x)\n",padapter->mlmepriv.fw_state);				
				rtw_ps_cmd(padapter);				
			}

		}
	}
	


}
Ejemplo n.º 19
0
static void _dynamic_check_timer_handlder(void *FunctionContext)
{
	struct adapter *adapter = (struct adapter *)FunctionContext;

	if (adapter->registrypriv.mp_mode == 1)
		return;
	rtw_dynamic_check_timer_handlder(adapter);
	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 20
0
static void _update_timer(evtimer_t *evtimer)
{
    if (evtimer->events) {
        evtimer_event_t *event = evtimer->events;
        _set_timer(&evtimer->timer, event->offset);
    }
    else {
        xtimer_remove(&evtimer->timer);
    }
}
Ejemplo n.º 21
0
/*
*r8712_indicate_connect: the caller has to lock pmlmepriv->lock
*/
void r8712_indicate_connect(struct _adapter *padapter)
{
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	pmlmepriv->to_join = false;
	set_fwstate(pmlmepriv, _FW_LINKED);
	padapter->ledpriv.LedControlHandler(padapter, LED_CTL_LINK);
	r8712_os_indicate_connect(padapter);
	if (padapter->registrypriv.power_mgnt > PS_MODE_ACTIVE)
		_set_timer(&pmlmepriv->dhcp_timer, 60000);
}
Ejemplo n.º 22
0
void _dynamic_check_timer_handlder (void *FunctionContext)
{
	_adapter *adapter = (_adapter *)FunctionContext;

#if (MP_DRIVER == 1)	
	return;
#endif
	rtw_dynamic_check_timer_handlder(adapter);
	
	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 23
0
void _dynamic_check_timer_handlder (void *FunctionContext)
{
	_adapter *adapter = (_adapter *)FunctionContext;

#if (MP_DRIVER == 1)
	if (adapter->registrypriv.mp_mode == 1 && adapter->mppriv.mp_dm ==0) { //for MP ODM dynamic Tx power tracking
		//DBG_871X("_dynamic_check_timer_handlder mp_dm =0 return \n");
		_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
		return;
	}
#endif

#ifdef CONFIG_CONCURRENT_MODE
	if(adapter->pbuddy_adapter)
		rtw_dynamic_check_timer_handlder(adapter->pbuddy_adapter);
#endif //CONFIG_CONCURRENT_MODE

	rtw_dynamic_check_timer_handlder(adapter);

	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 24
0
void _dynamic_check_timer_handlder (void *FunctionContext)
{
	_adapter *adapter = (_adapter *)FunctionContext;
/* remove for MP power tracking DM.
#if (MP_DRIVER == 1)	
if (adapter->registrypriv.mp_mode == 1)
	return;
#endif
*/
	rtw_dynamic_check_timer_handlder(adapter);
	
	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 25
0
static void _dynamic_check_timer_handlder(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
	_adapter *adapter = (_adapter *)FunctionContext;
#else
	_adapter *adapter = from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
#endif

	rtw_dynamic_check_timer_handlder(adapter);

	_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
Ejemplo n.º 26
0
// 5: channel sensing and report candidate channel
// 6: first time set channel to off channel
// 7: whab go back tp the channel linked with AP, send null data to peer STA as an indication
void _ch_switch_timer_hdl(void *FunctionContext)
{
	struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;

	if(ptdls_sta->option==5){
		_set_workitem(&ptdls_sta->option_workitem);
	}else if(ptdls_sta->option==6){
		issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta, 0);
		_set_timer(&ptdls_sta->base_ch_timer, 500);
	}else if(ptdls_sta->option==7){
		issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta, 0);
	}
}
int  ips_netdrv_open(_adapter *padapter)
{
	int status = _SUCCESS;
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);
	padapter->net_closed = _FALSE;
	printk("%s\n",__FUNCTION__);
	//if(padapter->bup == _FALSE)
    	{    
		padapter->bDriverStopped = _FALSE;
	 	padapter->bSurpriseRemoved = _FALSE;	 
		padapter->bCardDisableWOHSM = _FALSE;
		padapter->bup = _TRUE;        	
	
		status = rtw_hal_init(padapter);		
		if (status ==_FAIL)
		{			
			RT_TRACE(_module_os_intfs_c_,_drv_err_,("_r8192cu_netdrv_open(): Can't init h/w!\n"));
			goto netdev_open_error;
		}
  		

#ifdef CONFIG_USB_HCI	
		if(pHalData->hal_ops.inirp_init == NULL)
		{
			RT_TRACE(_module_os_intfs_c_,_drv_err_,("Initialize dvobjpriv.inirp_init error!!!\n"));
			goto netdev_open_error;	
		}
		else
		{	
			pHalData->hal_ops.inirp_init(padapter);
		}			
#endif

		_set_timer(&padapter->pwrctrlpriv.pwr_state_check_timer, padapter->pwrctrlpriv.pwr_state_check_inverval);
	}		
		
        RT_TRACE(_module_os_intfs_c_,_drv_info_,("-r8192cu_drv - dev_open\n"));
	//printk("-ips_netdrv_open - drv_open, bup=%d\n", padapter->bup);
		
	 return _SUCCESS;

netdev_open_error:

	//padapter->bup = _FALSE;
	
	RT_TRACE(_module_os_intfs_c_,_drv_err_,("-r8192cu_drv - dev_open, fail!\n"));
	//printk("-ips_netdrv_open - drv_open fail, bup=%d\n", padapter->bup);
	
	return _FAIL;
}
Ejemplo n.º 28
0
void _TPK_timer_hdl(void *FunctionContext)
{
	struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;

	ptdls_sta->TPK_count++;
	//TPK_timer set 1000 as default
	//retry timer should set at least 301 sec.
	if(ptdls_sta->TPK_count==TPK_RESEND_COUNT){
		ptdls_sta->TPK_count=0;
		issue_tdls_setup_req(ptdls_sta->padapter, ptdls_sta->hwaddr);
	}
	
	_set_timer(&ptdls_sta->TPK_timer, ptdls_sta->TDLS_PeerKey_Lifetime/TPK_RESEND_COUNT);
}
Ejemplo n.º 29
0
/*
sitesurvey_cmd(~)
	### NOTE:#### (!!!!)
	MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
*/
u8 sitesurvey_cmd(_adapter  *padapter, NDIS_802_11_SSID *pssid)
{
	struct cmd_obj*		ph2c;
	struct sitesurvey_parm*	psurveyPara;
	struct cmd_priv 	*pcmdpriv = &padapter->cmdpriv;
	struct mlme_priv	*pmlmepriv = &padapter->mlmepriv;

_func_enter_;	
	
	ph2c = (struct cmd_obj*)_malloc(sizeof(struct cmd_obj));
	if (ph2c == NULL)
		return _FAIL;

	psurveyPara = (struct sitesurvey_parm*)_malloc(sizeof(struct sitesurvey_parm)); 

	if (psurveyPara == NULL) {
		_mfree((unsigned char*) ph2c, sizeof(struct cmd_obj));
		return _FAIL;
	}

	free_network_queue(padapter);
	RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("\nflush  network queue\n\n"));

	init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey));

	psurveyPara->bsslimit = cpu_to_le32(48);
	psurveyPara->passive_mode = cpu_to_le32(1);
	psurveyPara->ss_ssidlen= cpu_to_le32(0);// pssid->SsidLength;

	if (pssid->SsidLength)
	{
		_memcpy(psurveyPara->ss_ssid, pssid->Ssid, pssid->SsidLength);
		psurveyPara->ss_ssidlen = cpu_to_le32(pssid->SsidLength);
	}
	else
	{
		_memset(psurveyPara->ss_ssid, 0, IW_ESSID_MAX_SIZE + 1);
	}

	set_fwstate(pmlmepriv, _FW_UNDER_SURVEY);

	enqueue_cmd(pcmdpriv, ph2c);

	_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);

_func_exit_;		

	return _SUCCESS;
}
Ejemplo n.º 30
0
// TDLS_DONE_CH_SEN: channel sensing and report candidate channel
// TDLS_OFF_CH: first time set channel to off channel
// TDLS_BASE_CH: when go back to the channel linked with AP, send null data to peer STA as an indication
void _ch_switch_timer_hdl(void *FunctionContext)
{

	struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;
	_adapter *padapter = ptdls_sta->padapter;
	
	if( ptdls_sta->option == TDLS_DONE_CH_SEN ){
		rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_DONE_CH_SEN);
	}else if( ptdls_sta->option == TDLS_OFF_CH ){
		issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta, 0);
		_set_timer(&ptdls_sta->base_ch_timer, 500);
	}else if( ptdls_sta->option == TDLS_BASE_CH){
		issue_nulldata_to_TDLS_peer_STA(ptdls_sta->padapter, ptdls_sta, 0);
	}
}