Пример #1
0
/**
 * \brief Restart the measurement SRV object upon recovery.
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 */
void measurementSRV_restart( TI_HANDLE hMeasurementSRV)
{
    measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_INT32 i;

	/* if a timer is running, stop it */
	if (pMeasurementSRV->bStartStopTimerRunning)
	{
		tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
		pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
	}
	for (i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++)
	{
		if (pMeasurementSRV->bRequestTimerRunning[i])
		{
			tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
			pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
		}
	}


    /* Initialize the state machine */
	/* initialize current state */
	pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;

    /* mark that all timers are not running */
    pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
    for ( i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++ )
    {
        pMeasurementSRV->bRequestTimerRunning[ i ] = TI_FALSE;
    }

}
Пример #2
0
/**
 * \\n
 * \date 17-November-2005\n
 * \brief Handles an unexpected event.\n
 *
 * Function Scope \e Private.\n
 * \param hMeasurementSrv - handle to the measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS actionUnexpected( TI_HANDLE hMeasurementSrv ) 
{
    measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSrv;
    TI_INT32 i;

    TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_SM, ": measurement SRV state machine error, unexpected Event\n");

    if (pMeasurementSRV->bStartStopTimerRunning)
    {
		tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
        pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
    }

    for (i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++)
    {
        if (pMeasurementSRV->bRequestTimerRunning[i])
        {
			tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
            pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
        }
    }

    /* we must clean the old command response CB since they are no longer relevant 
      since the state machine may be corrupted */
    pMeasurementSRV->commandResponseCBFunc = NULL;
    pMeasurementSRV->commandResponseCBObj = NULL;

    /* indicate the unexpected event in the return status */
    pMeasurementSRV->returnStatus = TI_NOK;
    
    return TI_OK;
}
/**
 * \\n
 * \date 09-November-2005\n
 * \brief Notifies the measurement SRV of a FW reset (recovery).\n
 *
 * Function Scope \e Public.\n
 * \param hMacServices - handle to the MacServices object.\n
 */
void MacServices_measurementSRV_FWReset( TI_HANDLE hMacServices )
{
    measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
    TI_INT32 i;

TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Received FW reset indication.\n");

	/* if a timer is running, stop it */
    if (pMeasurementSRV->bStartStopTimerRunning)
    {
        tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
        pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
    }
    for (i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++)
    {
        if (pMeasurementSRV->bRequestTimerRunning[i])
        {
            tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
            pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
        }
    }

    /* change SM state to idle */
    pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;
}
static TI_STATUS selfw_merge_rsnw(void *pData)
{
	conn_t *pConn=(conn_t *)pData;
	paramInfo_t param;

	os_printf("IBSS selfw_merge_rsnw!!!!!!!!!!\n");

	tmr_StopTimer (pConn->hConnTimer);
	siteMgr_join(pConn->hSiteMgr);

	param.paramType = RX_DATA_PORT_STATUS_PARAM;
	param.content.rxDataPortStatus = OPEN_EAPOL;
	rxData_setParam (pConn->hRxData, &param);

	/* Update TxMgmtQueue SM to enable EAPOL packets. */
	txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_EAPOL);

	/*
	 *  Notify that the driver is associated to the supplicant\IP stack.
	 */
	EvHandlerSendEvent (pConn->hEvHandler, IPC_EVENT_ASSOCIATED, NULL, 0);

	return rsn_start (pConn->hRsn);

}
Пример #5
0
static TI_STATUS connInfra_WaitDisconnectToIdle(void *pData)
{
    conn_t          *pConn = (conn_t *)pData;
    EScrResourceId  uResourceIndex;

    /* close all BA sessions */
    TWD_CloseAllBaSessions(pConn->hTWD);

    /* Stop the disconnect timeout timer. */
    tmr_StopTimer (pConn->hConnTimer);

    /*
     * In case of connection failuer we might get here without freeing the SCR.
     */
    for (uResourceIndex = SCR_RESOURCE_SERVING_CHANNEL;
         uResourceIndex < SCR_RESOURCE_NUM_OF_RESOURCES;
         uResourceIndex++)
    {
        if (pConn->scrRequested[ uResourceIndex ] == TI_TRUE)
        {
            scr_clientComplete(pConn->hScr, SCR_CID_CONNECT, uResourceIndex );
            pConn->scrRequested[ uResourceIndex ] = TI_FALSE;
        }
    }

    /*
     * Call the connection lost callback set by the SME or AP_CONN.
     */
    pConn->pConnStatusCB( pConn->connStatCbObj, pConn->smContext.disAssocEventReason, pConn->smContext.disAssocEventStatusCode);

    return TI_OK;
}
Пример #6
0
/**
 * \\n
 * \date 14-November-2005\n
 * \brief called when a measurement FW guard timer expires.
 *
 * Function Scope \e Public.\n
 * \param hMeasuremntSRV - handle to the measurement SRV object.\n
 * \param bTwdInitOccured -   Indicates if TWDriver recovery occured since timer started.\n
 */
