• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ os_timeStampMs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: idle_to_selfWait

/***********************************************************************
 *                        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;
}
开发者ID:ACSOP,项目名称:android_hardware_ti_wlan,代码行数:38,代码来源:connIbss.c


示例2: fwEvent_SmHandleEvents

/*
 * \brief	Handle the Fw Status information
 *
 * \param  hFwEvent  - FwEvent Driver handle
 * \return void
 *
 * \par Description
 * This function is called from fwEvent_Handle on a sync read, or from TwIf as a CB on an async read.
 * It calls fwEvent_CallHandlers to handle the triggered interrupts.
 *
 * \sa fwEvent_Handle
 */
static ETxnStatus fwEvent_SmHandleEvents (TfwEvent *pFwEvent)
{
	ETxnStatus eStatus;

	/* Save delta between driver and FW time (needed for Tx packets lifetime) */
	pFwEvent->uFwTimeOffset = (os_timeStampMs (pFwEvent->hOs) * 1000) -
	                          ENDIAN_HANDLE_LONG (pFwEvent->tFwStatusTxn.tFwStatus.fwLocalTime);

#ifdef HOST_INTR_MODE_LEVEL
	/* Acknowledge the host interrupt for LEVEL mode (must be after HINT_STT_CLR register clear on read) */
	os_InterruptServiced (pFwEvent->hOs);
#endif

	/* Save the interrupts status retreived from the FW */
	pFwEvent->uEventVector = pFwEvent->tFwStatusTxn.tFwStatus.intrStatus;

	/* Mask unwanted interrupts */
	pFwEvent->uEventVector &= pFwEvent->uEventMask;

	/* Call the interrupts handlers */
	eStatus = fwEvent_CallHandlers (pFwEvent);


	/* Return the status of the handlers processing (complete, pending or error) */
	return eStatus;
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:38,代码来源:FwEvent.c


示例3: switchChannel_smReqSCR_UpdateCmd

/**
*
*
* \b Description:
*
* Update the Switch Channel command parameters.
 * Request SCR and wait for SCR return.
 * if tx status suspend
 *  update regulatory Domain
 *  update tx
 *  start periodic timer

*
* \b ARGS:
*
*  I   - pData - pointer to the SwitchChannel SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
*
*************************************************************************/
static TI_STATUS switchChannel_smReqSCR_UpdateCmd(void *pData)
{
	switchChannel_t             *pSwitchChannel = (switchChannel_t*)pData;
	EScrClientRequestStatus     scrStatus;
	EScePendReason              scrPendReason;

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


	/* Save the TS when requesting SCR */
	pSwitchChannel->SCRRequestTimestamp = os_timeStampMs(pSwitchChannel->hOs);

	scrStatus = scr_clientRequest(pSwitchChannel->hSCR, SCR_CID_SWITCH_CHANNEL,
	                              SCR_RESOURCE_SERVING_CHANNEL, &scrPendReason);
	if ((scrStatus != SCR_CRS_RUN) && (scrStatus != SCR_CRS_PEND)) {
		return (switchChannel_smEvent((TI_UINT8*)&pSwitchChannel->currentState, SC_EVENT_SCR_FAIL, pSwitchChannel));

	}
	if (scrStatus == SCR_CRS_RUN) {
		switchChannel_scrStatusCB(pSwitchChannel, scrStatus, SCR_RESOURCE_SERVING_CHANNEL, scrPendReason);
	} else if ((scrPendReason==SCR_PR_OTHER_CLIENT_RUNNING) ||
	           (scrPendReason==SCR_PR_DIFFERENT_GROUP_RUNNING) ) {  /* No use to wait for the SCR, invoke FAIL */
		return (switchChannel_smEvent((TI_UINT8*)&pSwitchChannel->currentState, SC_EVENT_SCR_FAIL, pSwitchChannel));
	}
	/* wait for the SCR callback function to be called */
	return TI_OK;

}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:53,代码来源:SwitchChannel.c


示例4: switchChannel_smStartSwitchChannelCmd

/**
*
*
* \b Description:
*
* This function is called once SwitchChannel command was received and the SCR
 * request returned with reason RUN.
 * In this case perform the following:
 *  Set CMD to FW


*
* \b ARGS:
*
*  I   - pData - pointer to the SwitchChannel SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
*
*************************************************************************/
static TI_STATUS switchChannel_smStartSwitchChannelCmd(void *pData)
{
	switchChannel_t         *pSwitchChannel = (switchChannel_t *)pData;
	TSwitchChannelParams    pSwitchChannelCmd;
	TI_UINT32                   switchChannelTimeDuration;
	paramInfo_t             param;

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

	param.paramType = SITE_MGR_BEACON_INTERVAL_PARAM;
	siteMgr_getParam(pSwitchChannel->hSiteMgr, &param);

	switchChannelTimeDuration = pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount * param.content.beaconInterval * 1024 / 1000;
	if (  (switchChannelTimeDuration!=0) &&
	        ((os_timeStampMs(pSwitchChannel->hOs) - pSwitchChannel->SCRRequestTimestamp) >= switchChannelTimeDuration )) {  /* There's no time to perfrom the SCC, set the Count to 1 */
		pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount = 1;
	}

	apConn_indicateSwitchChannelInProgress(pSwitchChannel->hApConn);

	pSwitchChannelCmd.channelNumber = pSwitchChannel->curChannelSwitchCmdParams.channelNumber;
	pSwitchChannelCmd.switchTime    = pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount;
	pSwitchChannelCmd.txFlag        = pSwitchChannel->curChannelSwitchCmdParams.channelSwitchMode;
	pSwitchChannelCmd.flush         = 0;
	TWD_CmdSwitchChannel (pSwitchChannel->hTWD, &pSwitchChannelCmd);


	return TI_OK;

}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:54,代码来源:SwitchChannel.c


示例5: txCtrlParams_setAdmissionCtrlParams

/***********************************************************************
 *                        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;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:76,代码来源:txCtrlParams.c


示例6: fwEvent_SmHandleEvents

/*
 * \brief	Handle the Fw Status information 
 * 
 * \param  hFwEvent  - FwEvent Driver handle
 * \return void
 * 
 * \par Description
 * This function is called from fwEvent_Handle on a sync read, or from TwIf as a CB on an async read.
 * It calls fwEvent_CallHandlers to handle the triggered interrupts.
 * 
 * \sa fwEvent_Handle
 */
static ETxnStatus fwEvent_SmHandleEvents (TfwEvent *pFwEvent)
{
    ETxnStatus eStatus;
    CL_TRACE_START_L4();

    /* Save delta between driver and FW time (needed for Tx packets lifetime) */
    pFwEvent->uFwTimeOffset = (os_timeStampMs (pFwEvent->hOs) * 1000) - 
                              ENDIAN_HANDLE_LONG (pFwEvent->tFwStatusTxn.tFwStatus.fwLocalTime);

#ifdef HOST_INTR_MODE_LEVEL
    /* Acknowledge the host interrupt for LEVEL mode (must be after HINT_STT_CLR register clear on read) */
    os_InterruptServiced (pFwEvent->hOs);
#endif

    /* Save the interrupts status retreived from the FW */
    pFwEvent->uEventVector = pFwEvent->tFwStatusTxn.tFwStatus.intrStatus;

    /* Mask unwanted interrupts */
    pFwEvent->uEventVector &= pFwEvent->uEventMask;

    /* Call the interrupts handlers */
    eStatus = fwEvent_CallHandlers (pFwEvent);

    TRACE5(pFwEvent->hReport, REPORT_SEVERITY_INFORMATION, "fwEvent_SmHandleEvents: Status=%d, EventVector=0x%x, IntrPending=%d, NumPendHndlrs=%d, FwTimeOfst=%d\n", eStatus, pFwEvent->uEventVector, pFwEvent->bIntrPending, pFwEvent->uNumPendHndlrs, pFwEvent->uFwTimeOffset);
    CL_TRACE_END_L4("tiwlan_drv.ko", "CONTEXT", "FwEvent", "");

    /* Return the status of the handlers processing (complete, pending or error) */
    return eStatus;
} 
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:41,代码来源:FwEvent.c


示例7: TrafficMonitor_Start

TI_STATUS TrafficMonitor_Start(TI_HANDLE hTrafficMonitor)
{
	TrafficMonitor_t *TrafficMonitor =(TrafficMonitor_t*)hTrafficMonitor;
	TrafficAlertElement_t *AlertElement;
	TI_UINT32 CurentTime;


	if (TrafficMonitor == NULL)
		return TI_NOK;

	/*starts the bandwidth TIMER*/
	if (!TrafficMonitor->Active) { /*To prevent double call to timer start*/
		TrafficMonitor_UpdateDownTrafficTimerState (TrafficMonitor);
	}

	AlertElement  = (TrafficAlertElement_t*)List_GetFirst(TrafficMonitor->NotificationRegList);
	CurentTime = os_timeStampMs(TrafficMonitor->hOs);

	/* go over all the Down elements and reload the timer*/
	while (AlertElement) {
		if (AlertElement->CurrentState != ALERT_WAIT_FOR_RESET) {
			AlertElement->EventCounter = 0;
			AlertElement->TimeOut = AlertElement->TimeIntervalMs + CurentTime;
		}
		AlertElement = (TrafficAlertElement_t*)List_GetNext(TrafficMonitor->NotificationRegList);
	}
	TrafficMonitor->Active = TI_TRUE;

	return TI_OK;
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:30,代码来源:TrafficMonitor.c


示例8: MacServices_measurementSRV_startMeasurement

/**
 * \\n
 * \date 09-November-2005\n
 * \brief Starts a measurement operation.\n
 *
 * Function Scope \e Public.\n
 * \param hMacServices - handle to the MacServices object.\n
 * \param pMsrRequest - a structure containing measurement parameters.\n
 * \param timeToRequestexpiryMs - the time (in milliseconds) the measurement SRV has to start the request.\n
 * \param cmdResponseCBFunc - callback function to used for command response.\n
 * \param cmdResponseCBObj - handle to pass to command response CB.\n
 * \param cmdCompleteCBFunc - callback function to be used for command complete.\n
 * \param cmdCompleteCBObj - handle to pass to command complete CB.\n
 * \return TI_OK if successful (various, TBD codes if not).\n
 */
TI_STATUS MacServices_measurementSRV_startMeasurement( TI_HANDLE hMacServices,
        TMeasurementRequest* pMsrRequest,
        TI_UINT32 timeToRequestExpiryMs,
        TCmdResponseCb cmdResponseCBFunc,
        TI_HANDLE cmdResponseCBObj,
        TMeasurementSrvCompleteCb cmdCompleteCBFunc,
        TI_HANDLE cmdCompleteCBObj )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
	TI_INT32 i;

#ifdef TI_DBG
	measurementSRVPrintRequest( (TI_HANDLE)pMeasurementSRV, pMsrRequest );
#endif

	/* mark that request is in progress */
	pMeasurementSRV->bInRequest = TI_TRUE;

	/* mark to send NULL data when exiting driver mode (can be changed to TI_FALSE
	   only when explictly stopping the measurement */
	pMeasurementSRV->bSendNullDataWhenExitPs = TI_TRUE;

	/* Nullify return status */
	pMeasurementSRV->returnStatus = TI_OK;

	/* copy request parameters */
	os_memoryCopy (pMeasurementSRV->hOS,
	               (void *)&pMeasurementSRV->msrRequest,
	               (void *)pMsrRequest,
	               sizeof(TMeasurementRequest));

	/* Mark the current time stamp and the duration to start to cehck expiry later */
	pMeasurementSRV->requestRecptionTimeStampMs = os_timeStampMs( pMeasurementSRV->hOS );
	pMeasurementSRV->timeToRequestExpiryMs = timeToRequestExpiryMs;

	/* copy callbacks */
	pMeasurementSRV->commandResponseCBFunc = cmdResponseCBFunc;
	pMeasurementSRV->commandResponseCBObj = cmdResponseCBObj;
	pMeasurementSRV->measurmentCompleteCBFunc = cmdCompleteCBFunc;
	pMeasurementSRV->measurementCompleteCBObj = cmdCompleteCBObj;

	/* initialize reply */
	pMeasurementSRV->msrReply.numberOfTypes = pMsrRequest->numberOfTypes;
	for ( i = 0; i < pMsrRequest->numberOfTypes; i++ ) {
		pMeasurementSRV->msrReply.msrTypes[ i ].msrType = pMeasurementSRV->msrRequest.msrTypes[ i ].msrType;
		pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_OK;
	}

	/* nullify the pending CBs bitmap */
	pMeasurementSRV->pendingParamCBs = 0;

	/* send a start measurement event to the SM */
	measurementSRVSM_SMEvent( (TI_HANDLE)pMeasurementSRV, &(pMeasurementSRV->SMState),
	                          MSR_SRV_EVENT_MEASURE_START_REQUEST );

	/* mark that request has been sent */
	pMeasurementSRV->bInRequest = TI_FALSE;

	return pMeasurementSRV->returnStatus;
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:75,代码来源:MeasurementSrv.c


示例9: cmdQueue_Error

/*
 * \brief	Called when a command timeout occur
 *
 * \param  hCmdQueue - Handle to CmdQueue
 * \return TI_OK
 *
 * \par Description
 *
 * \sa cmdQueue_Init, cmdMbox_TimeOut
 */
TI_STATUS cmdQueue_Error (TI_HANDLE hCmdQueue, TI_UINT32 command, TI_UINT32 status, void *param)
{
	TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;

	if (status == CMD_STATUS_UNKNOWN_CMD)
	{
		TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: Unknown Cmd  (%d)\n", command);
	}
	else if (status == CMD_STATUS_UNKNOWN_IE)
	{
		TRACE4( pCmdQueue->hReport, REPORT_SEVERITY_CONSOLE, "cmdQueue_Error: Unknown IE, cmdType : %d (%d) IE: %d (%d)\n",
		        command,
		        command,
		        (param) ? *((TI_UINT16 *) param) : 0,
		        (param) ? *((TI_UINT16 *) param) : 0
		      );

		WLAN_OS_REPORT(("cmdQueue_Error: Unknown IE, cmdType : %s (%d) IE: %s (%d)\n",
		                cmdQueue_GetCmdString (command),
		                command,
		                (param) ? cmdQueue_GetIEString (command, *((TI_UINT16 *) param)) : "",
		                *((TI_UINT16 *) param)));
	}
	else
	{
		TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: CmdMbox status is %d\n", status);
	}

	if (status != CMD_STATUS_UNKNOWN_CMD && status != CMD_STATUS_UNKNOWN_IE)
	{
#ifdef TI_DBG

		TCmdQueueNode* pHead = &pCmdQueue->aCmdQueue[pCmdQueue->head];
		TI_UINT32 TimeStamp = os_timeStampMs(pCmdQueue->hOs);

		WLAN_OS_REPORT(("cmdQueue_Error: **ERROR**  Command Occured \n"
		                "                                        Cmd = %s %s, Len = %d \n"
		                "                                        NumOfCmd = %d\n"
		                "                                        MAC TimeStamp on timeout = %d\n",
		                cmdQueue_GetCmdString(pHead->cmdType),
		                (pHead->aParamsBuf) ? cmdQueue_GetIEString(pHead->cmdType, *(TI_UINT16 *)pHead->aParamsBuf) : "",
		                pHead->uParamsLen,
		                pCmdQueue->uNumberOfCommandInQueue,
		                TimeStamp));

		/* Print The command that was sent before the timeout occur */
		cmdQueue_PrintHistory(pCmdQueue, CMDQUEUE_HISTORY_DEPTH);

#endif /* TI_DBG */

		/* preform Recovery */
		if (pCmdQueue->fFailureCb)
		{
			pCmdQueue->fFailureCb (pCmdQueue->hFailureCb, TI_NOK);
		}
	}

	return TI_OK;
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:69,代码来源:CmdQueue.c


示例10: TrafficMonitor_Event

/***********************************************************************
 *                        TrafficMonitor_Event
 ***********************************************************************
DESCRIPTION: this function is called for every event that was requested from the Tx or Rx
             The function preformes update of the all the relevant Alert in the system
             that corresponds to the event. checks the Alert Status due to this event.



INPUT:          hTrafficMonitor -       Traffic Monitor the object.

            Count - evnet count.
            Mask - the event mask that That triggered this function.

            MonitorModuleType Will hold the module type from where this function was called.

OUTPUT:

RETURN:

************************************************************************/
void TrafficMonitor_Event(TI_HANDLE hTrafficMonitor,int Count,TI_UINT16 Mask,TI_UINT32 MonitorModuleType)
{
	TrafficMonitor_t *TrafficMonitor =(TrafficMonitor_t*)hTrafficMonitor;
	TrafficAlertElement_t *AlertElement;
	TI_UINT32 activeTrafDownEventsNum = 0;
	TI_UINT32 trafficDownMinTimeout = 0xFFFFFFFF;
	TI_UINT32 uCurentTS;

	if (TrafficMonitor == NULL)
		return;

	if (!TrafficMonitor->Active)
		return;

	uCurentTS = os_timeStampMs(TrafficMonitor->hOs);

	/* for BW calculation */
	if (MonitorModuleType == RX_TRAFF_MODULE) {
		if (Mask & DIRECTED_FRAMES_RECV) {
			TrafficMonitor_updateBW(&TrafficMonitor->DirectRxFrameBW, uCurentTS);
		}
	} else if (MonitorModuleType == TX_TRAFF_MODULE) {
		if (Mask & DIRECTED_FRAMES_XFER) {
			TrafficMonitor_updateBW(&TrafficMonitor->DirectTxFrameBW, uCurentTS);
		}
	} else {
		return; /* module type does not exist, error return */
	}

	AlertElement  = (TrafficAlertElement_t*)List_GetFirst(TrafficMonitor->NotificationRegList);

	/* go over all the elements and check for alert */
	while (AlertElement) {
		if (AlertElement->CurrentState != ALERT_WAIT_FOR_RESET) {
			if (AlertElement->MonitorMask[MonitorModuleType] & Mask) {
				AlertElement->ActionFunc(AlertElement,Count);
				if (AlertElement->Direction == TRAFF_UP) {
					isThresholdUp(AlertElement, uCurentTS);
				}
			}

			if ((AlertElement->Direction == TRAFF_DOWN) && (AlertElement->Trigger == TRAFF_EDGE) && (AlertElement->CurrentState == ALERT_OFF) && (AlertElement->Enabled == TI_TRUE)) {
				/* Increase counter of active traffic down events */
				activeTrafDownEventsNum++;

				/* Search for the alert with the most short Interval time - will be used to start timer */
				if ((AlertElement->TimeIntervalMs) < (trafficDownMinTimeout))
					trafficDownMinTimeout = AlertElement->TimeIntervalMs;
			}

		}
		AlertElement = (TrafficAlertElement_t*)List_GetNext(TrafficMonitor->NotificationRegList);
	}

	TrafficMonitor_ChangeDownTimerStatus (TrafficMonitor,activeTrafDownEventsNum,trafficDownMinTimeout);

}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:78,代码来源:TrafficMonitor.c


示例11: StartMissingPktTimer

/**
 * \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;
	}
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:16,代码来源:RxQueue.c


示例12: TrafficMonitor_GetFrameBandwidth

/***********************************************************************
 *                        TrafficMonitor_GetFrameBandwidth
 ***********************************************************************
DESCRIPTION: Returns the total direct frames in the Rx and Tx per second.

INPUT:          hTrafficMonitor -       Traffic Monitor the object.


OUTPUT:

RETURN:     Total BW
************************************************************************/
int TrafficMonitor_GetFrameBandwidth(TI_HANDLE hTrafficMonitor)
{
	TrafficMonitor_t 	*pTrafficMonitor =(TrafficMonitor_t*)hTrafficMonitor;
	TI_UINT32 			uCurentTS;

	if (pTrafficMonitor == NULL)
		return TI_NOK;

	uCurentTS = os_timeStampMs(pTrafficMonitor->hOs);

	/* Calculate BW for Rx & Tx */
	return ( TrafficMonitor_calcBW(&pTrafficMonitor->DirectRxFrameBW, uCurentTS) +
	         TrafficMonitor_calcBW(&pTrafficMonitor->DirectTxFrameBW, uCurentTS) );
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:26,代码来源:TrafficMonitor.c


示例13: sendDataPacket

void sendDataPacket (TI_HANDLE hOs)
{
    TI_UINT32       i;
	TTxCtrlBlk *    pPktCtrlBlk;
    TI_UINT8 *      pPktBuf;
    TEthernetHeader tEthHeader;
	char SrcBssid[6] = {0x88,0x88,0x88,0x88,0x88,0x88};
	char DesBssid[6] = {0x22,0x22,0x22,0x22,0x22,0x22};

	/* Allocate a TxCtrlBlk for the Tx packet and save timestamp, length and packet handle */
    pPktCtrlBlk = TWD_txCtrlBlk_Alloc (tmp_hTWD);

	if( NULL == pPktCtrlBlk )
	{
        os_printf("\n sendDataPacket() : pPktCtrlBlk returned as NULL from TWD_txCtrlBlk_Alloc() ");
        return;
	}

    pPktCtrlBlk->tTxDescriptor.startTime = os_timeStampMs (hOs);
    pPktCtrlBlk->tTxDescriptor.length    = (TI_UINT16)packetLength + ETHERNET_HDR_LEN;
    pPktCtrlBlk->tTxDescriptor.tid       = 0;
    pPktCtrlBlk->tTxPktParams.uPktType   = TX_PKT_TYPE_ETHER;

    /* Allocate buffer with headroom for getting the IP header in a 4-byte aligned address */
    pPktBuf = txCtrl_AllocPacketBuffer (tmp_hTxCtrl, pPktCtrlBlk, packetLength + ETHERNET_HDR_LEN + 2);

    /* Prepare Ethernet header */
    tEthHeader.type = HTOWLANS(ETHERTYPE_IP);
    MAC_COPY (tEthHeader.src, SrcBssid);
    MAC_COPY (tEthHeader.dst, DesBssid);

	if( pPktBuf )
	{
	    os_memoryCopy (hOs, pPktBuf + 2, &tEthHeader, ETHERNET_HDR_LEN);

        /* Build BDL */
        BUILD_TX_TWO_BUF_PKT_BDL (pPktCtrlBlk,
                                  pPktBuf + 2,
                                  ETHERNET_HDR_LEN,
                                  pPktBuf + 2 + ETHERNET_HDR_LEN,
                                  packetLength)

        /* Fill data buffer with incremented numbers */
        for (i = 0; i < packetLength; i++)
        {
            *(pPktBuf + 2 + ETHERNET_HDR_LEN + i) = i;
        }
	}
	else
	{
开发者ID:chambejp,项目名称:hardware,代码行数:50,代码来源:fwdriverdebug.c


示例14: whalCtrl_RecoveryEnded

/*
 * ----------------------------------------------------------------------------
 * Function : whalCtrl_RecoveryEnded
 *
 * Input    : 
 * Output   :
 * Process  :
 *		aanouce all the modules about the end of the recovery proccess.
 * Note(s)  :  Done
 * -----------------------------------------------------------------------------
 */
void whalCtrl_RecoveryEnded(TI_HANDLE hWhalCtrl)
{
	WHAL_CTRL *pWhalCtrl = (WHAL_CTRL *)hWhalCtrl;

	/*Change the State of the mboxQueue and the interrupt Module and 
	After recovery we should enable back all interrupts according to the last interrupt shadow mask*/
	whalCtrl_exitFromInitMode(hWhalCtrl);
    
    /* 
    Indicates the MboxQueue that Reconfig Ended in Order To Call the CallBacks
	That Was saved before the recovery process started 
	*/
	CmdQueue_EndReconfig(((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdQueue);
	
	WLAN_REPORT_INFORMATION(pWhalCtrl->hReport, HAL_CTRL_MODULE_LOG,
							 ("whalCtrl_ReConfig: End  (%d)\n", os_timeStampMs(pWhalCtrl->hOs)));
}
开发者ID:0omega,项目名称:platform_system_wlan_ti,代码行数:28,代码来源:whalRecovery.c


示例15: dummyPktReqCB

/****************************************************************************************
 *                               dummyPktReqCB                                          *
 ****************************************************************************************
DESCRIPTION: Callback for the TWD_OWN_EVENT_DUMMY_PKT_REQ event - transmits a dummy
             packet

INPUT:      - hTxMgmtQ      - Handle to the TxMgmtQ module
            - str			- Buffer containing the event data
            - strLen        - Event data length
OUTPUT:
RETURN:    void.\n
****************************************************************************************/
void dummyPktReqCB(TI_HANDLE hTxMgmtQ, char* str , TI_UINT32 strLen)
{
	TTxMgmtQ *pTxMgmtQ = (TTxMgmtQ*)hTxMgmtQ;
    TTxCtrlBlk* pTxCtrlBlk;
    void* pPayload;
    const TI_UINT16 uDummyPktBufLen = 1400;
    TI_STATUS status;

    /* Allocate control block for dummy packet */
    pTxCtrlBlk = TWD_txCtrlBlk_Alloc(pTxMgmtQ->hTWD);
    if (NULL == pTxCtrlBlk) {
        TRACE0(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "dummyPktReqCB: TxCtrlBlk allocation failed!\n");
        return;
    }

    /* Allocate payload buffer */
    pPayload  = txCtrl_AllocPacketBuffer(pTxMgmtQ->hTxCtrl, pTxCtrlBlk, WLAN_HDR_LEN + uDummyPktBufLen);
    if (NULL == pPayload)
    {
        TRACE0(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "dummyPktReqCB: Packet buffer allocation failed!\n");
        TWD_txCtrlBlk_Free (pTxMgmtQ->hTWD, pTxCtrlBlk);
        return;
    }

	/* Set packet parameters */
    {
		pTxCtrlBlk->tTxDescriptor.startTime = os_timeStampMs(pTxMgmtQ->hOs);

		/* Mark as a Dummy Blocks Packet */
		pTxCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_DUMMY_BLKS;

		BUILD_TX_TWO_BUF_PKT_BDL (pTxCtrlBlk, pTxCtrlBlk->aPktHdr, WLAN_HDR_LEN, pPayload, uDummyPktBufLen);
    }

    pTxMgmtQ->tDbgCounters.uDummyPackets++;

    /* Enqueue packet in the management-queues and run the scheduler. */
    status = txMgmtQ_Xmit(pTxMgmtQ, pTxCtrlBlk, TI_FALSE);

    if (TI_NOK == status)
    {
        TRACE0(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "dummyPktReqCB: xmit failed!\n");
    }
}
开发者ID:chambejp,项目名称:hardware,代码行数:56,代码来源:txMgmtQueue.c


示例16: TrafficMonitor_Init

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
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:43,代码来源:TrafficMonitor.c


示例17: whalCtrl_ReConfig

/*
 * ----------------------------------------------------------------------------
 * Function : whalCtrl_ReConfig
 *
 * Input    : 
 * Output   :
 * Process  :
 *      Do firmware download 
 *      Run the firmware
 *      Configure stage (ConfigHw)
 *      Re-Join if needed
 * Note(s)  :  Done
 * -----------------------------------------------------------------------------
 */
int whalCtrl_ReConfig (TI_HANDLE hWhalCtrl, int DoReJoin)
{
    WHAL_CTRL    *pWhalCtrl = (WHAL_CTRL *)hWhalCtrl;
    WlanParams_T *pWlanParams = whal_ParamsGetWlanParams (pWhalCtrl->pWhalParams);
    int           Stt;
    
    if (!pWlanParams->RecoveryEnable)
    {
        WLAN_OS_REPORT(("Recovery is disabled in registry, abort recovery process\n"));
        return OK;
    }
    
  #if 0
    /* L.M. PATCH for card eject */
    if (!whalBus_FwCtrl_isCardIn (pWhalCtrl->pHwCtrl->hWhalBus))
    {
        WLAN_REPORT_REPLY (pWhalCtrl->hReport, HAL_CTRL_MODULE_LOG,
                          ("whalCtrl_ReConfig: card was removed => not proceeding\n"));
        return OK;
    }
  #endif/*_WINDOWS*/

    /*
     * Initiate the wlan hardware (FW download).
     * -----------------------------------------
     */
    WLAN_REPORT_INFORMATION (pWhalCtrl->hReport, HAL_CTRL_MODULE_LOG,
                             ("whalCtrl_ReConfig: Start(%d)\n", os_timeStampMs (pWhalCtrl->hOs)));
    Stt = whal_hwCtrl_Initiate (pWhalCtrl->pHwCtrl);
    if (Stt != OK)
    {
        WLAN_REPORT_ERROR (pWhalCtrl->hReport, HAL_CTRL_MODULE_LOG,
            ("whalCtrl_ReConfig: whal_hwCtrl_Initiate failed\n"));
        return NOK;
    }

    /* Configure the WLAN hardware */
    Stt = whal_hwCtrl_ConfigHw (pWhalCtrl->pHwCtrl, (void *)whalCtrl_ReConfigCb, hWhalCtrl, TRUE);
    
    return OK;
}
开发者ID:0omega,项目名称:platform_system_wlan_ti,代码行数:55,代码来源:whalRecovery.c


示例18: wlanDrvIf_Xmit

/** 
 * \fn     wlanDrvIf_Xmit
 * \brief  Packets transmission
 * 
 * The network stack calls this function in order to transmit a packet
 *     through the WLAN interface.
 * The packet is inserted to the drver Tx queues and its handling is continued
 *     after switching to the driver context.
 *
 * \note   
 * \param  skb - The Linux packet buffer structure
 * \param  dev - The driver network-interface handle
 * \return 0 (= OK)
 * \sa     
 */ 
static int wlanDrvIf_Xmit (struct sk_buff *skb, struct net_device *dev)
{
	TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);
	TTxCtrlBlk *  pPktCtrlBlk;
	int status;

	CL_TRACE_START_L1();

	os_profile (drv, 0, 0);
	drv->stats.tx_packets++;
	drv->stats.tx_bytes += skb->len;

	/* Allocate a TxCtrlBlk for the Tx packet and save timestamp, length and packet handle */
	pPktCtrlBlk = TWD_txCtrlBlk_Alloc (drv->tCommon.hTWD);

	pPktCtrlBlk->tTxDescriptor.startTime    = os_timeStampMs(drv); /* remove use of skb->tstamp.off_usec */
	pPktCtrlBlk->tTxDescriptor.length       = skb->len;
	pPktCtrlBlk->tTxPktParams.pInputPkt     = skb;

	/* Point the first BDL buffer to the Ethernet header, and the second buffer to the rest of the packet */
	pPktCtrlBlk->tTxnStruct.aBuf[0] = skb->data;
	pPktCtrlBlk->tTxnStruct.aLen[0] = ETHERNET_HDR_LEN;
	pPktCtrlBlk->tTxnStruct.aBuf[1] = skb->data + ETHERNET_HDR_LEN;
	pPktCtrlBlk->tTxnStruct.aLen[1] = (TI_UINT16)skb->len - ETHERNET_HDR_LEN;
	pPktCtrlBlk->tTxnStruct.aLen[2] = 0;

	/* Send the packet to the driver for transmission. */
	status = txDataQ_InsertPacket (drv->tCommon.hTxDataQ, pPktCtrlBlk,(TI_UINT8)skb->priority);

	/* If failed (queue full or driver not running), drop the packet. */
    if (status != TI_OK)
    {
        drv->stats.tx_errors++;
    }
	os_profile (drv, 1, 0);

	CL_TRACE_END_L1("tiwlan_drv.ko", "OS", "TX", "");

	return 0;
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:55,代码来源:WlanDrvIf.c


示例19: idle_to_selfWait

/***********************************************************************
 *                        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;
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:35,代码来源:connIbss.c


示例20: TimerMonitor_TimeOut

/*
 *      Timer function that is called for every x time interval
 *   That will invoke a process if any down limit as occurred.
 *
 ************************************************************************/
static void TimerMonitor_TimeOut (TI_HANDLE hTrafficMonitor, TI_BOOL bTwdInitOccured)
{

	TrafficMonitor_t *TrafficMonitor =(TrafficMonitor_t*)hTrafficMonitor;
	TrafficAlertElement_t *AlertElement;
	TI_UINT32 CurentTime;
	TI_UINT32 activeTrafDownEventsNum = 0;
	TI_UINT32 trafficDownMinTimeout = 0xFFFFFFFF;

	if (TrafficMonitor == NULL)
		return;

	AlertElement  = (TrafficAlertElement_t*)List_GetFirst(TrafficMonitor->NotificationRegList);
	CurentTime = os_timeStampMs(TrafficMonitor->hOs);


	/* go over all the Down elements and check for alert */
	while (AlertElement) {
		if (AlertElement->CurrentState != ALERT_WAIT_FOR_RESET) {
			if (AlertElement->Direction == TRAFF_DOWN) {
				isThresholdDown(AlertElement,CurentTime);
			}
		}

		if ((AlertElement->Direction == TRAFF_DOWN) && (AlertElement->Trigger == TRAFF_EDGE) && (AlertElement->CurrentState == ALERT_OFF) && (AlertElement->Enabled == TI_TRUE)) {
			/* Increase counter of active traffic down events */
			activeTrafDownEventsNum++;

			/* Search for the alert with the most short Interval time - will be used to start timer */
			if ((AlertElement->TimeIntervalMs) < (trafficDownMinTimeout))
				trafficDownMinTimeout = AlertElement->TimeIntervalMs;
		}

		AlertElement = (TrafficAlertElement_t*)List_GetNext(TrafficMonitor->NotificationRegList);
	}

	TrafficMonitor_ChangeDownTimerStatus (TrafficMonitor,activeTrafDownEventsNum,trafficDownMinTimeout);

}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:44,代码来源:TrafficMonitor.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ os_time_get函数代码示例发布时间:2022-05-30
下一篇:
C++ os_strncpy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap