Пример #1
0
/**
*
* mainKeys_create
*
* \b Description:
*
* Allocate memory for the main security context, and create all the rest of the needed contexts.
*
* \b ARGS:
*
*  I - hOs - OS handle for OS operations.
*
* \b RETURNS:
*
*  pointer to main security context. If failed, returns NULL.
*
* \sa
*/
mainKeys_t* mainKeys_create(TI_HANDLE hOs)
{
	mainKeys_t 	*pHandle;
	TI_STATUS		status;

	/* allocate association context memory */
	pHandle = (mainKeys_t*)os_memoryAlloc(hOs, sizeof(mainKeys_t));
	if (pHandle == NULL)
	{
		return NULL;
	}

	os_memoryZero(hOs, pHandle, sizeof(mainKeys_t));

	/* allocate memory for association state machine */
	status = fsm_Create(hOs, &pHandle->pMainKeysSm, MAIN_KEYS_NUM_STATES, MAIN_KEYS_NUM_EVENTS);
	if (status != TI_OK)
	{
		os_memoryFree(hOs, pHandle, sizeof(mainKeys_t));
		return NULL;
	}

	pHandle->pKeyParser = keyParser_create(hOs);
	if (pHandle->pKeyParser == NULL)
	{
		fsm_Unload(hOs, pHandle->pMainKeysSm);
		os_memoryFree(hOs, pHandle, sizeof(mainKeys_t));
		return NULL;
	}

	pHandle->pBcastSm = broadcastKey_create(hOs);
	if (pHandle->pBcastSm == NULL)
	{
		keyParser_unload(pHandle->pKeyParser);
		fsm_Unload(hOs, pHandle->pMainKeysSm);
		os_memoryFree(hOs, pHandle, sizeof(mainKeys_t));
		return NULL;
	}

	pHandle->pUcastSm = unicastKey_create(hOs);
	if (pHandle->pBcastSm == NULL)
	{
		broadcastKey_unload(pHandle->pBcastSm);
		keyParser_unload(pHandle->pKeyParser);
		fsm_Unload(hOs, pHandle->pMainKeysSm);
		os_memoryFree(hOs, pHandle, sizeof(mainKeys_t));
		return NULL;
	}

	pHandle->hOs = hOs;

	/* At first Timeout we will send MediaSpecific Event   */
	/* At any other Timeout we will send the Timeout Event */

	pHandle->mainKeysTimeoutCounter = TI_FALSE;

	return pHandle;
}
/**
 * \author Yuval Adler\n
 * \date 16-Oct-2004\n
 * \brief Creates the scan SRV object
 *
 * Function Scope \e Public.\n
 * \param hOS - handle to the OS object.\n
 * \return a handle to the scan SRV object, NULL if an error occurred.\n
 */
