1 /*
2  * Copyright (c) 2012-2018, 2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: This file contains centralized definitions of converged configuration.
22  */
23 
24 #ifndef __CFG_MLME_NSS_CHAINS
25 #define __CFG_MLME_NSS_CHAINS
26 
27 /*
28  * <ini>
29  * num_tx_chains_2g - Config Param to change number of tx
30  * chains per vdev for 2.4ghz frequency connections
31  * @Min: 0x01249249
32  * @Max: 0x02492492
33  * @Default: 0x02492492
34  *
35  * This ini is used to change the num of chains for eg:-
36  * 0x01249249 - change all vdev's num tx chains for 2.4ghz connection to 1 each
37  * 0x02492492 - change all vdev's num tx chains for 2.4ghz connection to 2 each
38  * Bits          VDEV Type
39  * BIT[0:2]        STA
40  * BIT[3:5]        SAP
41  * BIT[6:8]        P2P GO
42  * BIT[9:11]       P2P Client
43  * BIT[12:14]      TDLS
44  * BIT[15:17]      IBSS
45  * BIT[18:20]      P2P device
46  * BIT[21:23]      OCB
47  * BIT[24:26]      NAN
48  * BIT[27:31]      Reserved
49  *
50  * Related: STA/SAP/P2P/IBSS/NAN.
51  *
52  * Supported Feature: Dynamic chainmask
53  *
54  * Usage: External
55  *
56  * </ini>
57  */
58 #define CFG_NUM_TX_CHAINS_2G CFG_INI_UINT( \
59 				"num_tx_chains_2g", \
60 				0x01249249, \
61 				0x02492492, \
62 				0x02492492, \
63 				CFG_VALUE_OR_DEFAULT, \
64 				"num tx chains 2g")
65 
66 /*
67  * <ini>
68  * num_tx_chains_5g - Config Param to change number of tx
69  * chains per vdev for 5 ghz frequency connections
70  * @Min: 0x01249249
71  * @Max: 0x02492492
72  * @Default: 0x02492492
73  *
74  * This ini is used to change the num of chains for eg:-
75  * 0x01249249- change all vdev's tx num chains for 5ghz connection to 1 each
76  * 0x02492492 - change all vdev's tx num chains for 5ghz connection to 2 each
77  * Bits          VDEV Type
78  * BIT[0:2]        STA
79  * BIT[3:5]        SAP
80  * BIT[6:8]        P2P GO
81  * BIT[9:11]       P2P Client
82  * BIT[12:14]      TDLS
83  * BIT[15:17]      IBSS
84  * BIT[18:20]      P2P device
85  * BIT[21:23]      OCB
86  * BIT[24:26]      NAN
87  * BIT[27:31]      Reserved
88  *
89  * Related: STA/SAP/P2P/IBSS/NAN.
90  *
91  * Supported Feature: Dynamic chainmask
92  *
93  * Usage: External
94  *
95  * </ini>
96  */
97 #define CFG_NUM_TX_CHAINS_5G CFG_INI_UINT( \
98 				"num_tx_chains_5g", \
99 				0x01249249, \
100 				0x02492492, \
101 				0x02492492, \
102 				CFG_VALUE_OR_DEFAULT, \
103 				"num tx chains 5g")
104 
105 /*
106  * <ini>
107  * num_rx_chains_2g - Config Param to change number of rx
108  * chains per vdev for 2.4 ghz frequency connections
109  * @Min: 0x01249249
110  * @Max: 0x02492492
111  * @Default: 0x02492492
112  *
113  * This ini is used to change the num of chains for eg:-
114  * 0x01249249 - change all vdev's rx num chains for 2.4ghz connections to 1 each
115  * 0x02492492 - change all vdev's rx num chains for 2.4ghz connections to 2 each
116  * Bits          VDEV Type
117  * BIT[0:2]        STA
118  * BIT[3:5]        SAP
119  * BIT[6:8]        P2P GO
120  * BIT[9:11]       P2P Client
121  * BIT[12:14]      TDLS
122  * BIT[15:17]      IBSS
123  * BIT[18:20]      P2P device
124  * BIT[21:23]      OCB
125  * BIT[24:26]      NAN
126  * BIT[27:31]      Reserved
127  *
128  * Related: STA/SAP/P2P/IBSS/NAN.
129  *
130  * Supported Feature: Dynamic chainmask
131  *
132  * Usage: External
133  *
134  * </ini>
135  */
136 #define CFG_NUM_RX_CHAINS_2G CFG_INI_UINT( \
137 				"num_rx_chains_2g", \
138 				0x01249249, \
139 				0x02492492, \
140 				0x02492492, \
141 				CFG_VALUE_OR_DEFAULT, \
142 				"num rx chains 2g")
143 
144 /*
145  * <ini>
146  * num_rx_chains_5g - Config Param to change number of rx
147  * chains per vdev for 5 ghz frequency connections
148  * @Min: 0x01249249
149  * @Max: 0x02492492
150  * @Default: 0x02492492
151  *
152  * This ini is used to change the num of chains for eg:-
153  * 0x01249249 - change all vdev's rx num chains for 5ghz connections to 1 each
154  * 0x02492492 - change all vdev's rx num chains for 5ghz connections to 2 each
155  * Bits          VDEV Type
156  * BIT[0:2]        STA
157  * BIT[3:5]        SAP
158  * BIT[6:8]        P2P GO
159  * BIT[9:11]       P2P Client
160  * BIT[12:14]      TDLS
161  * BIT[15:17]      IBSS
162  * BIT[18:20]      P2P device
163  * BIT[21:23]      OCB
164  * BIT[24:26]      NAN
165  * BIT[27:31]      Reserved
166  *
167  * Related: STA/SAP/P2P/IBSS/NAN.
168  *
169  * Supported Feature: Dynamic chainmask
170  *
171  * Usage: External
172  *
173  * </ini>
174  */
175 #define CFG_NUM_RX_CHAINS_5G CFG_INI_UINT( \
176 				"num_rx_chains_5g", \
177 				0x01249249, \
178 				0x02492492, \
179 				0x02492492, \
180 				CFG_VALUE_OR_DEFAULT, \
181 				"num rx chains 5g")
182 
183 /*
184  * <ini>
185  * tx_nss_2g - Config Param to change tx nss
186  * per vdev for 2.4ghz frequency connections
187  * @Min: 0x01249249
188  * @Max: 0x02492492
189  * @Default: 0x02492492
190  *
191  * This ini is used to change the num of tx spatial streams for eg:-
192  * 0x01249249 - change all vdev's tx nss for 2.4ghz connections to 1 each
193  * 0x02492492 - change all vdev's tx nss for 2.4ghz connections to 2 each
194  * Bits          VDEV Type
195  * BIT[0:2]        STA
196  * BIT[3:5]        SAP
197  * BIT[6:8]        P2P GO
198  * BIT[9:11]       P2P Client
199  * BIT[12:14]      TDLS
200  * BIT[15:17]      IBSS
201  * BIT[18:20]      P2P device
202  * BIT[21:23]      OCB
203  * BIT[24:26]      NAN
204  * BIT[27:31]      Reserved
205  *
206  * Related: STA/SAP/P2P/IBSS/NAN.
207  *
208  * Supported Feature: Dynamic chainmask
209  *
210  * Usage: External
211  *
212  * </ini>
213  */
214 #define CFG_TX_NSS_2G CFG_INI_UINT( \
215 				"tx_nss_2g", \
216 				0x01249249, \
217 				0x02492492, \
218 				0x02492492, \
219 				CFG_VALUE_OR_DEFAULT, \
220 				"tx nss 2.4ghz")
221 
222 /*
223  * <ini>
224  * tx_nss_5g - Config Param to change tx nss
225  * per vdev for 5ghz frequency connections
226  * @Min: 0x01249249
227  * @Max: 0x02492492
228  * @Default: 0x02492492
229  *
230  * This ini is used to change the num of tx spatial streams for eg:-
231  * 0x01249249 - change all vdev's tx nss for 5ghz connections to 1 each
232  * 0x02492492 - change all vdev's tx nss for 5ghz connections to 2 each
233  * Bits          VDEV Type
234  * BIT[0:2]        STA
235  * BIT[3:5]        SAP
236  * BIT[6:8]        P2P GO
237  * BIT[9:11]       P2P Client
238  * BIT[12:14]      TDLS
239  * BIT[15:17]      IBSS
240  * BIT[18:20]      P2P device
241  * BIT[21:23]      OCB
242  * BIT[24:26]      NAN
243  * BIT[27:31]      Reserved
244  *
245  * Related: STA/SAP/P2P/IBSS/NAN.
246  *
247  * Supported Feature: Dynamic chainmask
248  *
249  * Usage: External
250  *
251  * </ini>
252  */
253 #define CFG_TX_NSS_5G CFG_INI_UINT( \
254 				"tx_nss_5g", \
255 				0x01249249, \
256 				0x02492492, \
257 				0x02492492, \
258 				CFG_VALUE_OR_DEFAULT, \
259 				"tx nss 5ghz")
260 
261 /*
262  * <ini>
263  * rx_nss_2g - Config Param to change rx nss
264  * per vdev for 2.4ghz frequency connections
265  *
266  * @Min: 0x01249249
267  * @Max: 0x02492492
268  * @Default: 0x02492492
269  *
270  * This ini is used to change the num of rx spatial streams for eg:-
271  * 0x01249249 - change all vdev's rx nss for 2.4ghz connections to 1 each
272  * 0x02492492 - change all vdev's rx nss for 2.4ghz connections to 2 each
273  * Bits          VDEV Type
274  * BIT[0:2]        STA
275  * BIT[3:5]        SAP
276  * BIT[6:8]        P2P GO
277  * BIT[9:11]       P2P Client
278  * BIT[12:14]      TDLS
279  * BIT[15:17]      IBSS
280  * BIT[18:20]      P2P device
281  * BIT[21:23]      OCB
282  * BIT[24:26]      NAN
283  * BIT[27:31]      Reserved
284  *
285  * Related: STA/SAP/P2P/IBSS/NAN.
286  *
287  * Supported Feature: Dynamic chainmask
288  *
289  * Usage: External
290  *
291  * </ini>
292  */
293 #define CFG_RX_NSS_2G CFG_INI_UINT( \
294 				"rx_nss_2g", \
295 				0x01249249, \
296 				0x02492492, \
297 				0x02492492, \
298 				CFG_VALUE_OR_DEFAULT, \
299 				"rx nss 2.4ghz")
300 
301 /*
302  * <ini>
303  * rx_nss_5g - Config Param to change rx nss
304  * per vdev for 5ghz frequency connections
305  * @Min: 0x01249249
306  * @Max: 0x02492492
307  * @Default: 0x02492492
308  *
309  * This ini is used to change the num of rx spatial streams for eg:-
310  * 0x01249249 - change all vdev's rx nss for 5ghz connections to 1 each
311  * 0x02492492 - change all vdev's rx nss for 5ghz connections to 2 each
312  * Bits          VDEV Type
313  * BIT[0:2]        STA
314  * BIT[3:5]        SAP
315  * BIT[6:8]        P2P GO
316  * BIT[9:11]       P2P Client
317  * BIT[12:14]      TDLS
318  * BIT[15:17]      IBSS
319  * BIT[18:20]      P2P device
320  * BIT[21:23]      OCB
321  * BIT[24:26]      NAN
322  * BIT[27:31]      Reserved
323  *
324  * Related: STA/SAP/P2P/IBSS/NAN.
325  *
326  * Supported Feature: Dynamic chainmask
327  *
328  * Usage: External
329  *
330  * </ini>
331  */
332 #define CFG_RX_NSS_5G CFG_INI_UINT( \
333 				"rx_nss_5g", \
334 				0x01249249, \
335 				0x02492492, \
336 				0x02492492, \
337 				CFG_VALUE_OR_DEFAULT, \
338 				"rx nss 5ghz")
339 
340 /*
341  * <ini>
342  * num_tx_chains_11b - Config Param to change number of tx
343  * chains per vdev for 2.4ghz 11b mode connections
344  * @Min: 0x01249249
345  * @Max: 0x02492492
346  * @Default: 0x02492492
347  *
348  * This ini is used to change the num of chains for eg:-
349  * 0x01249249 - change all vdev's num chains for 11b connections to 1 each
350  * 0x02492492 - change all vdev's num chains for 11b connections to 2 each
351  * Bits          VDEV Type
352  * BIT[0:2]        STA
353  * BIT[3:5]        SAP
354  * BIT[6:8]        P2P GO
355  * BIT[9:11]       P2P Client
356  * BIT[12:14]      TDLS
357  * BIT[15:17]      IBSS
358  * BIT[18:20]      P2P device
359  * BIT[21:23]      OCB
360  * BIT[24:26]      NAN
361  * BIT[27:31]      Reserved
362  *
363  * Related: STA/SAP/P2P/IBSS/NAN.
364  *
365  * Supported Feature: Dynamic chainmask
366  *
367  * Usage: External
368  *
369  * </ini>
370  */
371 #define CFG_NUM_TX_CHAINS_11b CFG_INI_UINT( \
372 				"num_tx_chains_11b", \
373 				0x01249249, \
374 				0x02492492, \
375 				0x02492492, \
376 				CFG_VALUE_OR_DEFAULT, \
377 				"num tx chains 11b")
378 
379 /*
380  * <ini>
381  * num_tx_chains_11g - Config Param to change number of tx
382  * chains per vdev for 2.4ghz 11g mode connections
383  * @Min: 0x01249249
384  * @Max: 0x02492492
385  * @Default: 0x02492492
386  *
387  * This ini is used to change the num of chains for eg:-
388  * 0x01249249 - change all vdev's num chains for 11g connections to 1 each
389  * 0x02492492 - change all vdev's num chains for 11g connections to 2 each
390  * Bits          VDEV Type
391  * BIT[0:2]        STA
392  * BIT[3:5]        SAP
393  * BIT[6:8]        P2P GO
394  * BIT[9:11]       P2P Client
395  * BIT[12:14]      TDLS
396  * BIT[15:17]      IBSS
397  * BIT[18:20]      P2P device
398  * BIT[21:23]      OCB
399  * BIT[24:26]      NAN
400  * BIT[27:31]      Reserved
401  *
402  * Related: STA/SAP/P2P/IBSS/NAN.
403  *
404  * Supported Feature: Dynamic chainmask
405  *
406  * Usage: External
407  *
408  * </ini>
409  */
410 #define CFG_NUM_TX_CHAINS_11g CFG_INI_UINT( \
411 				"num_tx_chains_11g", \
412 				0x01249249, \
413 				0x02492492, \
414 				0x02492492, \
415 				CFG_VALUE_OR_DEFAULT, \
416 				"num tx chains 11g")
417 
418 /*
419  * <ini>
420  * num_tx_chains_11a - Config Param to change number of tx
421  * chains per vdev for 5ghz 11a mode connections
422  * @Min: 0x01249249
423  * @Max: 0x02492492
424  * @Default: 0x02492492
425  *
426  * This ini is used to change the num of chains for eg:-
427  * 0x01249249 - change all vdev's num chains for 11a connections to 1 each
428  * 0x02492492 - change all vdev's num chains for 11a connections to 2 each
429  * Bits          VDEV Type
430  * BIT[0:2]        STA
431  * BIT[3:5]        SAP
432  * BIT[6:8]        P2P GO
433  * BIT[9:11]       P2P Client
434  * BIT[12:14]      TDLS
435  * BIT[15:17]      IBSS
436  * BIT[18:20]      P2P device
437  * BIT[21:23]      OCB
438  * BIT[24:26]      NAN
439  * BIT[27:31]      Reserved
440  *
441  * Related: STA/SAP/P2P/IBSS/NAN.
442  *
443  * Supported Feature: Dynamic chainmask
444  *
445  * Usage: External
446  *
447  * </ini>
448  */
449 #define CFG_NUM_TX_CHAINS_11a CFG_INI_UINT( \
450 				"num_tx_chains_11a", \
451 				0x01249249, \
452 				0x02492492, \
453 				0x02492492, \
454 				CFG_VALUE_OR_DEFAULT, \
455 				"num tx chains 11a")
456 
457 /*
458  * <ini>
459  * disable_tx_mrc_2g - Config Param to disable 2 chains in 1x1 nss mode
460  * @Min: 0
461  * @Max: 1
462  * @Default: 0
463  *
464  * Related: STA/SAP/P2P/IBSS/NAN.
465  *
466  * Supported Feature: Dynamic chainmask
467  *
468  * Usage: External
469  *
470  * </ini>
471  */
472 #define CFG_DISABLE_TX_MRC_2G CFG_INI_BOOL( \
473 				"disable_tx_mrc_2g", \
474 				0, \
475 				"disable diversity gain tx 2g")
476 
477 /*
478  * <ini>
479  * disable_rx_mrc_2g - Config Param to disable 2 chains in 1x1 nss mode
480  * @Min: 0
481  * @Max: 1
482  * @Default: 0
483  *
484  * Related: STA/SAP/P2P/IBSS/NAN.
485  *
486  * Supported Feature: Dynamic chainmask
487  *
488  * Usage: External
489  *
490  * </ini>
491  */
492 #define CFG_DISABLE_RX_MRC_2G CFG_INI_BOOL( \
493 				"disable_rx_mrc_2g", \
494 				0, \
495 				"disable diversity gain rx 2g")
496 
497 /*
498  * <ini>
499  * disable_tx_mrc_5g - Config Param to disable 2 chains in 1x1 nss mode
500  * @Min: 0
501  * @Max: 1
502  * @Default: 0
503  *
504  * Related: STA/SAP/P2P/IBSS/NAN.
505  *
506  * Supported Feature: Dynamic chainmask
507  *
508  * Usage: External
509  *
510  * </ini>
511  */
512 #define CFG_DISABLE_TX_MRC_5G CFG_INI_BOOL( \
513 				"disable_tx_mrc_5g", \
514 				0, \
515 				"disable diversity gain tx 5g")
516 
517 /*
518  * <ini>
519  * disable_rx_mrc_5g - Config Param to disable 2 chains in 1x1 nss mode
520  * @Min: 0
521  * @Max: 1
522  * @Default: 0
523  *
524  * Related: STA/SAP/P2P/IBSS/NAN.
525  *
526  * Supported Feature: Dynamic chainmask
527  *
528  * Usage: External
529  *
530  * </ini>
531  */
532 #define CFG_DISABLE_RX_MRC_5G CFG_INI_BOOL( \
533 				"disable_rx_mrc_5g", \
534 				0, \
535 				"disable diversity gain rx 5g")
536 
537 /*
538  * <ini>
539  * enable_dynamic_nss_chain_config - Enable/Disable dynamic nss and chain config
540  * to FW.
541  * @Min: 0
542  * @Max: 1
543  * @Default: 1
544  *
545  * Related: STA/SAP/P2P/NAN.
546  *
547  * Supported Feature: Dynamic chainmask
548  *
549  * Usage: External
550  *
551  * </ini>
552  */
553 #define CFG_ENABLE_DYNAMIC_NSS_CHAIN_CONFIG CFG_INI_BOOL( \
554 					"enable_dynamic_nss_chain_config", \
555 					1, \
556 					"enable dynamic nss chain config")
557 
558 /*
559  * <ini>
560  * restart_sap_on_dynamic_nss_chains_config - Decide whether SAP needs to be
561  * restarted on dynamic nss chains update
562  * @Min: 0
563  * @Max: 1
564  * @Default: 0
565  *
566  * Related: SAP/P2P.
567  *
568  * Supported Feature: Dynamic chainmask
569  *
570  * Usage: External
571  *
572  * </ini>
573  */
574 #define CFG_RESTART_SAP_ON_DYNAMIC_NSS_CHAINS_CONFIG CFG_INI_BOOL( \
575 				"restart_sap_on_dynamic_nss_chains_config", \
576 				0, \
577 				"Restart SAP on dynamic nss chain config")
578 
579 #define CFG_NSS_CHAINS_ALL \
580 	CFG(CFG_NUM_TX_CHAINS_2G) \
581 	CFG(CFG_NUM_TX_CHAINS_5G) \
582 	CFG(CFG_NUM_RX_CHAINS_2G) \
583 	CFG(CFG_NUM_RX_CHAINS_5G) \
584 	CFG(CFG_TX_NSS_5G) \
585 	CFG(CFG_TX_NSS_2G) \
586 	CFG(CFG_RX_NSS_5G) \
587 	CFG(CFG_RX_NSS_2G) \
588 	CFG(CFG_NUM_TX_CHAINS_11b) \
589 	CFG(CFG_NUM_TX_CHAINS_11g) \
590 	CFG(CFG_NUM_TX_CHAINS_11a) \
591 	CFG(CFG_DISABLE_TX_MRC_2G) \
592 	CFG(CFG_DISABLE_RX_MRC_2G) \
593 	CFG(CFG_DISABLE_TX_MRC_5G) \
594 	CFG(CFG_DISABLE_RX_MRC_5G) \
595 	CFG(CFG_ENABLE_DYNAMIC_NSS_CHAIN_CONFIG) \
596 	CFG(CFG_RESTART_SAP_ON_DYNAMIC_NSS_CHAINS_CONFIG)
597 
598 #endif /* __CFG_MLME_NSS_CHAINS */
599 
600