本文整理汇总了C++中VOS_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ VOS_ASSERT函数的具体用法?C++ VOS_ASSERT怎么用?C++ VOS_ASSERT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VOS_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vos_timer_destroy
VOS_STATUS vos_timer_destroy ( vos_timer_t *timer )
{
VOS_STATUS vStatus=VOS_STATUS_SUCCESS;
unsigned long flags;
// Check for invalid pointer
if ( NULL == timer )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Null timer pointer being passed",__func__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// Check if timer refers to an uninitialized object
if ( LINUX_TIMER_COOKIE != timer->platformInfo.cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Cannot destroy uninitialized timer",__func__);
return VOS_STATUS_E_INVAL;
}
spin_lock_irqsave( &timer->platformInfo.spinlock,flags );
switch ( timer->state )
{
case VOS_TIMER_STATE_STARTING:
vStatus = VOS_STATUS_E_BUSY;
break;
case VOS_TIMER_STATE_RUNNING:
/* Stop the timer first */
del_timer(&(timer->platformInfo.Timer));
vStatus = VOS_STATUS_SUCCESS;
break;
case VOS_TIMER_STATE_STOPPED:
vStatus = VOS_STATUS_SUCCESS;
break;
case VOS_TIMER_STATE_UNUSED:
vStatus = VOS_STATUS_E_ALREADY;
break;
default:
vStatus = VOS_STATUS_E_FAULT;
break;
}
if ( VOS_STATUS_SUCCESS == vStatus )
{
timer->platformInfo.cookie = LINUX_INVALID_TIMER_COOKIE;
timer->state = VOS_TIMER_STATE_UNUSED;
spin_unlock_irqrestore( &timer->platformInfo.spinlock,flags );
return vStatus;
}
spin_unlock_irqrestore( &timer->platformInfo.spinlock,flags );
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Cannot destroy timer in state = %d",__func__, timer->state);
VOS_ASSERT(0);
return vStatus;
}
示例2: authRsnFsmProcessEvent
/**
* authRsnFsmProcessEvent
*
* FUNCTION
* Passes an event to the RSN key FSM instance for immediate processing.
*
* @param fsm the RSN Key FSM instance
* @param eventId the AAG event to process
* @param arg an optional argument for this event
*
* @return ANI_OK if the operation succeeds
*/
int
authRsnFsmProcessEvent(tAuthRsnFsm *fsm, tRsnFsmEvent eventId, void *arg)
{
VOS_ASSERT(fsm);
switch (eventId) {
case RSN_FSM_TIMER_EXPIRED:
// Proceed straight to checkTransition
break;
case RSN_FSM_AUTH_START:
fsm->authReq = eANI_BOOLEAN_TRUE;
authRsnAuthStartEventHandler(fsm);
break;
case RSN_FSM_EAPOL_FRAME_AVAILABLE:
fsm->eapolAvail = eANI_BOOLEAN_TRUE;
break;
case RSN_FSM_DISCONNECT:
fsm->disconnect = eANI_BOOLEAN_TRUE;
authRsnAuthDisconEventHandler(fsm);
break;
case RSN_FSM_INTEG_FAILED:
fsm->integFailed = eANI_BOOLEAN_TRUE;
break;
default:
VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
"Unknown event for Auth RSN Key Fsm: %d\n", eventId);
VOS_ASSERT( 0 );
return ANI_E_ILLEGAL_ARG;
break;
}
checkTransition(fsm, arg);
return ANI_OK;
}
示例3: palPktFree
void palPktFree( tHddHandle hHdd, eFrameType frmType, void* buf, void *pPacket)
{
vos_pkt_t *pVosPacket = (vos_pkt_t *)pPacket;
VOS_STATUS vosStatus;
do
{
VOS_ASSERT( pVosPacket );
if ( !pVosPacket ) break;
// we are only handling the 802_11_MGMT frame type for PE/LIM. All other frame types should be
// ported to use the VOSS APIs directly and should not be using this palPktAlloc API.
VOS_ASSERT( HAL_TXRX_FRM_802_11_MGMT == frmType );
if ( HAL_TXRX_FRM_802_11_MGMT != frmType ) break;
// return the vos packet to Voss. Nothing to do if this fails since the palPktFree does not
// have a return code.
vosStatus = vos_pkt_return_packet( pVosPacket );
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
} while( 0 );
return;
}
示例4: vos_event_init
/*-------------------------------------------------------------------------
\brief vos_event_init() - initializes a vOSS event
The vos_event_init() function initializes the specified event. Upon
successful initialization, the state of the event becomes initialized
and not signaled.
An event must be initialized before it may be used in any other event
functions.
Attempting to initialize an already initialized event results in
a failure.
\param lock - pointer to the opaque event object to initialize
\return VOS_STATUS_SUCCESS - event was successfully initialized and
is ready to be used.
VOS_STATUS_E_BUSY - The implementation has detected an attempt
to reinitialize the object referenced by event, a previously
initialized, but not yet destroyed, event.
VOS_STATUS_E_FAULT - event is an invalid pointer.
VOS_STATUS_E_FAILURE - event could not be created due to
unknown reasons
***VOS_STATUS_E_RESOURCES - System resources (other than memory)
are unavailable to initilize the event
***VOS_STATUS_E_NOMEM - insufficient memory exists to initialize
the event
\sa
( *** indicates return values do NOT exist yet )
-------------------------------------------------------------------------*/
VOS_STATUS vos_event_init ( vos_event_t* event )
{
// Check for null pointer
if ( NULL == event )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"NULL event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check for 'already initialized' event
if ( LINUX_EVENT_COOKIE == event->cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"Initialized event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_BUSY;
}
// initialize new event
init_completion(&event->complete);
event->cookie = LINUX_EVENT_COOKIE;
return VOS_STATUS_SUCCESS;
}
示例5: palPktFree
void palPktFree( tHddHandle hHdd, eFrameType frmType, void* buf, void *pPacket)
{
vos_pkt_t *pVosPacket = (vos_pkt_t *)pPacket;
VOS_STATUS vosStatus;
do
{
VOS_ASSERT( pVosPacket );
if ( !pVosPacket ) break;
VOS_ASSERT( HAL_TXRX_FRM_802_11_MGMT == frmType );
if ( HAL_TXRX_FRM_802_11_MGMT != frmType ) break;
vosStatus = vos_pkt_return_packet( pVosPacket );
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
} while( 0 );
return;
}
示例6: VOS_ASSERT
v_VOID_t vos_core_return_msg
(
v_PVOID_t pVContext,
pVosMsgWrapper pMsgWrapper
)
{
pVosContextType pVosContext = (pVosContextType) pVContext;
VOS_ASSERT( gpVosContext == pVosContext);
if (gpVosContext != pVosContext)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: gpVosContext != pVosContext", __func__);
return;
}
VOS_ASSERT( NULL !=pMsgWrapper );
if (pMsgWrapper == NULL)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: pMsgWrapper == NULL in function", __func__);
return;
}
INIT_LIST_HEAD(&pMsgWrapper->msgNode);
vos_mq_put(&pVosContext->freeVosMq, pMsgWrapper);
}
示例7: vos_event_set
VOS_STATUS vos_event_set ( vos_event_t* event )
{
// Check for null pointer
if ( NULL == event )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"NULL event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check if event refers to an initialized object
if ( LINUX_EVENT_COOKIE != event->cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"Uninitialized event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_INVAL;
}
complete(&event->complete);
return VOS_STATUS_SUCCESS;
}
示例8: vos_event_reset
/*--------------------------------------------------------------------------
\brief vos_event_reset() - resets a vOSS event - This function isn't required
for Linux. Therefore, it doesn't do much.
The state of the specified event is set to 'NOT signalled' by calling
\a vos_event_reset(). The state of the event remains NOT signalled until an
explicit call to vos_event_set().
This function sets the event to a NOT signalled state even if the event was
signalled multiple times before being signaled.
\param event - the event to set to the NOT signalled state
\return VOS_STATUS_SUCCESS - the event state was successfully change to
NOT signalled.
VOS_STATUS_E_INVAL - The value specified by event does not refer
to an initialized event object.
VOS_STATUS_E_FAULT - event is an invalid pointer.
VOS_STATUS_E_FAILURE - event could not be signaled due to
unknown reasons
\sa
-------------------------------------------------------------------------*/
VOS_STATUS vos_event_reset ( vos_event_t* event )
{
// check for null pointer
if ( NULL == event )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"NULL event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check to make sure it is an 'already initialized' event
if ( LINUX_EVENT_COOKIE != event->cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"Uninitialized event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_INVAL;
}
// (re)initialize event
INIT_COMPLETION(event->complete);
return VOS_STATUS_SUCCESS;
}
示例9: vos_event_destroy
VOS_STATUS vos_event_destroy ( vos_event_t* event )
{
// check for null pointer
if ( NULL == event )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"NULL event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check to make sure it is an 'already initialized' event
if ( LINUX_EVENT_COOKIE != event->cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"Uninitialized event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_INVAL;
}
// make sure nobody is waiting on the event
complete_all(&event->complete);
// destroy the event
memset(event, 0, sizeof(vos_event_t));
return VOS_STATUS_SUCCESS;
}
示例10: vos_stop
VOS_STATUS vos_stop( v_CONTEXT_t vosContext )
{
VOS_STATUS vosStatus;
vos_event_reset( &(gpVosContext->wdaCompleteEvent) );
vosStatus = WDA_stop( vosContext, HAL_STOP_TYPE_RF_KILL );
if (!VOS_IS_STATUS_SUCCESS(vosStatus))
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Failed to stop WDA", __func__);
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
WDA_setNeedShutdown(vosContext);
}
else
{
vosStatus = vos_wait_single_event( &(gpVosContext->wdaCompleteEvent),
VOS_WDA_STOP_TIMEOUT );
if ( vosStatus != VOS_STATUS_SUCCESS )
{
if ( vosStatus == VOS_STATUS_E_TIMEOUT )
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Timeout occurred before WDA complete", __func__);
}
else
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: WDA_stop reporting other error", __func__ );
}
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Test MC thread by posting a probe message to SYS", __func__);
wlan_sys_probe();
WDA_setNeedShutdown(vosContext);
}
}
vosStatus = sysStop( vosContext);
if (!VOS_IS_STATUS_SUCCESS(vosStatus))
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Failed to stop SYS", __func__);
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
}
vosStatus = WLANTL_Stop( vosContext );
if (!VOS_IS_STATUS_SUCCESS(vosStatus))
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Failed to stop TL", __func__);
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
}
return VOS_STATUS_SUCCESS;
}
示例11: checkRsnKeyMic
static int
checkRsnKeyMic(v_U32_t cryptHandle,
tAniPacket *eapolFrame,
tAniEapolRsnKeyDesc *rsnDesc,
v_U8_t *micKey,
v_U32_t micKeyLen)
{
int retVal = ANI_ERROR;
int len;
v_U8_t *ptr = NULL;
v_U8_t *micPos = NULL;
v_U8_t result[VOS_DIGEST_SHA1_SIZE]; // Larger of the two
v_U8_t incomingMic[ANI_EAPOL_KEY_RSN_MIC_SIZE];
if (!rsnDesc->info.micFlag)
{
VOS_ASSERT( 0 );
return ANI_E_ILLEGAL_ARG;
}
len = aniAsfPacketGetBytes(eapolFrame, &ptr);
if( ANI_IS_STATUS_SUCCESS( len ) )
{
micPos = ptr + ANI_SSM_RSN_KEY_MIC_OFFSET;
// Skip to the EAPOL version field for MIC computation
ptr += EAPOL_VERSION_POS;
len -= EAPOL_VERSION_POS;
// Copy existing MIC to temporary location and zero it out
vos_mem_copy( incomingMic, micPos, ANI_EAPOL_KEY_RSN_MIC_SIZE );
vos_mem_zero( micPos, ANI_EAPOL_KEY_RSN_MIC_SIZE );
if (rsnDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES)
{
if( VOS_IS_STATUS_SUCCESS( vos_sha1_hmac_str(cryptHandle, ptr, len, micKey, micKeyLen, result) ) )
{
retVal = ANI_OK;
}
}
else {
VOS_ASSERT( 0 );
retVal = ANI_E_ILLEGAL_ARG;
}
if (retVal == ANI_OK)
{
if ( !vos_mem_compare(incomingMic, result, ANI_EAPOL_KEY_RSN_MIC_SIZE))
{
retVal = ANI_E_MIC_FAILED;
}
}
}
return retVal;
}
示例12: vos_timer_init_debug
VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType,
vos_timer_callback_t callback, v_PVOID_t userData,
char* fileName, v_U32_t lineNum )
{
VOS_STATUS vosStatus;
unsigned long flags;
// Check for invalid pointer
if ((timer == NULL) || (callback == NULL))
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Null params being passed",__func__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
timer->ptimerNode = vos_mem_malloc(sizeof(timer_node_t));
if(timer->ptimerNode == NULL)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Not able to allocate memory for timeNode",__func__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
vos_mem_set(timer->ptimerNode, sizeof(timer_node_t), 0);
timer->ptimerNode->fileName = fileName;
timer->ptimerNode->lineNum = lineNum;
timer->ptimerNode->vosTimer = timer;
spin_lock_irqsave(&vosTimerList.lock, flags);
vosStatus = hdd_list_insert_front(&vosTimerList, &timer->ptimerNode->pNode);
spin_unlock_irqrestore(&vosTimerList.lock, flags);
if(VOS_STATUS_SUCCESS != vosStatus)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Unable to insert node into List vosStatus %d", __func__, vosStatus);
}
// set the various members of the timer structure
// with arguments passed or with default values
spin_lock_init(&timer->platformInfo.spinlock);
init_timer(&(timer->platformInfo.Timer));
timer->platformInfo.Timer.function = vos_linux_timer_callback;
timer->platformInfo.Timer.data = (unsigned long)timer;
timer->callback = callback;
timer->userData = userData;
timer->type = timerType;
timer->platformInfo.cookie = LINUX_TIMER_COOKIE;
timer->platformInfo.threadID = 0;
timer->state = VOS_TIMER_STATE_STOPPED;
return VOS_STATUS_SUCCESS;
}
示例13: vos_wait_single_event
/*----------------------------------------------------------------------------
\brief vos_wait_single_event() - Waits for a single event to be set.
This API waits for the event to be set.
\param pEvent - pointer to an event to wait on.
\param timeout - Timeout value (in milliseconds). This function returns
if this interval elapses, regardless if any of the events have
been set. An input value of 0 for this timeout parameter means
to wait infinitely, meaning a timeout will never occur.
\return VOS_STATUS_SUCCESS - the wait was satisifed by the event being
set.
VOS_STATUS_E_TIMEOUT - the timeout interval elapsed before the
event was set.
VOS_STATUS_E_INVAL - The value specified by event is invalid.
VOS_STATUS_E_FAULT - pEvent is an invalid pointer.
\sa vos_wait_multiple_events()
--------------------------------------------------------------------------*/
VOS_STATUS vos_wait_single_event ( vos_event_t* event, v_U32_t timeout)
{
if (in_interrupt())
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"%s cannot be called from interrupt context!!!", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check for null pointer
if ( NULL == event )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"NULL event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_FAULT;
}
// check if cookie is same as that of initialized event
if ( LINUX_EVENT_COOKIE != event->cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
"Uninitialized event passed into %s", __FUNCTION__);
VOS_ASSERT(0);
return VOS_STATUS_E_INVAL;
}
if (timeout)
{
long ret;
ret =
wait_for_completion_interruptible_timeout(&event->complete,
msecs_to_jiffies(timeout));
if ( 0 >= ret )
{
// 0 means timed out, negative means interrupted
return VOS_STATUS_E_TIMEOUT;
}
}
else
{
int ret;
ret = wait_for_completion_interruptible(&event->complete);
if ( 0 != ret )
{
// negative means interrupted
return VOS_STATUS_E_TIMEOUT;
}
}
return VOS_STATUS_SUCCESS;
}
示例14: tx_timer_activate
/**---------------------------------------------------------------------
* tx_timer_activate()
*
* FUNCTION:
*
* LOGIC:
*
* ASSUMPTIONS:
*
* NOTE:
*
* @param
*
* @return TX_SUCCESS.
*
*/
v_UINT_t tx_timer_activate(TX_TIMER *timer_ptr)
{
VOS_STATUS status;
// Uncomment the asserts, if the intention is to debug the occurence of the
// following anomalous cnditions.
// Assert that the timer structure pointer passed, is not NULL
//dbgAssert(NULL != timer_ptr);
// If the NIC is halting just spoof a successful timer activation, so that all
// the timers can be cleaned up.
if(NULL == timer_ptr)
return TX_TIMER_ERROR;
// Put a check for the free builds
if (TX_AIRGO_TMR_SIGNATURE != timer_ptr->tmrSignature) {
VOS_ASSERT( timer_ptr->tmrSignature == 0 );
return TX_TIMER_ERROR;
}
// Check for an uninitialized timer
VOS_ASSERT(0 != strlen(TIMER_NAME));
VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO,
"Timer %s being activated\n", TIMER_NAME);
status = vos_timer_start( &timer_ptr->vosTimer,
timer_ptr->initScheduleTimeInMsecs );
if (VOS_STATUS_SUCCESS == status)
{
VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO,
"Timer %s now activated\n", TIMER_NAME);
return TX_SUCCESS;
}
else if (VOS_STATUS_E_ALREADY == status)
{
// starting timer fails because timer is already started; this is okay
VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO,
"Timer %s is already running\n", TIMER_NAME);
return TX_SUCCESS;
}
else
{
VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
"Timer %s fails to activate\n", TIMER_NAME);
return TX_TIMER_ERROR;
}
} /*** tx_timer_activate() ***/
示例15: vos_timer_stop
/*--------------------------------------------------------------------------
\brief vos_timer_stop() - Stop a vOSS Timer
The \a vos_timer_stop() function stops a timer that has been started but
has not expired, essentially cancelling the 'start' request.
After a timer is stopped, it goes back to the state it was in after it
was created and can be started again via a call to vos_timer_start().
\param timer - the timer object to be stopped
\return VOS_STATUS_SUCCESS - timer was successfully stopped.
VOS_STATUS_E_INVAL - The value specified by timer is invalid.
VOS_STATUS_E_FAULT - timer is an invalid pointer.
\sa
------------------------------------------------------------------------*/
VOS_STATUS vos_timer_stop ( vos_timer_t *timer )
{
unsigned long flags;
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH,
"%s: Timer Addr inside voss_stop : 0x%p",__func__,timer );
// Check for invalid pointer
if ( NULL == timer )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s Null timer pointer being passed", __func__);
VOS_ASSERT(0);
return VOS_STATUS_E_INVAL;
}
// Check if timer refers to an uninitialized object
if ( LINUX_TIMER_COOKIE != timer->platformInfo.cookie )
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Cannot stop uninitialized timer",__func__);
if ( LINUX_INVALID_TIMER_COOKIE != timer->platformInfo.cookie )
{
VOS_ASSERT(0);
}
return VOS_STATUS_E_INVAL;
}
// Ensure the timer state is correct
spin_lock_irqsave( &timer->platformInfo.spinlock,flags );
if ( VOS_TIMER_STATE_RUNNING != timer->state )
{
spin_unlock_irqrestore( &timer->platformInfo.spinlock,flags );
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH,
"%s: Cannot stop timer in state = %d",
__func__, timer->state);
return VOS_STATUS_SUCCESS;
}
timer->state = VOS_TIMER_STATE_STOPPED;
del_timer(&(timer->platformInfo.Timer));
spin_unlock_irqrestore( &timer->platformInfo.spinlock,flags );
tryAllowingSleep( timer->type );
return VOS_STATUS_SUCCESS;
}