Home | History | Annotate | Download | only in Assoc
      1 
      2 /** \file AssocSM.h
      3  *  \brief 802.11 Association SM
      4  *
      5  *  \see assocSM.c
      6  */
      7 
      8 /****************************************************************************
      9 **+-----------------------------------------------------------------------+**
     10 **|                                                                       |**
     11 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
     12 **| All rights reserved.                                                  |**
     13 **|                                                                       |**
     14 **| Redistribution and use in source and binary forms, with or without    |**
     15 **| modification, are permitted provided that the following conditions    |**
     16 **| are met:                                                              |**
     17 **|                                                                       |**
     18 **|  * Redistributions of source code must retain the above copyright     |**
     19 **|    notice, this list of conditions and the following disclaimer.      |**
     20 **|  * Redistributions in binary form must reproduce the above copyright  |**
     21 **|    notice, this list of conditions and the following disclaimer in    |**
     22 **|    the documentation and/or other materials provided with the         |**
     23 **|    distribution.                                                      |**
     24 **|  * Neither the name Texas Instruments nor the names of its            |**
     25 **|    contributors may be used to endorse or promote products derived    |**
     26 **|    from this software without specific prior written permission.      |**
     27 **|                                                                       |**
     28 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     29 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     30 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     31 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     32 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     33 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     34 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     35 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     36 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     37 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     38 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     39 **|                                                                       |**
     40 **+-----------------------------------------------------------------------+**
     41 ****************************************************************************/
     42 
     43 /***************************************************************************/
     44 /*																		   */
     45 /*		MODULE:	AssocSM.h												   */
     46 /*    PURPOSE:	802.11 Association SM									   */
     47 /*																	 	   */
     48 /***************************************************************************/
     49 
     50 #ifndef _ASSOC_SM_H
     51 #define _ASSOC_SM_H
     52 
     53 #include "fsm.h"
     54 #include "mlmeApi.h"
     55 
     56 /* Constants */
     57 
     58 #define MAX_ASSOC_MSG_LENGTH			512
     59 
     60 #define ASSOC_SM_CAP_ESS_MODE			0x0001
     61 #define ASSOC_SM_CAP_IBSS_MODE			0x0002
     62 #define ASSOC_SM_CAP_CF_POLLABLE		0x0004
     63 #define ASSOC_SM_CAP_CF_POLL_REQ		0x0008
     64 #define ASSOC_SM_CAP_PIVACY				0x0010
     65 #define ASSOC_SM_CAP_SHORT_PREAMBLE		0x0020
     66 #define ASSOC_SM_CAP_PBCC				0x0040
     67 #define ASSOC_SM_CAP_CH_AGILITY			0x0080
     68 
     69 /* Enumerations */
     70 
     71 /* state machine states */
     72 typedef enum
     73 {
     74 	ASSOC_SM_STATE_IDLE		= 0,
     75 	ASSOC_SM_STATE_WAIT    	= 1,
     76 	ASSOC_SM_STATE_ASSOC	= 2
     77 } assoc_smStates_t;
     78 
     79 /* State machine inputs */
     80 typedef enum
     81 {
     82 	ASSOC_SM_EVENT_START		= 0,
     83 	ASSOC_SM_EVENT_STOP			= 1,
     84 	ASSOC_SM_EVENT_SUCCESS    	= 2,
     85     ASSOC_SM_EVENT_FAIL			= 3,
     86    	ASSOC_SM_EVENT_TIMEOUT		= 4,
     87    	ASSOC_SM_EVENT_MAX_RETRY	= 5
     88 } assoc_smEvents_t;
     89 
     90 
     91 
     92 /* Typedefs */
     93 
     94 typedef struct
     95 {
     96 	fsm_stateMachine_t	        *pAssocSm;
     97 	UINT32				        timeout;
     98 	UINT8				        currentState;
     99 	UINT32				        maxCount;
    100 	UINT8				        retryCount;
    101 	UINT32				        assocRejectCount;
    102 	UINT32				        assocTimeoutCount;
    103 	char				        *pChalange;
    104     UINT8                       assocRespBuffer[MAX_ASSOC_MSG_LENGTH];
    105     UINT32                      assocRespLen;
    106     UINT8                       assocReqBuffer[MAX_ASSOC_MSG_LENGTH];
    107     UINT32                      assocReqLen;
    108 
    109 	BOOL						reAssoc;
    110 	BOOL 						disAssoc; /* When set dissasociation frame will be sent. */
    111 
    112 	TI_HANDLE			        timer;
    113 	TI_HANDLE			        hMlme;
    114 	TI_HANDLE			        hSiteMgr;
    115 	TI_HANDLE			        hCtrlData;
    116 	TI_HANDLE			        hTxData;
    117 	TI_HANDLE			        hHalCtrl;
    118 	TI_HANDLE			        hRsn;
    119 	TI_HANDLE			        hReport;
    120 	TI_HANDLE			        hOs;
    121 	TI_HANDLE					hRegulatoryDomain;
    122 	TI_HANDLE			        hExcMngr;
    123 	TI_HANDLE			        hQosMngr;
    124     TI_HANDLE			        hMeasurementMgr;
    125 	TI_HANDLE			        hApConn;
    126 } assoc_t;
    127 
    128 /* Structures */
    129 
    130 /* External data definitions */
    131 
    132 /* External functions definitions */
    133 
    134 /* Function prototypes */
    135 
    136 TI_STATUS assoc_start(TI_HANDLE hAssoc);
    137 
    138 TI_STATUS reassoc_start(TI_HANDLE hAssoc);
    139 
    140 TI_STATUS assoc_stop(TI_HANDLE hAssoc);
    141 
    142 TI_STATUS assoc_recv(TI_HANDLE hAssoc, mlmeFrameInfo_t *pFrame);
    143 
    144 TI_STATUS assoc_setDisAssocFlag(TI_HANDLE hAssoc, BOOL disAsoccFlag);
    145 
    146 TI_STATUS assoc_smCapBuild(assoc_t *pCtx, UINT16 *cap);
    147 
    148 
    149 /* local functions */
    150 
    151 TI_STATUS assoc_saveAssocRespMessage(assoc_t *pAssocSm, UINT8 *pAssocBuffer, UINT32 length);
    152 
    153 
    154 #endif
    155 
    156