/*----------------------------------------------------------------------------

   @brief Un-Register function
        Un-Register Thermal Mitigation Level Changed handle callback function

   @param hdd_context_t pHddCtx
        Global hdd context

   @return General status code
        VOS_STATUS_SUCCESS       Un-Registration Success
        VOS_STATUS_E_FAILURE     Un-Registration Fail

----------------------------------------------------------------------------*/
VOS_STATUS hddDevTmUnregisterNotifyCallback(hdd_context_t *pHddCtx)
{
   VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;

   wcnss_unregister_thermal_mitigation(hddDevTmLevelChangedHandler);

   if(VOS_TIMER_STATE_RUNNING ==
           vos_timer_getCurrentState(&pHddCtx->tmInfo.txSleepTimer))
   {
       vosStatus = vos_timer_stop(&pHddCtx->tmInfo.txSleepTimer);
       if(!VOS_IS_STATUS_SUCCESS(vosStatus))
       {
           VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                                "%s: Timer stop fail", __func__);
       }
   }

   // Destroy the vos timer...
   vosStatus = vos_timer_destroy(&pHddCtx->tmInfo.txSleepTimer);
   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
   {
       VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR,
                            "%s: Fail to destroy timer", __func__);
   }

   return VOS_STATUS_SUCCESS;
}
Ejemplo n.º 2
0
/*==========================================================================

  FUNCTION    WLANBAP_DeinitLinkSupervisionTimer

  DESCRIPTION
    Destroy the Link Supervision Timer.

  DEPENDENCIES

  PARAMETERS

    IN
    pBtampCtx:   pointer to the BAP control block

  RETURN VALUE
    The result code associated with performing the operation

    VOS_STATUS_E_FAULT:  access would cause a page fault
    VOS_STATUS_SUCCESS:  Everything is good :)

  SIDE EFFECTS

============================================================================*/
VOS_STATUS
WLANBAP_DeinitLinkSupervisionTimer
(
  ptBtampContext  pBtampCtx
)
{
  VOS_STATUS  vosStatus = VOS_STATUS_SUCCESS;

  /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/


  /*------------------------------------------------------------------------
    Sanity check BAP control block
   ------------------------------------------------------------------------*/

  if ( NULL == pBtampCtx )
  {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                 "Invalid BAP pointer in %s", __func__);
    return VOS_STATUS_E_FAULT;
  }

  /*Initialize and then Start the timer */
  vosStatus = vos_timer_destroy (
          &pBtampCtx->bapLinkSupervisionTimer );

  return VOS_STATUS_SUCCESS;
}/* WLANBAP_DeinitLinkSupervisionTimer */
Ejemplo n.º 3
0
/*--------------------------------------------------------------------------
  Cleanup the SME FT Global context.
  ------------------------------------------------------------------------*/
void sme_FTClose(tHalHandle hHal, tANI_U32 sessionId)
{
   tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
   tCsrRoamSession *pSession = NULL;

   /* Clear the FT Context */
   sme_FTReset(hHal, sessionId);

   pSession = CSR_GET_SESSION( pMac, sessionId );
   if (NULL != pSession)
   {
      /* check if the timer is running */
      if (VOS_TIMER_STATE_RUNNING ==
            vos_timer_getCurrentState(
                     &pSession->ftSmeContext.preAuthReassocIntvlTimer))
      {
         vos_timer_stop(&pSession->ftSmeContext.preAuthReassocIntvlTimer);
      }

      if (VOS_STATUS_SUCCESS !=
            vos_timer_destroy(&pSession->ftSmeContext.preAuthReassocIntvlTimer))
      {
         smsLog(pMac, LOGE, FL("preAuthReAssocTimer destroy failed"));
      }

      if (pSession->ftSmeContext.pUsrCtx != NULL) {
          smsLog(pMac, LOG1,
                 FL("Freeing ftSmeContext.pUsrCtx and setting to NULL"));
          vos_mem_free(pSession->ftSmeContext.pUsrCtx);
          pSession->ftSmeContext.pUsrCtx = NULL;
      }
   }
}
/*--------------------------------------------------------------------------
  Cleanup the SME FT Global context. 
  ------------------------------------------------------------------------*/
void sme_FTClose(tHalHandle hHal)
{
    tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
    //Clear the FT Context.
    sme_FTReset(hHal);
    vos_timer_destroy(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer);
}
/**
 * authRsnFsmFree
 *
 * FUNCTION
 * Frees a previously allocated RSN Key FSM in a STA context. If the
 * RSN Key FSM is not yet allocated, then this is an error.
 * 
 * @param ctx the STA context whose FSM instance is to be freed
 *
 * @return ANI_OK if the operation succeeds
 */