TI_HANDLE MacServices_scanSRV_create( TI_HANDLE hOS )
{
    /* allocate the scan SRV object */
    scanSRV_t *pScanSRV = os_memoryAlloc( hOS, sizeof(scanSRV_t) );
    if ( NULL == pScanSRV )
    {
        WLAN_OS_REPORT( ("ERROR: Failed to create scan SRV module") );
        return NULL;
    }

    /* allocate the state machine */
    if ( OK != fsm_Create( hOS, &(pScanSRV->SM), SCAN_SRV_NUM_OF_STATES, SCAN_SRV_NUM_OF_EVENTS ) )
    {
        WLAN_OS_REPORT( ("ERROR: Failed to allocate scan SRV state machine") );
        os_memoryFree( hOS, pScanSRV, sizeof(scanSRV_t) );
        return NULL;
    }

    /* create the timer */
    pScanSRV->timer = os_timerCreate( hOS, MacServices_scanSRV_scanTimerExpired, pScanSRV );
    if ( NULL == pScanSRV->timer )
    {
        WLAN_OS_REPORT( ("ERROR: Failed to create timer for scan SRV module") );
        fsm_Unload( hOS, pScanSRV->SM );
        os_memoryFree( hOS, pScanSRV, sizeof(scanSRV_t) );
        return NULL;
    }

    /* store the OS handle */
    pScanSRV->hOS = hOS;

    return pScanSRV;
}
Пример #3
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief Destroys the measurement SRV object
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 */
void MacServices_measurementSRV_destroy( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_INT32 i;

	/* sanity cehcking */
	if ( NULL == hMeasurementSRV ) {
		return;
	}

	/* release state machine */
	if ( NULL != pMeasurementSRV->SM ) {
		fsm_Unload( pMeasurementSRV->hOS, pMeasurementSRV->SM );
	}

	/* release timers */
	for ( i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++ ) {
		if (pMeasurementSRV->hRequestTimer[i]) {
			tmr_DestroyTimer (pMeasurementSRV->hRequestTimer[i]);
		}
	}
	if (pMeasurementSRV->hStartStopTimer) {
		tmr_DestroyTimer (pMeasurementSRV->hStartStopTimer);
	}

	/* release object space */
	os_memoryFree( pMeasurementSRV->hOS, (TI_HANDLE)pMeasurementSRV, sizeof(measurementSRV_t));
}
Пример #4
0
/**
*
* mainSec_config
*
* \b Description: 
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  OK on success, NOK otherwise.
*
* \sa 
*/
TI_STATUS mainSec_unload(mainSec_t *pMainSec)
{
    TI_STATUS   status;

    if (pMainSec == NULL)
    {
        return NOK;
    }

    status = mainKeys_unload(pMainSec->pMainKeys);
    if (status != OK)
    {
        /* report failure but don't stop... */
        WLAN_REPORT_ERROR(pMainSec->hReport, RSN_MODULE_LOG,
                          ("MAIN_SEC_SM: Error releasing Main Keys SM memory \n"));
    }

    status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm);
    if (status != OK)
    {
        /* report failure but don't stop... */
        WLAN_REPORT_ERROR(pMainSec->hReport, RSN_MODULE_LOG,
                          ("MAIN_SEC_SM: Error releasing FSM memory \n"));
    }

    os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t));

    return OK;
}
Пример #5
0
/**
 * Releases the module's allocated objects according to the given init vector.
 * 
 * @param pMeasurementMgr A handle to the Measurement Manager module.
 * @param initVec The init vector with a bit set for each allocated object.
 * 
 * @date 01-Jan-2006
 */
