1/*
2 * STADExternalIf.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
35/****************************************************************************/
36/*                                                                          */
37/*    MODULE:   TiWlnIf.h                                       */
38/*    PURPOSE:                                                              */
39/*                                                                          */
40/****************************************************************************/
41#ifndef __TIWLNIF_NEW_H__
42#define __TIWLNIF_NEW_H__
43
44/** \file  STADExternalIf.h
45 *  \brief STAD External APIs
46 */
47
48#include "tidef.h"
49#include "report.h"
50#include "osDot11.h"
51#include "TI_IPC_Api.h"
52#include "bssTypes.h"
53#include "roamingMngrTypes.h"
54#include "version.h"
55#include "privateCmd.h"
56#include "CmdInterfaceCodes.h"
57#include "coreDefaultParams.h"
58#include "scanMngrTypes.h"
59#include "TWDriver.h"
60
61/***********/
62/* defines */
63/***********/
64
65#define NUM_OF_CONFIG_PARAMS_IN_SG  	    2
66#define NUM_OF_STATUS_PARAMS_IN_SG  		11
67#define NUM_OF_COEX_ACTIVITY_PARAMS_IN_SG 	6
68#define NUM_OF_RATE_MNGT_PARAMS_MAX			14
69#define SET_SSID_WITHOUT_SUPPL      		0x8000
70
71#define TX_RETRY_HISTOGRAM_SIZE 			16
72
73#define RX_DATA_FILTER_MAX_MASK_SIZE        8
74#define RX_DATA_FILTER_MAX_PATTERN_SIZE     64
75
76#define KEEP_ALIVE_TEMPLATE_MAX_LENGTH      64
77
78#define KEEP_ALIVE_MAX_USER_MESSAGES     	2
79
80
81/*********************/
82/* enumeration types */
83/*********************/
84
85/** \enum TxDelayRanges_e
86 * \brief TX Delay Ranges
87 *
88 * \par Description
89 * The Tx path delay histogram (host + MAC)ranges in msec
90 * Used as indexes in tx Delay Histogram Ranges (including Start & End of ranges) Table
91 *
92 * \sa
93 */
94typedef enum
95{
96    TX_DELAY_RANGE_MIN        = 0,		/**< */
97
98    TX_DELAY_RANGE_0_TO_1     = 0,		/**< */
99    TX_DELAY_RANGE_1_TO_10    = 1,		/**< */
100    TX_DELAY_RANGE_10_TO_20   = 2,		/**< */
101    TX_DELAY_RANGE_20_TO_40   = 3,		/**< */
102    TX_DELAY_RANGE_40_TO_60   = 4,		/**< */
103    TX_DELAY_RANGE_60_TO_80   = 5,		/**< */
104    TX_DELAY_RANGE_80_TO_100  = 6,		/**< */
105    TX_DELAY_RANGE_100_TO_200 = 7,		/**< */
106    TX_DELAY_RANGE_ABOVE_200  = 8,		/**< */
107
108    TX_DELAY_RANGE_MAX        = 8,		/**< */
109    TX_DELAY_RANGES_NUM       = 9		/**< */
110} TxDelayRanges_e;
111
112/** \enum TIWLN_SIMPLE_CONFIG_MODE
113 * \brief TI WLAN Simple Configuration Mode
114 *
115 * \par Description
116 * Used for indicating WiFi Simple Configuration mode
117 *
118 * \sa
119 */
120typedef enum
121{
122    TIWLN_SIMPLE_CONFIG_OFF = 0,		/**< Simple Configuration OFF			*/
123    TIWLN_SIMPLE_CONFIG_PIN_METHOD,		/**< Simple Configuration PIN Method	*/
124    TIWLN_SIMPLE_CONFIG_PBC_METHOD		/**< Simple Configuration PBC Method	*/
125} TIWLN_SIMPLE_CONFIG_MODE;
126
127/** \enum EDraftNumber
128 * \brief Draft Number
129 *
130 * \par Description
131 * Site Manager / Exteranl Rate use draft number
132 *
133 * \sa
134 */
135typedef enum
136{
137    DRAFT_5_AND_EARLIER = 5,	/**< */
138    DRAFT_6_AND_LATER   = 6		/**< */
139
140} EDraftNumber;
141
142/********************/
143/* Structures types */
144/********************/
145
146
147/** \struct TTxDataCounters
148 * \brief TX Data Counters
149 *
150 * \par Description
151 * Tx statistics per Tx-queue
152 *
153 * \sa
154 */
155typedef struct
156{
157    TI_UINT32      XmitOk;                 /**< The number of frames that were transferred to TNET without errors 						*/
158    TI_UINT32      DirectedBytesXmit;      /**< The number of bytes in directed packets that are transmitted without errors 			*/
159    TI_UINT32      DirectedFramesXmit;     /**< The number of directed packets that are transmitted without errors 						*/
160    TI_UINT32      MulticastBytesXmit;     /**< The number of bytes in multicast/functional packets that are transmitted without errors */
161    TI_UINT32      MulticastFramesXmit;    /**< The number of multicast/functional packets that are transmitted without errors			*/
162    TI_UINT32      BroadcastBytesXmit;     /**< The number of bytes in broadcast packets that are transmitted without errors 			*/
163    TI_UINT32      BroadcastFramesXmit;    /**< The number of broadcast packets that are transmitted without errors 					*/
164
165    TI_UINT32      RetryHistogram[ TX_RETRY_HISTOGRAM_SIZE ];	/**< Histogram counting the number of packets xfered with any retry number	*/
166
167    TI_UINT32      RetryFailCounter;       /**< Number of packets that failed transmission due to retry number exceeded 				*/
168    TI_UINT32      TxTimeoutCounter;       /**< Number of packets that failed transmission due to lifetime expiry 						*/
169    TI_UINT32      NoLinkCounter;          /**< Number of packets that failed transmission due to link failure 							*/
170    TI_UINT32      OtherFailCounter;       /**< Number of packets that failed transmission due to other reasons 						*/
171    TI_UINT32      MaxConsecutiveRetryFail;/**< Maximum consecutive packets that failed transmission due to retry limit exceeded 		*/
172
173    /*  TX path delay statistics  */
174    TI_UINT32      txDelayHistogram[TX_DELAY_RANGES_NUM];	/**< Histogram of Tx path delay (host + MAC) 								*/
175    TI_UINT32      NumPackets;             /**< For average calculation - Total packets counted 										*/
176    TI_UINT32      SumTotalDelayMs;        /**< For average calculation - the sum of packets total delay 								*/
177    TI_UINT32      SumFWDelayUs;           /**< For average calculation - The sum of packets FW delay 									*/
178    TI_UINT32      SumMacDelayUs;          /**< For average calculation - the sum of packets MAC delay 									*/
179} TTxDataCounters;
180
181/** \struct TIWLN_TX_STATISTICS
182 * \brief TI WLAN TX Statistics
183 *
184 * \par Description
185 * All Tx statistics of all Tx Queues Tx-queue
186 *
187 * \sa
188 */
189typedef struct
190{
191    TTxDataCounters  txCounters[MAX_NUM_OF_AC];	/**< Table which holds Tx statistics of each Tx-queue */
192} TIWLN_TX_STATISTICS;
193
194/** \struct TDfsChannelRange
195 * \brief DFS Channel Range
196 *
197 * \par Description
198 * Range of Dynamic Frequency Selection Channel
199 *
200 * \sa
201 */
202typedef struct
203{
204    TI_UINT16   minDFS_channelNum;	/**< Lower limit of DFS Channel Range		*/
205    TI_UINT16   maxDFS_channelNum;	/**< Higher limit of DFS Channel Range		*/
206} TDfsChannelRange;
207
208/** \struct TDebugRegisterReq
209 * \brief Debug Register Request
210 *
211 * \par Description
212 * Used for reading HW register (for debug)
213 *
214 * \sa
215 */
216typedef struct
217{
218    TI_UINT32 regSize;			/**< Register Size			*/
219    TI_UINT32 regAddr;			/**< Register Address  		*/
220    TI_UINT32 regValue;			/**< Register value read	*/
221} TDebugRegisterReq;
222
223/** \struct TIWLN_REG_RW
224 * \brief TI WLAN Register R/W
225 *
226 * \par Description
227 * Used for writing HW register (for debug)
228 *
229 * \sa
230 */
231typedef struct
232{
233        TI_UINT32 regSize;		/**< Register Size			*/
234        TI_UINT32 regAddr;		/**< Register Address  		*/
235        TI_UINT32 regValue;		/**< Register write value	*/
236} TIWLN_REG_RW;
237
238/** \struct TCountry
239 * \brief Country Parameters
240 *
241 * \par Description
242 * Parameters of Country Informatino Element
243 *
244 * \sa
245 */
246typedef struct
247{
248    TI_UINT8            elementId;		/**< Country IE ID 										*/
249    TI_UINT8            len;			/**< Country IE data length 							*/
250    dot11_countryIE_t   countryIE;	   	/**< Country IE (country string and tripple channel)	*/
251} TCountry;
252
253/** \struct TRates
254 * \brief Rates Parameters
255 *
256 * \par Description
257 * Site Manager Supported rates parameters
258 *
259 * \sa
260 */
261typedef struct
262{
263    TI_UINT8       len;											/**< Number of entries in the rates list													*/
264    TI_UINT8       ratesString[DOT11_MAX_SUPPORTED_RATES];		/**< Rates List. From each entry - a different bitrate (in bps) can be driven as followed:
265																((ratesString[i] & 0x7F) * 500000). Bits 1-7 are used for the bitrate and bit 8 is MASK used
266																for indicating if NET Basic
267																*/
268} TRates;
269
270/** \struct TRxDataFilterRequest
271 * \brief RX Data Filter Request
272 *
273 * \par Description
274 * Use for handling RX Data Filter (Add, Remove, parse, usage)
275 *
276 * \sa
277 */
278typedef struct
279{
280    TI_UINT8       offset; 									/**< Pattern Start Offset (0-255) 										*/
281    TI_UINT8       maskLength; 								/**< Byte-Mask Length, 1-8 bytes of mask, 0- match all packets 			*/
282    TI_UINT8       patternLength; 							/**< Should correspond to the number of asserted bits in the Byte-Mask 	*/
283    TI_UINT8       mask[RX_DATA_FILTER_MAX_MASK_SIZE]; 		/**< Byte-Mask 															*/
284    TI_UINT8       pattern[RX_DATA_FILTER_MAX_PATTERN_SIZE];/**< Data Filter PAttern												*/
285} TRxDataFilterRequest;
286
287/** \struct TIWLN_COUNTERS
288 * \brief TI WLAN Counters
289 *
290 * \par Description
291 * Use for handling RX Data Filter (Add, Remove, parse, usage)
292 *
293 * \sa
294 */
295typedef struct
296{
297    TI_UINT32  RecvOk;              /**< Number of frames that the NIC receives without errors										*/
298    TI_UINT32  RecvError;           /**< Number of frames that a NIC receives but does not indicate to the protocols due to errors	*/
299    TI_UINT32  RecvNoBuffer;        /**< Number of frames that the NIC cannot receive due to lack of NIC receive buffer space     	*/
300    TI_UINT32  DirectedBytesRecv;   /**< Number of bytes in directed packets that are received without errors                     	*/
301    TI_UINT32  DirectedFramesRecv;  /**< Number of directed packets that are received without errors                              	*/
302    TI_UINT32  MulticastBytesRecv;  /**< Number of bytes in multicast/functional packets that are received without errors         	*/
303    TI_UINT32  MulticastFramesRecv; /**< Number of multicast/functional packets that are received without errors                  	*/
304    TI_UINT32  BroadcastBytesRecv;  /**< Number of bytes in broadcast packets that are received without errors.                   	*/
305    TI_UINT32  BroadcastFramesRecv; /**< Number of broadcast packets that are received without errors.                            	*/
306
307    TI_UINT32  FragmentsRecv;		/**< Number of Fragments Received 															  	*/
308    TI_UINT32  FrameDuplicates;		/**< Number of Farme Duplicates						  											*/
309    TI_UINT32  FcsErrors;			/**< Number of frames that a NIC receives but does not indicate to the protocols due to errors	*/
310
311    TI_UINT32  BeaconsXmit;			/**< Number of Beacons Sent																		*/
312    TI_UINT32  BeaconsRecv;			/**< Number of Beacons Reveived																	*/
313    TI_UINT32  AssocRejects;		/**< Number of Rejected Assoc.			  		  												*/
314    TI_UINT32  AssocTimeouts;		/**< Number of Assoc. Time Outs																	*/
315    TI_UINT32  AuthRejects;			/**< Number of Authentication rejects 															*/
316    TI_UINT32  AuthTimeouts;		/**< Number of Authentication Time Outs 														*/
317
318} TIWLN_COUNTERS;
319
320/** \struct TPowerMgr_PowerMode
321 * \brief Power Mode Parameters
322 *
323 * \par Description
324 *
325 * \sa
326 */
327typedef struct
328{
329    PowerMgr_PowerMode_e    PowerMode;			/**< Power Mode	Type		*/
330    PowerMgr_Priority_e     PowerMngPriority; 	/**< Power Mode	Priority	*/
331} TPowerMgr_PowerMode;
332
333/** \struct TWscMode
334 * \brief WSC Mode
335 *
336 * \par Description
337 * This structure is used whenever the WiFi Simple Configuration Mode is modified between ON and OFF.
338 * Upon enabling the Simple Configuration, the user must fill the probeReqWSCIE fields
339 *
340 * \sa
341 */
342typedef struct
343{
344    TIWLN_SIMPLE_CONFIG_MODE  WSCMode;						/**< WiFi Simple Configuration mode 			   			*/
345    TI_UINT8 probeReqWSCIE[DOT11_WSC_PROBE_REQ_MAX_LENGTH];	/**< Buffer which holds the parameters of ProbeReq - WSC IE	*/
346}  TWscMode;
347
348/** \struct TKeepAliveTemplate
349 * \brief Keep Alive Template
350 *
351 * \par Description
352 * Used for Add/Remove to/from FW Keep Alive Configuration (Parameters & Template)
353 *
354 * \sa
355 */
356typedef struct
357{
358    TKeepAliveParams    keepAliveParams;								/**< Keep Alive Parameters						*/
359    TI_UINT8            msgBuffer[ KEEP_ALIVE_TEMPLATE_MAX_LENGTH ];	/**< Buffer which holds the Keep Alive Template	*/
360    TI_UINT32           msgBufferLength;								/**< Length of Keep Alive Template				*/
361
362} TKeepAliveTemplate;
363
364/** \struct TKeepAliveConfig
365 * \brief Keep Alive Configuration
366 *
367 * \par Description
368 * Used for Get/Set Keep Alive Configuration (Parameters & Template)
369 *
370 * \sa
371 */
372typedef struct
373{
374    TI_UINT8                enaDisFlag;									/**< Indicates if Keep Alive is Enabled/Disabled	*/
375    TKeepAliveTemplate      templates[ KEEP_ALIVE_MAX_USER_MESSAGES ];	/**< Buffer which holds the maximum Keep Alive Template
376																		* possible (according to maximum Keep Alive user messages
377																		possible)
378																		*/
379} TKeepAliveConfig;
380
381#endif /* __TIWLNIF_H__*/
382