xref: /wlan-driver/qcacld-3.0/components/umac/twt/dispatcher/inc/cfg_twt.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name  * above copyright notice and this permission notice appear in all
7*5113495bSYour Name  * copies.
8*5113495bSYour Name  *
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name  */
18*5113495bSYour Name 
19*5113495bSYour Name /**
20*5113495bSYour Name  * DOC: This file contains TWT config related definitions
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name #ifndef __CFG_TWT_H_
24*5113495bSYour Name #define __CFG_TWT_H_
25*5113495bSYour Name 
26*5113495bSYour Name #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
27*5113495bSYour Name /*
28*5113495bSYour Name  * <ini>
29*5113495bSYour Name  * twt_requestor - twt requestor.
30*5113495bSYour Name  * @Min: 0
31*5113495bSYour Name  * @Max: 1
32*5113495bSYour Name  * @Default: 1
33*5113495bSYour Name  *
34*5113495bSYour Name  * This cfg is used to store twt requestor config.
35*5113495bSYour Name  *
36*5113495bSYour Name  * Related: NA
37*5113495bSYour Name  *
38*5113495bSYour Name  * Supported Feature: 11AX
39*5113495bSYour Name  *
40*5113495bSYour Name  * Usage: Internal
41*5113495bSYour Name  *
42*5113495bSYour Name  * </ini>
43*5113495bSYour Name  */
44*5113495bSYour Name #define CFG_TWT_REQUESTOR CFG_INI_BOOL( \
45*5113495bSYour Name 		"twt_requestor", \
46*5113495bSYour Name 		1, \
47*5113495bSYour Name 		"TWT requestor")
48*5113495bSYour Name /*
49*5113495bSYour Name  * <ini>
50*5113495bSYour Name  * twt_responder - twt responder.
51*5113495bSYour Name  * @Min: 0
52*5113495bSYour Name  * @Max: 1
53*5113495bSYour Name  * @Default: false
54*5113495bSYour Name  *
55*5113495bSYour Name  * This cfg is used to store twt responder config.
56*5113495bSYour Name  *
57*5113495bSYour Name  * Related: NA
58*5113495bSYour Name  *
59*5113495bSYour Name  * Supported Feature: 11AX
60*5113495bSYour Name  *
61*5113495bSYour Name  * Usage: Internal
62*5113495bSYour Name  *
63*5113495bSYour Name  * </ini>
64*5113495bSYour Name  */
65*5113495bSYour Name #define CFG_TWT_RESPONDER CFG_INI_BOOL( \
66*5113495bSYour Name 		"twt_responder", \
67*5113495bSYour Name 		false, \
68*5113495bSYour Name 		"TWT responder")
69*5113495bSYour Name 
70*5113495bSYour Name /*
71*5113495bSYour Name  * <ini>
72*5113495bSYour Name  * enable_twt - Enable Target Wake Time support.
73*5113495bSYour Name  * @Min: 0
74*5113495bSYour Name  * @Max: 1
75*5113495bSYour Name  * @Default: 1
76*5113495bSYour Name  *
77*5113495bSYour Name  * This ini is used to enable or disable TWT support.
78*5113495bSYour Name  *
79*5113495bSYour Name  * Related: NA
80*5113495bSYour Name  *
81*5113495bSYour Name  * Supported Feature: 11AX
82*5113495bSYour Name  *
83*5113495bSYour Name  * Usage: External
84*5113495bSYour Name  *
85*5113495bSYour Name  * </ini>
86*5113495bSYour Name  */
87*5113495bSYour Name #define CFG_ENABLE_TWT CFG_INI_BOOL( \
88*5113495bSYour Name 		"enable_twt", \
89*5113495bSYour Name 		1, \
90*5113495bSYour Name 		"TWT support")
91*5113495bSYour Name 
92*5113495bSYour Name /*
93*5113495bSYour Name  * <ini>
94*5113495bSYour Name  * twt_congestion_timeout - Target wake time congestion timeout.
95*5113495bSYour Name  * @Min: 0
96*5113495bSYour Name  * @Max: 10000
97*5113495bSYour Name  * @Default: 100
98*5113495bSYour Name  *
99*5113495bSYour Name  * STA uses this timer to continuously monitor channel congestion levels to
100*5113495bSYour Name  * decide whether to start or stop TWT. This ini is used to configure the
101*5113495bSYour Name  * target wake time congestion timeout value in the units of milliseconds.
102*5113495bSYour Name  * A value of Zero indicates that this is a host triggered TWT and all the
103*5113495bSYour Name  * necessary configuration for TWT will be directed from the host.
104*5113495bSYour Name  *
105*5113495bSYour Name  * Related: NA
106*5113495bSYour Name  *
107*5113495bSYour Name  * Supported Feature: 11AX
108*5113495bSYour Name  *
109*5113495bSYour Name  * Usage: External
110*5113495bSYour Name  *
111*5113495bSYour Name  * </ini>
112*5113495bSYour Name  */
113*5113495bSYour Name #define CFG_TWT_CONGESTION_TIMEOUT CFG_INI_UINT( \
114*5113495bSYour Name 		"twt_congestion_timeout", \
115*5113495bSYour Name 		0, \
116*5113495bSYour Name 		10000, \
117*5113495bSYour Name 		100, \
118*5113495bSYour Name 		CFG_VALUE_OR_DEFAULT, \
119*5113495bSYour Name 		"twt congestion timeout")
120*5113495bSYour Name /*
121*5113495bSYour Name  * <ini>
122*5113495bSYour Name  * twt_bcast_req_resp_config - To enable broadcast twt requestor and responder.
123*5113495bSYour Name  * @Min: 0 Disable the extended twt capability
124*5113495bSYour Name  * @Max: 3
125*5113495bSYour Name  * @Default: 1
126*5113495bSYour Name  *
127*5113495bSYour Name  * This cfg is used to configure the broadcast TWT requestor and responder.
128*5113495bSYour Name  * Bitmap for enabling the broadcast twt requestor and responder.
129*5113495bSYour Name  * BIT 0: Enable/Disable broadcast twt requestor.
130*5113495bSYour Name  * BIT 1: Enable/Disable broadcast twt responder.
131*5113495bSYour Name  * BIT 2-31: Reserved
132*5113495bSYour Name  *
133*5113495bSYour Name  * Related: CFG_ENABLE_TWT
134*5113495bSYour Name  * Related: CFG_TWT_RESPONDER
135*5113495bSYour Name  * Related: CFG_TWT_REQUESTOR
136*5113495bSYour Name  *
137*5113495bSYour Name  * Supported Feature: 11AX
138*5113495bSYour Name  *
139*5113495bSYour Name  * Usage: External
140*5113495bSYour Name  *
141*5113495bSYour Name  * </ini>
142*5113495bSYour Name  */
143*5113495bSYour Name /* defines to extract the requestor/responder capabilities from cfg */
144*5113495bSYour Name #define TWT_BCAST_REQ_INDEX    0
145*5113495bSYour Name #define TWT_BCAST_REQ_BITS     1
146*5113495bSYour Name #define TWT_BCAST_RES_INDEX    1
147*5113495bSYour Name #define TWT_BCAST_RES_BITS     1
148*5113495bSYour Name 
149*5113495bSYour Name #define CFG_BCAST_TWT_REQ_RESP CFG_INI_UINT( \
150*5113495bSYour Name 		"twt_bcast_req_resp_config", \
151*5113495bSYour Name 		0, \
152*5113495bSYour Name 		3, \
153*5113495bSYour Name 		1, \
154*5113495bSYour Name 		CFG_VALUE_OR_DEFAULT, \
155*5113495bSYour Name 		"BROADCAST TWT CAPABILITY")
156*5113495bSYour Name 
157*5113495bSYour Name #define CFG_TWT_GET_BCAST_REQ(_bcast_conf) \
158*5113495bSYour Name 	QDF_GET_BITS(_bcast_conf, \
159*5113495bSYour Name 		     TWT_BCAST_REQ_INDEX, \
160*5113495bSYour Name 		     TWT_BCAST_REQ_BITS)
161*5113495bSYour Name 
162*5113495bSYour Name #define CFG_TWT_GET_BCAST_RES(_bcast_conf) \
163*5113495bSYour Name 	QDF_GET_BITS(_bcast_conf, \
164*5113495bSYour Name 		     TWT_BCAST_RES_INDEX, \
165*5113495bSYour Name 		     TWT_BCAST_RES_BITS)
166*5113495bSYour Name 
167*5113495bSYour Name /*
168*5113495bSYour Name  * <ini>
169*5113495bSYour Name  * rtwt_req_resp_config - To enable restricted twt requestor and responder.
170*5113495bSYour Name  * @Min: 0 Disable the extended twt capability
171*5113495bSYour Name  * @Max: 3
172*5113495bSYour Name  * @Default: 0
173*5113495bSYour Name  *
174*5113495bSYour Name  * This cfg is used to configure the restricted TWT requestor and responder.
175*5113495bSYour Name  * Bitmap for enabling the restricted twt requestor and responder.
176*5113495bSYour Name  * BIT 0: Enable/Disable restricted twt requestor.
177*5113495bSYour Name  * BIT 1: Enable/Disable restricted twt responder.
178*5113495bSYour Name  * BIT 2-31: Reserved
179*5113495bSYour Name  *
180*5113495bSYour Name  * Related: CFG_ENABLE_TWT
181*5113495bSYour Name  * Related: CFG_TWT_RESPONDER
182*5113495bSYour Name  * Related: CFG_TWT_REQUESTOR
183*5113495bSYour Name  *
184*5113495bSYour Name  * Supported Feature: 11AX
185*5113495bSYour Name  *
186*5113495bSYour Name  * Usage: External
187*5113495bSYour Name  *
188*5113495bSYour Name  * </ini>
189*5113495bSYour Name  */
190*5113495bSYour Name /* defines to extract the requestor/responder capabilities from cfg */
191*5113495bSYour Name #define RTWT_REQ_INDEX    0
192*5113495bSYour Name #define RTWT_REQ_BITS     1
193*5113495bSYour Name #define RTWT_RES_INDEX    1
194*5113495bSYour Name #define RTWT_RES_BITS     1
195*5113495bSYour Name 
196*5113495bSYour Name #define CFG_RTWT_REQ_RESP CFG_INI_UINT( \
197*5113495bSYour Name 		"rtwt_req_resp_config", \
198*5113495bSYour Name 		0, \
199*5113495bSYour Name 		3, \
200*5113495bSYour Name 		0, \
201*5113495bSYour Name 		CFG_VALUE_OR_DEFAULT, \
202*5113495bSYour Name 		"RESTRICTED TWT CAPABILITY")
203*5113495bSYour Name 
204*5113495bSYour Name #define CFG_GET_RTWT_REQ(_rtwt_conf) \
205*5113495bSYour Name 	QDF_GET_BITS(_rtwt_conf, \
206*5113495bSYour Name 		     RTWT_REQ_INDEX, \
207*5113495bSYour Name 		     RTWT_REQ_BITS)
208*5113495bSYour Name 
209*5113495bSYour Name #define CFG_GET_RTWT_RES(_rtwt_conf) \
210*5113495bSYour Name 	QDF_GET_BITS(_rtwt_conf, \
211*5113495bSYour Name 		     RTWT_RES_INDEX, \
212*5113495bSYour Name 		     RTWT_RES_BITS)
213*5113495bSYour Name 
214*5113495bSYour Name /*
215*5113495bSYour Name  * <ini>
216*5113495bSYour Name  * enable_twt_24ghz - Enable Target wake time when STA is connected on 2.4Ghz
217*5113495bSYour Name  * band.
218*5113495bSYour Name  * @Min: 0
219*5113495bSYour Name  * @Max: 1
220*5113495bSYour Name  * @Default: 1
221*5113495bSYour Name  *
222*5113495bSYour Name  * This ini is used to enable/disable the host TWT when STA is connected to AP
223*5113495bSYour Name  * in 2.4Ghz band.
224*5113495bSYour Name  *
225*5113495bSYour Name  * Related: NA
226*5113495bSYour Name  *
227*5113495bSYour Name  * Supported Feature: 11AX
228*5113495bSYour Name  *
229*5113495bSYour Name  * Usage: External
230*5113495bSYour Name  *
231*5113495bSYour Name  * </ini>
232*5113495bSYour Name  */
233*5113495bSYour Name #define CFG_ENABLE_TWT_24GHZ CFG_INI_BOOL( \
234*5113495bSYour Name 		"enable_twt_24ghz", \
235*5113495bSYour Name 		true, \
236*5113495bSYour Name 		"enable twt in 2.4Ghz band")
237*5113495bSYour Name /*
238*5113495bSYour Name  * <ini>
239*5113495bSYour Name  * twt_disable_info - Enable/Disable TWT info frame.
240*5113495bSYour Name  * @Min: 0
241*5113495bSYour Name  * @Max: 1
242*5113495bSYour Name  * @Default: 0
243*5113495bSYour Name  *
244*5113495bSYour Name  * This ini is used to enable/disable TWT Info frame
245*5113495bSYour Name  *
246*5113495bSYour Name  * Related: NA
247*5113495bSYour Name  *
248*5113495bSYour Name  * Supported Feature: 11AX
249*5113495bSYour Name  *
250*5113495bSYour Name  * Usage: External
251*5113495bSYour Name  *
252*5113495bSYour Name  * </ini>
253*5113495bSYour Name  */
254*5113495bSYour Name #define CFG_DISABLE_TWT_INFO_FRAME CFG_INI_BOOL( \
255*5113495bSYour Name 		"twt_disable_info", \
256*5113495bSYour Name 		false, \
257*5113495bSYour Name 		"disable twt info frame")
258*5113495bSYour Name 
259*5113495bSYour Name #define CFG_HE_FLEX_TWT_SCHED CFG_BOOL( \
260*5113495bSYour Name 				"he_flex_twt_sched", \
261*5113495bSYour Name 				0, \
262*5113495bSYour Name 				"HE Flex Twt Sched")
263*5113495bSYour Name 
264*5113495bSYour Name /*
265*5113495bSYour Name  * <ini>
266*5113495bSYour Name  * enable_twt_in_11n - Enable TWT support in 11n mode
267*5113495bSYour Name  * @MIN: 0
268*5113495bSYour Name  * @MAX: 1
269*5113495bSYour Name  * @Default: 0
270*5113495bSYour Name  *
271*5113495bSYour Name  * This ini is used to enable/disable TWT support 11n mode.
272*5113495bSYour Name  * Generally by default TWT support present from HE capable
273*5113495bSYour Name  * devices but if this ini is enabled then it will support
274*5113495bSYour Name  * partially from 11n mode itself.
275*5113495bSYour Name  *
276*5113495bSYour Name  * Related: NA
277*5113495bSYour Name  *
278*5113495bSYour Name  * Usage: External
279*5113495bSYour Name  *
280*5113495bSYour Name  * </ini>
281*5113495bSYour Name  */
282*5113495bSYour Name #define CFG_TWT_ENABLE_IN_11N CFG_INI_BOOL( \
283*5113495bSYour Name 		"enable_twt_in_11n", \
284*5113495bSYour Name 		false, \
285*5113495bSYour Name 		"enable twt support in 11n mode")
286*5113495bSYour Name 
287*5113495bSYour Name #define CFG_TWT_ALL \
288*5113495bSYour Name 	CFG(CFG_ENABLE_TWT) \
289*5113495bSYour Name 	CFG(CFG_TWT_REQUESTOR) \
290*5113495bSYour Name 	CFG(CFG_TWT_RESPONDER) \
291*5113495bSYour Name 	CFG(CFG_TWT_CONGESTION_TIMEOUT) \
292*5113495bSYour Name 	CFG(CFG_BCAST_TWT_REQ_RESP) \
293*5113495bSYour Name 	CFG(CFG_ENABLE_TWT_24GHZ) \
294*5113495bSYour Name 	CFG(CFG_DISABLE_TWT_INFO_FRAME) \
295*5113495bSYour Name 	CFG(CFG_TWT_ENABLE_IN_11N) \
296*5113495bSYour Name 	CFG(CFG_RTWT_REQ_RESP)
297*5113495bSYour Name #elif !defined(WLAN_SUPPORT_TWT) && !defined(WLAN_TWT_CONV_SUPPORTED)
298*5113495bSYour Name #define CFG_TWT_ALL
299*5113495bSYour Name #endif
300*5113495bSYour Name #endif /* __CFG_TWT_H_ */
301