static void measurementMgr_releaseModule (measurementMgr_t * pMeasurementMgr)
{
#ifdef XCC_MODULE_INCLUDED
    TI_UINT32 currAC;
#endif

    if (pMeasurementMgr->hActivationDelayTimer)
    {
        tmr_DestroyTimer (pMeasurementMgr->hActivationDelayTimer);
    }

#ifdef XCC_MODULE_INCLUDED
    for (currAC = 0; currAC < MAX_NUM_OF_AC; currAC++)
    {
        if (pMeasurementMgr->hTsMetricsReportTimer[currAC])
        {
            tmr_DestroyTimer (pMeasurementMgr->hTsMetricsReportTimer[currAC]);
        }
    }
#endif

    if (pMeasurementMgr->pMeasurementMgrSm)
    {
        fsm_Unload(pMeasurementMgr->hOs, pMeasurementMgr->pMeasurementMgrSm);
    }

    if (pMeasurementMgr->hRequestH)
    {
        requestHandler_destroy(pMeasurementMgr->hRequestH);
    }
    
    os_memoryFree(pMeasurementMgr->hOs, pMeasurementMgr, sizeof(measurementMgr_t));
}
Пример #6
0
broadcastKey_t* broadcastKey_create(TI_HANDLE hOs)
{
	TI_STATUS				status;
	broadcastKey_t 		*pBroadcastKey;

	/* allocate key parser context memory */
	pBroadcastKey = (broadcastKey_t*)os_memoryAlloc(hOs, sizeof(broadcastKey_t));
	if (pBroadcastKey == NULL)
	{
		return NULL;
	}

	os_memoryZero(hOs, pBroadcastKey, sizeof(broadcastKey_t));

	/* allocate memory for association state machine */
	status = fsm_Create(hOs, &pBroadcastKey->pBcastKeySm, BCAST_KEY_MAX_NUM_STATES, BCAST_KEY_MAX_NUM_EVENTS);
	if (status != TI_OK)
	{
		os_memoryFree(hOs, pBroadcastKey, sizeof(broadcastKey_t));
		return NULL;
	}

	pBroadcastKey->pKeyDerive = keyDerive_create(hOs);
	if (pBroadcastKey->pKeyDerive == NULL)
	{
		fsm_Unload(hOs, pBroadcastKey->pBcastKeySm);
		os_memoryFree(hOs, pBroadcastKey, sizeof(broadcastKey_t));
		return NULL;
	}

	pBroadcastKey->hOs = hOs;

	return pBroadcastKey;
}
Пример #7
0
/**
*
* mainSec_config
*
* \b Description: 
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*
* \sa 
*/
TI_STATUS mainSec_unload(mainSec_t *pMainSec)
{
    TI_STATUS   status;

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

    status = mainKeys_unload(pMainSec->pMainKeys);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing Main Keys SM memory \n");
    }

    status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing FSM memory \n");
    }

    status = externalSec_Destroy (pMainSec->pExternalSec);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing External Security SM memory \n");
    }

    os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t));

    return TI_OK;
}
/**
*
* assoc_create - allocate memory for association SM
*
* \b Description: 
*
* Allocate memory for association SM. \n
* 		Allocates memory for Association context. \n
* 		Allocates memory for association timer. \n
* 		Allocates memory for association SM matrix. \n
*
* \b ARGS:
*
*  I   - hOs - OS context  \n
*
* \b RETURNS:
*
*  OK if successful, NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_HANDLE assoc_create(TI_HANDLE hOs)
{
	assoc_t 	*pHandle;
	TI_STATUS		status;

	/* allocate association context memory */
	pHandle = (assoc_t*)os_memoryAlloc(hOs, sizeof(assoc_t));
	if (pHandle == NULL)
	{
		return NULL;
	}

	os_memoryZero(hOs, pHandle, sizeof(assoc_t));

	pHandle->hOs = hOs;

	/* allocate memory for association state machine */
	status = fsm_Create(hOs, &pHandle->pAssocSm, ASSOC_SM_NUM_STATES, ASSOC_SM_NUM_EVENTS);
	if (status != OK)
	{
		os_memoryFree(hOs, pHandle, sizeof(assoc_t));
		return NULL;
	}

	/* allocate OS timer memory */
	pHandle->timer = os_timerCreate(hOs, assoc_smTimeout, pHandle);
	if (pHandle->timer == NULL)
	{
		fsm_Unload(hOs, pHandle->pAssocSm);
		os_memoryFree(hOs, pHandle, sizeof(assoc_t));		
		return NULL;
	}

	return pHandle;
}
Пример #9
0
/**
*
* mainKeys_config
*
* \b Description:
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*
* \sa
*/
TI_STATUS mainKeys_unload(mainKeys_t *pMainKeys)
{
	TI_STATUS	status;

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

	status = fsm_Unload(pMainKeys->hOs, pMainKeys->pMainKeysSm);

	if (pMainKeys->hSessionTimer)
	{
		tmr_DestroyTimer (pMainKeys->hSessionTimer);
	}
    pMainKeys->hSessionTimer = NULL;

    status = keyParser_unload(pMainKeys->pKeyParser);

	status = broadcastKey_unload(pMainKeys->pBcastSm);

	status = unicastKey_unload(pMainKeys->pUcastSm);

	os_memoryFree(pMainKeys->hOs, pMainKeys, sizeof(mainKeys_t));

    return TI_OK;
}
Пример #10
0
/**
*
* mainSec_create
*
* \b Description: 
*
* Allocate memory for the main security context, and create all the rest of the needed contexts.
*
* \b ARGS:
*
*  I - hOs - OS handle for OS operations.
*
* \b RETURNS:
*
*  pointer to main security context. If failed, returns NULL.
*
* \sa 
*/
mainSec_t* mainSec_create(TI_HANDLE hOs)
{
    mainSec_t   *pHandle;
    TI_STATUS       status;

    /* allocate association context memory */
    pHandle = (mainSec_t*)os_memoryAlloc(hOs, sizeof(mainSec_t));
    if (pHandle == NULL)
    {
        return NULL;
    }

    os_memoryZero(hOs, pHandle, sizeof(mainSec_t));

    /* allocate memory for association state machine */
    status = fsm_Create(hOs, &pHandle->pMainSecSm, MAIN_SEC_MAX_NUM_STATES, MAIN_SEC_MAX_NUM_EVENTS);
    if (status != TI_OK)
    {
        os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
        return NULL;
    }

    pHandle->pMainKeys = mainKeys_create(hOs);
    if (pHandle->pMainKeys == NULL)
    {
        fsm_Unload(hOs, pHandle->pMainSecSm);
        os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
        return NULL;
    }

    pHandle->pKeyParser = pHandle->pMainKeys->pKeyParser;
    pHandle->hOs = hOs;
    
    /* created only for external security mode */
    pHandle->pExternalSec = externalSec_create(hOs);

    if (pHandle->pExternalSec == NULL)
    {
        fsm_Unload(hOs, pHandle->pMainSecSm);
        mainKeys_unload(pHandle->pMainKeys);
        os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
        return NULL;
    }

    return pHandle;
}
Пример #11
0
/***********************************************************************
 *                        release_module									
 ***********************************************************************
DESCRIPTION:	Release all module resources - FSMs, timer and object.
                                                                                                   
INPUT:      hConn	-	Connection handle.

OUTPUT:		

RETURN:     void

************************************************************************/
static void release_module(conn_t *pConn)
{
	if (pConn->ibss_pFsm)
    {
		fsm_Unload (pConn->hOs, pConn->ibss_pFsm);
    }

    if (pConn->infra_pFsm)
    {
		fsm_Unload (pConn->hOs, pConn->infra_pFsm);
    }

	if (pConn->hConnTimer)
    {
		tmr_DestroyTimer (pConn->hConnTimer);
    }

	os_memoryFree(pConn->hOs, pConn, sizeof(conn_t));
}
/**
 * \author Yuval Adler\n
 * \date 29-Dec-2004\n
 * \brief Finalizes the scan SRV module (releasing memory and timer)
 *
 * Function Scope \e Public.\n
 * \param hScanSRV - handle to the scan SRV object.\n
 */