void MacServices_measurementSRV_startStopTimerExpired (TI_HANDLE hMeasurementSRV, TI_BOOL bTwdInitOccured)
{
    measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
    TI_INT32 i;

    TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": FW guard timer expired.\n");

    /* mark that the FW guard timer is not running */
    pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;

    /* if any other timer is running - stop it */
    for (i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++)
    {
        if (pMeasurementSRV->bRequestTimerRunning[i])
        {
            tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
            pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
        }
    }

    /* change SM state to idle */
    pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;

    /*Error Reporting - call the centeral error function in the health monitor if a request for measurement was faield*/
    pMeasurementSRV->failureEventFunc(pMeasurementSRV->failureEventObj ,MEASUREMENT_FAILURE);
}
/***********************************************************************
 *                        txCtrlParams_setAdmissionCtrlParams
 ***********************************************************************
DESCRIPTION:    This function is called for add/delete a tspec in order
				to update parameters.

INPUT:			hTxCtrl - handale to the ts data object
				acId - the AC of the tspec
				mediumTime	- tha alocated medium time for this UP 
				minimumPHYRate - the min phy rate to send a packet of this UP
				admFlag - indicate if the its addition or deletion of tspec 

OUTPUT:     None

RETURN:     void
************************************************************************/
TI_STATUS txCtrlParams_setAdmissionCtrlParams(TI_HANDLE hTxCtrl, TI_UINT8 acId, TI_UINT16 mediumTime, 
											  TI_UINT32 minimumPHYRate, TI_BOOL admFlag)
{
	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
	TI_UINT32	i;

	if(admFlag == TI_TRUE) 
	{
		/* tspec added */
		pTxCtrl->mediumTime[acId] = mediumTime;
        pTxCtrl->admissionState[acId] = AC_ADMITTED;
		pTxCtrl->useAdmissionAlgo[acId] = TI_TRUE;
		pTxCtrl->lastCreditCalcTimeStamp[acId] = os_timeStampMs(pTxCtrl->hOs);
		pTxCtrl->credit[acId] = mediumTime;
	}
	else
	{
		/* tspaec deleted */
		pTxCtrl->mediumTime[acId] = 0;
        pTxCtrl->admissionState[acId] = AC_NOT_ADMITTED;
		pTxCtrl->useAdmissionAlgo[acId] = TI_FALSE;
		pTxCtrl->lastCreditCalcTimeStamp[acId] = 0;
		pTxCtrl->credit[acId] = 0;
	}

	/* Update the Tx queues mapping after admission change. */
	txCtrl_UpdateQueuesMapping (hTxCtrl);
	
	/* If the timer was not enabled in registry than we will never set it */
	if (pTxCtrl->bCreditCalcTimerEnabled)
	{
    	/* enable disable credit calculation timer */
    	for (i = 0; i < MAX_NUM_OF_AC; i++)
    	{
    		if (pTxCtrl->useAdmissionAlgo[i])
    		{
    			if (!pTxCtrl->bCreditCalcTimerRunning)
    			{
    				pTxCtrl->bCreditCalcTimerRunning = TI_TRUE;
                    tmr_StartTimer (pTxCtrl->hCreditTimer,
                                    calcCreditFromTimer,
                                    (TI_HANDLE)pTxCtrl,
                                    pTxCtrl->creditCalculationTimeout, 
                                    TI_TRUE);
    			}
    			
    			return TI_OK;
    		}
    	}
    
    	/* in all queues useAdmissionAlgo is not TRUE, so stop timer if running */
        if (pTxCtrl->bCreditCalcTimerRunning)
        {
            tmr_StopTimer (pTxCtrl->hCreditTimer);
            pTxCtrl->bCreditCalcTimerRunning = TI_FALSE;
        }
    }

	return TI_OK;
}
Пример #8
0
/***********************************************************************
 *                        selfWait_to_waitToDisconnCmplt
 ***********************************************************************
DESCRIPTION: 


INPUT:   

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
static TI_STATUS selfWait_to_waitToDisconnCmplt (void *pData)
{
	conn_t      *pConn = (conn_t *)pData;
    paramInfo_t  param;  

    tmr_StopTimer (pConn->hConnTimer);
    
    siteMgr_removeSelfSite(pConn->hSiteMgr);

    /* Update current BSS connection type and mode */
    currBSS_updateConnectedState(pConn->hCurrBss, TI_FALSE, BSS_INDEPENDENT);
    
    /* stop beacon generation  */
    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = CLOSE;
    rxData_setParam(pConn->hRxData, &param);

	/* Update TxMgmtQueue SM to close Tx path. */
	txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_CLOSE);

    /* Start the disconnect complete time out timer.
       Disconect Complete event, which stops the timer. */
    tmr_StartTimer (pConn->hConnTimer, conn_timeout, (TI_HANDLE)pConn, DISCONNECT_TIMEOUT_MSEC, TI_FALSE);

    TWD_CmdFwDisconnect (pConn->hTWD, DISCONNECT_IMMEDIATE, STATUS_UNSPECIFIED);

    return TI_OK;
}
Пример #9
0
/*
 * \brief	Read the command's result
 * 
 * \param  hCmdMbox  - Handle to CmdMbox
 * \return void
 * 
 * \par Description
 * This function is called from FwEvent module uppon receiving command complete interrupt.
 * It issues a read transaction from the mailbox with a CB.
 * 
 * \sa cmdMbox_SendCommand, cmdMbox_TransferComplete
 */
