blob: 3594ef35a3a046076c6948fb89ed6a1be1b9ab9f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Abhinav Kumar4d44f632019-08-02 13:55:54 +05302 * Copyright (c) 2012-2014, 2019 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
Abhinav Kumar4d44f632019-08-02 13:55:54 +053087 eSIR_AUTH_TYPE_SAE = 3,
Abhinav Kumar487e49e2019-07-22 14:46:18 +053088 eSIR_AUTH_TYPE_OWE = 4,
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080089#if defined FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -070090 eSIR_LEAP_AUTH = 0x80,
91#endif
92 eSIR_AUTO_SWITCH,
93 eSIR_DONOT_USE_AUTH_TYPE = SIR_MAX_ENUM_SIZE
94} tAniAuthType;
95
96/// Encryption type enum used with peer
97typedef enum eAniEdType
98{
99 eSIR_ED_NONE,
100 eSIR_ED_WEP40,
101 eSIR_ED_WEP104,
102 eSIR_ED_TKIP,
103 eSIR_ED_CCMP,
104#if defined(FEATURE_WLAN_WAPI)
105 eSIR_ED_WPI,
106#endif
107 /*DPU HW treats encryption mode 4 plus RMF bit set in TX BD as BIP.
108 Thus while setting BIP encryption mode in corresponding DPU Desc
109 eSIR_ED_AES_128_CMAC should be set to eSIR_ED_CCMP*/
110 eSIR_ED_AES_128_CMAC,
111 eSIR_ED_NOT_IMPLEMENTED = SIR_MAX_ENUM_SIZE
112} tAniEdType;
113
114
115typedef enum eAniWepType
116{
117 eSIR_WEP_STATIC,
118 eSIR_WEP_DYNAMIC,
119} tAniWepType;
120
121/// Enum to specify whether key is used
122/// for TX only, RX only or both
123typedef enum eAniKeyDirection
124{
125 eSIR_TX_ONLY,
126 eSIR_RX_ONLY,
127 eSIR_TX_RX,
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 eSIR_TX_DEFAULT,
Jeff Johnson295189b2012-06-20 16:38:30 -0700129 eSIR_DONOT_USE_KEY_DIRECTION = SIR_MAX_ENUM_SIZE
130} tAniKeyDirection;
131
132/// Enum for rate
133typedef enum eAniRate
134{
135 eSIR_ANY_RATE
136} tAniRate;
137
138typedef struct sAniSSID
139{
140 tANI_U8 length;
141 tANI_U8 ssId[SIR_MAC_MAX_SSID_LENGTH];
142} tAniSSID, *tpAniSSID;
143
144typedef struct sAniApName
145{
146 tANI_U8 length;
147 tANI_U8 name[SIR_MAC_MAX_SSID_LENGTH];
148} tAniApName, *tpAniApName;
149
150/// RSN IE information
151typedef struct sSirRSNie
152{
153 tANI_U16 length;
154 tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2];
155} tSirRSNie, *tpSirRSNie;
156
157/// Additional IE information :
158/// This can include WSC IE, P2P IE, and/or FTIE from upper layer.
159/// MAC layer transparently convey these IE info between peer STA and upper layer,
160/// but never requires to parse it.
161typedef struct sSirAddie
162{
163 tANI_U16 length;
Ganesh Kondabattini7500fb32015-04-10 14:50:32 +0530164 tANI_U8 addIEdata[SIR_MAC_MAX_ADD_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700165} tSirAddie, *tpSirAddie;
166
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800167#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700168
Jeff Johnson3c3e1782013-02-27 10:48:42 -0800169// The CCKM IE needs to be in the
170// Join and Reassoc Req.
Jeff Johnson295189b2012-06-20 16:38:30 -0700171typedef struct sSirCCKMie
172{
173 tANI_U16 length;
Jeff Johnson3c3e1782013-02-27 10:48:42 -0800174 tANI_U8 cckmIEdata[SIR_MAC_MAX_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700175} tSirCCKMie, *tpSirCCKMie;
176
177#endif
178
179/// Need to refine structure definitions for Keying material,
180/// QoS policy, etc
181
182/// Definition Quality of Service
183typedef struct sSirQos
184{
185 tANI_U16 temp1; // Need to define later
186 tANI_U16 temp2; // Need to define later
187} tSirQos, *tpSirQos;
188
189/// Definition for Encryption Keys
190typedef struct sSirKeys
191{
192 tANI_U8 keyId;
193 tANI_U8 unicast; // 0 for multicast
194 tAniKeyDirection keyDirection;
195 tANI_U8 keyRsc[WLAN_MAX_KEY_RSC_LEN]; // Usage is unknown
196 tANI_U8 paeRole; // =1 for authenticator,
197 // =0 for supplicant
198 tANI_U16 keyLength;
199 tANI_U8 key[SIR_MAC_MAX_KEY_LENGTH];
200} tSirKeys, *tpSirKeys;
201
202/// Definition for Keying material
203typedef struct sSirKeyMaterial
204{
205 tANI_U16 length; // This is the length of all
206 // data that follows
207 tAniEdType edType; // Encryption/Decryption type
208 tANI_U8 numKeys;
209 tSirKeys key[1];
210} tSirKeyMaterial, *tpSirKeyMaterial;
211
212#define SIR_CIPHER_SEQ_CTR_SIZE 6
213/// Definition for MIC failure indication
214typedef struct sSirMicFailureInfo
215{
216 tSirMacAddr srcMacAddr; //address used to compute MIC
217 tSirMacAddr taMacAddr; //transmitter address
218 tSirMacAddr dstMacAddr;
219 tAniBool multicast;
220 tANI_U8 IV1; // first byte of IV
221 tANI_U8 keyId; // second byte of IV
222 tANI_U8 TSC[SIR_CIPHER_SEQ_CTR_SIZE]; // sequence number
223 tSirMacAddr rxMacAddr; // receive address
224
225} tSirMicFailureInfo, *tpSirMicFailureInfo;
226
Sachin Ahuja3d47fcd2015-08-28 16:02:06 +0530227typedef struct sSirLostLinkParamsInfo
228{
229 tANI_U8 bssIdx;
230 tANI_U8 rssi;
231 tSirMacAddr selfMacAddr;
232 tANI_U32 linkFlCnt;
233 tANI_U32 linkFlTx;
234 tANI_U32 lastDataRate;
235 tANI_U32 rsvd1;
236 tANI_U32 rsvd2;
237}tSirLostLinkParamsInfo, *tpSirLostLinkParamsInfo;
238
Jeff Johnson295189b2012-06-20 16:38:30 -0700239// Boa command. Used mainly for radar info persistance
240typedef struct sBoaCommand
241{
242 tANI_U8 length;
243 tANI_U8 cmd[64];
244}tBoaCommand;
245
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700246
247typedef __ani_attr_pre_packed struct sTrafStrmMetrics
248{
249 tANI_U16 UplinkPktQueueDly;
250 tANI_U16 UplinkPktQueueDlyHist[4];
251 tANI_U32 UplinkPktTxDly;
252 tANI_U16 UplinkPktLoss;
253 tANI_U16 UplinkPktCount;
254 tANI_U8 RoamingCount;
255 tANI_U16 RoamingDly;
256} __ani_attr_packed tTrafStrmMetrics, *tpTrafStrmMetrics;
257
258
Srinivas Girigowda91ccbe82013-11-10 16:37:38 -0800259typedef __ani_attr_pre_packed struct sBcnReportFields
260{
261 tANI_U8 ChanNum;
262 tANI_U8 Spare;
263 tANI_U16 MeasDuration;
264 tANI_U8 PhyType;
265 tANI_U8 RecvSigPower;
266 tSirMacAddr Bssid;
267 tANI_U32 ParentTsf;
268 tANI_U32 TargetTsf[2];
269 tANI_U16 BcnInterval;
270 tANI_U16 CapabilityInfo;
271} __ani_attr_packed tBcnReportFields, *tpBcnReportFields;
272
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700273
Jeff Johnson295189b2012-06-20 16:38:30 -0700274#endif /* __ANI_SYSTEM_DEFS_H */
275