示例#1
0
/***********************************************************************
 *                        healthMonitor_sendFailureEvent
 ***********************************************************************
DESCRIPTION:    Entry point for all low level modules to send a failure evrnt

INPUT:          handle - health monitor handle
                failureEvent - the error

OUTPUT:

RETURN:    

************************************************************************/
void healthMonitor_sendFailureEvent (TI_HANDLE hHealthMonitor, EFailureEvent failureEvent)
{
    THealthMonitor *pHealthMonitor = (THealthMonitor*)hHealthMonitor;

    /* Check the recovery process is already running */
    if (pHealthMonitor->failureEvent < MAX_FAILURE_EVENTS)
    {
        TRACE0(pHealthMonitor->hReport, REPORT_SEVERITY_WARNING , ": recovery process is already handling , new trigger is \n");
    }

    /* Recovery is performed only if this trigger is enabled in the .INI file */
    else if (pHealthMonitor->recoveryTriggerEnabled[failureEvent])
    {
        pHealthMonitor->failureEvent = failureEvent;
        /* 
         * NOTE: start timer with minimum expiry (1 msec) for recovery will start
         *       from the top of the stack 
         */
        tmr_StartTimer (pHealthMonitor->hFailTimer,
                        healthMonitor_proccessFailureEvent,
                        (TI_HANDLE)pHealthMonitor,
                        1,
                        TI_FALSE);
    }
    else 
    {
        TRACE0(pHealthMonitor->hReport, REPORT_SEVERITY_ERROR , ": Recovery trigger  is disabled!\n");
    }
}
示例#2
0
/* STOP_MLME, SET_DATA_PORT_CLOSE, DIS_JOIN */
static TI_STATUS mlmeWait_to_WaitDisconnect(void *pData)
{
    TI_STATUS   status;
    paramInfo_t *pParam;
    conn_t      *pConn = (conn_t *)pData;

    status = mlme_stop( pConn->hMlme, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP );
    if (status != TI_OK)
        return status;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = CLOSE;
    rxData_setParam(pConn->hRxData, pParam);


    /* 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);

    /* FW will send the disconn frame according to disConnType */ 
    TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP); 

    os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
    return TI_OK;
}
示例#3
0
TI_STATUS mainKeys_startIdle(struct _mainKeys_t *pMainKeys)
{
	TI_STATUS  status;

	status = pMainKeys->pUcastSm->start(pMainKeys->pUcastSm);
	if (status != TI_OK)
	{
		return TI_NOK;
	}

	status = pMainKeys->pBcastSm->start(pMainKeys->pBcastSm);
	if (status != TI_OK)
	{
		return TI_NOK;
	}

    tmr_StartTimer (pMainKeys->hSessionTimer,
                    mainKeys_sessionTimeout,
                    (TI_HANDLE)pMainKeys,
                    pMainKeys->keysTimeout,
                    TI_FALSE);

	status = pMainKeys->pKeyParser->replayReset(pMainKeys->pKeyParser);

	return status;
}
示例#4
0
/***********************************************************************
 *                        idle_to_selfWait
 ***********************************************************************
DESCRIPTION: 


INPUT:   

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
static TI_STATUS idle_to_selfWait (void *pData)
{
	conn_t    *pConn = (conn_t *)pData;
    TI_UINT16  randomTime;

    siteMgr_join (pConn->hSiteMgr);

    /* get a randomTime that is constructed of the lower 13 bits ot the system time to 
       get a MS random time of ~8000 ms */
    randomTime = os_timeStampMs (pConn->hOs) & 0x1FFF;

    /* Update current BSS connection type and mode */
    currBSS_updateConnectedState (pConn->hCurrBss, TI_TRUE, BSS_INDEPENDENT);

    tmr_StartTimer (pConn->hConnTimer,
                    conn_timeout,
                    (TI_HANDLE)pConn,
                    pConn->timeout + randomTime,
                    TI_FALSE);

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

    return TI_OK;
}
示例#5
0
static TI_STATUS state_WaitScanStopDueToDoze(TI_HANDLE hPwrState, EPwrStateSmEvent eEvent)
{
	TPwrState *this = (TPwrState*) hPwrState;
	TI_STATUS rc;

	reportEvent(this, eEvent);

	switch (eEvent)
	{
	case PWRSTATE_EVNT_SCANCNCN_STOPPED:
	{
		this->fCurrentState = state_WaitDoze;

		tmr_StartTimer(this->hDozeTimer, pwrState_DozeTimeout, this, this->tConfig.uDozeTimeout, TI_FALSE);
		rc = powerMgr_Suspend(this->hPowerMgr, &this->tConfig, pwrState_DozeDone, this);

		break;
	}
	default:
		handleUnexpectedEvent(this, eEvent);
		rc = TI_NOK;
	}

	return rc;
}
/***********************************************************************
 *                        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;
}
示例#7
0
/**
*
* mainKeySmLogMessage
*
* \b Description:
*
* Prints Log messge.\n
* Start session timer.
*
* \b ARGS:
*
*  I   - pData - station control block  \n
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_smTimeOut(void* data)
{
	OS_802_11_AUTHENTICATION_REQUEST   *request;
	TI_UINT8                   AuthBuf[sizeof(TI_UINT32) + sizeof(OS_802_11_AUTHENTICATION_REQUEST)];
	paramInfo_t				param;
	TI_STATUS				status;
	struct _mainKeys_t 		*pMainKeys = (struct _mainKeys_t *)data;


TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "MAIN_KEY_SM: TRAP: Session Timeout for station , mainKeysTimeoutCounter=%d\n", pMainKeys->mainKeysTimeoutCounter);

	request = (OS_802_11_AUTHENTICATION_REQUEST *)(AuthBuf + sizeof(TI_UINT32));
	request->Length = sizeof(OS_802_11_AUTHENTICATION_REQUEST);

	param.paramType = CTRL_DATA_CURRENT_BSSID_PARAM;
	status = ctrlData_getParam(pMainKeys->hCtrlData, &param);
	if (status != TI_OK)
	{
		return TI_NOK;
	}

    TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "current station is banned from the roaming candidates list for %d Ms\n", RSN_MAIN_KEYS_SESSION_TIMEOUT);

    rsn_banSite(pMainKeys->hRsn, param.content.ctrlDataCurrentBSSID, RSN_SITE_BAN_LEVEL_FULL, RSN_MAIN_KEYS_SESSION_TIMEOUT);


	/* mainKeysTimeoutCounter is a boolean variable, With states:	*/
	/* TI_TRUE - It is a Timeout Association Event						*/
	/* TI_FALSE - It is a Media specific Event							*/

	if (!pMainKeys->mainKeysTimeoutCounter)
	{
		/* Fill Media specific indication fields and send to OS/User    */
		MAC_COPY (request->BSSID, param.content.ctrlDataCurrentBSSID);

		request->Flags = OS_802_11_REQUEST_REAUTH;

		*(TI_UINT32*)AuthBuf = os802_11StatusType_Authentication;

TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, " %d Ms\n",RSN_MAIN_KEYS_SESSION_TIMEOUT);

		EvHandlerSendEvent(pMainKeys->hEvHandler, IPC_EVENT_MEDIA_SPECIFIC, (TI_UINT8*)AuthBuf,
							sizeof(TI_UINT32) + sizeof(OS_802_11_AUTHENTICATION_REQUEST));

        tmr_StartTimer (pMainKeys->hSessionTimer,
                        mainKeys_sessionTimeout,
                        (TI_HANDLE)pMainKeys,
                        pMainKeys->keysTimeout,
                        TI_FALSE);

		pMainKeys->mainKeysTimeoutCounter = TI_TRUE;
	}
	else
	{
        pMainKeys->mainKeysTimeoutCounter = TI_FALSE;
        rsn_reportAuthFailure(pMainKeys->hRsn, RSN_AUTH_STATUS_TIMEOUT);
        conn_reportRsnStatus(pMainKeys->hConn, (mgmtStatus_e)STATUS_SECURITY_FAILURE);
	}
	return TI_OK;
}
示例#8
0
/***********************************************************************
 *                        rsnWait_to_waitToDisconnCmplt
 ***********************************************************************
DESCRIPTION: 


INPUT:   

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

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

    tStatus = rsn_stop(((conn_t *)pData)->hRsn, TI_FALSE);

    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = CLOSE;
    rxData_setParam(((conn_t *)pData)->hRxData, &param);

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

    /* Update current BSS connection type and mode */
    currBSS_updateConnectedState(((conn_t *)pData)->hCurrBss, TI_FALSE, BSS_INDEPENDENT);

    /* 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);

    /* Stop beacon generation */
    TWD_CmdFwDisconnect (((conn_t *)pData)->hTWD, DISCONNECT_IMMEDIATE, STATUS_UNSPECIFIED); 

    return tStatus;
}
示例#9
0
/** 
 * \fn     twIf_Restart
 * \brief  Restart module upon driver stop or recovery
 * 
 * Called upon driver stop command or upon recovery. 
 * Calls txnQ_Restart to clear the WLAN queues and call the TxnDone CB on each tansaction.
 * If no transaction in progress, the queues are cleared immediately. 
 * If a transaction is in progress, it is done upon TxnDone.
 * The status in transactions that were dropped due to restart is TXN_STATUS_RECOVERY,
 *     and its originator (Xfer module) handles it if required (if its CB was written in the Txn).
 * 
 * \note   
 * \param  hTwIf - The module's object
 * \return COMPLETE if the WLAN queues were restarted, PENDING if waiting for TxnDone to restart queues
 * \sa     
 */