ETxnStatus cmdMbox_CommandComplete (TI_HANDLE hCmdMbox)
{
    TCmdMbox   *pCmdMbox = (TCmdMbox *)hCmdMbox;
    TTxnStruct *pCmdTxn = (TTxnStruct*)&pCmdMbox->aCmdTxn[1].tTxnStruct;
    Command_t  *pCmd = (Command_t*)&pCmdMbox->aCmdTxn[1].tCmdMbox;
    ETxnStatus  rc;

    /* stop the CmdMbox timer */
    tmr_StopTimer(pCmdMbox->hCmdMboxTimer);

    /* Build the command TxnStruct */
    TXN_PARAM_SET(pCmdTxn, TXN_LOW_PRIORITY, TXN_FUNC_ID_WLAN, TXN_DIRECTION_READ, TXN_INC_ADDR)
    /* Applying a CB in case of an async read */
    BUILD_TTxnStruct(pCmdTxn, pCmdMbox->uFwAddr, pCmd, pCmdMbox->uReadLen,(TTxnDoneCb)cmdMbox_TransferComplete, hCmdMbox)
    /* Send the command */
    rc = twIf_Transact(pCmdMbox->hTwIf, pCmdTxn);

    /* In case of a sync read, call the CB directly */
    if (rc == TXN_STATUS_COMPLETE)
    {
        cmdMbox_TransferComplete(hCmdMbox);
    }

    return TXN_STATUS_COMPLETE;
}
TI_STATUS TrafficMonitor_Stop(TI_HANDLE hTrafficMonitor)
{
	TrafficMonitor_t       *pTrafficMonitor = (TrafficMonitor_t*)hTrafficMonitor;
	TrafficAlertElement_t  *AlertElement;

	if (pTrafficMonitor == NULL) {
		return TI_NOK;
	}

	if (pTrafficMonitor->Active) { /*To prevent double call to timer stop*/

		pTrafficMonitor->Active = TI_FALSE;

		pTrafficMonitor->DownTimerEnabled = TI_FALSE;
		tmr_StopTimer (pTrafficMonitor->hTrafficMonTimer);
	}

	/* Set all events state to ALERT_OFF to enable them to "kick" again once after TrafficMonitor is started */
	AlertElement = (TrafficAlertElement_t*)List_GetFirst(pTrafficMonitor->NotificationRegList);

	while (AlertElement) {
		AlertElement->CurrentState = ALERT_OFF;
		AlertElement = (TrafficAlertElement_t*)List_GetNext(pTrafficMonitor->NotificationRegList);
	}

	return TI_OK;
}
Пример #11
0
static void measurementSRVSM_requestMeasureStartResponseCB(TI_HANDLE hMeasurementSRV, TI_UINT32 uMboxStatus)
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_INT32 i;

	TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS = %d\n", uMboxStatus);

	if (uMboxStatus == TI_OK)
	{
		TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS_SUCCESS!\n");

		if ( NULL != pMeasurementSRV->commandResponseCBFunc )
		{
			pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_OK );
		}
	}
	else
	{
		if (uMboxStatus == SG_REJECT_MEAS_SG_ACTIVE)
		{
			TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS_REJECT_MEAS_SG_ACTIVE!\n");
		}

		TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS NOK!!!\n");


		/* if a timer is running, stop it */
		if ( TI_TRUE == pMeasurementSRV->bStartStopTimerRunning )
		{
			TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "***** STOP TIMER 8 *****\n");
			tmr_StopTimer( pMeasurementSRV->hStartStopTimer );
			pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
		}
		for ( i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++ )
		{
			if ( TI_TRUE == pMeasurementSRV->bRequestTimerRunning[ i ] )
			{
				tmr_StopTimer( pMeasurementSRV->hRequestTimer[ i ] );
				pMeasurementSRV->bRequestTimerRunning[ i ] = TI_FALSE;
			}
		}

		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_START_FAILURE );
	}
}
Пример #12
0
/**
*
* mainKeySmReportComplete
*
* \b Description:
*
* Report key complete to the main security SM.
*
* \b ARGS:
*
*  I   - pData - station control block  \n
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_bcastCompleteUcastComplete(struct _mainKeys_t *pMainKeys)
{
	TI_STATUS  status;

    tmr_StopTimer (pMainKeys->hSessionTimer);

	status = pMainKeys->pParent->reportKeysStatus(pMainKeys->pParent, TI_OK);

	return status;
}
Пример #13
0
/**
*
* mainKeySmReportComplete
*
* \b Description:
*
* Report key complete to the main security SM.
*
* \b ARGS:
*
*  I   - pData - station control block  \n
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_ucastCompleteBcastComplete(struct _mainKeys_t *pMainKeys)
{
	TI_STATUS  status;

	tmr_StopTimer (pMainKeys->hSessionTimer);
	pMainKeys->mainKeysTimeoutCounter = TI_FALSE;
	status = pMainKeys->pParent->reportKeysStatus(pMainKeys->pParent, TI_OK);

	return status;
}
TI_STATUS openAuth_smStopTimer(auth_t *hAuth)
{
	if (hAuth == NULL) {
		return TI_NOK;
	}

	tmr_StopTimer (hAuth->hAuthSmTimer);

	return TI_OK;
}
Пример #15
0
/**
*
* mainKeySmReportComplete
*
* \b Description:
*
* Report key complete to the main security SM.
*
* \b ARGS:
*
*  I   - pData - station control block  \n
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_ucastCompleteBcastComplete(struct _mainKeys_t *pMainKeys)
{
	TI_STATUS  status;

    TRACE0(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "mainKeys_ucastCompleteBcastComplete \n");

	tmr_StopTimer (pMainKeys->hSessionTimer);
	pMainKeys->mainKeysTimeoutCounter = TI_FALSE;
	status = pMainKeys->pParent->reportKeysStatus(pMainKeys->pParent, TI_OK);

	return status;
}
Пример #16
0
/**
*
* mainKeySmReportComplete
*
* \b Description:
*
* Report key complete to the main security SM.
*
* \b ARGS:
*
*  I   - pData - station control block  \n
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_bcastCompleteUcastComplete(struct _mainKeys_t *pMainKeys)
{
	TI_STATUS  status;

    TRACE0(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "mainKeys_bcastCompleteUcastComplete - sending Interrogate \n");

    tmr_StopTimer (pMainKeys->hSessionTimer);

	status = pMainKeys->pParent->reportKeysStatus(pMainKeys->pParent, TI_OK);

	return status;
}
Пример #17
0
/**
 * \\n
 * \date 14-November-2005\n
 * \brief callback function used by the HAL for measure stop event (sent when the FW
 * has finished measurement operation, i.e. switched channel to serving channel and changed back RX filters).\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 */