int
authRsnFsmFree(tBtampContext *ctx)
{
    tAuthRsnFsm *fsm = &ctx->uFsm.authFsm;

    VOS_ASSERT(fsm);

    if( fsm->cryptHandle)
    {
        vos_crypto_deinit( fsm->cryptHandle );
    }
     
    bapRsnClearTxRxCallbacks(); 

    if ( fsm->staCtx )
    {
        fsm->staCtx->authRsnFsm = NULL;
    }

    if ( VOS_TIMER_STATE_UNUSED != fsm->msg2Timer.state ) vos_timer_destroy( &fsm->msg2Timer );
    if ( VOS_TIMER_STATE_UNUSED != fsm->msg4Timer.state ) vos_timer_destroy( &fsm->msg4Timer );

    if (fsm->lastEapol)
    {    
        aniAsfPacketFree(fsm->lastEapol);
        fsm->lastEapol = NULL; 
    }

    if( fsm->staCtx )
    {
        if( fsm->staCtx->pmk )
        {
            aniAsfPacketFree( fsm->staCtx->pmk );
            fsm->staCtx->pmk = NULL;
        }
       vos_mem_free(fsm->staCtx);
       fsm->staCtx = NULL; 
    }

    vos_mem_zero( fsm, sizeof(tAuthRsnFsm) );

    return ANI_OK;
}
v_UINT_t tx_timer_delete( TX_TIMER *timer_ptr )
{
   // Put a check for the free builds
   if (TX_AIRGO_TMR_SIGNATURE != timer_ptr->tmrSignature)
   {
      return TX_TIMER_ERROR;
   }

   vos_timer_destroy( &timer_ptr->vosTimer );
   return TX_SUCCESS;
} /*** tx_timer_delete() ***/
v_UINT_t tx_timer_delete( TX_TIMER *timer_ptr )
{
   VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO, 
             "tx_timer_delete() called for timer %s\n", TIMER_NAME);

   // Put a check for the free builds
   if (TX_AIRGO_TMR_SIGNATURE != timer_ptr->tmrSignature)
   {
      return TX_TIMER_ERROR;      
   }

   vos_timer_destroy( &timer_ptr->vosTimer );
   return TX_SUCCESS;     
} /*** tx_timer_delete() ***/
/*==========================================================================

  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 */
/*--------------------------------------------------------------------------
  Cleanup the SME FT Global context. 
  ------------------------------------------------------------------------*/
void sme_FTClose(tHalHandle hHal)
{
    tpAniSirGlobal pMac = PMAC_STRUCT( hHal );

    if (pMac->ft.ftSmeContext.auth_ft_ies != NULL)
    {
#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
        smsLog( pMac, LOGE, FL(" Freeing %p and setting to NULL"),
            pMac->ft.ftSmeContext.auth_ft_ies);
#endif
        vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies);
        pMac->ft.ftSmeContext.auth_ft_ies = NULL;
    }
    pMac->ft.ftSmeContext.auth_ft_ies_length = 0;                        

    if (pMac->ft.ftSmeContext.reassoc_ft_ies != NULL)
    {
#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
        smsLog( pMac, LOGE, FL(" Freeing %p and setting to NULL"),
            pMac->ft.ftSmeContext.reassoc_ft_ies);
#endif
        vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies);
        pMac->ft.ftSmeContext.reassoc_ft_ies = NULL;                        
    }
    pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0;                        

    pMac->ft.ftSmeContext.FTState = eFT_START_READY;
    vos_mem_zero(pMac->ft.ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE);

    if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp != NULL)
    {
#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
        smsLog( pMac, LOGE, FL("%s: Freeing %p and setting to NULL"),
            pMac->ft.ftSmeContext.psavedFTPreAuthRsp);
#endif
        vos_mem_free(pMac->ft.ftSmeContext.psavedFTPreAuthRsp);
        pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL;                        
    }

    vos_timer_destroy(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer);
}
/*---------------------------------------------------------------------------
    \brief wpalTimerDelete - invalidate a wpt_timer object

    \param pTimer a pointer to caller allocated wpt_timer object

    \return eWLAN_PAL_STATUS_SUCCESS ?? success. Fail otherwise.
---------------------------------------------------------------------------*/
wpt_status wpalTimerDelete(wpt_timer *pTimer)
{
   wpt_status status;

   /* Sanity Checks */
   if( pTimer == NULL )
   {
      WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, " %s Wrong param pTimer(%d)\n",
         __func__, (wpt_uint32)pTimer );
      return eWLAN_PAL_STATUS_E_INVAL;
   }

   status = WPAL_VOS_TO_WPAL_STATUS( vos_timer_destroy(&pTimer->timer.timerObj));

   if( status == eWLAN_PAL_STATUS_SUCCESS )
   {
      pTimer->callback = NULL;
      pTimer->pUserData = NULL;
   }

   return status;
}/*wpalTimerDelete*/
eHalStatus palTimerFree( tHddHandle hHdd, tPalTimerHandle hPalTimer )
{
   eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
   VOS_STATUS vosStatus;
   tPalTimer *pPalTimer = (tPalTimer *)hPalTimer;
    
   do
   {
      if ( NULL == pPalTimer ) break;
   
      // Destroy the vos timer...      
      vosStatus = vos_timer_destroy( &pPalTimer->vosTimer );
      if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) break;
      
      // Free the memory for the intrnal timer struct...
      vos_mem_free( pPalTimer );
      
      status = eHAL_STATUS_SUCCESS;
      
   } while( 0 );
    
   return( status );
}