void MacServices_scanSRV_destroy( TI_HANDLE hScanSRV )
{
    scanSRV_t *pScanSRV = (scanSRV_t*)hScanSRV;

    /* free timer */
    os_timerStop( pScanSRV->hOS, pScanSRV->timer );
    os_timerDestroy( pScanSRV->hOS, pScanSRV->timer );

    /* free memory */
    fsm_Unload( pScanSRV->hOS, pScanSRV->SM );
    os_memoryFree( pScanSRV->hOS, (TI_HANDLE)pScanSRV , sizeof(scanSRV_t) );
}
Пример #13
0
/**
*
* Function  - externalSec_Destroy.
*
* \b Description:
*
* Called by mainSecSM (mainSec_unload).
*
* \b ARGS:
*
*
* \b RETURNS:
*
*  TI_STATUS - 0 on success, any other value on failure.
*
*/
TI_STATUS externalSec_Destroy (struct externalSec_t *pExternalSec)
{
    TI_STATUS	status;

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

    status = fsm_Unload (pExternalSec->hOs, pExternalSec->pExternalSecSm);

    os_memoryFree (pExternalSec->hOs, pExternalSec, sizeof(struct externalSec_t));

    return TI_OK;
}
Пример #14
0
/*
DESCRIPTION:    Called by the destroy function or by the create function (on failure)
                Go over the vector, for each bit that is set, release the corresponding module.

INPUT:      pSwitchChannel  -   SwitchChannel pointer.
            initVec -   Vector that contains a bit set for each module thah had been initiualized

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
static void release_module(switchChannel_t *pSwitchChannel, TI_UINT32 initVec)
{
	if (pSwitchChannel == NULL) {
		return;
	}
	if (initVec & (1 << SC_SM_INIT_BIT)) {
		fsm_Unload(pSwitchChannel->hOs, pSwitchChannel->pSwitchChannelSm);
	}

	if (initVec & (1 << SC_INIT_BIT)) {
		os_memoryFree(pSwitchChannel->hOs, pSwitchChannel, sizeof(switchChannel_t));
	}

	initVec = 0;
}
Пример #15
0
/**
*
* mainKeys_config
*
* \b Description: 
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  OK on success, NOK otherwise.
*
* \sa 
*/
TI_STATUS mainKeys_unload(mainKeys_t *pMainKeys)
{
	TI_STATUS	status;

	if (pMainKeys == NULL)
	{
		return NOK;
	}

	status = fsm_Unload(pMainKeys->hOs, pMainKeys->pMainKeysSm);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pMainKeys->hReport, RSN_MODULE_LOG,
						  ("MAIN_KEYS_SM: Error releasing FSM memory \n"));
	}

	os_timerStop(pMainKeys->hOs, pMainKeys->timer);
    os_timerDestroy(pMainKeys->hOs, pMainKeys->timer);
	
    status = keyParser_unload(pMainKeys->pKeyParser);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pMainKeys->hReport, RSN_MODULE_LOG,
						  ("MAIN_KEYS_SM: Error unloading key parser\n"));
	}

	status = broadcastKey_unload(pMainKeys->pBcastSm);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pMainKeys->hReport, RSN_MODULE_LOG,
						  ("MAIN_KEYS_SM: Error unloading broadcast key SM\n"));
	}

	status = unicastKey_unload(pMainKeys->pUcastSm);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pMainKeys->hReport, RSN_MODULE_LOG,
						  ("MAIN_KEYS_SM: Error unloading unicast key SM\n"));
	}
	
	os_memoryFree(pMainKeys->hOs, pMainKeys, sizeof(mainKeys_t));

    return OK;
}
/**
*
* mlme_Unload - unload MLME SM from memory
*
* \b Description:
*
* Unload MLME SM from memory
*
* \b ARGS:
*
*  I   - hMlme - MLME SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS mlme_unload(TI_HANDLE hMlme)
{
	TI_STATUS       status;
	mlme_t      *pHandle;

	pHandle = (mlme_t*)hMlme;

	status = fsm_Unload(pHandle->hOs, pHandle->pMlmeSm);
	if (status != TI_OK) {
		/* report failure but don't stop... */
	}

	os_memoryFree(pHandle->hOs, hMlme, sizeof(mlme_t));

	return TI_OK;
}
Пример #17
0
/**
*
* mainKeys_config
*
* \b Description:
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*
* \sa
*/
TI_STATUS mainKeys_unload(mainKeys_t *pMainKeys)
{
	TI_STATUS	status;

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

	status = fsm_Unload(pMainKeys->hOs, pMainKeys->pMainKeysSm);
    if (status != TI_OK)
	{
		/* report failure but don't stop... */
        TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error releasing FSM memory \n");
	}

	if (pMainKeys->hSessionTimer)
	{
		tmr_DestroyTimer (pMainKeys->hSessionTimer);
	}
    pMainKeys->hSessionTimer = NULL;

    status = keyParser_unload(pMainKeys->pKeyParser);
    if (status != TI_OK)
	{
		/* report failure but don't stop... */
        TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading key parser\n");
	}

	status = broadcastKey_unload(pMainKeys->pBcastSm);
    if (status != TI_OK)
	{
		/* report failure but don't stop... */
        TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading broadcast key SM\n");
	}

	status = unicastKey_unload(pMainKeys->pUcastSm);
    if (status != TI_OK)
	{
		/* report failure but don't stop... */
        TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading unicast key SM\n");
	}

	os_memoryFree(pMainKeys->hOs, pMainKeys, sizeof(mainKeys_t));

    return TI_OK;
}
Пример #18
0
/**
*
* auth_unload - unload authentication SM from memory
*
* \b Description:
*
* Unload authentication SM from memory
*
* \b ARGS:
*
*  I   - hAuth - Authentication SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS auth_unload(TI_HANDLE hAuth)
{
	TI_STATUS 		status;
	auth_t		*pHandle;

	pHandle = (auth_t*)hAuth;

	status = fsm_Unload(pHandle->hOs, pHandle->pAuthSm);

	if (pHandle->hAuthSmTimer) {
		tmr_DestroyTimer (pHandle->hAuthSmTimer);
	}

	os_memoryFree(pHandle->hOs, pHandle, sizeof(auth_t));

	return TI_OK;
}
Пример #19
0
/**
*
* Function  - externalSec_Destroy.
*
* \b Description:
*
* Called by mainSecSM (mainSec_unload).
*
* \b ARGS:
*
*
* \b RETURNS:
*
*  TI_STATUS - 0 on success, any other value on failure.
*
*/
TI_STATUS externalSec_Destroy (struct externalSec_t *pExternalSec)
{
    TI_STATUS	status;

    if (pExternalSec == NULL)
    {
        return TI_NOK;
    }
    status = fsm_Unload(pExternalSec->hOs, pExternalSec->pExternalSecSm);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pExternalSec->hReport, REPORT_SEVERITY_ERROR, "EXTERNAL SECURITY: Error releasing FSM memory \n");
    }

    os_memoryFree(pExternalSec->hOs, pExternalSec, sizeof(struct externalSec_t));
    return TI_OK;
}
Пример #20
0
/**
*
* mainSec_config
*
* \b Description: 
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*
* \sa 
*/
TI_STATUS mainSec_unload(mainSec_t *pMainSec)
{
    TI_STATUS   status;

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

    status = mainKeys_unload(pMainSec->pMainKeys);

    status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm);

    status = externalSec_Destroy (pMainSec->pExternalSec);

    os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t));

    return TI_OK;
}
/**
*
* assocunload - unload association SM from memory
*
* \b Description: 
*
* Unload association SM from memory
*
* \b ARGS:
*
*  I   - hAssoc - association SM context  \n
*
* \b RETURNS:
*
*  OK if successful, NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS assoc_unload(TI_HANDLE hAssoc)
{
    TI_STATUS 		status;
	assoc_t		*pHandle;

	pHandle = (assoc_t*)hAssoc;

	status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pHandle->hReport, ASSOC_MODULE_LOG,
				  ("ASSOC_SM: Error releasing FSM memory \n"));
	}
	
	os_timerDestroy(pHandle->hOs, pHandle->timer);
	
	os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t));

	return OK;
}
Пример #22
0
/**
 * Releases the module's allocated objects according to the given init vector.
 * 
 * @param pMeasurementMgr A handle to the Measurement Manager module.
 * @param initVec The init vector with a bit set for each allocated object.
 * 
 * @date 01-Jan-2006
 */
