blob: 578d0b833911349e228ad4e56c42d68fe06ae08e [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
3 *
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.
20 */
21
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
28/*
29 *
30 * This file ani_system_defs.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 "sir_types.h"
43#include "sir_mac_prot_def.h"
44
45#define ANI_OUI 0x000AF5
46
47/* / Max WDS info length. */
48#define ANI_WDS_INFO_MAX_LENGTH 64
49
50/* This is to force compiler to use the maximum of an int for enum */
51#define SIR_MAX_ENUM_SIZE 0x7FFFFFFF
52
53/* Max key size including the WAPI and TKIP */
54#define WLAN_MAX_KEY_RSC_LEN 16
55#define WLAN_WAPI_KEY_RSC_LEN 16
56
57#ifndef false
58#undef false
59#define false 0
60#endif
61#ifndef true
62#undef true
63#define true 1
64#endif
65
66typedef enum eAniBool {
67 eSIR_FALSE,
68 eSIR_TRUE,
69 eSIR_DONOT_USE_BOOL = SIR_MAX_ENUM_SIZE
70} tAniBool;
71
72/* / Authentication type enum used with peer */
73typedef enum eAniAuthType {
74 eSIR_OPEN_SYSTEM,
75 eSIR_SHARED_KEY,
76#if defined WLAN_FEATURE_VOWIFI_11R
77 eSIR_FT_AUTH,
78#endif
79#if defined FEATURE_WLAN_ESE
80 eSIR_LEAP_AUTH = 0x80,
81#endif
82 eSIR_AUTO_SWITCH,
83 eSIR_DONOT_USE_AUTH_TYPE = SIR_MAX_ENUM_SIZE
84} tAniAuthType;
85
86/* / Encryption type enum used with peer */
87typedef enum eAniEdType {
88 eSIR_ED_NONE,
89 eSIR_ED_WEP40,
90 eSIR_ED_WEP104,
91 eSIR_ED_TKIP,
92 eSIR_ED_CCMP,
93#if defined(FEATURE_WLAN_WAPI)
94 eSIR_ED_WPI,
95#endif
96 /*DPU HW treats encryption mode 4 plus RMF bit set in TX BD as BIP.
97 Thus while setting BIP encryption mode in corresponding DPU Desc
98 eSIR_ED_AES_128_CMAC should be set to eSIR_ED_CCMP */
99 eSIR_ED_AES_128_CMAC,
100 eSIR_ED_NOT_IMPLEMENTED = SIR_MAX_ENUM_SIZE
101} tAniEdType;
102
103typedef enum eAniWepType {
104 eSIR_WEP_STATIC,
105 eSIR_WEP_DYNAMIC,
106} tAniWepType;
107
108/* / Enum to specify whether key is used */
109/* / for TX only, RX only or both */
110typedef enum eAniKeyDirection {
111 eSIR_TX_ONLY,
112 eSIR_RX_ONLY,
113 eSIR_TX_RX,
114 eSIR_TX_DEFAULT,
115 eSIR_DONOT_USE_KEY_DIRECTION = SIR_MAX_ENUM_SIZE
116} tAniKeyDirection;
117
118typedef struct sAniSSID {
119 uint8_t length;
120 uint8_t ssId[SIR_MAC_MAX_SSID_LENGTH];
121} tAniSSID, *tpAniSSID;
122
123typedef struct sAniApName {
124 uint8_t length;
125 uint8_t name[SIR_MAC_MAX_SSID_LENGTH];
126} tAniApName, *tpAniApName;
127
128/* / RSN IE information */
129typedef struct sSirRSNie {
130 uint16_t length;
131 uint8_t rsnIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
132} tSirRSNie, *tpSirRSNie;
133
134typedef struct sSirWAPIie {
135 uint16_t length;
136 uint8_t wapiIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
137} tSirWAPIie, *tpSirWAPIie;
138/* / Additional IE information : */
139/* / This can include WSC IE, P2P IE, and/or FTIE from upper layer. */
140/* / MAC layer transparently convey these IE info between peer STA and upper layer, */
141/* / but never requires to parse it. */
142typedef struct sSirAddie {
143 uint16_t length;
144 uint8_t addIEdata[SIR_MAC_MAX_ADD_IE_LENGTH + 2];
145} tSirAddie, *tpSirAddie;
146
147#ifdef FEATURE_WLAN_ESE
148
149/* The CCKM IE needs to be in the */
150/* Join and Reassoc Req. */
151typedef struct sSirCCKMie {
152 uint16_t length;
153 uint8_t cckmIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
154} tSirCCKMie, *tpSirCCKMie;
155
156#endif
157
158/* / Definition for Encryption Keys */
159typedef struct sSirKeys {
160 uint8_t keyId;
161 uint8_t unicast; /* 0 for multicast */
162 tAniKeyDirection keyDirection;
163 uint8_t keyRsc[WLAN_MAX_KEY_RSC_LEN]; /* Usage is unknown */
164 uint8_t paeRole; /* =1 for authenticator, */
165 /* =0 for supplicant */
166 uint16_t keyLength;
167 uint8_t key[SIR_MAC_MAX_KEY_LENGTH];
168} tSirKeys, *tpSirKeys;
169
170/* / Definition for Keying material */
171typedef struct sSirKeyMaterial {
172 uint16_t length; /* This is the length of all */
173 /* data that follows */
174 tAniEdType edType; /* Encryption/Decryption type */
175 uint8_t numKeys;
176 tSirKeys key[1];
177} tSirKeyMaterial, *tpSirKeyMaterial;
178
179#define SIR_CIPHER_SEQ_CTR_SIZE 6
180/* / Definition for MIC failure indication */
181typedef struct sSirMicFailureInfo {
182 tSirMacAddr srcMacAddr; /* address used to compute MIC */
183 tSirMacAddr taMacAddr; /* transmitter address */
184 tSirMacAddr dstMacAddr;
185 tAniBool multicast;
186 uint8_t IV1; /* first byte of IV */
187 uint8_t keyId; /* second byte of IV */
188 uint8_t TSC[SIR_CIPHER_SEQ_CTR_SIZE]; /* sequence number */
189 tSirMacAddr rxMacAddr; /* receive address */
190
191} tSirMicFailureInfo, *tpSirMicFailureInfo;
192
193typedef struct sTrafStrmMetrics {
194 uint16_t UplinkPktQueueDly;
195 uint16_t UplinkPktQueueDlyHist[4];
196 uint32_t UplinkPktTxDly;
197 uint16_t UplinkPktLoss;
198 uint16_t UplinkPktCount;
199 uint8_t RoamingCount;
200 uint16_t RoamingDly;
201} cdf_packed tTrafStrmMetrics, *tpTrafStrmMetrics;
202
203typedef struct sBcnReportFields {
204 uint8_t ChanNum;
205 uint8_t Spare;
206 uint16_t MeasDuration;
207 uint8_t PhyType;
208 uint8_t RecvSigPower;
209 tSirMacAddr Bssid;
210 uint32_t ParentTsf;
211 uint32_t TargetTsf[2];
212 uint16_t BcnInterval;
213 uint16_t CapabilityInfo;
214} cdf_packed tBcnReportFields, *tpBcnReportFields;
215
216#endif /* __ANI_SYSTEM_DEFS_H */