ETxnStatus twIf_Restart(TI_HANDLE hTwIf)
{
	TTwIfObj *pTwIf = (TTwIfObj *) hTwIf;
	ETxnStatus eStatus;

	pTwIf->eState = SM_STATE_SLEEP;
	pTwIf->uAwakeReqCount = 0;

	pTwIf->uPendingTxnCount = 0;

	/* Clear done queue */
	twIf_ClearTxnDoneQueue(hTwIf);

	/* Restart WLAN queues */
	eStatus = txnQ_Restart(pTwIf->hTxnQ, TXN_FUNC_ID_WLAN);

	/* If pending upon ongoing transaction, start guard timer in case SDIO does not call us back */
	if (eStatus == TXN_STATUS_PENDING) {
		pTwIf->bPendRestartTimerRunning = TI_TRUE;
		tmr_StartTimer(pTwIf->hPendRestartTimer,
			       twIf_PendRestratTimeout, hTwIf,
			       PEND_RESTART_TIMEOUT, TI_FALSE);
	}

	/* Return result (COMPLETE if completed or PENDING if will be completed in TxnDone context) */
	return eStatus;
}
/** 
 * \fn     tmr_HandleExpiry
 * \brief  Handles queued expiry events in driver context
 * 
 * This is the Timer module's callback that is registered to the ContextEngine module to be invoked
 *   from the driver task (after requested by tmr_GetExpiry through context_RequestSchedule ()).
 * It dequeues all expiry events from the queue that correlates to the current driver state,
 *   and calls their users callbacks.
 * 
 * \note   
 * \param  hTimerModule - The module object
 * \return void
 * \sa     tmr_GetExpiry
 */ 
void tmr_HandleExpiry (TI_HANDLE hTimerModule)
{
    TTimerModule *pTimerModule = (TTimerModule *)hTimerModule; /* The timer module handle */
    TTimerInfo   *pTimerInfo;      /* The timer handle */     
    TI_BOOL       bTwdInitOccured; /* Indicates if TWD init occured since timer start */

    if (!pTimerModule)
    {
        WLAN_OS_REPORT (("tmr_HandleExpiry(): ERROR - NULL timer!\n"));
        return;
    }

    while (1)
    {
        /* Enter critical section */
        context_EnterCriticalSection (pTimerModule->hContext);
    
        /* If current driver state is Operational, dequeue timer object from Operational-queue */
        if (pTimerModule->bOperState)
        {
            pTimerInfo = (TTimerInfo *) que_Dequeue (pTimerModule->hOperQueue);
        }
    
        /* Else (driver state is NOT-Operational), dequeue timer object from Init-queue */
        else
        {
            pTimerInfo = (TTimerInfo *) que_Dequeue (pTimerModule->hInitQueue);
        }
    
        /* Leave critical section */
        context_LeaveCriticalSection (pTimerModule->hContext);

        /* If no more objects in queue, exit */
        if (!pTimerInfo) 
        {
            return;  /** EXIT Point **/
        }

        /* If current TWD-Init-Count is different than when the timer was started, Init occured. */
        bTwdInitOccured = (pTimerModule->uTwdInitCount != pTimerInfo->uTwdInitCountWhenStarted);

        /* Call specific timer callback function */
        pTimerInfo->fExpiryCbFunc (pTimerInfo->hExpiryCbHndl, bTwdInitOccured);

        /* If the expired timer is periodic, start it again. */
        if (pTimerInfo->bPeriodic) 
        {
            tmr_StartTimer ((TI_HANDLE)pTimerInfo,
                            pTimerInfo->fExpiryCbFunc,
                            pTimerInfo->hExpiryCbHndl,
                            pTimerInfo->uIntervalMsec,
                            pTimerInfo->bPeriodic);
        }
    }
}
示例#11
0
/*
 * \brief	Send the Command to the Mailbox
 * 
 * \param  hCmdMbox  - Handle to CmdMbox
 * \param  cmdType  - 
 * \param  pParamsBuf  - The buffer that will be written to the mailbox
 * \param  uWriteLen  - Length of data to write to the mailbox
 * \param  uReadLen  - Length of data to read from the mailbox (when the result is received)
 * \return TI_PENDING
 * 
 * \par Description
 * Copy the buffer given to a local struct, update the write & read lengths
 * and send to the FW's mailbox.
 *             
 *       ------------------------------------------------------
 *      | CmdMbox Header | Cmd Header    | Command parameters |
 *      ------------------------------------------------------
 *      | ID   | Status  | Type | Length | Command parameters |
 *      ------------------------------------------------------
 *       16bit   16bit    16bit   16bit     
 *
 * \sa cmdMbox_CommandComplete
 */
