xref: /wlan-driver/qcacld-3.0/components/nan/dispatcher/inc/cfg_nan.h (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #if !defined(__NAN_CFG_H__)
21*5113495bSYour Name #define __NAN_CFG_H__
22*5113495bSYour Name 
23*5113495bSYour Name /**
24*5113495bSYour Name  * DOC: nan_cfg.h
25*5113495bSYour Name  *
26*5113495bSYour Name  * NAN feature INI configuration parameter definitions
27*5113495bSYour Name  */
28*5113495bSYour Name #include "cfg_define.h"
29*5113495bSYour Name #include "cfg_converged.h"
30*5113495bSYour Name #include "qdf_types.h"
31*5113495bSYour Name 
32*5113495bSYour Name /*
33*5113495bSYour Name  * <ini>
34*5113495bSYour Name  * gEnableNanSupport - NAN feature support configuration
35*5113495bSYour Name  * @Min: 0
36*5113495bSYour Name  * @Max: 1
37*5113495bSYour Name  * @Default: 1
38*5113495bSYour Name  *
39*5113495bSYour Name  * When set to 1 NAN feature will be enabled.
40*5113495bSYour Name  *
41*5113495bSYour Name  * Related: None
42*5113495bSYour Name  *
43*5113495bSYour Name  * Supported Feature: NAN
44*5113495bSYour Name  *
45*5113495bSYour Name  * Usage: External
46*5113495bSYour Name  *
47*5113495bSYour Name  * </ini>
48*5113495bSYour Name  */
49*5113495bSYour Name #define CFG_NAN_ENABLE CFG_INI_BOOL("gEnableNanSupport", \
50*5113495bSYour Name 				    1, \
51*5113495bSYour Name 				    "Enable NAN Support")
52*5113495bSYour Name 
53*5113495bSYour Name /*
54*5113495bSYour Name  * <ini>
55*5113495bSYour Name  * nan_separate_iface_support: Separate iface creation for NAN
56*5113495bSYour Name  * @Min: 0
57*5113495bSYour Name  * @Max: 1
58*5113495bSYour Name  * @Default: 1
59*5113495bSYour Name  *
60*5113495bSYour Name  * Value is 1 when Host HDD supports separate iface creation
61*5113495bSYour Name  * for NAN.
62*5113495bSYour Name  *
63*5113495bSYour Name  * Related: None
64*5113495bSYour Name  *
65*5113495bSYour Name  * Supported Feature: NAN
66*5113495bSYour Name  *
67*5113495bSYour Name  * Usage: External
68*5113495bSYour Name  *
69*5113495bSYour Name  * </ini>
70*5113495bSYour Name  */
71*5113495bSYour Name #define CFG_NAN_SEPARATE_IFACE_SUPP CFG_INI_BOOL("nan_separate_iface_support", \
72*5113495bSYour Name 						 1, \
73*5113495bSYour Name 						 "Separate iface for NAN")
74*5113495bSYour Name 
75*5113495bSYour Name 
76*5113495bSYour Name /*
77*5113495bSYour Name  * <ini>
78*5113495bSYour Name  * genable_nan_datapath - Enable NaN data path feature. NaN data path
79*5113495bSYour Name  *                        enables NAN supported devices to exchange
80*5113495bSYour Name  *                        data over TCP/UDP network stack.
81*5113495bSYour Name  * @Min: 0
82*5113495bSYour Name  * @Max: 1
83*5113495bSYour Name  * @Default: 1
84*5113495bSYour Name  *
85*5113495bSYour Name  * When set to 1 NAN Datapath feature will be enabled.
86*5113495bSYour Name  *
87*5113495bSYour Name  * Related: gEnableNanSupport
88*5113495bSYour Name  *
89*5113495bSYour Name  * Supported Feature: NAN
90*5113495bSYour Name  *
91*5113495bSYour Name  * Usage: External
92*5113495bSYour Name  *
93*5113495bSYour Name  * </ini>
94*5113495bSYour Name  */
95*5113495bSYour Name #define CFG_NAN_DATAPATH_ENABLE CFG_INI_BOOL("genable_nan_datapath", \
96*5113495bSYour Name 					     1, \
97*5113495bSYour Name 					     "Enable NAN Datapath support")
98*5113495bSYour Name 
99*5113495bSYour Name /*
100*5113495bSYour Name  * <ini>
101*5113495bSYour Name  * gEnableNDIMacRandomization - When enabled this will randomize NDI Mac
102*5113495bSYour Name  * @Min: 0
103*5113495bSYour Name  * @Max: 1
104*5113495bSYour Name  * @Default: 1
105*5113495bSYour Name  *
106*5113495bSYour Name  * When enabled this will randomize NDI Mac
107*5113495bSYour Name  *
108*5113495bSYour Name  * Related: gEnableNanSupport
109*5113495bSYour Name  *
110*5113495bSYour Name  * Supported Feature: NAN
111*5113495bSYour Name  *
112*5113495bSYour Name  * Usage: External
113*5113495bSYour Name  *
114*5113495bSYour Name  * </ini>
115*5113495bSYour Name  */
116*5113495bSYour Name #define CFG_NAN_RANDOMIZE_NDI_MAC CFG_INI_BOOL("gEnableNDIMacRandomization", \
117*5113495bSYour Name 					       1, \
118*5113495bSYour Name 					       "Enable NAN MAC Randomization")
119*5113495bSYour Name 
120*5113495bSYour Name /*
121*5113495bSYour Name  * <ini>
122*5113495bSYour Name  * ndp_inactivity_timeout - To configure duration of how many seconds
123*5113495bSYour Name  * without TX/RX data traffic, NDI vdev can kickout the connected
124*5113495bSYour Name  * peer(i.e. NDP Termination).
125*5113495bSYour Name  *
126*5113495bSYour Name  * @Min: 0
127*5113495bSYour Name  * @Max: 1800
128*5113495bSYour Name  * @Default: 60
129*5113495bSYour Name  *
130*5113495bSYour Name  * Related: None
131*5113495bSYour Name  *
132*5113495bSYour Name  * Supported Feature: NAN
133*5113495bSYour Name  *
134*5113495bSYour Name  * Usage: External
135*5113495bSYour Name  *
136*5113495bSYour Name  * </ini>
137*5113495bSYour Name  */
138*5113495bSYour Name #define CFG_NAN_NDP_INACTIVITY_TIMEOUT CFG_INI_UINT("ndp_inactivity_timeout", \
139*5113495bSYour Name 						    0, \
140*5113495bSYour Name 						    1800, \
141*5113495bSYour Name 						    60, \
142*5113495bSYour Name 						    CFG_VALUE_OR_DEFAULT, \
143*5113495bSYour Name 						    "NDP Auto Terminate time")
144*5113495bSYour Name 
145*5113495bSYour Name /*
146*5113495bSYour Name  * <ini>
147*5113495bSYour Name  * gNdpKeepAlivePeriod - To configure duration of how many seconds
148*5113495bSYour Name  * to wait to kickout peer if peer is not reachable.
149*5113495bSYour Name  *
150*5113495bSYour Name  * @Min: 10
151*5113495bSYour Name  * @Max: 30
152*5113495bSYour Name  * @Default: 14
153*5113495bSYour Name  *
154*5113495bSYour Name  * Related: None
155*5113495bSYour Name  *
156*5113495bSYour Name  * Supported Feature: NAN
157*5113495bSYour Name  *
158*5113495bSYour Name  * Usage: External
159*5113495bSYour Name  *
160*5113495bSYour Name  * </ini>
161*5113495bSYour Name  */
162*5113495bSYour Name 
163*5113495bSYour Name #define CFG_NDP_KEEP_ALIVE_PERIOD CFG_INI_UINT( \
164*5113495bSYour Name 			"gNdpKeepAlivePeriod", \
165*5113495bSYour Name 			10, \
166*5113495bSYour Name 			30, \
167*5113495bSYour Name 			14, \
168*5113495bSYour Name 			CFG_VALUE_OR_DEFAULT, \
169*5113495bSYour Name 			"Keep alive timeout of a peer")
170*5113495bSYour Name 
171*5113495bSYour Name /* MAX NDP sessions supported */
172*5113495bSYour Name #define MAX_NDP_SESSIONS 8
173*5113495bSYour Name 
174*5113495bSYour Name /*
175*5113495bSYour Name  * <ini>
176*5113495bSYour Name  * ndp_max_sessions - To configure max ndp sessions
177*5113495bSYour Name  * supported by host.
178*5113495bSYour Name  *
179*5113495bSYour Name  * @Min: 1
180*5113495bSYour Name  * @Max: 8
181*5113495bSYour Name  * @Default: 8
182*5113495bSYour Name  *
183*5113495bSYour Name  * Related: None
184*5113495bSYour Name  *
185*5113495bSYour Name  * Supported Feature: NAN
186*5113495bSYour Name  *
187*5113495bSYour Name  * Usage: Internal
188*5113495bSYour Name  *
189*5113495bSYour Name  * </ini>
190*5113495bSYour Name  */
191*5113495bSYour Name 
192*5113495bSYour Name #define CFG_NDP_MAX_SESSIONS CFG_INI_UINT( \
193*5113495bSYour Name 			"ndp_max_sessions", \
194*5113495bSYour Name 			1, \
195*5113495bSYour Name 			MAX_NDP_SESSIONS, \
196*5113495bSYour Name 			8, \
197*5113495bSYour Name 			CFG_VALUE_OR_DEFAULT, \
198*5113495bSYour Name 			"max ndp sessions host supports")
199*5113495bSYour Name 
200*5113495bSYour Name /*
201*5113495bSYour Name  * <ini>
202*5113495bSYour Name  * gSupportMp0Discovery - To support discovery of NAN cluster with
203*5113495bSYour Name  * Master Preference (MP) as 0 when a new device is enabling NAN.
204*5113495bSYour Name  *
205*5113495bSYour Name  * @Min: 0
206*5113495bSYour Name  * @Max: 1
207*5113495bSYour Name  * @Default: 0
208*5113495bSYour Name  *
209*5113495bSYour Name  * Related: None
210*5113495bSYour Name  *
211*5113495bSYour Name  * Supported Feature: NAN
212*5113495bSYour Name  *
213*5113495bSYour Name  * Usage: External
214*5113495bSYour Name  *
215*5113495bSYour Name  * </ini>
216*5113495bSYour Name  */
217*5113495bSYour Name #define CFG_SUPPORT_MP0_DISCOVERY CFG_INI_BOOL( \
218*5113495bSYour Name 			"gSupportMp0Discovery", \
219*5113495bSYour Name 			1, \
220*5113495bSYour Name 			"Enable/Disable discovery of NAN cluster with Master Preference (MP) as 0")
221*5113495bSYour Name /*
222*5113495bSYour Name  * <ini>
223*5113495bSYour Name  * ndi_max_support - To configure max number of ndi host supports
224*5113495bSYour Name  *
225*5113495bSYour Name  * @Min: 1
226*5113495bSYour Name  * @Max: 2
227*5113495bSYour Name  * @Default: 1
228*5113495bSYour Name  *
229*5113495bSYour Name  * Related: None
230*5113495bSYour Name  *
231*5113495bSYour Name  * Supported Feature: NAN
232*5113495bSYour Name  *
233*5113495bSYour Name  * Usage: Internal
234*5113495bSYour Name  *
235*5113495bSYour Name  * </ini>
236*5113495bSYour Name  */
237*5113495bSYour Name #define CFG_NDI_MAX_SUPPORT CFG_INI_UINT( \
238*5113495bSYour Name 			"ndi_max_support", \
239*5113495bSYour Name 			1, \
240*5113495bSYour Name 			2, \
241*5113495bSYour Name 			1, \
242*5113495bSYour Name 			CFG_VALUE_OR_DEFAULT, \
243*5113495bSYour Name 			"Max number of NDI host supports")
244*5113495bSYour Name 
245*5113495bSYour Name /*
246*5113495bSYour Name  * <ini>
247*5113495bSYour Name  * nan_feature_config - Bitmap to enable/disable a particular NAN/NDP feature
248*5113495bSYour Name  *
249*5113495bSYour Name  * @Min: 0
250*5113495bSYour Name  * @Max: 0xFFFF
251*5113495bSYour Name  * @Default: 0
252*5113495bSYour Name  *
253*5113495bSYour Name  * This parameter helps to enable/disable a particular feature config by setting
254*5113495bSYour Name  * corresponding bit and send to firmware through the VDEV param
255*5113495bSYour Name  * wmi_vdev_param_enable_disable_nan_config_features
256*5113495bSYour Name  * Acceptable values for this:
257*5113495bSYour Name  * BIT(0): Allow DW configuration from framework in sync role.
258*5113495bSYour Name  *	   If this is not set, firmware shall follow the spec/default behavior.
259*5113495bSYour Name  * BIT(1) to BIT(31): Reserved
260*5113495bSYour Name  *
261*5113495bSYour Name  * Related: None
262*5113495bSYour Name  *
263*5113495bSYour Name  * Supported Feature: NAN
264*5113495bSYour Name  *
265*5113495bSYour Name  * Usage: External
266*5113495bSYour Name  *
267*5113495bSYour Name  * </ini>
268*5113495bSYour Name  */
269*5113495bSYour Name #define CFG_NAN_FEATURE_CONFIG CFG_INI_UINT( \
270*5113495bSYour Name 			"nan_feature_config", \
271*5113495bSYour Name 			0, \
272*5113495bSYour Name 			0xFFFF, \
273*5113495bSYour Name 			0, \
274*5113495bSYour Name 			CFG_VALUE_OR_DEFAULT, \
275*5113495bSYour Name 			"Enable the specified NAN features in firmware")
276*5113495bSYour Name 
277*5113495bSYour Name /*
278*5113495bSYour Name  * <ini>
279*5113495bSYour Name  * disable_6g_nan - Disable NAN feature support in 6GHz
280*5113495bSYour Name  * @Min: 0
281*5113495bSYour Name  * @Max: 1
282*5113495bSYour Name  * @Default: 0
283*5113495bSYour Name  *
284*5113495bSYour Name  * When set to 1 NAN feature will be disabled in 6GHz.
285*5113495bSYour Name  *
286*5113495bSYour Name  * Related: None
287*5113495bSYour Name  *
288*5113495bSYour Name  * Supported Feature: NAN
289*5113495bSYour Name  *
290*5113495bSYour Name  * Usage: External
291*5113495bSYour Name  *
292*5113495bSYour Name  * </ini>
293*5113495bSYour Name  */
294*5113495bSYour Name #define CFG_DISABLE_6G_NAN CFG_INI_BOOL("disable_6g_nan", \
295*5113495bSYour Name 					0, \
296*5113495bSYour Name 					"Disable NAN Support in 6GHz")
297*5113495bSYour Name 
298*5113495bSYour Name /*
299*5113495bSYour Name  * <ini>
300*5113495bSYour Name  * g_nan_enable_eht_cap- enable/disable NAN EHT CAP
301*5113495bSYour Name  * @Min: 0
302*5113495bSYour Name  * @Max: 1
303*5113495bSYour Name  * @Default: 0
304*5113495bSYour Name  *
305*5113495bSYour Name  * This ini is used to enable/disable NAN EHT capability
306*5113495bSYour Name  *
307*5113495bSYour Name  * Related: None
308*5113495bSYour Name  *
309*5113495bSYour Name  * Supported Feature: NAN
310*5113495bSYour Name  *
311*5113495bSYour Name  * Usage: Internal/External
312*5113495bSYour Name  *
313*5113495bSYour Name  * </ini>
314*5113495bSYour Name  */
315*5113495bSYour Name #define CFG_NAN_ENABLE_EHT_CAP CFG_INI_BOOL("g_nan_enable_eht_cap", \
316*5113495bSYour Name 					     0, \
317*5113495bSYour Name 					     "Enable NAN EHT CAP")
318*5113495bSYour Name 
319*5113495bSYour Name 
320*5113495bSYour Name #ifdef WLAN_FEATURE_NAN
321*5113495bSYour Name #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
322*5113495bSYour Name 			CFG(CFG_DISABLE_6G_NAN) \
323*5113495bSYour Name 			CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
324*5113495bSYour Name 			CFG(CFG_SUPPORT_MP0_DISCOVERY)
325*5113495bSYour Name #define CFG_NAN_DP      CFG(CFG_NAN_DATAPATH_ENABLE) \
326*5113495bSYour Name 			CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
327*5113495bSYour Name 			CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
328*5113495bSYour Name 			CFG(CFG_NAN_SEPARATE_IFACE_SUPP)
329*5113495bSYour Name #else
330*5113495bSYour Name #define CFG_NAN_DISC
331*5113495bSYour Name #define CFG_NAN_DP
332*5113495bSYour Name #endif
333*5113495bSYour Name 
334*5113495bSYour Name #define CFG_NAN_ALL     CFG_NAN_DISC \
335*5113495bSYour Name 			CFG_NAN_DP \
336*5113495bSYour Name 			CFG(CFG_NDP_MAX_SESSIONS) \
337*5113495bSYour Name 			CFG(CFG_NDI_MAX_SUPPORT) \
338*5113495bSYour Name 			CFG(CFG_NAN_FEATURE_CONFIG) \
339*5113495bSYour Name 			CFG(CFG_NAN_ENABLE_EHT_CAP)
340*5113495bSYour Name 
341*5113495bSYour Name #endif
342