wpt_status wpalMutexDelete(wpt_mutex *pMutex)
{
    

   if( vos_lock_destroy( (vos_lock_t*)pMutex  ) != VOS_STATUS_SUCCESS )
   {
      WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, 
                 " mutex delete fail");
      return eWLAN_PAL_STATUS_E_FAILURE;
   }

   return eWLAN_PAL_STATUS_SUCCESS;
}
/*---------------------------------------------------------------------------
    @brief Invalidate a mutex object

    \param pMutex - a pointer to caller allocated object of wpt_mutex

    \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise.
---------------------------------------------------------------------------*/
wpt_status wpalMutexDelete(wpt_mutex *pMutex)
{
    /* Not doing sanity checks since VOS does them anyways */

   if( vos_lock_destroy( (vos_lock_t*)pMutex  ) != VOS_STATUS_SUCCESS )
   {
      WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, 
                 " mutex delete fail");
      return eWLAN_PAL_STATUS_E_FAILURE;
   }

   return eWLAN_PAL_STATUS_SUCCESS;
}
/*==========================================================================

  FUNCTION    WLANBAP_Stop

  DESCRIPTION 
    Called by vos_stop to stop operation in BAP, before close. BAP will suspend all 
    BT-AMP Protocol Adaption Layer operation and will wait for the close 
    request to clean up its resources. 
    
  DEPENDENCIES 
    
  PARAMETERS 

    IN
    pvosGCtx:       pointer to the global vos context; a handle to BAP's 
                    control block can be extracted from its context 
   
  RETURN VALUE
    The result code associated with performing the operation  

    VOS_STATUS_E_FAULT:  pointer to BAP cb is NULL ; access would cause a page 
                         fault  
    VOS_STATUS_SUCCESS:  Everything is good :) 

  SIDE EFFECTS 
  
============================================================================*/
VOS_STATUS 
WLANBAP_Stop
( 
  v_PVOID_t  pvosGCtx 
)
{
  ptBtampContext  pBtampCtx = NULL; 
  VOS_STATUS  vosStatus = VOS_STATUS_SUCCESS;
  /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

  /*------------------------------------------------------------------------
    Sanity check
    Extract BAP control block 
   ------------------------------------------------------------------------*/
  pBtampCtx = VOS_GET_BAP_CB(pvosGCtx);
  if ( NULL == pBtampCtx ) 
  {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                 "Invalid BAP pointer from pvosGCtx on WLANBAP_Stop");
    return VOS_STATUS_E_FAULT;
  }

  /*------------------------------------------------------------------------
    Stop BAP (de-register RSN handler!?)  
   ------------------------------------------------------------------------*/
  vosStatus = WLANBAP_DeinitConnectionAcceptTimer(pBtampCtx);
  if ( VOS_STATUS_SUCCESS != vosStatus)
  {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
               "Couldn't destroy  bapConnectionAcceptTimer");
  }

  vosStatus = WLANBAP_DeinitLinkSupervisionTimer(pBtampCtx);
  if ( VOS_STATUS_SUCCESS != vosStatus)
  {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
               "Couldn't destroy  bapLinkSupervisionTimer");
  }

  vosStatus = vos_timer_destroy ( 
    &pBtampCtx->bapTxPktMonitorTimer );
  if ( VOS_STATUS_SUCCESS != vosStatus)
  {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
               "Couldn't destroy  bapTxPktMonitorTimer");
  }
  vos_lock_destroy(&pBtampCtx->bapLock);
  return VOS_STATUS_SUCCESS;
}/* WLANBAP_Stop */
void csrLLClose( tDblLinkList *pList )
{
    if( !pList) 
    {
        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL,"%s: Error!! pList is Null", __func__);
        return ; 
    }

    if ( LIST_FLAG_OPEN == pList->Flag ) 
    {
        // Make sure the list is empty...
        csrLLPurge( pList, LL_ACCESS_LOCK );
        vos_lock_destroy( &pList->Lock );
        pList->Flag = LIST_FLAG_CLOSE;
    }
}
eHalStatus palSpinLockFree( tHddHandle hHdd, tPalSpinLockHandle hSpinLock )
{
    eHalStatus halStatus = eHAL_STATUS_FAILURE;
    vos_lock_t *pLock = (vos_lock_t *)hSpinLock;
    VOS_STATUS vosStatus;

    vosStatus = vos_lock_destroy( pLock );
    if ( VOS_IS_STATUS_SUCCESS( vosStatus ) )
    {
        // if we successfully destroy the lock, free
        // the memory and indicate success to the caller.
        vos_mem_free( pLock );

        halStatus = eHAL_STATUS_SUCCESS;
    }
    return( halStatus );
}
예제 #6
0
eHalStatus palSpinLockFree( tHddHandle hHdd, tPalSpinLockHandle hSpinLock )
{
   eHalStatus halStatus = eHAL_STATUS_FAILURE;
   vos_lock_t *pLock = (vos_lock_t *)hSpinLock;
   VOS_STATUS vosStatus;
   
   vosStatus = vos_lock_destroy( pLock );
   if ( VOS_IS_STATUS_SUCCESS( vosStatus ) )
   {
      
      
      vos_mem_free( pLock );
      
      halStatus = eHAL_STATUS_SUCCESS;
   }
   return( halStatus );
}