1/** \file utilsReplvl.h
2 *  \brief Report level API
3 *
4 *  \see utilsReplvl.c
5 */
6/****************************************************************************
7**+-----------------------------------------------------------------------+**
8**|                                                                       |**
9**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
10**| All rights reserved.                                                  |**
11**|                                                                       |**
12**| Redistribution and use in source and binary forms, with or without    |**
13**| modification, are permitted provided that the following conditions    |**
14**| are met:                                                              |**
15**|                                                                       |**
16**|  * Redistributions of source code must retain the above copyright     |**
17**|    notice, this list of conditions and the following disclaimer.      |**
18**|  * Redistributions in binary form must reproduce the above copyright  |**
19**|    notice, this list of conditions and the following disclaimer in    |**
20**|    the documentation and/or other materials provided with the         |**
21**|    distribution.                                                      |**
22**|  * Neither the name Texas Instruments nor the names of its            |**
23**|    contributors may be used to endorse or promote products derived    |**
24**|    from this software without specific prior written permission.      |**
25**|                                                                       |**
26**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
27**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
28**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
29**| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
30**| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
31**| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
32**| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
33**| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
34**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
35**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
36**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
37**|                                                                       |**
38**+-----------------------------------------------------------------------+**
39****************************************************************************/
40
41/***************************************************************************/
42/*																									*/
43/*	  MODULE:	utilsReplvl.h																*/
44/*    PURPOSE:	Report level API			 								*/
45/*																									*/
46/***************************************************************************/
47#ifndef __RSN_API_H__
48#define __RSN_API_H__
49
50#include "osTIType.h"
51#include "paramOut.h"
52#include "paramIn.h"
53#include "memMngrEx.h"
54#include "802_11Defs.h"
55
56/* Constants */
57
58#define RSN_MAC_ADDR_LEN			6
59#define MAX_KEY_RSC_LEN				8
60#define MAX_SSN_KEY_DATA_LENGTH		32
61#define RSN_AUTH_FAILURE_TIMEOUT    30000
62
63/* Enumerations */
64
65/** RSN key management suites */
66typedef enum
67{
68	RSN_KEY_MNG_NONE				= 0,		/**< no key management available */
69	RSN_KEY_MNG_802_1X				= 1,		/**< "802.1X" key management */
70	RSN_KEY_MNG_WPA			        = 2,		/**< "WPA 4 way handshake" key management */
71	RSN_KEY_MNG_EXC			        = 3,		/**< "EXC" key management */
72	RSN_KEY_MNG_UNKNOWN				= 255		/**< UNKNOWN key management available */
73} rsn_keyMngSuite_e;
74
75/** Available cipher suites for admission control */
76typedef enum
77{
78	RSN_IBSS            	= 0, 		/**< IBSS mode */
79	RSN_INFRASTRUCTURE		= 1 		/**< Infrastructure mode */
80} rsn_networkMode_t;
81
82/** Port Access Entity role type */
83typedef enum
84{
85	RSN_PAE_AP		= 0,
86	RSN_PAE_SUPP	= 1
87} rsn_paeRole_t;
88
89/** RSN Events */
90typedef enum {
91	RSN_EVENT_EAPOL_RECV    		= 0x0,		/**< EAPOL frame received in the RX */
92	RSN_EVENT_SEC_ATTACK_DETECT		= 0x1,		/**< Security Attack detection */
93	RSN_EVENT_RAW_KEY_RECV			= 0x2,		/**< Raw key recive */
94    RSN_EVENT_KEY_REMOVE            = 0x3		/**< Key remove event */
95} rsn_event_e;
96
97/** Site ben levels */
98typedef enum
99{
100    RSN_SITE_BAN_LEVEL_HALF = 1,
101    RSN_SITE_BAN_LEVEL_FULL  = 2
102} rsn_siteBanLevel_e;
103
104
105/* Typedefs */
106
107/** Port Access Entity structure */
108typedef struct
109{
110	externalAuthMode_e	authProtocol;
111	rsn_keyMngSuite_e	keyExchangeProtocol;
112	cipherSuite_e		unicastSuite;
113	cipherSuite_e		broadcastSuite;
114} rsn_paeConfig_t;
115
116typedef struct
117{
118	BOOL 		    privacy;
119	UINT8		    *pIe;
120	UINT8		    ieLen;
121} rsnData_t;
122
123typedef struct
124{
125   macAddress_t bssId;
126   dot11_RSN_t  *pRsnIEs;
127   UINT8        rsnIeLen;
128} bssidRsnInfo_t;
129
130#define MAX_NUM_OF_PRE_AUTH_BSSIDS 	16
131typedef struct
132{
133   UINT8          NumOfItems;
134   bssidRsnInfo_t bssidList[MAX_NUM_OF_PRE_AUTH_BSSIDS];
135} bssidList4PreAuth_t;
136
137
138/* Prototypes */
139
140TI_HANDLE rsn_create(TI_HANDLE hOs);
141
142TI_STATUS rsn_unload(TI_HANDLE hRsn);
143
144TI_STATUS rsn_config(TI_HANDLE 		hRsn,
145				  TI_HANDLE			hTx,
146				  TI_HANDLE			hRx,
147				  TI_HANDLE			hConn,
148				  TI_HANDLE			hMlme,
149				  TI_HANDLE			hCtrlData,
150				  TI_HANDLE			hWhalCtrl,
151				  TI_HANDLE			hMemMgr,
152                  TI_HANDLE         hSiteMgr,
153				  TI_HANDLE 		hReport,
154				  TI_HANDLE 		hOs,
155				  TI_HANDLE 		hExcMngr,
156				  TI_HANDLE 		hPowerMgr,
157                  TI_HANDLE         hEvHandler,
158                  TI_HANDLE         hSmeSm,
159                  TI_HANDLE         hAPConn,
160				  rsnInitParams_t	*pInitParam);
161
162TI_STATUS rsn_reconfig(TI_HANDLE hRsn);
163
164TI_STATUS rsn_start(TI_HANDLE hRsn);
165
166TI_STATUS rsn_stop(TI_HANDLE hRsn, BOOL removeKeys);
167
168TI_STATUS rsn_eventRecv(TI_HANDLE hRsn, rsn_event_e event, void* pData);
169
170TI_STATUS rsn_setParam(TI_HANDLE hCtrlData, paramInfo_t	*pParam);
171
172TI_STATUS rsn_getParam(TI_HANDLE hCtrlData, paramInfo_t	*pParam);
173
174TI_STATUS rsn_getParamPartial(TI_HANDLE hRsn, paramInfoPartial_t *pParam);
175
176TI_STATUS rsn_evalSite(TI_HANDLE hRsn, rsnData_t *pRsnData, bssType_e bssType, macAddress_t bssid, UINT32 *pMetric);
177
178TI_STATUS rsn_setSite(TI_HANDLE hRsn, rsnData_t *pRsnData, UINT8 *pAssocIe, UINT8 *pAssocIeLen);
179
180TI_STATUS rsn_recvEapol(TI_HANDLE hRsn, mem_MSDU_T *pMsdu);
181
182TI_STATUS rsn_getInfoElement(TI_HANDLE hRsn, UINT8 *pRsnIe, UINT8 *pRsnIeLen);
183
184#ifdef EXC_MODULE_INCLUDED
185TI_STATUS rsn_getExcExtendedInfoElement(TI_HANDLE hRsn, UINT8 *pRsnIe, UINT8 *pRsnIeLen);
186#endif
187
188TI_STATUS rsn_reportAuthFailure(TI_HANDLE hRsn, authStatus_e authStatus);
189
190TI_STATUS rsn_reportMicFailure(TI_HANDLE hRsn, UINT8 *pType, UINT32 Length);
191
192TI_STATUS rsn_resetPMKIDList(TI_HANDLE hRsn);
193
194TI_STATUS rsn_removedDefKeys(TI_HANDLE hRsn);
195
196TI_STATUS rsn_startPreAuth(TI_HANDLE hRsn, bssidList4PreAuth_t *pBssidList);
197
198rsn_siteBanLevel_e rsn_banSite(TI_HANDLE hRsn, macAddress_t siteBssid, rsn_siteBanLevel_e banLevel, UINT32 durationMs);
199
200BOOL rsn_isSiteBanned(TI_HANDLE hRsn, macAddress_t siteBssid);
201
202void rsn_MboxFlushFinishCb(TI_HANDLE handle, UINT16 MboxStatus, char *InterrogateParamsBuf);
203
204
205#endif /* __RSN_API_H__*/
206