blob: 7308796bb494fc6a87a6eb6d1824dd02b5bb64cf [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
92/**
93 * enum wlan_umac_comp_id - UMAC component id
Sandeep Puligilla7225a3b2017-01-15 18:13:37 -080094 * @WLAN_UMAC_COMP_MLME: MLME
Amar Singhal1fd82c62017-03-15 11:57:40 -070095 * @WLAN_UMAC_COMP_REGULATORY: REGULATORY
Soumya Bhatbe6cc172016-12-30 14:42:58 +053096 * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
Krunal Sonic4e35922017-02-01 14:59:01 -080097 * @WLAN_UMAC_COMP_SERIALIZATION: Serialization
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053098 * @WLAN_UMAC_COMP_SCAN: SCAN - as scan module uses services provided by
99 * MLME, MGMT_TXRX and SERIALIZATION, SCAN module
100 * must be initializes after above modules.
Mukul Sharmad8fd1442017-02-03 11:27:17 +0530101 * @WLAN_UMAC_COMP_PMO: PMO component
Wu Gaof482dea2017-02-16 11:39:12 +0800102 * @WLAN_UMAC_COMP_P2P: P2P
Tushnim Bhattacharyyafbce0772017-02-22 11:56:59 -0800103 * @WLAN_UMAC_COMP_POLICY_MGR: Policy Manager
Tushnim Bhattacharyya7cea3412017-02-24 12:54:33 -0800104 * @WLAN_UMAC_COMP_CONFIG: Configuration
Naveen Rawatb35a0dd2017-03-06 15:57:33 -0800105 * @WLAN_UMAC_COMP_WIFI_POS: WIFI Positioning
Frank Liu73ce0d02017-03-02 17:17:53 +0800106 * @WLAN_UMAC_COMP_TDLS: TDLS
Subrat Mishra81c60e82017-03-02 14:23:37 +0530107 * @WLAN_UMAC_COMP_ATF: Airtime Fairness
Ashok Ponnaiahd9737162017-03-21 14:54:16 +0530108 * @WLAN_UMAC_COMP_CRYPTO: CRYPTO
Krunal Sonic4e35922017-02-01 14:59:01 -0800109 * @WLAN_UMAC_COMP_ID_MAX: Maximum components in UMAC
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530110 *
111 * This id is static.
112 * On Adding new component, new id has to be assigned
113 */
114enum wlan_umac_comp_id {
Krunal Sonic4e35922017-02-01 14:59:01 -0800115 WLAN_UMAC_COMP_MLME = 0,
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530116 WLAN_UMAC_COMP_MGMT_TXRX = 1,
117 WLAN_UMAC_COMP_SERIALIZATION = 2,
118 WLAN_UMAC_COMP_SCAN = 3,
Mukul Sharmad8fd1442017-02-03 11:27:17 +0530119 WLAN_UMAC_COMP_PMO = 4,
Wu Gaof482dea2017-02-16 11:39:12 +0800120 WLAN_UMAC_COMP_P2P = 5,
Tushnim Bhattacharyyafbce0772017-02-22 11:56:59 -0800121 WLAN_UMAC_COMP_POLICY_MGR = 6,
Tushnim Bhattacharyya7cea3412017-02-24 12:54:33 -0800122 WLAN_UMAC_COMP_CONFIG = 7,
Naveen Rawatb35a0dd2017-03-06 15:57:33 -0800123 WLAN_UMAC_COMP_WIFI_POS = 8,
Frank Liu73ce0d02017-03-02 17:17:53 +0800124 WLAN_UMAC_COMP_TDLS = 9,
Subrat Mishra81c60e82017-03-02 14:23:37 +0530125 WLAN_UMAC_COMP_ATF = 10,
Amar Singhal1fd82c62017-03-15 11:57:40 -0700126 WLAN_UMAC_COMP_REGULATORY = 11,
Ashok Ponnaiahd9737162017-03-21 14:54:16 +0530127 WLAN_UMAC_COMP_CRYPTO = 12,
Krunal Sonic4e35922017-02-01 14:59:01 -0800128 WLAN_UMAC_COMP_ID_MAX,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530129};
130
131/**
132 * enum WLAN_DEV_TYPE - for DA or OL architecture types
133 * @WLAN_DEV_DA: Direct attach
134 * @WLAN_DEV_OL: Partial offload
135 * @WLAN_DEV_INVALID: Invalid dev type
136 */
137typedef enum {
138 WLAN_DEV_DA = 0,
139 WLAN_DEV_OL = 1,
140 WLAN_DEV_INVALID = 3,
141} WLAN_DEV_TYPE;
142
143/**
144 * enum wlan_phymode - phy mode
145 * @WLAN_PHYMODE_AUTO: autoselect
146 * @WLAN_PHYMODE_11A: 5GHz, OFDM
147 * @WLAN_PHYMODE_11B: 2GHz, CCK
148 * @WLAN_PHYMODE_11G: 2GHz, OFDM
149 * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
150 * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
151 * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
152 * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
153 * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
154 * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
155 * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
156 * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
157 * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
158 * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
159 * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
160 * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
161 * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
162 * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
163 * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
164 */
165enum wlan_phymode {
166 WLAN_PHYMODE_AUTO = 0,
167 WLAN_PHYMODE_11A = 1,
168 WLAN_PHYMODE_11B = 2,
169 WLAN_PHYMODE_11G = 3,
170 WLAN_PHYMODE_11NA_HT20 = 4,
171 WLAN_PHYMODE_11NG_HT20 = 5,
172 WLAN_PHYMODE_11NA_HT40PLUS = 6,
173 WLAN_PHYMODE_11NA_HT40MINUS = 7,
174 WLAN_PHYMODE_11NG_HT40PLUS = 8,
175 WLAN_PHYMODE_11NG_HT40MINUS = 9,
176 WLAN_PHYMODE_11NG_HT40 = 10,
177 WLAN_PHYMODE_11NA_HT40 = 11,
178 WLAN_PHYMODE_11AC_VHT20 = 12,
179 WLAN_PHYMODE_11AC_VHT40PLUS = 13,
180 WLAN_PHYMODE_11AC_VHT40MINUS = 14,
181 WLAN_PHYMODE_11AC_VHT40 = 15,
182 WLAN_PHYMODE_11AC_VHT80 = 16,
183 WLAN_PHYMODE_11AC_VHT160 = 17,
184 WLAN_PHYMODE_11AC_VHT80_80 = 18,
185};
186
187#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
188
189/**
190 * enum wlan_peer_type - peer type
191 * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
192 * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
193 * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
194 * @WLAN_PEER_TDLS: TDLS Peer
195 * @WLAN_PEER_NAWDS: NAWDS Peer
196 * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530197 * @WLAN_PEER_IBSS: IBSS Peer
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530198 */
199enum wlan_peer_type {
200 WLAN_PEER_SELF = 1,
201 WLAN_PEER_AP = 2,
202 WLAN_PEER_STA = 3,
203 WLAN_PEER_TDLS = 4,
204 WLAN_PEER_NAWDS = 5,
205 WLAN_PEER_STA_TEMP = 6,
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530206 WLAN_PEER_IBSS = 7,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530207};
208
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530209/**
210 * enum wlan_band - specifies operating channel band
211 * @WLAN_BAND_ALL: Any band
212 * @WLAN_BAND_2_4_GHZ: 2.4 GHz band
213 * @WLAN_BAND_5_GHZ: 5 GHz band
214 * @WLAN_BAND_4_9_GHZ: 4.9 GHz band
215 */
216enum wlan_band {
217 WLAN_BAND_ALL,
218 WLAN_BAND_2_4_GHZ,
219 WLAN_BAND_5_GHZ,
220 WLAN_BAND_4_9_GHZ,
221};
222
223/**
224 * enum wlan_bss_type - type of network
225 * @WLAN_TYPE_ANY: Default value
226 * @WLAN_TYPE_BSS: Type BSS
227 * @WLAN_TYPE_IBSS: Type IBSS
228 */
229enum wlan_bss_type {
230 WLAN_TYPE_ANY,
231 WLAN_TYPE_BSS,
232 WLAN_TYPE_IBSS,
233};
234
235/**
236 * enum wlan_pmf_cap: pmf capability
237 * @PMF_DISABLED: PMF is disabled
238 * @PMF_CAPABLE: PMF is supported
239 * @PMF_REQUIRED: PMF is mandatory
240 */
241enum wlan_pmf_cap {
242 WLAN_PMF_DISABLED,
243 WLAN_PMF_CAPABLE,
244 WLAN_PMF_REQUIRED,
245};
246
247/**
248 * enum wlan_auth_type - Enumeration of the various Auth types
249 * @WLAN_AUTH_TYPE_OPEN_SYSTEM: Open auth type
250 * @WLAN_AUTH_TYPE_SHARED_KEY: Shared Key Auth type
251 * @WLAN_AUTH_TYPE_AUTOSWITCH: Auto switch Open/Shared
252 * @WLAN_AUTH_TYPE_WPA: WPA Enterprise
253 * @WLAN_AUTH_TYPE_WPA_PSK: WPA PSK
254 * @WLAN_AUTH_TYPE_WPA_NONE: WPA None
255 * @WLAN_AUTH_TYPE_RSN: RSN Enterprise
256 * @WLAN_AUTH_TYPE_RSN_PSK: RSN PSK
257 * @WLAN_AUTH_TYPE_FT_RSN: FT RSN Enterprise
258 * @WLAN_AUTH_TYPE_FT_RSN_PSK: FT RSN PSK
259 * @WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE: WAPI certificate
260 * @WLAN_AUTH_TYPE_WAPI_WAI_PSK: WAPI PSK
261 * @WLAN_AUTH_TYPE_CCKM_WPA: CCKM WPA
262 * @WLAN_AUTH_TYPE_CCKM_RSN: CCKM RSN
263 * @WLAN_AUTH_TYPE_RSN_PSK_SHA256: SHA256 PSK
264 * @WLAN_AUTH_TYPE_RSN_8021X_SHA256: SHA256 Enterprise
265 * @WLAN_NUM_OF_SUPPORT_AUTH_TYPE: Max no of Auth type
266 */
267enum wlan_auth_type {
268 WLAN_AUTH_TYPE_OPEN_SYSTEM,
269 WLAN_AUTH_TYPE_SHARED_KEY,
270 WLAN_AUTH_TYPE_AUTOSWITCH,
271 WLAN_AUTH_TYPE_WPA,
272 WLAN_AUTH_TYPE_WPA_PSK,
273 WLAN_AUTH_TYPE_WPA_NONE,
274 WLAN_AUTH_TYPE_RSN,
275 WLAN_AUTH_TYPE_RSN_PSK,
276 WLAN_AUTH_TYPE_FT_RSN,
277 WLAN_AUTH_TYPE_FT_RSN_PSK,
278 WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE,
279 WLAN_AUTH_TYPE_WAPI_WAI_PSK,
280 WLAN_AUTH_TYPE_CCKM_WPA,
281 WLAN_AUTH_TYPE_CCKM_RSN,
282 WLAN_AUTH_TYPE_RSN_PSK_SHA256,
283 WLAN_AUTH_TYPE_RSN_8021X_SHA256,
284 WLAN_NUM_OF_SUPPORT_AUTH_TYPE,
285};
286
287/**
288 * enum wlan_enc_type - Enumeration of the various Enc types
289 * @WLAN_ENCRYPT_TYPE_NONE: No encryption
290 * @WLAN_ENCRYPT_TYPE_WEP40_STATICKEY: WEP 40 Static key
291 * @WLAN_ENCRYPT_TYPE_WEP104_STATICKEY: WEP 104 Static key
292 * @WLAN_ENCRYPT_TYPE_WEP40: WEP 40
293 * @WLAN_ENCRYPT_TYPE_WEP104: WEP 104
294 * @WLAN_ENCRYPT_TYPE_TKIP: TKIP
295 * @WLAN_ENCRYPT_TYPE_AES: AES
296 * @WLAN_ENCRYPT_TYPE_WPI: WAPI
297 * @WLAN_ENCRYPT_TYPE_KRK: KRK
298 * @WLAN_ENCRYPT_TYPE_BTK: BTK
299 * @WLAN_ENCRYPT_TYPE_AES_CMAC: 11W BIP
300 * @WLAN_ENCRYPT_TYPE_ANY: Any
301 * @WLAN_NUM_OF_ENCRYPT_TYPE: Max value
302 */
303enum wlan_enc_type {
304 WLAN_ENCRYPT_TYPE_NONE,
305 WLAN_ENCRYPT_TYPE_WEP40_STATICKEY,
306 WLAN_ENCRYPT_TYPE_WEP104_STATICKEY,
307 WLAN_ENCRYPT_TYPE_WEP40,
308 WLAN_ENCRYPT_TYPE_WEP104,
309 WLAN_ENCRYPT_TYPE_TKIP,
310 WLAN_ENCRYPT_TYPE_AES,
311 WLAN_ENCRYPT_TYPE_WPI,
312 WLAN_ENCRYPT_TYPE_KRK,
313 WLAN_ENCRYPT_TYPE_BTK,
314 WLAN_ENCRYPT_TYPE_AES_CMAC,
315 WLAN_ENCRYPT_TYPE_ANY,
316 WLAN_NUM_OF_ENCRYPT_TYPE = WLAN_ENCRYPT_TYPE_ANY,
317};
318
319/**
320 * struct wlan_ssid - SSID info
321 * @length: ssid length of bss excluding null
322 * @ssid: ssid character array potentially non null terminated
323 */
324struct wlan_ssid {
325 uint8_t length;
326 uint8_t ssid[WLAN_SSID_MAX_LEN];
327};
328
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530329/* MAC address length */
330#define WLAN_MACADDR_LEN 6
331/* Util API to copy the MAC address */
332#define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
333/* Util API to compare the MAC address */
334#define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
335
336#endif /* _WLAN_OBJMGR_CMN_H_*/