/** * * 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; }
/** * * 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; }
/** * * 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; }