void MacServices_measurementSRV_measureCompleteCB( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;


	/* stop the FW guard timer */
	tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
	pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;

	measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
	                          MSR_SRV_EVENT_STOP_COMPLETE );
}
Пример #18
0
TI_STATUS scanSRVSM_releasePS( TI_HANDLE hScanSrv )
{
      scanSRV_t *pScanSRV = (scanSRV_t*)hScanSrv;
      TI_STATUS psStatus;
    
     /* stop timer */
    if ( TI_TRUE == pScanSRV->bTimerRunning )
    {
        tmr_StopTimer (pScanSRV->hScanSrvTimer);
        pScanSRV->bTimerRunning = TI_FALSE;
    }
  
    /* if exit from driver mode requested, do so */
    if ( TI_TRUE == pScanSRV->bExitFromDriverMode )
    {
        /* here we need to get an answer if we succeeded to exit driver mode */
 
        psStatus = powerSrv_ReleasePS(  pScanSRV->hPowerSrv,
                                pScanSRV->bSendNullData,
                                hScanSrv,
                                MacServices_scanSRV_powerSaveCB);


    }
    else            /* no need to exit PS - send PS_SUCCESS */
    {
        return scanSRVSM_SMEvent( hScanSrv, (scan_SRVSMStates_e*)&pScanSRV->SMState, SCAN_SRV_EVENT_PS_SUCCESS );
    }


    switch (psStatus)
    {
        /* if successful */
    case POWER_SAVE_802_11_IS_CURRENT:
        /* send a PS_SUCCESS event */
        return scanSRVSM_SMEvent( hScanSrv, (scan_SRVSMStates_e*)&pScanSRV->SMState, SCAN_SRV_EVENT_PS_SUCCESS );
        
        /* if pending */
    case POWER_SAVE_802_11_PENDING:
    case TI_OK:
        /* stay in the PS_EXIT state */
        break; 
        
        /* if not successful */
    default:
        
        /* send a PS_FAIL event */
        return scanSRVSM_SMEvent( hScanSrv, (scan_SRVSMStates_e*)&pScanSRV->SMState, SCAN_SRV_EVENT_PS_FAIL );

    }

    return TI_OK;
}
Пример #19
0
/*
 * \brief	Restart the module upon driver stop or restart
 *
 * \param  hCmdMbox  - Handle to CmdMbox
 * \return TI_OK
 *
 * \par Description
 *
 * \sa
 */
