blob: f86e5a6204609a29b30ebdcc30c23b01224fc3b8 [file] [log] [blame]
Soumya Bhatbe6cc172016-12-30 14:42:58 +05301/*
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +05302 * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
Soumya Bhatbe6cc172016-12-30 14:42:58 +05303 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18 /**
19 * DOC: This file provides the common definitions for object manager
20 */
21
22#ifndef _WLAN_CMN_H_
23#define _WLAN_CMN_H_
24
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053025#include <qdf_types.h>
26
Soumya Bhatbe6cc172016-12-30 14:42:58 +053027/* Max no of UMAC components */
28#define WLAN_UMAC_MAX_COMPONENTS 25
29/* Max no. of radios, a pSoc/Device can support */
30#define WLAN_UMAC_MAX_PDEVS 3
31/* Max no. of VDEV per PSOC */
32#define WLAN_UMAC_PSOC_MAX_VDEVS 51
33/* Max no. of VDEVs, a PDEV can support */
34#define WLAN_UMAC_PDEV_MAX_VDEVS 17
35/* Max no. of Peers, a device can support */
36#define WLAN_UMAC_PSOC_MAX_PEERS 1024
37
38/* Max length of a SSID */
39#define WLAN_SSID_MAX_LEN 32
40
Vivek979a3f32017-03-17 09:42:20 +053041/* Max sequence number */
42#define WLAN_MAX_SEQ_NUM 4096
43
Soumya Bhatbe6cc172016-12-30 14:42:58 +053044/* Max no. of Stations can be associated to VDEV*/
45#define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
46/* Max no. of peers for STA vap */
47#define WLAN_UMAC_MAX_STA_PEERS 2
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053048/* Max vdev_id */
49#define WLAN_UMAC_VDEV_ID_MAX 0xFF
Soumya Bhatbe6cc172016-12-30 14:42:58 +053050
51/* 802.11 cap info */
52#define WLAN_CAPINFO_ESS 0x0001
53#define WLAN_CAPINFO_IBSS 0x0002
54#define WLAN_CAPINFO_CF_POLLABLE 0x0004
55#define WLAN_CAPINFO_CF_POLLREQ 0x0008
56#define WLAN_CAPINFO_PRIVACY 0x0010
57#define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020
58#define WLAN_CAPINFO_PBCC 0x0040
59#define WLAN_CAPINFO_CHNL_AGILITY 0x0080
60#define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100
61#define WLAN_CAPINFO_QOS 0x0200
62#define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400
63#define WLAN_CAPINFO_APSD 0x0800
64#define WLAN_CAPINFO_RADIOMEAS 0x1000
65#define WLAN_CAPINFO_DSSSOFDM 0x2000
66
67/* Allowed time to wait for Object creation */
68#define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
69 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053070#define WLAN_VDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053071
72#define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
73 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053074#define WLAN_PDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053075
76#define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
77/* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053078#define WLAN_PSOC_CREATE_TIMEOUT 25
Sandeep Puligilla7acd31f2017-02-25 16:35:35 -080079#define WLAN_24_GHZ_BASE_FREQ (2407)
80#define WLAN_5_GHZ_BASE_FREQ (5000)
81#define WLAN_24_GHZ_CHANNEL_6 (6)
82#define WLAN_24_GHZ_CHANNEL_14 (14)
83#define WLAN_24_GHZ_CHANNEL_15 (15)
84#define WLAN_24_GHZ_CHANNEL_27 (27)
85#define WLAN_5_GHZ_CHANNEL_170 (170)
86#define WLAN_CHAN_SPACING_5MHZ (5)
87#define WLAN_CHAN_SPACING_20MHZ (20)
88#define WLAN_CHAN_14_FREQ (2484)
89#define WLAN_CHAN_15_FREQ (2512)
90#define WLAN_CHAN_170_FREQ (5852)
Soumya Bhatbe6cc172016-12-30 14:42:58 +053091
Wu Gaodfc571c2017-03-22 13:18:15 +080092#define WLAN_MAC_EID_VENDOR 221
93
Soumya Bhatbe6cc172016-12-30 14:42:58 +053094/**
95 * enum wlan_umac_comp_id - UMAC component id
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +053096 * @WLAN_UMAC_COMP_MLME: MLME
97 * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
Krunal Sonic4e35922017-02-01 14:59:01 -080098 * @WLAN_UMAC_COMP_SERIALIZATION: Serialization
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +053099 * @WLAN_UMAC_COMP_SCAN: SCAN - as scan module uses services provided by
100 * MLME, MGMT_TXRX and SERIALIZATION, SCAN module
101 * must be initializes after above modules.
102 * @WLAN_UMAC_COMP_PMO: PMO component
103 * @WLAN_UMAC_COMP_P2P: P2P
104 * @WLAN_UMAC_COMP_POLICY_MGR: Policy Manager
105 * @WLAN_UMAC_COMP_CONFIG: Configuration
106 * @WLAN_UMAC_COMP_WIFI_POS: WIFI Positioning
107 * @WLAN_UMAC_COMP_TDLS: TDLS
108 * @WLAN_UMAC_COMP_ATF: Airtime Fairness
Venkateswara Swamy Bandaru0b9f5ec2017-05-11 10:45:35 +0530109 * @WLAN_UMAC_COMP_SA_API: Smart Antenna API
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +0530110 * @WLAN_UMAC_COMP_REGULATORY: REGULATORY
111 * @WLAN_UMAC_COMP_CRYPTO: CRYPTO
112 * @WLAN_UMAC_COMP_NAN: Neighbor Aware Networking
113 * @WLAN_UMAC_COMP_DFS: DFS
Edayilliam Jayadev642201f2017-04-05 14:29:18 +0530114 * @WLAN_UMAC_COMP_SPECTRAL: Spectral
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +0530115 * @WLAN_UMAC_COMP_ID_MAX: Maximum components in UMAC
Kiran Venkatappa34536742017-04-04 00:09:10 +0530116 * @WLAN_UMAC_COMP_OFFCHAN_TXRX: Offchan TxRx
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530117 *
118 * This id is static.
119 * On Adding new component, new id has to be assigned
120 */
121enum wlan_umac_comp_id {
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +0530122 WLAN_UMAC_COMP_MLME,
123 WLAN_UMAC_COMP_MGMT_TXRX,
124 WLAN_UMAC_COMP_SERIALIZATION,
125 WLAN_UMAC_COMP_SCAN,
126 WLAN_UMAC_COMP_PMO,
127 WLAN_UMAC_COMP_P2P,
128 WLAN_UMAC_COMP_POLICY_MGR,
129 WLAN_UMAC_COMP_CONFIG,
130 WLAN_UMAC_COMP_WIFI_POS,
131 WLAN_UMAC_COMP_TDLS,
132 WLAN_UMAC_COMP_ATF,
Venkateswara Swamy Bandaru0b9f5ec2017-05-11 10:45:35 +0530133 WLAN_UMAC_COMP_SA_API,
Abhijit Pradhan5ae2b3a2017-03-31 08:52:58 +0530134 WLAN_UMAC_COMP_REGULATORY,
135 WLAN_UMAC_COMP_CRYPTO,
136 WLAN_UMAC_COMP_NAN,
137 WLAN_UMAC_COMP_DFS,
Kiran Venkatappa34536742017-04-04 00:09:10 +0530138 WLAN_UMAC_COMP_OFFCHAN_TXRX,
Bharat Bhushan Chakravarty145d3932017-03-20 12:52:16 -0700139 WLAN_UMAC_COMP_SON,
Edayilliam Jayadev642201f2017-04-05 14:29:18 +0530140 WLAN_UMAC_COMP_SPECTRAL,
Krunal Sonic4e35922017-02-01 14:59:01 -0800141 WLAN_UMAC_COMP_ID_MAX,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530142};
143
144/**
145 * enum WLAN_DEV_TYPE - for DA or OL architecture types
146 * @WLAN_DEV_DA: Direct attach
147 * @WLAN_DEV_OL: Partial offload
148 * @WLAN_DEV_INVALID: Invalid dev type
149 */
150typedef enum {
151 WLAN_DEV_DA = 0,
152 WLAN_DEV_OL = 1,
153 WLAN_DEV_INVALID = 3,
154} WLAN_DEV_TYPE;
155
156/**
157 * enum wlan_phymode - phy mode
158 * @WLAN_PHYMODE_AUTO: autoselect
159 * @WLAN_PHYMODE_11A: 5GHz, OFDM
160 * @WLAN_PHYMODE_11B: 2GHz, CCK
161 * @WLAN_PHYMODE_11G: 2GHz, OFDM
162 * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
163 * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
164 * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
165 * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
166 * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
167 * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
168 * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
169 * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
170 * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
171 * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
172 * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
173 * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
174 * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
175 * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
176 * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
177 */
178enum wlan_phymode {
179 WLAN_PHYMODE_AUTO = 0,
180 WLAN_PHYMODE_11A = 1,
181 WLAN_PHYMODE_11B = 2,
182 WLAN_PHYMODE_11G = 3,
183 WLAN_PHYMODE_11NA_HT20 = 4,
184 WLAN_PHYMODE_11NG_HT20 = 5,
185 WLAN_PHYMODE_11NA_HT40PLUS = 6,
186 WLAN_PHYMODE_11NA_HT40MINUS = 7,
187 WLAN_PHYMODE_11NG_HT40PLUS = 8,
188 WLAN_PHYMODE_11NG_HT40MINUS = 9,
189 WLAN_PHYMODE_11NG_HT40 = 10,
190 WLAN_PHYMODE_11NA_HT40 = 11,
191 WLAN_PHYMODE_11AC_VHT20 = 12,
192 WLAN_PHYMODE_11AC_VHT40PLUS = 13,
193 WLAN_PHYMODE_11AC_VHT40MINUS = 14,
194 WLAN_PHYMODE_11AC_VHT40 = 15,
195 WLAN_PHYMODE_11AC_VHT80 = 16,
196 WLAN_PHYMODE_11AC_VHT160 = 17,
197 WLAN_PHYMODE_11AC_VHT80_80 = 18,
198};
199
200#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
201
202/**
203 * enum wlan_peer_type - peer type
204 * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
205 * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
Rachit Kankane4475ff22017-04-19 11:49:18 +0530206 * @WLAN_PEER_P2P_GO: BSS peer for P2P CLI mode, Self peer for P2P GO mode
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530207 * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
Rachit Kankane4475ff22017-04-19 11:49:18 +0530208 * @WLAN_PEER_P2P_CLI: Self peer for P2P CLI mode, P2P CLI peer for P2P GO mode
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530209 * @WLAN_PEER_TDLS: TDLS Peer
210 * @WLAN_PEER_NAWDS: NAWDS Peer
211 * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530212 * @WLAN_PEER_IBSS: IBSS Peer
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530213 */
214enum wlan_peer_type {
215 WLAN_PEER_SELF = 1,
216 WLAN_PEER_AP = 2,
Rachit Kankane4475ff22017-04-19 11:49:18 +0530217 WLAN_PEER_P2P_GO = 3,
218 WLAN_PEER_STA = 4,
219 WLAN_PEER_P2P_CLI = 5,
220 WLAN_PEER_TDLS = 6,
221 WLAN_PEER_NAWDS = 7,
222 WLAN_PEER_STA_TEMP = 8,
223 WLAN_PEER_IBSS = 9,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530224};
225
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530226/**
227 * enum wlan_band - specifies operating channel band
228 * @WLAN_BAND_ALL: Any band
229 * @WLAN_BAND_2_4_GHZ: 2.4 GHz band
230 * @WLAN_BAND_5_GHZ: 5 GHz band
231 * @WLAN_BAND_4_9_GHZ: 4.9 GHz band
232 */
233enum wlan_band {
234 WLAN_BAND_ALL,
235 WLAN_BAND_2_4_GHZ,
236 WLAN_BAND_5_GHZ,
237 WLAN_BAND_4_9_GHZ,
238};
239
240/**
241 * enum wlan_bss_type - type of network
242 * @WLAN_TYPE_ANY: Default value
243 * @WLAN_TYPE_BSS: Type BSS
244 * @WLAN_TYPE_IBSS: Type IBSS
245 */
246enum wlan_bss_type {
247 WLAN_TYPE_ANY,
248 WLAN_TYPE_BSS,
249 WLAN_TYPE_IBSS,
250};
251
252/**
253 * enum wlan_pmf_cap: pmf capability
254 * @PMF_DISABLED: PMF is disabled
255 * @PMF_CAPABLE: PMF is supported
256 * @PMF_REQUIRED: PMF is mandatory
257 */
258enum wlan_pmf_cap {
259 WLAN_PMF_DISABLED,
260 WLAN_PMF_CAPABLE,
261 WLAN_PMF_REQUIRED,
262};
263
264/**
265 * enum wlan_auth_type - Enumeration of the various Auth types
266 * @WLAN_AUTH_TYPE_OPEN_SYSTEM: Open auth type
267 * @WLAN_AUTH_TYPE_SHARED_KEY: Shared Key Auth type
268 * @WLAN_AUTH_TYPE_AUTOSWITCH: Auto switch Open/Shared
269 * @WLAN_AUTH_TYPE_WPA: WPA Enterprise
270 * @WLAN_AUTH_TYPE_WPA_PSK: WPA PSK
271 * @WLAN_AUTH_TYPE_WPA_NONE: WPA None
272 * @WLAN_AUTH_TYPE_RSN: RSN Enterprise
273 * @WLAN_AUTH_TYPE_RSN_PSK: RSN PSK
274 * @WLAN_AUTH_TYPE_FT_RSN: FT RSN Enterprise
275 * @WLAN_AUTH_TYPE_FT_RSN_PSK: FT RSN PSK
276 * @WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE: WAPI certificate
277 * @WLAN_AUTH_TYPE_WAPI_WAI_PSK: WAPI PSK
278 * @WLAN_AUTH_TYPE_CCKM_WPA: CCKM WPA
279 * @WLAN_AUTH_TYPE_CCKM_RSN: CCKM RSN
280 * @WLAN_AUTH_TYPE_RSN_PSK_SHA256: SHA256 PSK
281 * @WLAN_AUTH_TYPE_RSN_8021X_SHA256: SHA256 Enterprise
282 * @WLAN_NUM_OF_SUPPORT_AUTH_TYPE: Max no of Auth type
283 */
284enum wlan_auth_type {
285 WLAN_AUTH_TYPE_OPEN_SYSTEM,
286 WLAN_AUTH_TYPE_SHARED_KEY,
287 WLAN_AUTH_TYPE_AUTOSWITCH,
288 WLAN_AUTH_TYPE_WPA,
289 WLAN_AUTH_TYPE_WPA_PSK,
290 WLAN_AUTH_TYPE_WPA_NONE,
291 WLAN_AUTH_TYPE_RSN,
292 WLAN_AUTH_TYPE_RSN_PSK,
293 WLAN_AUTH_TYPE_FT_RSN,
294 WLAN_AUTH_TYPE_FT_RSN_PSK,
295 WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE,
296 WLAN_AUTH_TYPE_WAPI_WAI_PSK,
297 WLAN_AUTH_TYPE_CCKM_WPA,
298 WLAN_AUTH_TYPE_CCKM_RSN,
299 WLAN_AUTH_TYPE_RSN_PSK_SHA256,
300 WLAN_AUTH_TYPE_RSN_8021X_SHA256,
301 WLAN_NUM_OF_SUPPORT_AUTH_TYPE,
302};
303
304/**
305 * enum wlan_enc_type - Enumeration of the various Enc types
306 * @WLAN_ENCRYPT_TYPE_NONE: No encryption
307 * @WLAN_ENCRYPT_TYPE_WEP40_STATICKEY: WEP 40 Static key
308 * @WLAN_ENCRYPT_TYPE_WEP104_STATICKEY: WEP 104 Static key
309 * @WLAN_ENCRYPT_TYPE_WEP40: WEP 40
310 * @WLAN_ENCRYPT_TYPE_WEP104: WEP 104
311 * @WLAN_ENCRYPT_TYPE_TKIP: TKIP
312 * @WLAN_ENCRYPT_TYPE_AES: AES
313 * @WLAN_ENCRYPT_TYPE_WPI: WAPI
314 * @WLAN_ENCRYPT_TYPE_KRK: KRK
315 * @WLAN_ENCRYPT_TYPE_BTK: BTK
316 * @WLAN_ENCRYPT_TYPE_AES_CMAC: 11W BIP
317 * @WLAN_ENCRYPT_TYPE_ANY: Any
318 * @WLAN_NUM_OF_ENCRYPT_TYPE: Max value
319 */
320enum wlan_enc_type {
321 WLAN_ENCRYPT_TYPE_NONE,
322 WLAN_ENCRYPT_TYPE_WEP40_STATICKEY,
323 WLAN_ENCRYPT_TYPE_WEP104_STATICKEY,
324 WLAN_ENCRYPT_TYPE_WEP40,
325 WLAN_ENCRYPT_TYPE_WEP104,
326 WLAN_ENCRYPT_TYPE_TKIP,
327 WLAN_ENCRYPT_TYPE_AES,
328 WLAN_ENCRYPT_TYPE_WPI,
329 WLAN_ENCRYPT_TYPE_KRK,
330 WLAN_ENCRYPT_TYPE_BTK,
331 WLAN_ENCRYPT_TYPE_AES_CMAC,
332 WLAN_ENCRYPT_TYPE_ANY,
333 WLAN_NUM_OF_ENCRYPT_TYPE = WLAN_ENCRYPT_TYPE_ANY,
334};
335
336/**
337 * struct wlan_ssid - SSID info
338 * @length: ssid length of bss excluding null
339 * @ssid: ssid character array potentially non null terminated
340 */
341struct wlan_ssid {
342 uint8_t length;
343 uint8_t ssid[WLAN_SSID_MAX_LEN];
344};
345
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530346/* MAC address length */
347#define WLAN_MACADDR_LEN 6
348/* Util API to copy the MAC address */
349#define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
350/* Util API to compare the MAC address */
351#define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
352
353#endif /* _WLAN_OBJMGR_CMN_H_*/