blob: 7519bf153fc1592a3cfbf24397bbbf1194869f0e [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
41/* Max no. of Stations can be associated to VDEV*/
42#define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
43/* Max no. of peers for STA vap */
44#define WLAN_UMAC_MAX_STA_PEERS 2
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053045/* Max vdev_id */
46#define WLAN_UMAC_VDEV_ID_MAX 0xFF
Soumya Bhatbe6cc172016-12-30 14:42:58 +053047
48/* 802.11 cap info */
49#define WLAN_CAPINFO_ESS 0x0001
50#define WLAN_CAPINFO_IBSS 0x0002
51#define WLAN_CAPINFO_CF_POLLABLE 0x0004
52#define WLAN_CAPINFO_CF_POLLREQ 0x0008
53#define WLAN_CAPINFO_PRIVACY 0x0010
54#define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020
55#define WLAN_CAPINFO_PBCC 0x0040
56#define WLAN_CAPINFO_CHNL_AGILITY 0x0080
57#define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100
58#define WLAN_CAPINFO_QOS 0x0200
59#define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400
60#define WLAN_CAPINFO_APSD 0x0800
61#define WLAN_CAPINFO_RADIOMEAS 0x1000
62#define WLAN_CAPINFO_DSSSOFDM 0x2000
63
64/* Allowed time to wait for Object creation */
65#define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
66 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053067#define WLAN_VDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053068
69#define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
70 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053071#define WLAN_PDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053072
73#define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
74/* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053075#define WLAN_PSOC_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053076
77/**
78 * enum wlan_umac_comp_id - UMAC component id
Sandeep Puligilla7225a3b2017-01-15 18:13:37 -080079 * @WLAN_UMAC_COMP_MLME: MLME
Soumya Bhatbe6cc172016-12-30 14:42:58 +053080 * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
Krunal Sonic4e35922017-02-01 14:59:01 -080081 * @WLAN_UMAC_COMP_SERIALIZATION: Serialization
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053082 * @WLAN_UMAC_COMP_SCAN: SCAN - as scan module uses services provided by
83 * MLME, MGMT_TXRX and SERIALIZATION, SCAN module
84 * must be initializes after above modules.
Mukul Sharmad8fd1442017-02-03 11:27:17 +053085 * @WLAN_UMAC_COMP_PMO: PMO component
Wu Gaof482dea2017-02-16 11:39:12 +080086 * @WLAN_UMAC_COMP_P2P: P2P
Krunal Sonic4e35922017-02-01 14:59:01 -080087 * @WLAN_UMAC_COMP_ID_MAX: Maximum components in UMAC
Soumya Bhatbe6cc172016-12-30 14:42:58 +053088 *
89 * This id is static.
90 * On Adding new component, new id has to be assigned
91 */
92enum wlan_umac_comp_id {
Krunal Sonic4e35922017-02-01 14:59:01 -080093 WLAN_UMAC_COMP_MLME = 0,
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053094 WLAN_UMAC_COMP_MGMT_TXRX = 1,
95 WLAN_UMAC_COMP_SERIALIZATION = 2,
96 WLAN_UMAC_COMP_SCAN = 3,
Mukul Sharmad8fd1442017-02-03 11:27:17 +053097 WLAN_UMAC_COMP_PMO = 4,
Wu Gaof482dea2017-02-16 11:39:12 +080098 WLAN_UMAC_COMP_P2P = 5,
Krunal Sonic4e35922017-02-01 14:59:01 -080099 WLAN_UMAC_COMP_ID_MAX,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530100};
101
102/**
103 * enum WLAN_DEV_TYPE - for DA or OL architecture types
104 * @WLAN_DEV_DA: Direct attach
105 * @WLAN_DEV_OL: Partial offload
106 * @WLAN_DEV_INVALID: Invalid dev type
107 */
108typedef enum {
109 WLAN_DEV_DA = 0,
110 WLAN_DEV_OL = 1,
111 WLAN_DEV_INVALID = 3,
112} WLAN_DEV_TYPE;
113
114/**
115 * enum wlan_phymode - phy mode
116 * @WLAN_PHYMODE_AUTO: autoselect
117 * @WLAN_PHYMODE_11A: 5GHz, OFDM
118 * @WLAN_PHYMODE_11B: 2GHz, CCK
119 * @WLAN_PHYMODE_11G: 2GHz, OFDM
120 * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
121 * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
122 * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
123 * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
124 * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
125 * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
126 * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
127 * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
128 * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
129 * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
130 * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
131 * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
132 * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
133 * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
134 * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
135 */
136enum wlan_phymode {
137 WLAN_PHYMODE_AUTO = 0,
138 WLAN_PHYMODE_11A = 1,
139 WLAN_PHYMODE_11B = 2,
140 WLAN_PHYMODE_11G = 3,
141 WLAN_PHYMODE_11NA_HT20 = 4,
142 WLAN_PHYMODE_11NG_HT20 = 5,
143 WLAN_PHYMODE_11NA_HT40PLUS = 6,
144 WLAN_PHYMODE_11NA_HT40MINUS = 7,
145 WLAN_PHYMODE_11NG_HT40PLUS = 8,
146 WLAN_PHYMODE_11NG_HT40MINUS = 9,
147 WLAN_PHYMODE_11NG_HT40 = 10,
148 WLAN_PHYMODE_11NA_HT40 = 11,
149 WLAN_PHYMODE_11AC_VHT20 = 12,
150 WLAN_PHYMODE_11AC_VHT40PLUS = 13,
151 WLAN_PHYMODE_11AC_VHT40MINUS = 14,
152 WLAN_PHYMODE_11AC_VHT40 = 15,
153 WLAN_PHYMODE_11AC_VHT80 = 16,
154 WLAN_PHYMODE_11AC_VHT160 = 17,
155 WLAN_PHYMODE_11AC_VHT80_80 = 18,
156};
157
158#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
159
160/**
161 * enum wlan_peer_type - peer type
162 * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
163 * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
164 * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
165 * @WLAN_PEER_TDLS: TDLS Peer
166 * @WLAN_PEER_NAWDS: NAWDS Peer
167 * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530168 * @WLAN_PEER_IBSS: IBSS Peer
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530169 */
170enum wlan_peer_type {
171 WLAN_PEER_SELF = 1,
172 WLAN_PEER_AP = 2,
173 WLAN_PEER_STA = 3,
174 WLAN_PEER_TDLS = 4,
175 WLAN_PEER_NAWDS = 5,
176 WLAN_PEER_STA_TEMP = 6,
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530177 WLAN_PEER_IBSS = 7,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530178};
179
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530180/**
181 * enum wlan_band - specifies operating channel band
182 * @WLAN_BAND_ALL: Any band
183 * @WLAN_BAND_2_4_GHZ: 2.4 GHz band
184 * @WLAN_BAND_5_GHZ: 5 GHz band
185 * @WLAN_BAND_4_9_GHZ: 4.9 GHz band
186 */
187enum wlan_band {
188 WLAN_BAND_ALL,
189 WLAN_BAND_2_4_GHZ,
190 WLAN_BAND_5_GHZ,
191 WLAN_BAND_4_9_GHZ,
192};
193
194/**
195 * enum wlan_bss_type - type of network
196 * @WLAN_TYPE_ANY: Default value
197 * @WLAN_TYPE_BSS: Type BSS
198 * @WLAN_TYPE_IBSS: Type IBSS
199 */
200enum wlan_bss_type {
201 WLAN_TYPE_ANY,
202 WLAN_TYPE_BSS,
203 WLAN_TYPE_IBSS,
204};
205
206/**
207 * enum wlan_pmf_cap: pmf capability
208 * @PMF_DISABLED: PMF is disabled
209 * @PMF_CAPABLE: PMF is supported
210 * @PMF_REQUIRED: PMF is mandatory
211 */
212enum wlan_pmf_cap {
213 WLAN_PMF_DISABLED,
214 WLAN_PMF_CAPABLE,
215 WLAN_PMF_REQUIRED,
216};
217
218/**
219 * enum wlan_auth_type - Enumeration of the various Auth types
220 * @WLAN_AUTH_TYPE_OPEN_SYSTEM: Open auth type
221 * @WLAN_AUTH_TYPE_SHARED_KEY: Shared Key Auth type
222 * @WLAN_AUTH_TYPE_AUTOSWITCH: Auto switch Open/Shared
223 * @WLAN_AUTH_TYPE_WPA: WPA Enterprise
224 * @WLAN_AUTH_TYPE_WPA_PSK: WPA PSK
225 * @WLAN_AUTH_TYPE_WPA_NONE: WPA None
226 * @WLAN_AUTH_TYPE_RSN: RSN Enterprise
227 * @WLAN_AUTH_TYPE_RSN_PSK: RSN PSK
228 * @WLAN_AUTH_TYPE_FT_RSN: FT RSN Enterprise
229 * @WLAN_AUTH_TYPE_FT_RSN_PSK: FT RSN PSK
230 * @WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE: WAPI certificate
231 * @WLAN_AUTH_TYPE_WAPI_WAI_PSK: WAPI PSK
232 * @WLAN_AUTH_TYPE_CCKM_WPA: CCKM WPA
233 * @WLAN_AUTH_TYPE_CCKM_RSN: CCKM RSN
234 * @WLAN_AUTH_TYPE_RSN_PSK_SHA256: SHA256 PSK
235 * @WLAN_AUTH_TYPE_RSN_8021X_SHA256: SHA256 Enterprise
236 * @WLAN_NUM_OF_SUPPORT_AUTH_TYPE: Max no of Auth type
237 */
238enum wlan_auth_type {
239 WLAN_AUTH_TYPE_OPEN_SYSTEM,
240 WLAN_AUTH_TYPE_SHARED_KEY,
241 WLAN_AUTH_TYPE_AUTOSWITCH,
242 WLAN_AUTH_TYPE_WPA,
243 WLAN_AUTH_TYPE_WPA_PSK,
244 WLAN_AUTH_TYPE_WPA_NONE,
245 WLAN_AUTH_TYPE_RSN,
246 WLAN_AUTH_TYPE_RSN_PSK,
247 WLAN_AUTH_TYPE_FT_RSN,
248 WLAN_AUTH_TYPE_FT_RSN_PSK,
249 WLAN_AUTH_TYPE_WAPI_WAI_CERTIFICATE,
250 WLAN_AUTH_TYPE_WAPI_WAI_PSK,
251 WLAN_AUTH_TYPE_CCKM_WPA,
252 WLAN_AUTH_TYPE_CCKM_RSN,
253 WLAN_AUTH_TYPE_RSN_PSK_SHA256,
254 WLAN_AUTH_TYPE_RSN_8021X_SHA256,
255 WLAN_NUM_OF_SUPPORT_AUTH_TYPE,
256};
257
258/**
259 * enum wlan_enc_type - Enumeration of the various Enc types
260 * @WLAN_ENCRYPT_TYPE_NONE: No encryption
261 * @WLAN_ENCRYPT_TYPE_WEP40_STATICKEY: WEP 40 Static key
262 * @WLAN_ENCRYPT_TYPE_WEP104_STATICKEY: WEP 104 Static key
263 * @WLAN_ENCRYPT_TYPE_WEP40: WEP 40
264 * @WLAN_ENCRYPT_TYPE_WEP104: WEP 104
265 * @WLAN_ENCRYPT_TYPE_TKIP: TKIP
266 * @WLAN_ENCRYPT_TYPE_AES: AES
267 * @WLAN_ENCRYPT_TYPE_WPI: WAPI
268 * @WLAN_ENCRYPT_TYPE_KRK: KRK
269 * @WLAN_ENCRYPT_TYPE_BTK: BTK
270 * @WLAN_ENCRYPT_TYPE_AES_CMAC: 11W BIP
271 * @WLAN_ENCRYPT_TYPE_ANY: Any
272 * @WLAN_NUM_OF_ENCRYPT_TYPE: Max value
273 */
274enum wlan_enc_type {
275 WLAN_ENCRYPT_TYPE_NONE,
276 WLAN_ENCRYPT_TYPE_WEP40_STATICKEY,
277 WLAN_ENCRYPT_TYPE_WEP104_STATICKEY,
278 WLAN_ENCRYPT_TYPE_WEP40,
279 WLAN_ENCRYPT_TYPE_WEP104,
280 WLAN_ENCRYPT_TYPE_TKIP,
281 WLAN_ENCRYPT_TYPE_AES,
282 WLAN_ENCRYPT_TYPE_WPI,
283 WLAN_ENCRYPT_TYPE_KRK,
284 WLAN_ENCRYPT_TYPE_BTK,
285 WLAN_ENCRYPT_TYPE_AES_CMAC,
286 WLAN_ENCRYPT_TYPE_ANY,
287 WLAN_NUM_OF_ENCRYPT_TYPE = WLAN_ENCRYPT_TYPE_ANY,
288};
289
290/**
291 * struct wlan_ssid - SSID info
292 * @length: ssid length of bss excluding null
293 * @ssid: ssid character array potentially non null terminated
294 */
295struct wlan_ssid {
296 uint8_t length;
297 uint8_t ssid[WLAN_SSID_MAX_LEN];
298};
299
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530300/* MAC address length */
301#define WLAN_MACADDR_LEN 6
302/* Util API to copy the MAC address */
303#define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
304/* Util API to compare the MAC address */
305#define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
306
307#endif /* _WLAN_OBJMGR_CMN_H_*/