TI_STATUS cmdMbox_Restart (TI_HANDLE hCmdMbox)
{
	TCmdMbox   *pCmdMbox = (TCmdMbox *)hCmdMbox;

	/* Stop the timeout timer if running and reset the state */
	tmr_StopTimer (pCmdMbox->hCmdMboxTimer);
	pCmdMbox->bCmdInProgress = TI_FALSE;
	pCmdMbox->uReadLen       = 0;
	pCmdMbox->uWriteLen      = 0;

	return TI_OK;
}
Пример #20
0
/**
 * \\n
 * \date 09-November-2005\n
 * \brief Notifies the measurement SRV of a FW reset (recovery).\n
 *
 * Function Scope \e Public.\n
 * \param hMacServices - handle to the MacServices object.\n
 */
void MacServices_measurementSRV_FWReset( TI_HANDLE hMacServices )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
	TI_INT32 i;


	/* if a timer is running, stop it */
	if (pMeasurementSRV->bStartStopTimerRunning) {
		tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
		pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
	}
	for (i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++) {
		if (pMeasurementSRV->bRequestTimerRunning[i]) {
			tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
			pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
		}
	}

	/* change SM state to idle */
	pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;
}
/**
 * Called when a frame has been received while we are processing another frame.
 * In this case the older frame is discarded and the new frame is processed.
 *
 * @date 05-Jan-2006
 */
