Home | History | Annotate | Download | only in Sta_Management
      1 /*
      2  * sharedKeyAuthSm.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 sharedKeyAuthSm.h
     35  *  \brief shared key 802.11 authentication SM
     36  *
     37  *  \see sharedKeyAuthSm.c
     38  */
     39 
     40 
     41 /***************************************************************************/
     42 /*																		   */
     43 /*		MODULE:	sharedKeyAuthSm.h										   */
     44 /*    PURPOSE:	shared key 802.11 authentication SM						   */
     45 /*																	 	   */
     46 /***************************************************************************/
     47 
     48 #ifndef _SHARED_KEY_AUTH_SM_H
     49 #define _SHARED_KEY_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 	SHARED_KEY_AUTH_SM_STATE_IDLE		= 0,
     63 	SHARED_KEY_AUTH_SM_STATE_WAIT_1    	= 1,
     64 	SHARED_KEY_AUTH_SM_STATE_WAIT_2    	= 2,
     65 	SHARED_KEY_AUTH_SM_STATE_AUTH		= 3
     66 } sharedKeyAuth_smStates_t;
     67 
     68 /* State machine inputs */
     69 typedef enum
     70 {
     71 	SHARED_KEY_AUTH_SM_EVENT_START			= 0,
     72 	SHARED_KEY_AUTH_SM_EVENT_STOP			= 1,
     73 	SHARED_KEY_AUTH_SM_EVENT_SUCCESS_1  	= 2,
     74 	SHARED_KEY_AUTH_SM_EVENT_FAIL_1			= 3,
     75 	SHARED_KEY_AUTH_SM_EVENT_SUCCESS_2  	= 4,
     76 	SHARED_KEY_AUTH_SM_EVENT_FAIL_2			= 5,
     77 	SHARED_KEY_AUTH_SM_EVENT_TIMEOUT		= 6,
     78 	SHARED_KEY_AUTH_SM_EVENT_MAX_RETRY		= 7
     79 } sharedKeyAuth_smEvents_t;
     80 
     81 /* Typedefs */
     82 
     83 /* Structures */
     84 
     85 /* External data definitions */
     86 
     87 /* External functions definitions */
     88 
     89 /* Function prototypes */
     90 
     91 TI_STATUS sharedKeyAuth_Config(TI_HANDLE 	hAuth,
     92 							TI_HANDLE 	pOs);
     93 
     94 TI_STATUS sharedKeyAuth_Recv(TI_HANDLE pAssoc, mlmeFrameInfo_t *pFrame);
     95 
     96 TI_STATUS sharedKey_Timeout(auth_t *pAuth);
     97 
     98 TI_STATUS auth_skSMEvent(TI_UINT8 *currentState, TI_UINT8 event, TI_HANDLE hAuth);
     99 
    100 /* state machine functions */
    101 
    102 TI_STATUS sharedKeyAuth_smStartIdle(auth_t *hAuth);
    103 TI_STATUS sharedKeyAuth_smStopWait(auth_t *hAuth);
    104 TI_STATUS sharedKeyAuth_smSuccess1Wait1(auth_t *hAuth);
    105 TI_STATUS sharedKeyAuth_smFailure1Wait1(auth_t *hAuth);
    106 TI_STATUS sharedKeyAuth_smSuccess2Wait2(auth_t *hAuth);
    107 TI_STATUS sharedKeyAuth_smFailure2Wait2(auth_t *hAuth);
    108 TI_STATUS sharedKeyAuth_smTimeoutWait1(auth_t *hAuth);
    109 TI_STATUS sharedKeyAuth_smTimeoutWait2(auth_t *hAuth);
    110 TI_STATUS sharedKeyAuth_smMaxRetryWait(auth_t *hAuth);
    111 TI_STATUS sharedKeyAuth_smStopAuth(auth_t *hAuth);
    112 TI_STATUS sharedKeyAuth_smActionUnexpected(auth_t *hAuth);
    113 
    114 TI_STATUS sharedKeyAuth_smResetRetry(auth_t *hAuth);
    115 TI_STATUS sharedKeyAuth_smIncRetry(auth_t *hAuth);
    116 TI_STATUS sharedKeyAuth_smReportSuccess(auth_t *hAuth);
    117 TI_STATUS sharedKeyAuth_smReportFailure(auth_t *hAuth);
    118 TI_STATUS sharedKeyAuth_smSendAuth1(auth_t *hAuth);
    119 TI_STATUS sharedKeyAuth_smSendAuth2(auth_t *hAuth);
    120 TI_STATUS sharedKeyAuth_smStartTimer(auth_t *hAuth);
    121 TI_STATUS sharedKeyAuth_smStopTimer(auth_t *hAuth);
    122 
    123 #endif
    124 
    125