TI_STATUS cmdMbox_SendCommand       (TI_HANDLE hCmdMbox, Command_e cmdType, TI_UINT8* pParamsBuf, TI_UINT32 uWriteLen, TI_UINT32 uReadLen)
{
    TCmdMbox   *pCmdMbox = (TCmdMbox *)hCmdMbox;
    TTxnStruct *pCmdTxn = (TTxnStruct*)&pCmdMbox->aCmdTxn[0].tTxnStruct;
    TTxnStruct *pRegTxn = (TTxnStruct*)&pCmdMbox->aRegTxn[0].tTxnStruct;
    Command_t  *pCmd = (Command_t*)&pCmdMbox->aCmdTxn[0].tCmdMbox;
    

    if (pCmdMbox->bCmdInProgress)
    {
        TRACE0(pCmdMbox->hReport, REPORT_SEVERITY_ERROR, "cmdMbox_SendCommand(): Trying to send Cmd while other Cmd is still in progres!\n");
        return TI_NOK;
    }

    /* Add the CMDMBOX_HEADER_LEN to the read length, used when reading the result later on */
    pCmdMbox->uReadLen = uReadLen + CMDMBOX_HEADER_LEN;
    /* Prepare the Cmd Hw template */
    pCmd->cmdID = cmdType;
    pCmd->cmdStatus = CMD_STATUS_SUCCESS;
    os_memoryCopy (pCmdMbox->hOs, (void *)pCmd->parameters, (void *)pParamsBuf, uWriteLen);

    /* Add the CMDMBOX_HEADER_LEN to the write length */
    pCmdMbox->uWriteLen = uWriteLen + CMDMBOX_HEADER_LEN;

    /* Must make sure that the length is multiple of 32 bit */
    if (pCmdMbox->uWriteLen & 0x3)
    {
        TRACE1(pCmdMbox->hReport, REPORT_SEVERITY_WARNING, "cmdMbox_SendCommand(): Command length isn't 32bit aligned! CmdId=%d\n", pCmd->cmdID);
        pCmdMbox->uWriteLen = (pCmdMbox->uWriteLen + 4) & 0xFFFFFFFC;
    }

    /* no other command can start the send process  till bCmdInProgress will return to TI_FALSE*/
    pCmdMbox->bCmdInProgress = TI_TRUE;

    /* Build the command TxnStruct */
    TXN_PARAM_SET(pCmdTxn, TXN_LOW_PRIORITY, TXN_FUNC_ID_WLAN, TXN_DIRECTION_WRITE, TXN_INC_ADDR)
    BUILD_TTxnStruct(pCmdTxn, pCmdMbox->uFwAddr, pCmd, pCmdMbox->uWriteLen, NULL, NULL)
    /* Send the command */
    twIf_Transact(pCmdMbox->hTwIf, pCmdTxn);

    /* Build the trig TxnStruct */
    pCmdMbox->aRegTxn[0].uRegister = INTR_TRIG_CMD;
    TXN_PARAM_SET(pRegTxn, TXN_LOW_PRIORITY, TXN_FUNC_ID_WLAN, TXN_DIRECTION_WRITE, TXN_INC_ADDR)
    BUILD_TTxnStruct(pRegTxn, ACX_REG_INTERRUPT_TRIG, &(pCmdMbox->aRegTxn[0].uRegister), REGISTER_SIZE, NULL, NULL)

    /* start the CmdMbox timer */
    tmr_StartTimer (pCmdMbox->hCmdMboxTimer, cmdMbox_TimeOut, hCmdMbox, CMDMBOX_WAIT_TIMEOUT, TI_FALSE);

    /* Send the FW trigger */
    twIf_Transact(pCmdMbox->hTwIf, pRegTxn);


    return TXN_STATUS_PENDING;
}
示例#12
0
/**
 * \brief	Starts the timer guarding the waiting for a missing packet
 *
 * \param	uTid	index of TID timer to start
 */
static void StartMissingPktTimer(TRxQueue *pRxQueue, TI_UINT8 uTid)
{
	/* request to clear this TID's queue */
	pRxQueue->tRxQueueArraysMng.tSa1ArrayMng[uTid].uMissingPktTimeStamp = os_timeStampMs(pRxQueue->hOs);

	/* start timer (if not started already) */
	if ( pRxQueue->uMissingPktTimerClient == TID_CLIENT_NONE ) {
		tmr_StartTimer (pRxQueue->hMissingPktTimer, MissingPktTimeout, pRxQueue, BA_SESSION_TIME_TO_SLEEP, TI_FALSE);
		pRxQueue->uMissingPktTimerClient = uTid;
	}
}
示例#13
0
/* This function is called from the WAIT_FOR_JOIN_CB_CMPLT state (before mlme_start)
  - all we need to do is call siteMgr_disJoin */
static TI_STATUS JoinWait_to_WaitDisconnect(void *pData)
{
    conn_t *pConn = (conn_t *)pData; 

    /* 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);

    /* FW will send the disconn frame according to disConnType */ 
    TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP); 
    
   return TI_OK;
}
TI_STATUS openAuth_smStartTimer(auth_t *hAuth)
{
	if (hAuth == NULL) {
		return TI_NOK;
	}

	tmr_StartTimer (hAuth->hAuthSmTimer,
	                auth_smTimeout,
	                (TI_HANDLE)hAuth,
	                hAuth->timeout,
	                TI_FALSE);

	return TI_OK;
}
示例#15
0
/*
 * \brief	Invokes the transition-complete callback
 *
 * 			If the transition was completed in the same driver-task it
 * 			was started in, uses a timer to complete it in another task.
 *
 * 			Otherwise, directly invokes the callback.
 *
 * \param	bTWDInitOccured	ignored
 */