static TI_STATUS measurementMgrSM_acFrameReceived_fromProcessingRequest(void * pData)
{
	measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) pData;

	/* Stopping the activationDelay Timer */
	tmr_StopTimer (pMeasurementMgr->hActivationDelayTimer);

	/* Clear Measurement fields */
	measurementMgrSM_resetParams(pMeasurementMgr);

	/* Process New Frame */
	return measurementMgrSM_acFrameReceived_fromIdle(pData);
}
Пример #22
0
/**
 * \\n
 * \date 14-November-2005\n
 * \brief callback function used by the HAL for measure stop event (sent when the FW
 * has finished measurement operation, i.e. switched channel to serving channel and changed back RX filters).\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 */
void MacServices_measurementSRV_measureCompleteCB( TI_HANDLE hMeasurementSRV )
{
    measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;

    TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure complete CB called.\n");

    /* stop the FW guard timer */
    tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
    pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;

    measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
                              MSR_SRV_EVENT_STOP_COMPLETE );
}
Пример #23
0
/**
 * \fn     RxQueue_CloseBaSession ()
 * \brief  Close BA session receiver and pass all packets in the TID queue to upper layer.
 *
 * \note
 * \param  hRxQueue - RxQueue handle.
 * \param  uFrameTid - TID session.
 * \return None
 * \sa
 */
void RxQueue_CloseBaSession(TI_HANDLE hRxQueue, TI_UINT8 uFrameTid)
{
	TRxQueue   *pRxQueue = (TRxQueue *)hRxQueue;
	TI_UINT32   i;


	/* Set the SA Tid pointer */
	TRxQueueTidDataBase *pTidDataBase = &(pRxQueue->tRxQueueArraysMng.tSa1ArrayMng[uFrameTid]);

	/* TID illegal value ? */
	if (uFrameTid >= MAX_NUM_OF_802_1d_TAGS)
	{
		TRACE1(pRxQueue->hReport, REPORT_SEVERITY_ERROR , "RxQueue_CloseBaSession: BA event - DELBA frame with TID value too big, TID = %d\n", uFrameTid);

		return;
	}

	if (pTidDataBase->aTidBaEstablished == TI_TRUE)
	{
		/* Clean BA session */
		pTidDataBase->aTidBaEstablished = TI_FALSE;

		/* Pass all valid entries at the array */
		for (i = 0; (i < RX_QUEUE_ARRAY_SIZE) && (i < RX_QUEUE_WIN_SIZE); i++)
		{
			if (pTidDataBase->aPaketsQueue[pTidDataBase->aWinStartArrayInex].pPacket != NULL)
			{
				RxQueue_PassPacket (pRxQueue,
				                    pTidDataBase->aPaketsQueue[pTidDataBase->aWinStartArrayInex].tStatus,
				                    pTidDataBase->aPaketsQueue[pTidDataBase->aWinStartArrayInex].pPacket);

				pTidDataBase->aPaketsQueue[pTidDataBase->aWinStartArrayInex].pPacket = NULL;

				pRxQueue->tPacketTimeout.aPacketsStored--;
			}

			pTidDataBase->aWinStartArrayInex ++;

			/* aWinStartArrayInex % RX_QUEUE_ARRAY_SIZE */
			pTidDataBase->aWinStartArrayInex &= RX_QUEUE_ARRAY_SIZE_BIT_MASK;
		}

		/* If timer is started - stop it */
		if (pRxQueue->tPacketTimeout.bPacketMiss)
		{
			tmr_StopTimer (pRxQueue->hTimer);
			pRxQueue->tPacketTimeout.bPacketMiss = TI_FALSE;
		}
	}
}
/**
 * Called when the Measurement Manager module has been disable while
 * processing a measurement request.
 *
 * @date 05-Jan-2006
 */
