1 /* 2 * openAuthSm.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 assocSm.h 35 * \brief 802.11 authentication SM 36 * 37 * \see assocSm.c 38 */ 39 40 41 /***************************************************************************/ 42 /* */ 43 /* MODULE: assocSm.h */ 44 /* PURPOSE: 802.11 authentication SM */ 45 /* */ 46 /***************************************************************************/ 47 48 #ifndef _OPEN_AUTH_SM_H 49 #define _OPEN_AUTH_SM_H 50 51 #include "fsm.h" 52 #include "mlmeApi.h" 53 #include "authSm.h" 54 55 /* Constants */ 56 57 /* Enumerations */ 58 59 /* state machine states */ 60 typedef enum 61 { 62 OPEN_AUTH_SM_STATE_IDLE = 0, 63 OPEN_AUTH_SM_STATE_WAIT = 1, 64 OPEN_AUTH_SM_STATE_AUTH = 2 65 } openAuth_smStates_t; 66 67 /* State machine inputs */ 68 typedef enum 69 { 70 OPEN_AUTH_SM_EVENT_START = 0, 71 OPEN_AUTH_SM_EVENT_STOP = 1, 72 OPEN_AUTH_SM_EVENT_SUCCESS = 2, 73 OPEN_AUTH_SM_EVENT_FAIL = 3, 74 OPEN_AUTH_SM_EVENT_TIMEOUT = 4, 75 OPEN_AUTH_SM_EVENT_MAX_RETRY = 5 76 } openAuth_smEvents_t; 77 78 /* Typedefs */ 79 80 /* Structures */ 81 82 /* External data definitions */ 83 84 /* External functions definitions */ 85 86 /* Function prototypes */ 87 88 TI_STATUS openAuth_Config(TI_HANDLE hAuth, 89 TI_HANDLE pOs); 90 91 TI_STATUS openAuth_Recv(TI_HANDLE pAssoc, mlmeFrameInfo_t *pFrame); 92 93 TI_STATUS openAuth_Timeout(auth_t *pAuth); 94 95 TI_STATUS auth_osSMEvent(TI_UINT8 *currentState, TI_UINT8 event, TI_HANDLE hAuth); 96 97 /* state machine functions */ 98 99 TI_STATUS openAuth_smStartIdle(auth_t *pAuth); 100 TI_STATUS openAuth_smStopWait(auth_t *hAuth); 101 TI_STATUS openAuth_smSuccessWait(auth_t *hAuth); 102 TI_STATUS openAuth_smFailureWait(auth_t *hAuth); 103 TI_STATUS openAuth_smTimeoutWait(auth_t *hAuth); 104 TI_STATUS openAuth_smMaxRetryWait(auth_t *hAuth); 105 TI_STATUS openAuth_smStopAuth(auth_t *hAuth); 106 TI_STATUS openAuth_smActionUnexpected(auth_t *hAuth); 107 108 TI_STATUS openAuth_smResetRetry(auth_t *hAuth); 109 TI_STATUS openAuth_smIncRetry(auth_t *hAuth); 110 TI_STATUS openAuth_smReportSuccess(auth_t *hAuth); 111 TI_STATUS openAuth_smReportFailure(auth_t *hAuth); 112 TI_STATUS openAuth_smSendAuthReq(auth_t *hAuth); 113 TI_STATUS openAuth_smStartTimer(auth_t *hAuth); 114 TI_STATUS openAuth_smStopTimer(auth_t *hAuth); 115 116 #endif 117 118