static void notifyTransitionComplete(TI_HANDLE hPwrState, TI_BOOL bTWDInitOccured)
{
	TPwrState *this = (TPwrState*) hPwrState;

	/*
	 * If the transition was started and completed in different
	 * tasks - it is safe to invoke the command-complete callback.
	 */
	if (this->tCurrentTransition.bAsyncTransition)
	{
		TRACE1(this->hReport, REPORT_SEVERITY_INFORMATION, "transition to %pF completed\n", this->fCurrentState);

		if (this->tCurrentTransition.fCompleteCb)
		{
			void(*fCb)(TI_HANDLE,int,void*);

			/* prevent re-entring / re-invoking the callback */
			fCb = this->tCurrentTransition.fCompleteCb;
			this->tCurrentTransition.fCompleteCb = NULL;

			/* invoke the callback */
			(fCb)(
					(this->tCurrentTransition.hCompleteCb),
					(this->tCurrentTransition.iCompleteStatus),
					NULL );
		}
	}
	/*
	 * Otherwise, the transition was started in this task (where
	 * this function was called).
	 * Since we cannot invoke the command-complete callback from the
	 * same driver's task the (async) command was started in - we need
	 * to use a timer to do it in another task.
	 */
	else
	{
		TRACE0(this->hReport, REPORT_SEVERITY_INFORMATION, "transition completed synchronously. Setting timer to complete it asynchronously\n");

		/*
		 * Mark as an asynchronous transition (we will finish it in another task)
		 */
		this->tCurrentTransition.bAsyncTransition = TI_TRUE;

		/*
		 * Start a minimal-time timer (it will still let this task finish first)
		 */
		tmr_StartTimer(this->tCurrentTransition.hCompleteTimer, notifyTransitionComplete, this, 1, TI_FALSE);
	}
}
/*-----------------------------------------------------------------------------
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);
	}
}
示例#17
0
static TI_STATUS prepare_send_disconnect(void *pData)
{
    conn_t          *pConn = (conn_t *)pData;

    txCtrlParams_setEapolEncryptionStatus(pConn->hTxCtrl, DEF_EAPOL_ENCRYPTION_STATUS);
    qosMngr_disconnect (pConn->hQosMngr, TI_TRUE);


    /* 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);

    /* FW will send the disconn frame according to disConnType */ 
    TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP); 


    return TI_OK;
}
void TrafficMonitor_Init (TStadHandlesList *pStadHandles, TI_UINT32 BWwindowMs)
{
	TrafficMonitor_t *TrafficMonitor = (TrafficMonitor_t *)(pStadHandles->hTrafficMon);
	TI_UINT32 uCurrTS = os_timeStampMs (TrafficMonitor->hOs);

	/* Create the base threshold timer that will serve all the down thresholds*/
	TrafficMonitor->hTrafficMonTimer = tmr_CreateTimer (pStadHandles->hTimer);

	TrafficMonitor->Active = TI_FALSE;

	TrafficMonitor->hRxData = pStadHandles->hRxData;
	TrafficMonitor->hTxCtrl = pStadHandles->hTxCtrl;
	TrafficMonitor->hTimer  = pStadHandles->hTimer;

	/*Init All the bandwidth elements in the system */
	os_memoryZero(TrafficMonitor->hOs,&TrafficMonitor->DirectTxFrameBW,sizeof(BandWidth_t));
	os_memoryZero(TrafficMonitor->hOs,&TrafficMonitor->DirectRxFrameBW,sizeof(BandWidth_t));
	TrafficMonitor->DirectRxFrameBW.auFirstEventsTS[0] = uCurrTS;
	TrafficMonitor->DirectTxFrameBW.auFirstEventsTS[0] = uCurrTS;

	/*Registering to the RX module for notification.*/
	TrafficMonitor->RxRegReqHandle = rxData_RegNotif (pStadHandles->hRxData,
	                                 DIRECTED_FRAMES_RECV,
	                                 TrafficMonitor_Event,
	                                 TrafficMonitor,
	                                 RX_TRAFF_MODULE);

	/*Registering to the TX module for notification .*/
	TrafficMonitor->TxRegReqHandle = txCtrlParams_RegNotif (pStadHandles->hTxCtrl,
	                                 DIRECTED_FRAMES_XFER,
	                                 TrafficMonitor_Event,
	                                 TrafficMonitor,
	                                 TX_TRAFF_MODULE);

	TrafficMonitor->DownTimerEnabled = TI_FALSE;
	TrafficMonitor->trafficDownTestIntervalPercent = MIN_INTERVAL_PERCENT;

#ifdef TRAFF_TEST
	TestTrafficMonitor = TrafficMonitor;
	TestEventTimer = tmr_CreateTimer (pStadHandles->hTimer);
	tmr_StartTimer (TestEventTimer, TestEventFunc, (TI_HANDLE)TrafficMonitor, 5000, TI_TRUE);
#endif
}
示例#19
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief Handle an ALL_TYPE_COMPLETE event by sending a stop measure command to the FW.\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_requestMeasureStop( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_STATUS status;

	/* since this function may also be called when stop is requested and start complete event
	   has not yet been received from the FW, we may need to stop the FW guard timer */
	if (pMeasurementSRV->bStartStopTimerRunning)
	{
		tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
		pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
	}

	/* Send Measurement Stop command to the FW */
	status = cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
	                                    (void *)pMeasurementSRV->commandResponseCBFunc,
	                                    pMeasurementSRV->commandResponseCBObj);

	pMeasurementSRV->commandResponseCBFunc = NULL;
	pMeasurementSRV->commandResponseCBObj = NULL;

	if ( TI_OK != status )
	{
		TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement stop command, statud=%d,\n", status);

		/* send a measurement complete event - since it can't be stopped */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState), MSR_SRV_EVENT_STOP_COMPLETE );
		return TI_OK;
	}

	TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure stop command sent.\n");

	/* start the FW guard timer */
	pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
	tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
	                MacServices_measurementSRV_startStopTimerExpired,
	                (TI_HANDLE)pMeasurementSRV,
	                MSR_FW_GUARD_TIME,
	                TI_FALSE);

	return TI_OK;
}
示例#20
0
/**
 * \\n
 * \brief Handle ap discovery measurement start request
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_startApDiscovery(TI_HANDLE hMeasurementSRV)
{

    measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
    TI_UINT32 requestIndex = pMeasurementSRV->uApDiscoveryRequestIndex;

    /* stop Ap Discovery event timer */
    tmr_StopTimer(pMeasurementSRV->hApDiscoveryTimer);

    /* Start Timer */
    tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
                    MacServices_measurementSRV_requestTimerExpired,
                    (TI_HANDLE)pMeasurementSRV,
                    (pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration * 1024)/1000,
                    TI_FALSE);

    pMeasurementSRV->bRequestTimerRunning[ requestIndex ] = TI_TRUE;

    return TI_OK;
}
/***********************************************************************
 *                        idle_to_selfWait
 ***********************************************************************
DESCRIPTION:


INPUT:

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
static TI_STATUS idle_to_selfWait (void *pData)
{
	conn_t    *pConn = (conn_t *)pData;
	TI_UINT16  randomTime;

	siteMgr_join (pConn->hSiteMgr);

	/* get a randomTime that is constructed of the lower 13 bits ot the system time to
	   get a MS random time of ~8000 ms */
	randomTime = os_timeStampMs (pConn->hOs) & 0x1FFF;

	/* Update current BSS connection type and mode */
	currBSS_updateConnectedState (pConn->hCurrBss, TI_TRUE, BSS_INDEPENDENT);

	tmr_StartTimer (pConn->hConnTimer,
	                conn_timeout,
	                (TI_HANDLE)pConn,
	                pConn->timeout + randomTime,
	                TI_FALSE);

	return TI_OK;
}
示例#22
0
/**
 * \brief	Stop the timer guarding the waiting for a missing packet
 *
 *			Stops the timer ONLY for the specified TID - other TID's timers will
 *			still run (if started)
 *
 * \param	uTid	index of TID timer to stop
 */
static void StopMissingPktTimer(TRxQueue *pRxQueue, TI_UINT8 uTid)
{
	TI_UINT8 i;
	TI_UINT32 uMinRequestTime;
	TI_UINT8 uNextClient;
	TI_UINT32 uNowMs;
	TRxQueueTidDataBase *pTidInfo = &(pRxQueue->tRxQueueArraysMng.tSa1ArrayMng[uTid]);

	/* mark this TID no longer needs the timer */
	pTidInfo->uMissingPktTimeStamp = 0xffffffff;

	/* if timer was not started for this TID, don't stop it */
	if ( pRxQueue->uMissingPktTimerClient != uTid ) {
		return;
	}

	uMinRequestTime = 0xffffffff;
	uNextClient = 0;
	uNowMs = os_timeStampMs(pRxQueue->hOs);

	/* stop timer */
	tmr_StopTimer(pRxQueue->hMissingPktTimer);
	pRxQueue->uMissingPktTimerClient = TID_CLIENT_NONE;

	/* find the minimum request time */
	for (i = 0; i < MAX_NUM_OF_802_1d_TAGS; i++) {
		if (pRxQueue->tRxQueueArraysMng.tSa1ArrayMng[i].uMissingPktTimeStamp < uMinRequestTime) {
			uMinRequestTime = pRxQueue->tRxQueueArraysMng.tSa1ArrayMng[i].uMissingPktTimeStamp;
			uNextClient = i;
		}
	}

	/* restart timer if any requests left */
	if (uMinRequestTime < 0xffffffff) {
		tmr_StartTimer (pRxQueue->hMissingPktTimer, MissingPktTimeout, pRxQueue, uMinRequestTime + BA_SESSION_TIME_TO_SLEEP - uNowMs, TI_FALSE);
		pRxQueue->uMissingPktTimerClient = uNextClient;
	}
}
示例#23
0
/**
 * \\n
 * \date 10-Jan-2005\n
 * \brief Send the scan command to the firmware.\n
 *
 * 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_startActualScan( TI_HANDLE hScanSrv )
{ 
    scanSRV_t *pScanSRV = (scanSRV_t*)hScanSrv;

 
    /* start the timer */
    pScanSRV->bTimerRunning = TI_TRUE;
    tmr_StartTimer (pScanSRV->hScanSrvTimer,
                    MacServices_scanSRV_scanTimerExpired,
                    (TI_HANDLE)pScanSRV,
                    MacServices_scanSRVcalculateScanTimeout (hScanSrv, pScanSRV->scanParams, !pScanSRV->bDtimOverlapping), 
                    TI_FALSE);
    
    /* start the scan */
            /* we send the MacServices_scanSRVCommandMailBoxCB to be called when this command is recieved */
    if ( SCAN_TYPE_SPS == pScanSRV->scanParams->scanType )
    {
        pScanSRV->returnStatus = cmdBld_CmdStartSPSScan (pScanSRV->hCmdBld, pScanSRV->scanParams, pScanSRV->eScanTag,
                                                         (void *)MacServices_scanSRVCommandMailBoxCB, hScanSrv);
    }
    else
    {    
        pScanSRV->returnStatus = cmdBld_CmdStartScan (pScanSRV->hCmdBld, pScanSRV->scanParams, pScanSRV->eScanTag, 
                                                      pScanSRV->bHighPriority , (void *)MacServices_scanSRVCommandMailBoxCB, 
                                                      hScanSrv);
    }
    /* if scan request failed */
    if ( TI_OK != pScanSRV->returnStatus )
    {

        /* send a scan complete event. This will do all necessary clean-up (timer, power manager, notifying scan complete) */
        scanSRVSM_SMEvent( hScanSrv, (scan_SRVSMStates_e*)&pScanSRV->SMState, SCAN_SRV_EVENT_SCAN_COMPLETE );
    }
    
    return TI_OK;
}
示例#24
0
static TI_STATUS prepare_send_disconnect(void *pData)
{
    conn_t          *pConn = (conn_t *)pData;

    txCtrlParams_setEapolEncryptionStatus(pConn->hTxCtrl, DEF_EAPOL_ENCRYPTION_STATUS);
    qosMngr_disconnect (pConn->hQosMngr, TI_TRUE);

#ifdef XCC_MODULE_INCLUDED
    measurementMgr_disableTsMetrics(pConn->hMeasurementMgr, MAX_NUM_OF_AC);
#endif

    /* 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 * 4, TI_FALSE);

    /* FW will send the disconn frame according to disConnType */ 
    TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP); 