static TI_STATUS measurementMgrSM_acDisable_fromProcessingRequest(void * pData)
{
	measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) pData;

	/* Stopping the activationDelay Timer */
	tmr_StopTimer (pMeasurementMgr->hActivationDelayTimer);

	/* Clear Measurement fields  */
	measurementMgrSM_resetParams(pMeasurementMgr);

	pMeasurementMgr->Enabled = TI_FALSE;

	return TI_OK;
}
/**
 * Called when for some reason we abort while processing a request.
 *
 * @date 05-Jan-2006
 */
static TI_STATUS measurementMgrSM_acAbort_fromProcessingRequest(void * pData)
{
	measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) pData;

	TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Entered\n");

	/* Stopping the activationDelay Timer */
	tmr_StopTimer (pMeasurementMgr->hActivationDelayTimer);

	/* Clear Measurement fields */
	measurementMgrSM_resetParams(pMeasurementMgr);

	return TI_OK;
}
Пример #26
0
/**
 * \\n
 * \date 14-November-2005\n
 * \brief callback function used by the HAL for measure start event (sent when the FW
 * has started measurement operation, i.e. switched channel and changed RX filters).\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 */
void MacServices_measurementSRV_measureStartCB( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t *pMeasurementSRV  = (measurementSRV_t*)hMeasurementSRV;


	/* stop the FW guard timer */
	tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
	pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;

	/* clear the CB function, so that it won't be called on stop as well! */
	pMeasurementSRV->commandResponseCBFunc = NULL;
	pMeasurementSRV->commandResponseCBObj = NULL;

	measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
	                          MSR_SRV_EVENT_START_SUCCESS );
}
Пример #27
0
/***********************************************************************
 *                        selfWait_to_rsnWait
 ***********************************************************************
DESCRIPTION: 


INPUT:   

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
static TI_STATUS selfWait_to_rsnWait (void *pData)
{
	conn_t      *pConn = (conn_t *)pData;
    paramInfo_t  param;

    tmr_StopTimer (pConn->hConnTimer);

    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = OPEN_EAPOL;
    rxData_setParam (pConn->hRxData, &param);

	/* Update TxMgmtQueue SM to enable EAPOL packets. */
	txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_EAPOL);

    return rsn_start (pConn->hRsn);
}
Пример #28
0
/****************************************************************************************
 *                        powerSrv_restart															*
 ****************************************************************************************
DESCRIPTION: Restart the scan SRV module upon recovery.
				-	init the Power server to active state.
				-	call the init function of the state machine.

INPUT:     	- hPowerSrv 			- handle to the PowerSrv object.

OUTPUT:
RETURN:    TI_STATUS - TI_OK on success else TI_NOK.
****************************************************************************************/
TI_STATUS powerSrv_restart(	TI_HANDLE hPowerSrv)
{
    powerSrv_t* pPowerSrv = (powerSrv_t*)hPowerSrv;
    PowerSrvSM_t *pPowerSrvSM = (PowerSrvSM_t*)pPowerSrv->hPowerSrvSM;
    /*
    init PowerSrv state machine.
    */
    /*
    the PowerSrvSM start in active mode (POWER_SRV_STATE_ACTIVE)
    the PowerSrvSM::currentState must be sync with the PowerSrv::desiredPowerModeProfile (POWER_MODE_ACTIVE).
    */
    pPowerSrvSM->currentState = POWER_SRV_STATE_ACTIVE;
    pPowerSrv->currentMode = USER_MODE;
    tmr_StopTimer (pPowerSrvSM->hPwrSrvSmTimer);

    /*init all request with init values*/
    powerSrvCreatePssRequest(hPowerSrv,
                             USER_MODE,
                             HANDLED_REQUEST,
                             POWER_SAVE_OFF,
                             TI_FALSE,
                             NULL,
                             NULL,
                             NULL);
    powerSrvCreatePssRequest(hPowerSrv,
                             DRIVER_MODE,
                             HANDLED_REQUEST,
                             POWER_SAVE_OFF,
                             TI_FALSE,
                             NULL,
                             NULL,
                             NULL);
    pPowerSrv->userLastRequestMode = (powerSrvMode_e)POWER_SAVE_OFF;
    pPowerSrv->pCurrentRequest 	= & pPowerSrv->userRequest;

    /*
    register for Event
    */
    eventMbox_RegisterEvent (pPowerSrv->hEventMbox,
                             TWD_OWN_EVENT_PS_REPORT,
                             (void *)powerSrv802_11PsReport,
                             hPowerSrv);

    eventMbox_UnMaskEvent (pPowerSrv->hEventMbox, TWD_OWN_EVENT_PS_REPORT, NULL, NULL);

    return TI_OK;
}
Пример #29
0
/**
 * \\n
 * \date 17-Jan-2005\n
 * \brief Handles a FW reset event (one that was detected outside the scan SRV) by stopping the timer.
 *
 * Function Scope \e Private.\n
 * \param hScanSrv - handle to the scan SRV object.\n
 * \return TI_OK if successful, TI_NOK otherwise.\n
 */
