blob: 0eb1cce4205b65113804b38bd79b728caa74ca6a [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002 * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080028/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 *
Jeff Johnson295189b2012-06-20 16:38:30 -070030 * This file aniSystemDefs.h contains definitions used by
31 * various ANI entities
32 * Author: Chandra Modumudi
33 * Date: 09/18/2002
34 * History:-
35 * Date Modified by Modification Information
36 * --------------------------------------------------------------------
37 */
38
39#ifndef __ANI_SYSTEM_DEFS_H
40#define __ANI_SYSTEM_DEFS_H
41
42#include "sirTypes.h"
43#include "sirMacProtDef.h"
44
45#define ANI_OUI 0x000AF5
46
47/// Max WDS info length.
48#define ANI_WDS_INFO_MAX_LENGTH 64
49
50
51/// Max number of SSIDs to support Multiple SSID feature
52#define ANI_MAX_NUM_OF_SSIDS 16
53
54//This is to force compiler to use the maximum of an int for enum
55#define SIR_MAX_ENUM_SIZE 0x7FFFFFFF
56
57/* Max key size including the WAPI and TKIP */
58#define WLAN_MAX_KEY_RSC_LEN 16
59#define WLAN_WAPI_KEY_RSC_LEN 16
60
61
62
63#ifndef FALSE
64#undef FALSE
65#define FALSE 0
66#endif
67#ifndef TRUE
68#undef TRUE
69#define TRUE 1
70#endif
71
72typedef enum eAniBool
73{
74 eSIR_FALSE,
75 eSIR_TRUE,
76 eSIR_DONOT_USE_BOOL = SIR_MAX_ENUM_SIZE
77} tAniBool;
78
79/// Authentication type enum used with peer
80typedef enum eAniAuthType
81{
82 eSIR_OPEN_SYSTEM,
83 eSIR_SHARED_KEY,
84#if defined WLAN_FEATURE_VOWIFI_11R
85 eSIR_FT_AUTH,
86#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080087#if defined FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -070088 eSIR_LEAP_AUTH = 0x80,
89#endif
90 eSIR_AUTO_SWITCH,
91 eSIR_DONOT_USE_AUTH_TYPE = SIR_MAX_ENUM_SIZE
92} tAniAuthType;
93
94/// Encryption type enum used with peer
95typedef enum eAniEdType
96{
97 eSIR_ED_NONE,
98 eSIR_ED_WEP40,
99 eSIR_ED_WEP104,
100 eSIR_ED_TKIP,
101 eSIR_ED_CCMP,
102#if defined(FEATURE_WLAN_WAPI)
103 eSIR_ED_WPI,
104#endif
105 /*DPU HW treats encryption mode 4 plus RMF bit set in TX BD as BIP.
106 Thus while setting BIP encryption mode in corresponding DPU Desc
107 eSIR_ED_AES_128_CMAC should be set to eSIR_ED_CCMP*/
108 eSIR_ED_AES_128_CMAC,
109 eSIR_ED_NOT_IMPLEMENTED = SIR_MAX_ENUM_SIZE
110} tAniEdType;
111
112
113typedef enum eAniWepType
114{
115 eSIR_WEP_STATIC,
116 eSIR_WEP_DYNAMIC,
117} tAniWepType;
118
119/// Enum to specify whether key is used
120/// for TX only, RX only or both
121typedef enum eAniKeyDirection
122{
123 eSIR_TX_ONLY,
124 eSIR_RX_ONLY,
125 eSIR_TX_RX,
Jeff Johnson295189b2012-06-20 16:38:30 -0700126 eSIR_TX_DEFAULT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700127 eSIR_DONOT_USE_KEY_DIRECTION = SIR_MAX_ENUM_SIZE
128} tAniKeyDirection;
129
130/// Enum for rate
131typedef enum eAniRate
132{
133 eSIR_ANY_RATE
134} tAniRate;
135
136typedef struct sAniSSID
137{
138 tANI_U8 length;
139 tANI_U8 ssId[SIR_MAC_MAX_SSID_LENGTH];
140} tAniSSID, *tpAniSSID;
141
142typedef struct sAniApName
143{
144 tANI_U8 length;
145 tANI_U8 name[SIR_MAC_MAX_SSID_LENGTH];
146} tAniApName, *tpAniApName;
147
148/// RSN IE information
149typedef struct sSirRSNie
150{
151 tANI_U16 length;
152 tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2];
153} tSirRSNie, *tpSirRSNie;
154
155/// Additional IE information :
156/// This can include WSC IE, P2P IE, and/or FTIE from upper layer.
157/// MAC layer transparently convey these IE info between peer STA and upper layer,
158/// but never requires to parse it.
159typedef struct sSirAddie
160{
161 tANI_U16 length;
Ganesh Kondabattini7500fb32015-04-10 14:50:32 +0530162 tANI_U8 addIEdata[SIR_MAC_MAX_ADD_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700163} tSirAddie, *tpSirAddie;
164
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800165#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700166
Jeff Johnson3c3e1782013-02-27 10:48:42 -0800167// The CCKM IE needs to be in the
168// Join and Reassoc Req.
Jeff Johnson295189b2012-06-20 16:38:30 -0700169typedef struct sSirCCKMie
170{
171 tANI_U16 length;
Jeff Johnson3c3e1782013-02-27 10:48:42 -0800172 tANI_U8 cckmIEdata[SIR_MAC_MAX_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700173} tSirCCKMie, *tpSirCCKMie;
174
175#endif
176
177/// Need to refine structure definitions for Keying material,
178/// QoS policy, etc
179
180/// Definition Quality of Service
181typedef struct sSirQos
182{
183 tANI_U16 temp1; // Need to define later
184 tANI_U16 temp2; // Need to define later
185} tSirQos, *tpSirQos;
186
187/// Definition for Encryption Keys
188typedef struct sSirKeys
189{
190 tANI_U8 keyId;
191 tANI_U8 unicast; // 0 for multicast
192 tAniKeyDirection keyDirection;
193 tANI_U8 keyRsc[WLAN_MAX_KEY_RSC_LEN]; // Usage is unknown
194 tANI_U8 paeRole; // =1 for authenticator,
195 // =0 for supplicant
196 tANI_U16 keyLength;
197 tANI_U8 key[SIR_MAC_MAX_KEY_LENGTH];
198} tSirKeys, *tpSirKeys;
199
200/// Definition for Keying material
201typedef struct sSirKeyMaterial
202{
203 tANI_U16 length; // This is the length of all
204 // data that follows
205 tAniEdType edType; // Encryption/Decryption type
206 tANI_U8 numKeys;
207 tSirKeys key[1];
208} tSirKeyMaterial, *tpSirKeyMaterial;
209
210#define SIR_CIPHER_SEQ_CTR_SIZE 6
211/// Definition for MIC failure indication
212typedef struct sSirMicFailureInfo
213{
214 tSirMacAddr srcMacAddr; //address used to compute MIC
215 tSirMacAddr taMacAddr; //transmitter address
216 tSirMacAddr dstMacAddr;
217 tAniBool multicast;
218 tANI_U8 IV1; // first byte of IV
219 tANI_U8 keyId; // second byte of IV
220 tANI_U8 TSC[SIR_CIPHER_SEQ_CTR_SIZE]; // sequence number
221 tSirMacAddr rxMacAddr; // receive address
222
223} tSirMicFailureInfo, *tpSirMicFailureInfo;
224
Sachin Ahuja3d47fcd2015-08-28 16:02:06 +0530225typedef struct sSirLostLinkParamsInfo
226{
227 tANI_U8 bssIdx;
228 tANI_U8 rssi;
229 tSirMacAddr selfMacAddr;
230 tANI_U32 linkFlCnt;
231 tANI_U32 linkFlTx;
232 tANI_U32 lastDataRate;
233 tANI_U32 rsvd1;
234 tANI_U32 rsvd2;
235}tSirLostLinkParamsInfo, *tpSirLostLinkParamsInfo;
236
Jeff Johnson295189b2012-06-20 16:38:30 -0700237// Boa command. Used mainly for radar info persistance
238typedef struct sBoaCommand
239{
240 tANI_U8 length;
241 tANI_U8 cmd[64];
242}tBoaCommand;
243
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700244
245typedef __ani_attr_pre_packed struct sTrafStrmMetrics
246{
247 tANI_U16 UplinkPktQueueDly;
248 tANI_U16 UplinkPktQueueDlyHist[4];
249 tANI_U32 UplinkPktTxDly;
250 tANI_U16 UplinkPktLoss;
251 tANI_U16 UplinkPktCount;
252 tANI_U8 RoamingCount;
253 tANI_U16 RoamingDly;
254} __ani_attr_packed tTrafStrmMetrics, *tpTrafStrmMetrics;
255
256
Srinivas Girigowda91ccbe82013-11-10 16:37:38 -0800257typedef __ani_attr_pre_packed struct sBcnReportFields
258{
259 tANI_U8 ChanNum;
260 tANI_U8 Spare;
261 tANI_U16 MeasDuration;
262 tANI_U8 PhyType;
263 tANI_U8 RecvSigPower;
264 tSirMacAddr Bssid;
265 tANI_U32 ParentTsf;
266 tANI_U32 TargetTsf[2];
267 tANI_U16 BcnInterval;
268 tANI_U16 CapabilityInfo;
269} __ani_attr_packed tBcnReportFields, *tpBcnReportFields;
270
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700271
Jeff Johnson295189b2012-06-20 16:38:30 -0700272#endif /* __ANI_SYSTEM_DEFS_H */
273