xref: /wlan-driver/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_power.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 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_POWER_H
25 #define __CFG_MLME_POWER_H
26 
27 /*
28  * <cfg>
29  * max_tx_power_24 - max tx power allowed for 2.4 ghz
30  * @Min: 0 minimum length of tx power
31  * @Max: default data length of tx power in string format
32  * @Default: 1, 14, 20
33  *
34  * This ini contains the string in the form of first_channel number,
35  * number of channels and max tx power triplets
36  */
37 #define CFG_MAX_TX_POWER_2_4_DATA "1, 14, 20"
38 #define CFG_MAX_TX_POWER_2_4 CFG_STRING( \
39 		"max_tx_power_24", \
40 		0, \
41 		sizeof(CFG_MAX_TX_POWER_2_4_DATA) - 1, \
42 		CFG_MAX_TX_POWER_2_4_DATA, \
43 		"max tx power 24")
44 
45 /*
46  * <cfg>
47  * max_tx_power_5 - max tx power allowed for 5 ghz
48  * @Min: 0 minimum length of tx power
49  * @Max: default data length of tx power in string format
50  * @Default: 36, 126, 20
51  *
52  * This ini contains the string in the form of first_channel number,
53  * number of channels and max tx power triplets
54  */
55 #define CFG_MAX_TX_POWER_5_DATA "36, 126, 20"
56 #define CFG_MAX_TX_POWER_5 CFG_STRING( \
57 		"max_tx_power_5", \
58 		0, \
59 		sizeof(CFG_MAX_TX_POWER_5_DATA) - 1, \
60 		CFG_MAX_TX_POWER_5_DATA, \
61 		"max tx power 5")
62 
63 /*
64  * <ini>
65  * gPowerUsage - power usage name
66  * @Min: "Min" - minimum power usage
67  * @Max: "Max" - maximum power usage
68  * @Default: "Mod"
69  *
70  * Usage: Internal/External
71  *
72  * </ini>
73  */
74 
75 #define CFG_POWER_USAGE CFG_INI_STRING( \
76 		"gPowerUsage", \
77 		0, \
78 		3, \
79 		"Mod", \
80 		"power usage")
81 /*
82  * <ini>
83  * TxPower2g - Limit power in case of 2.4ghz
84  * @Min: 0
85  * @Max: 30
86  * @Default: 30
87  *
88  * Usage: Internal/External
89  *
90  * </ini>
91  */
92 
93 #define CFG_SET_TXPOWER_LIMIT2G CFG_INI_UINT( \
94 			"TxPower2g", \
95 			0, \
96 			30, \
97 			30, \
98 			CFG_VALUE_OR_DEFAULT, \
99 			"power limit 2g")
100 /*
101  * <ini>
102  * TxPower5g - Limit power in case of 5ghz
103  * @Min: 0
104  * @Max: 30
105  * @Default: 30
106  *
107  * Usage: Internal/External
108  *
109  * </ini>
110  */
111 
112 #define CFG_SET_TXPOWER_LIMIT5G CFG_INI_UINT( \
113 			"TxPower5g", \
114 			0, \
115 			30, \
116 			30, \
117 			CFG_VALUE_OR_DEFAULT, \
118 			"power limit 5g")
119 
120 /*
121  * <cfg>
122  * current_tx_power_level - current tx power level
123  * @Min: 0
124  * @Max: 128
125  * @Default: 27
126  */
127 #define CFG_CURRENT_TX_POWER_LEVEL CFG_UINT( \
128 		"current_tx_power_level", \
129 		0, \
130 		128, \
131 		27, \
132 		CFG_VALUE_OR_DEFAULT, \
133 		"current tx power level")
134 
135 /*
136  * <cfg>
137  * local_power_constraint - local power constraint
138  * @Min: 0
139  * @Max: 255
140  * @Default: 0
141  */
142 #define CFG_LOCAL_POWER_CONSTRAINT CFG_UINT( \
143 		"local_power_constraint", \
144 		0, \
145 		255, \
146 		0, \
147 		CFG_VALUE_OR_DEFAULT, \
148 		"local power constraint")
149 
150 /*
151  * <ini>
152  * skip_tpe_consideration - Skip TPE IE value in tx power calculation for
153  * 2G/5G bands
154  * @Min: 0
155  * @Max: 1
156  * @Default: 1
157  *
158  * This ini is to determine if the TPE IE should be considered in the Tx power
159  * calculation. If the ini is set, host will consider TPE IE in case of 6GHz
160  * only (skip over in 2GHz or 5GHz case). If the ini is not set, honor the TPE
161  * IE values in all bands.
162  *
163  * Related: None
164  *
165  * Supported Feature: Transmit power calculation (TPC)
166  *
167  * Usage: External
168  *
169  * </ini>
170  */
171 #define CFG_SKIP_TPE_CONSIDERATION CFG_INI_BOOL("skip_tpe_consideration", \
172 						true, \
173 						"consider TPE IE in tx power")
174 
175 #define CFG_MLME_POWER_ALL \
176 	CFG(CFG_MAX_TX_POWER_2_4) \
177 	CFG(CFG_MAX_TX_POWER_5) \
178 	CFG(CFG_POWER_USAGE) \
179 	CFG(CFG_SET_TXPOWER_LIMIT2G) \
180 	CFG(CFG_SET_TXPOWER_LIMIT5G) \
181 	CFG(CFG_CURRENT_TX_POWER_LEVEL) \
182 	CFG(CFG_LOCAL_POWER_CONSTRAINT) \
183 	CFG(CFG_SKIP_TPE_CONSIDERATION)
184 
185 #endif /* __CFG_MLME_POWER_H */
186