#ifdef XCC_MODULE_INCLUDED
    XCCMngr_updateIappInformation(pConn->hXCCMngr, XCC_DISASSOC);
#endif

    return TI_OK;
}
示例#25
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief handle a STOP_REQUEST event when in MEASURE_IN_PROGRESS by stopping all measure types and
 * \brief requesting measure stop from the FW.\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_stopFromMeasureInProgress( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TNoiseHistogram   pNoiseHistParams;
	TI_STATUS         status;
	TI_INT32          i;

	/* stop all running measure types */
	for (i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++)
	{
		if (pMeasurementSRV->bRequestTimerRunning[i])
		{
			/* stop timer */
			tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
			pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;

			/* if necessary, stop measurement type */
			switch ( pMeasurementSRV->msrRequest.msrTypes[ i ].msrType )
			{
			case MSR_TYPE_BEACON_MEASUREMENT:
				/* send stop AP discovery command */
				status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
				if ( TI_OK != status )
				{
					TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_ApDiscoveryStop returned status %d\n", status);
				}
				break;

			case MSR_TYPE_NOISE_HISTOGRAM_MEASUREMENT:
				/* Set Noise Histogram Cmd Params */
				pNoiseHistParams.cmd = STOP_NOISE_HIST;
				pNoiseHistParams.sampleInterval = 0;
				os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[ 0 ]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );

				/* Send a Stop command to the FW */
				status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);

				if ( TI_OK != status )
				{
					TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_NoiseHistogramCmd returned status %d\n", status);
				}
				break;

				/* These are just to avoid compilation warnings, nothing is actualy done here! */
			case MSR_TYPE_BASIC_MEASUREMENT:
			case MSR_TYPE_CCA_LOAD_MEASUREMENT:
			case MSR_TYPE_FRAME_MEASUREMENT:
			case MSR_TYPE_MAX_NUM_OF_MEASURE_TYPES:
			default:
				TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": unsupported measurement type: %d\n", pMeasurementSRV->msrRequest.msrTypes[ i ].msrType);
				break;
			}

			/* mark that measurement has failed */
			pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
		}
	}

	/* Send Measurement Stop command to the FW */
	status = cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
	                                    (void *)pMeasurementSRV->commandResponseCBFunc,
	                                    pMeasurementSRV->commandResponseCBObj);

	pMeasurementSRV->commandResponseCBFunc = NULL;
	pMeasurementSRV->commandResponseCBObj = NULL;

	if ( TI_OK != status )
	{
		TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement stop command, statud=%d,\n", status);

		/* send a measurement complete event - since it can't be stopped */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_STOP_COMPLETE );
		return TI_OK;
	}

	TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure stop command sent.\n");

	/* start the FW guard timer */
	pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
	tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
	                MacServices_measurementSRV_startStopTimerExpired,
	                (TI_HANDLE)pMeasurementSRV,
	                MSR_FW_GUARD_TIME,
	                TI_FALSE);

	return TI_OK;
}
示例#26
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief Handle a START_SUCCESS event by starting different measure types and setting timers.\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_startMeasureTypes( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t      *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_UINT8                 requestIndex, rangeIndex;
	TI_INT8                  rangeUpperBound;
	TTwdParamInfo         tTwdParam;
	TI_STATUS             status;
	TNoiseHistogram       pNoiseHistParams;
	TApDiscoveryParams    pApDiscoveryParams;
	TI_UINT32                currentTime = os_timeStampMs( pMeasurementSRV->hOS );

	/* check if request time has expired (note: timer wrap-around is also handled)*/
	if ( (pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs)
	        < currentTime )
	{
		TI_INT32 i;

		TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request time has expired, request expiry time:%d, current time:%d\n", pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs, currentTime);

		/* mark that all measurement types has failed */
		for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
		{
			pMeasurementSRV->msrReply.msrTypes[ i ].status = MSR_REJECT_MAX_DELAY_PASSED;
		}

		/* send a measurement complete event */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_ALL_TYPES_COMPLETE );

		return TI_OK;
	}

	/* Going over all request types that should be executed in parallel
	to start their timers and execute the measurement */
	for ( requestIndex = 0; requestIndex < pMeasurementSRV->msrRequest.numberOfTypes ; requestIndex++ )
	{
		switch (pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType)
		{
		case MSR_TYPE_CCA_LOAD_MEASUREMENT:
			/* Clearing the Medium Occupancy Register */
			tTwdParam.paramType = TWD_MEDIUM_OCCUPANCY_PARAM_ID;
			tTwdParam.content.interogateCmdCBParams.fCb = (void *)MacServices_measurementSRV_dummyChannelLoadParamCB;
			tTwdParam.content.interogateCmdCBParams.hCb = hMeasurementSRV;
			tTwdParam.content.interogateCmdCBParams.pCb =
			    (TI_UINT8*)&pMeasurementSRV->mediumOccupancyResults;
			status = cmdBld_GetParam (pMeasurementSRV->hCmdBld, &tTwdParam);
			if ( TI_OK == status  )
			{
				TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Medium Usage has been nullified, starting timer.\n");

				/* Start Timer */
				tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
				                MacServices_measurementSRV_requestTimerExpired,
				                (TI_HANDLE)pMeasurementSRV,
				                pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
				                TI_FALSE);
				pMeasurementSRV->bRequestTimerRunning[requestIndex] = TI_TRUE;
			}
			else
			{
				TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_GetParam (for channel load) returned status %d\n", status);
			}

			break;

		case MSR_TYPE_NOISE_HISTOGRAM_MEASUREMENT:
			/* Set Noise Histogram Cmd Params */
			pNoiseHistParams.cmd = START_NOISE_HIST;
			pNoiseHistParams.sampleInterval = DEF_SAMPLE_INTERVAL;
			os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[0]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );

			/* Set Ranges */
			/* (-87) - First Range's Upper Bound */
			rangeUpperBound = -87;

			/* Previously we converted from RxLevel to dBm - now this isn't necessary */
			/* rangeUpperBound = TWD_convertRSSIToRxLevel( pMeasurementSRV->hTWD, -87); */

			for (rangeIndex = 0; rangeIndex < MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES -1; rangeIndex++)
			{
				if (rangeUpperBound > 0)
				{
					pNoiseHistParams.ranges[rangeIndex] = 0;
				}
				else
				{
					pNoiseHistParams.ranges[rangeIndex] = rangeUpperBound;
				}
				rangeUpperBound += 5;
			}
			pNoiseHistParams.ranges[rangeIndex] = 0xFE;

			/* Print for Debug */
			TRACE8(pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ":Noise histogram Measurement Ranges:\n%d %d %d %d %d %d %d %d\n", (TI_INT8) pNoiseHistParams.ranges[0], (TI_INT8) pNoiseHistParams.ranges[1], (TI_INT8) pNoiseHistParams.ranges[2], (TI_INT8) pNoiseHistParams.ranges[3], (TI_INT8) pNoiseHistParams.ranges[4], (TI_INT8) pNoiseHistParams.ranges[5], (TI_INT8) pNoiseHistParams.ranges[6], (TI_INT8) pNoiseHistParams.ranges[7]);

			/* Send a Start command to the FW */
			status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);

			if ( TI_OK == status )
			{
				/* Print for Debug */
				TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Sent noise histogram command. Starting timer\n");

				/* Start Timer */
				tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
				                MacServices_measurementSRV_requestTimerExpired,
				                (TI_HANDLE)pMeasurementSRV,
				                pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
				                TI_FALSE);
				pMeasurementSRV->bRequestTimerRunning[requestIndex] = TI_TRUE;
			}
			else
			{
				TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_NoiseHistogramCmd returned status %d\n", status);
			}
			break;

		case MSR_TYPE_BEACON_MEASUREMENT:
			/* set all parameters in the AP discovery command */
			pApDiscoveryParams.scanDuration = pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].duration * 1000;
			pApDiscoveryParams.numOfProbRqst = 1;
			pApDiscoveryParams.txdRateSet = HW_BIT_RATE_1MBPS;
			pApDiscoveryParams.ConfigOptions = RX_CONFIG_OPTION_FOR_MEASUREMENT;
			pApDiscoveryParams.FilterOptions = RX_FILTER_OPTION_DEF_PRSP_BCN;
			pApDiscoveryParams.txPowerDbm = pMeasurementSRV->msrRequest.txPowerDbm;
			pApDiscoveryParams.scanOptions = SCAN_ACTIVE; /* both scan type and band are 0 for active and */
			/* 2.4 GHz, respectively, but 2.4 is not defined */

			/* band determined at the initiate measurement command not at that structure */

			/* scan mode go into the scan option field */
			if ( MSR_SCAN_MODE_PASSIVE == pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].scanMode )
			{
				pApDiscoveryParams.scanOptions |= SCAN_PASSIVE;
			}

			/* Send AP Discovery command */
			status = cmdBld_CmdApDiscovery (pMeasurementSRV->hCmdBld, &pApDiscoveryParams, NULL, NULL);

			if ( TI_OK == status )
			{
				TRACE7( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": AP discovery command sent. Params:\n scanDuration=%d, scanOptions=%d, numOfProbRqst=%d, txdRateSet=%d, txPowerDbm=%d, configOptions=%d, filterOptions=%d\n Starting timer...\n", pApDiscoveryParams.scanDuration, pApDiscoveryParams.scanOptions, pApDiscoveryParams.numOfProbRqst, pApDiscoveryParams.txdRateSet, pApDiscoveryParams.txPowerDbm, pApDiscoveryParams.ConfigOptions, pApDiscoveryParams.FilterOptions);

				/* Start Timer */
				tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
				                MacServices_measurementSRV_requestTimerExpired,
				                (TI_HANDLE)pMeasurementSRV,
				                pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
				                TI_FALSE);
				pMeasurementSRV->bRequestTimerRunning[ requestIndex ] = TI_TRUE;
			}
			else
			{
				TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_ApDiscoveryCmd returned status %d\n", status);
			}
			break;

		case MSR_TYPE_BASIC_MEASUREMENT: /* not supported in current implemntation */
		case MSR_TYPE_FRAME_MEASUREMENT: /* not supported in current implemntation */
		default:
			TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Measurement type %d is not supported\n", pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType);
			break;
		}
	}

	/* if no measurement types are running, sen al types complete event.
	   This can happen if all types failed to start */
	if ( TI_TRUE == measurementSRVIsMeasurementComplete( hMeasurementSRV ))
	{
		/* send the event */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_ALL_TYPES_COMPLETE );
	}

	return TI_OK;
}
示例#27
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief Handle a DRIVER_MODE_SUCCESS event by sending start measure command to the FW.\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_requestMeasureStart( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t     *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TMeasurementParams    pMeasurementCmd;
	TI_STATUS             status;
	TI_UINT32                currentTime = os_timeStampMs( pMeasurementSRV->hOS );

	/* check if request time has expired (note: timer wrap-around is also handled)*/
	if ( (pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs)
	        < currentTime )
	{
		TI_INT32 i;

		TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request time has expired, request expiry time:%d, current time:%d\n", pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs, currentTime);

		/* mark that all measurement types has failed */
		for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
		{
			pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
		}

		/* send a measurement complete event */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_STOP_COMPLETE );

		return TI_OK;
	}

	pMeasurementCmd.channel = pMeasurementSRV->msrRequest.channel;
	pMeasurementCmd.band = pMeasurementSRV->msrRequest.band;
	pMeasurementCmd.duration = 0; /* Infinite */
	pMeasurementCmd.eTag = pMeasurementSRV->msrRequest.eTag;

	if ( measurementSRVIsBeaconMeasureIncluded( hMeasurementSRV ))
	{  /* Beacon Measurement is one of the types */

		/* get the current channel */
		TTwdParamInfo	paramInfo;

		paramInfo.paramType = TWD_CURRENT_CHANNEL_PARAM_ID;
		cmdBld_GetParam (pMeasurementSRV->hCmdBld, &paramInfo);

		pMeasurementCmd.ConfigOptions = RX_CONFIG_OPTION_FOR_MEASUREMENT;

		/* check if the request is on the serving channel */
		if ( paramInfo.content.halCtrlCurrentChannel == pMeasurementSRV->msrRequest.channel )
		{
			/* Set the RX Filter to the join one, so that any packets will
			be received on the serving channel - beacons and probe requests for
			the measurmenet, and also data (for normal operation) */
			pMeasurementCmd.FilterOptions = RX_FILTER_OPTION_JOIN;
		}
		else
		{
			/* not on the serving channle - only beacons and rpobe responses are required */
			pMeasurementCmd.FilterOptions = RX_FILTER_OPTION_DEF_PRSP_BCN;
		}
	}
	else
	{  /* No beacon measurement - use the current RX Filter */
		pMeasurementCmd.ConfigOptions = 0xffffffff;
		pMeasurementCmd.FilterOptions = 0xffffffff;
	}

	/* Send start measurement command */
	status = cmdBld_CmdMeasurement (pMeasurementSRV->hCmdBld,
	                                &pMeasurementCmd,
	                                (void *)measurementSRVSM_requestMeasureStartResponseCB,
	                                pMeasurementSRV);

	if ( TI_OK != status )
	{
		TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement start command, statud=%d,\n", status);

		/* keep the faulty return status */
		pMeasurementSRV->returnStatus = status;

		/* send a measurement start fail event */
		return measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                                 MSR_SRV_EVENT_START_FAILURE );
	}

	TRACE6( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure start command sent. Params:\n channel=%d, band=%d, duration=%d, \n configOptions=0x%x, filterOptions=0x%x, status=%d, \n", pMeasurementCmd.channel, pMeasurementCmd.band, pMeasurementCmd.duration, pMeasurementCmd.ConfigOptions, pMeasurementCmd.FilterOptions, status);

	/* start the FW guard timer */
	pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
	tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
	                MacServices_measurementSRV_startStopTimerExpired,
	                (TI_HANDLE)pMeasurementSRV,
	                MSR_FW_GUARD_TIME,
	                TI_FALSE);

	return TI_OK;
}
/**
 * Called when the SM is in an idle state and we receive a new measurement frame.
 *
 * @date 05-Jan-2006
 */
