1 /* 2 * externalSec.h 3 * 4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * * Neither the name Texas Instruments nor the names of its 18 * contributors may be used to endorse or promote products derived 19 * from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 /** \file externalSec.h 35 * \brief station externalSec API 36 * 37 * \see externalSec.c 38 */ 39 40 /**************************************************************************** 41 * * 42 * MODULE: externalSec * 43 * PURPOSE: station external security * 44 * * 45 ****************************************************************************/ 46 47 #ifndef _EXTERNAL_SEC_H 48 #define _EXTERNAL_SEC_H 49 50 #include "paramOut.h" 51 #include "fsm.h" 52 #include "rsnApi.h" 53 #include "keyTypes.h" 54 55 /* Constants */ 56 /** number of states in the state machine */ 57 #define EXTERNAL_SEC_NUM_STATES 2 58 59 /** number of events in the state machine */ 60 #define EXTERNAL_SEC_NUM_EVENTS 3 61 62 /* Enumerations */ 63 64 /** state machine states */ 65 typedef enum 66 { 67 EXTERNAL_SEC_STATE_IDLE = 0, 68 EXTERNAL_SEC_STATE_WAIT = 1 69 } externalSec_smStates; 70 71 72 /** State machine events */ 73 typedef enum 74 { 75 EXTERNAL_SEC_EVENT_START = 0, 76 EXTERNAL_SEC_EVENT_COMPLETE = 1, 77 EXTERNAL_SEC_EVENT_STOP = 2 78 } externalSec_smSEvents; 79 80 /* Typedefs */ 81 82 /* Structures */ 83 struct externalSec_t 84 { 85 TI_UINT8 currentState; 86 fsm_stateMachine_t *pExternalSecSm; 87 mainSec_t *pParent; 88 TI_HANDLE hOs; 89 TI_HANDLE hReport; 90 TI_BOOL bPortStatus; 91 }; 92 93 /* External data definitions */ 94 95 /* External functions definitions */ 96 97 /* Function prototypes */ 98 99 TI_STATUS externalSec_config(mainSec_t *pMainSec); 100 struct externalSec_t* externalSec_create(TI_HANDLE hOs); 101 TI_STATUS externalSec_Destroy(struct externalSec_t *pExternalSec); 102 TI_STATUS externalSec_event(struct externalSec_t *pExternalSec, TI_UINT8 event, void *pData); 103 TI_STATUS externalSec_rsnComplete(struct externalSec_t *pExternalSec); 104 #endif /* _EXTERNAL_SEC_H*/ 105