TI_STATUS scanSRVSM_handleRecovery( TI_HANDLE hScanSrv )
{
    scanSRV_t *pScanSRV = (scanSRV_t*)hScanSrv;

 
    /* The Power Manager is responsible to exit PS mode in recovery. Also, the scan CB is not called - 
       The SCR is responsible to notify scan concentrator of the event (which actually notifies scan SRV */

    /* if timer is running - stop it */
    if ( TI_TRUE == pScanSRV->bTimerRunning )
    {
        tmr_StopTimer (pScanSRV->hScanSrvTimer);
        pScanSRV->bTimerRunning = TI_FALSE;
    }

    return TI_OK;
}
/*-----------------------------------------------------------------------------
Routine Name: TrafficMonitor_ChangeDownTimerStatus
Routine Description: Start or stop down traffic timer according to number of down events found and minInterval time.
Arguments:
Return Value:
-----------------------------------------------------------------------------*/
static void TrafficMonitor_ChangeDownTimerStatus (TI_HANDLE hTrafficMonitor, TI_UINT32 downEventsFound, TI_UINT32 minIntervalTime)
{
	TrafficMonitor_t *pTrafficMonitor = (TrafficMonitor_t*)hTrafficMonitor;

	if ((downEventsFound == 0) && pTrafficMonitor->DownTimerEnabled) {
		pTrafficMonitor->DownTimerEnabled = TI_FALSE;
		tmr_StopTimer (pTrafficMonitor->hTrafficMonTimer);
	} else if ((downEventsFound > 0) && (pTrafficMonitor->DownTimerEnabled == TI_FALSE)) {
		pTrafficMonitor->DownTimerEnabled = TI_TRUE;
		/* Start the timer with user defined percentage of the the minimum interval discovered earlier */
		tmr_StartTimer (pTrafficMonitor->hTrafficMonTimer,
		                TimerMonitor_TimeOut,
		                (TI_HANDLE)pTrafficMonitor,
		                ((minIntervalTime * pTrafficMonitor->trafficDownTestIntervalPercent) / 100),
		                TI_TRUE);
	}
}