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