static TI_STATUS measurementMgrSM_acFrameReceived_fromIdle(void * pData)
{
	measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) pData;
	TI_UINT16 activationDelay;
	TI_STATUS status;
	paramInfo_t param;
	TI_UINT16 tbtt;

	/* handle frame request only if we're connected and measurement is enabled */
	if (pMeasurementMgr->Connected == TI_FALSE ||
	    pMeasurementMgr->Enabled == TI_FALSE) {
		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_ERROR, ": Frame received while SM is in disconnected/disabled state\n");

		return measurementMgrSM_event((TI_UINT8 *) &(pMeasurementMgr->currentState),
		                              MEASUREMENTMGR_EVENT_ABORT, pMeasurementMgr);
	}

	/* Setting the frame Type */
	pMeasurementMgr->currentFrameType = pMeasurementMgr->newFrameRequest.frameType;

	TRACE1(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Frame Type = %d\n", pMeasurementMgr->currentFrameType);

	/* Getting the Beacon Interval from the Site Mgr */
	param.paramType = SITE_MGR_BEACON_INTERVAL_PARAM;
	status = siteMgr_getParam(pMeasurementMgr->hSiteMgr, &param);
	if (status != TI_OK) {
		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_ERROR, ": Failed to retrieve beacon interval - not connected?\n");

		return measurementMgrSM_event((TI_UINT8 *) &(pMeasurementMgr->currentState),
		                              MEASUREMENTMGR_EVENT_ABORT, pMeasurementMgr);
	}

	/* converting beacon interval to msec */
	tbtt = (param.content.beaconInterval * 1024) / 1000;	/* from TU to msec */

	/* Initializing Activation Delay Time */
	activationDelay	= pMeasurementMgr->newFrameRequest.hdr->activatioDelay;
	activationDelay	*= tbtt;
	/* Adding the Measurement Offset to the activation delay */
	activationDelay	+= pMeasurementMgr->newFrameRequest.hdr->measurementOffset;

	/* Inserting all received measurement requests into the queue */
	status = requestHandler_insertRequests(pMeasurementMgr->hRequestH,
	                                       pMeasurementMgr->Mode,
	                                       pMeasurementMgr->newFrameRequest);

	/* Clean New Frame Params */
	os_memoryZero(pMeasurementMgr->hOs, &pMeasurementMgr->newFrameRequest,
	              sizeof(TMeasurementFrameRequest));

	if (status != TI_OK) {
		pMeasurementMgr->currentFrameType = MSR_FRAME_TYPE_NO_ACTIVE;

		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_ERROR, ": Could not insert request into the queue\n");

		return measurementMgrSM_event((TI_UINT8 *) &(pMeasurementMgr->currentState),
		                              MEASUREMENTMGR_EVENT_ABORT, pMeasurementMgr);
	}

	TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": New frame has been inserted into the queue\n");

	/* If frame type isn't Unicast add to Activation Delay a random delay */
	if ((pMeasurementMgr->currentFrameType != MSR_FRAME_TYPE_UNICAST) && (activationDelay > 0)) {
		activationDelay	+= ((os_timeStampMs(pMeasurementMgr->hOs) % MSR_ACTIVATION_DELAY_RANDOM)
		                    + MSR_ACTIVATION_DELAY_OFFSET);
	}

	TRACE1(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Activation Delay in ms = %d\n", activationDelay);

	if (activationDelay > 0) {
		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Going to wait for activation delay timer callback\n");

		/* Starting the Activation Delay Timer */
		tmr_StartTimer (pMeasurementMgr->hActivationDelayTimer,
		                measurementMgrSM_uponActivationDelayTimeout,
		                (TI_HANDLE)pMeasurementMgr,
		                activationDelay,
		                TI_FALSE);

		return TI_OK;
	} else {
		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Activating the next request immediately without waiting for callback\n");

		/* Calling to schedule the first waiting request */
		return measurementMgr_activateNextRequest(pData);
	}
}
示例#29
0
TI_STATUS txDataQ_InsertPacket (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk, TI_UINT8 uPacketDtag, TIntraBssBridge *pIntraBssBridgeParam)
{
	TTxDataQ        *pTxDataQ = (TTxDataQ *)hTxDataQ;
	TEthernetHeader *pEthHead = (TEthernetHeader *)(pPktCtrlBlk->tTxnStruct.aBuf[0]);
	TI_STATUS        eStatus;
	TI_UINT32        uQueId;
	TI_UINT32        uQueSize;
	txCtrl_t         *pTxCtrl = (txCtrl_t *)(pTxDataQ->hTxCtrl);
	TI_BOOL          bRequestSchedule = TI_FALSE;
	TI_BOOL          bStopNetStack = TI_FALSE;
	TDataLinkQ       *pLinkQ;
	TI_UINT32        uHlid;

	/* If packet is EAPOL or from the generic Ethertype, forward it to the Mgmt-Queue and exit */
	if ((HTOWLANS(pEthHead->type) == ETHERTYPE_EAPOL) ||
	    (HTOWLANS(pEthHead->type) == pTxCtrl->genericEthertype)) {
		pPktCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_EAPOL;

		return txMgmtQ_Xmit (pTxDataQ->hTxMgmtQ, pPktCtrlBlk, TI_TRUE);
		/* Note: The last parameter indicates that we are running in external context */
	}

	/* Find link id by destination MAC address, if not found drop the packet */
	/* use Intra Bss bridge params*/
	if(!pIntraBssBridgeParam) {
		if (TI_UNLIKELY(MAC_MULTICAST(pEthHead->dst))) {
			uHlid = pTxDataQ->uBcastHlid;
		} else {
			if (txDataQ_LinkMacFind( hTxDataQ, &uHlid, pEthHead->dst) != TI_OK) {
				/* If the packet can't be queued drop it */
				txCtrl_FreePacket (pTxDataQ->hTxCtrl, pPktCtrlBlk, TI_NOK);
				pTxDataQ->uLinkNotFoundCount++;
				return TI_NOK;
			}
		}
	} else {
		uHlid = pIntraBssBridgeParam->uParam;
	}
	pPktCtrlBlk->tTxDescriptor.hlid = uHlid;

	pLinkQ = &pTxDataQ->aDataLinkQ[uHlid]; /* Link queues */

	pPktCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_ETHER;
	/*  set encryption bit */
	if (pLinkQ->bEncrypt) {
		SET_PKT_TYPE_ENCRYPT(pPktCtrlBlk);
	}

	/* Enter critical section to protect classifier data and queue access */
	context_EnterCriticalSection (pTxDataQ->hContext);

	/* Call the Classify function to set the TID field */
	if (txDataClsfr_ClassifyTxPacket (hTxDataQ, pPktCtrlBlk, uPacketDtag) != TI_OK) {
#ifdef TI_DBG
		pTxDataQ->uClsfrMismatchCount++;
#endif /* TI_DBG */
	}

	uQueId = aTidToQueueTable[pPktCtrlBlk->tTxDescriptor.tid];

	/* Check resources per LINK and per AC */
	if (txDataQ_AllocCheckResources( hTxDataQ, pPktCtrlBlk) != TI_OK) {
#ifdef TI_DBG
		pLinkQ->aQueueCounters[uQueId].uDroppedPacket++;
		pTxDataQ->uNoResourcesCount++;
#endif /* TI_DBG */

		/* Leave critical section */
		context_LeaveCriticalSection (pTxDataQ->hContext);
		/* If the packet can't be queued drop it - Should be out of the critical section */
		/* !!! This call should be out of the critical section */
		txCtrl_FreePacket (pTxDataQ->hTxCtrl, pPktCtrlBlk, TI_NOK);
		return TI_NOK;
	}

	/* Enqueue the packet in the appropriate Queue */
	eStatus = que_Enqueue (pLinkQ->aQueues[uQueId], (TI_HANDLE)pPktCtrlBlk);

	/* Get number of packets in current queue */
	uQueSize = que_Size (pLinkQ->aQueues[uQueId]);

	/* If the current queue is not stopped */
	if (pTxDataQ->aQueueBusy[uQueId] == TI_FALSE) {
		/* If the queue has the desired number of packets, request switch to driver context for handling them */
		if (uQueSize == pTxDataQ->aTxSendPaceThresh[uQueId]) {
			tmr_StopTimer (pTxDataQ->hTxSendPaceTimer);
			bRequestSchedule = TI_TRUE;
		}
		/* If below Tx-Send pacing threshold, start timer to trigger packets handling if expired */
		else if (uQueSize < pTxDataQ->aTxSendPaceThresh[uQueId]) {
			tmr_StartTimer (pTxDataQ->hTxSendPaceTimer,
			                txDataQ_TxSendPaceTimeout,
			                hTxDataQ,
			                TX_SEND_PACE_TIMEOUT_MSEC,
			                TI_FALSE);
		}
	}

	/* If allowed to stop network stack and the queue is full, indicate to stop network and
	      to schedule Tx handling (both are executed below, outside the critical section!) */
	if ((pTxDataQ->bStopNetStackTx) && (uQueSize == pTxDataQ->aQueueMaxSize[uQueId])) {
		pLinkQ->aNetStackQueueStopped[uQueId] = TI_TRUE;
		bRequestSchedule = TI_TRUE;
		bStopNetStack = TI_TRUE;
	}

	/* Leave critical section */
	context_LeaveCriticalSection (pTxDataQ->hContext);

	/* If needed, schedule Tx handling */
	if (bRequestSchedule) {
		context_RequestSchedule (pTxDataQ->hContext, pTxDataQ->uContextId);
	}

	/* If needed, stop the network stack Tx */
	if (bStopNetStack) {
		/* Stop the network stack from sending Tx packets as we have at least one date queue full.
		Note that in some of the OS's (e.g Win Mobile) it is implemented by blocking the thread! */
		wlanDrvIf_StopTx (pTxDataQ->hOs);
	}

	if (eStatus != TI_OK) {
		/* If the packet can't be queued drop it */
		txCtrl_FreePacket (pTxDataQ->hTxCtrl, pPktCtrlBlk, TI_NOK);
#ifdef TI_DBG
		pLinkQ->aQueueCounters[uQueId].uDroppedPacket++;
#endif /* TI_DBG */
	} else {
#ifdef TI_DBG
		pLinkQ->aQueueCounters[uQueId].uEnqueuePacket++;
#endif /* TI_DBG */
	}


	return eStatus;
}
TI_STATUS txDataQ_InsertPacket (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk, TI_UINT8 uPacketDtag)
{
	TTxDataQ        *pTxDataQ = (TTxDataQ *)hTxDataQ;
	TEthernetHeader *pEthHead = (TEthernetHeader *)(pPktCtrlBlk->tTxnStruct.aBuf[0]);
	TI_STATUS        eStatus;
	TI_UINT32        uQueId;
	TI_UINT32        uQueSize;
	txCtrl_t         *pTxCtrl = (txCtrl_t *)(pTxDataQ->hTxCtrl);
	TI_BOOL          bRequestSchedule = TI_FALSE;
	TI_BOOL          bStopNetStack = TI_FALSE;
	CL_TRACE_START_L3();

	/* If packet is EAPOL or from the generic Ethertype, forward it to the Mgmt-Queue and exit */
	if ((HTOWLANS(pEthHead->type) == ETHERTYPE_EAPOL) ||
	        (HTOWLANS(pEthHead->type) == pTxCtrl->genericEthertype)) {
		pPktCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_EAPOL;

		return txMgmtQ_Xmit (pTxDataQ->hTxMgmtQ, pPktCtrlBlk, TI_TRUE);
		/* Note: The last parameter indicates that we are running in external context */
	}

	pPktCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_ETHER;

	/* Enter critical section to protect classifier data and queue access */
	context_EnterCriticalSection (pTxDataQ->hContext);

	/* Call the Classify function to set the TID field */
	if (txDataClsfr_ClassifyTxPacket (hTxDataQ, pPktCtrlBlk, uPacketDtag) != TI_OK) {
#ifdef TI_DBG
		pTxDataQ->uClsfrMismatchCount++;
		TRACE0(pTxDataQ->hReport, REPORT_SEVERITY_WARNING, "txDataQueue_xmit: No matching classifier found \n");
#endif /* TI_DBG */
	}

	/* Enqueue the packet in the appropriate Queue */
	uQueId = aTidToQueueTable[pPktCtrlBlk->tTxDescriptor.tid];
	eStatus = que_Enqueue (pTxDataQ->aQueues[uQueId], (TI_HANDLE)pPktCtrlBlk);

	/* Get number of packets in current queue */
	uQueSize = que_Size (pTxDataQ->aQueues[uQueId]);

	/* If the current queue is not stopped */
	if (pTxDataQ->aQueueBusy[uQueId] == TI_FALSE) {
		/* If the queue has the desired number of packets, request switch to driver context for handling them */
		if (uQueSize == pTxDataQ->aTxSendPaceThresh[uQueId]) {
			tmr_StopTimer (pTxDataQ->hTxSendPaceTimer);
			bRequestSchedule = TI_TRUE;
		}
		/* If below Tx-Send pacing threshold, start timer to trigger packets handling if expired */
		else if (uQueSize < pTxDataQ->aTxSendPaceThresh[uQueId]) {
			tmr_StartTimer (pTxDataQ->hTxSendPaceTimer,
			                txDataQ_TxSendPaceTimeout,
			                hTxDataQ,
			                TX_SEND_PACE_TIMEOUT_MSEC,
			                TI_FALSE);
		}
	}

	/* If allowed to stop network stack and the queue is full, indicate to stop network and
	      to schedule Tx handling (both are executed below, outside the critical section!) */
	if ((pTxDataQ->bStopNetStackTx) && (uQueSize == pTxDataQ->aQueueMaxSize[uQueId])) {
		pTxDataQ->aNetStackQueueStopped[uQueId] = TI_TRUE;
		bRequestSchedule = TI_TRUE;
		bStopNetStack = TI_TRUE;
	}

	/* Leave critical section */
	context_LeaveCriticalSection (pTxDataQ->hContext);

	/* If needed, schedule Tx handling */
	if (bRequestSchedule) {
		context_RequestSchedule (pTxDataQ->hContext, pTxDataQ->uContextId);
	}

	/* If needed, stop the network stack Tx */
	if (bStopNetStack) {
		/* Stop the network stack from sending Tx packets as we have at least one date queue full.
		Note that in some of the OS's (e.g Win Mobile) it is implemented by blocking the thread*/
		wlanDrvIf_StopTx (pTxDataQ->hOs);
	}

	if (eStatus != TI_OK) {
		/* If the packet can't be queued drop it */
		txCtrl_FreePacket (pTxDataQ->hTxCtrl, pPktCtrlBlk, TI_NOK);
#ifdef TI_DBG
		pTxDataQ->aQueueCounters[uQueId].uDroppedPacket++;
#endif /* TI_DBG */
	} else {
#ifdef TI_DBG
		pTxDataQ->aQueueCounters[uQueId].uEnqueuePacket++;
#endif /* TI_DBG */
	}

	CL_TRACE_END_L3 ("tiwlan_drv.ko", "INHERIT", "TX", "");

	return eStatus;
}