static void measurementMgr_releaseModule (measurementMgr_t * pMeasurementMgr)
{

    if (pMeasurementMgr->hActivationDelayTimer)
    {
        tmr_DestroyTimer (pMeasurementMgr->hActivationDelayTimer);
    }


    if (pMeasurementMgr->pMeasurementMgrSm)
    {
        fsm_Unload(pMeasurementMgr->hOs, pMeasurementMgr->pMeasurementMgrSm);
    }

    if (pMeasurementMgr->hRequestH)
    {
        requestHandler_destroy(pMeasurementMgr->hRequestH);
    }
    
    os_memoryFree(pMeasurementMgr->hOs, pMeasurementMgr, sizeof(measurementMgr_t));
}
TI_STATUS broadcastKey_unload(struct _broadcastKey_t *pBroadcastKey)
{
	TI_STATUS		status;

	status = keyDerive_unload(pBroadcastKey->pKeyDerive);

	if (status != TI_OK) {
		TRACE0(pBroadcastKey->hReport, REPORT_SEVERITY_CONSOLE, "BCAST_KEY_SM: Error in unloading key derivation module\n");
		WLAN_OS_REPORT(("BCAST_KEY_SM: Error in unloading key derivation module\n"));
	}

	status = fsm_Unload(pBroadcastKey->hOs, pBroadcastKey->pBcastKeySm);
	if (status != TI_OK) {
		TRACE0(pBroadcastKey->hReport, REPORT_SEVERITY_CONSOLE, "BCAST_KEY_SM: Error in unloading state machine\n");
		WLAN_OS_REPORT(("BCAST_KEY_SM: Error in unloading state machine\n"));
	}

	/* free key parser context memory */
	os_memoryFree(pBroadcastKey->hOs, pBroadcastKey, sizeof(broadcastKey_t));

	return TI_OK;
}
Пример #24
0
/**
*
* assocunload - unload association SM from memory
*
* \b Description: 
*
* Unload association SM from memory
*
* \b ARGS:
*
*  I   - hAssoc - association SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS assoc_unload(TI_HANDLE hAssoc)
{
    TI_STATUS       status;
    assoc_t     *pHandle;

    pHandle = (assoc_t*)hAssoc;

    status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: Error releasing FSM memory \n");
    }
    
	if (pHandle->hAssocSmTimer)
	{
		tmr_DestroyTimer (pHandle->hAssocSmTimer);
	}
    
    os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t));

    return TI_OK;
}