xref: /wlan-driver/qca-wifi-host-cmn/umac/regulatory/core/src/reg_utils.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  *
6  * Permission to use, copy, modify, and/or distribute this software for
7  * any purpose with or without fee is hereby granted, provided that the
8  * above copyright notice and this permission notice appear in all
9  * copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
12  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
14  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
17  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18  * PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 /**
22  * DOC: reg_utils.h
23  * This file provides prototypes for setting and getting regulatory variables.
24  */
25 
26 #ifndef __REG_UTILS_H_
27 #define __REG_UTILS_H_
28 
29 #include <wlan_lmac_if_def.h>
30 
31 #ifdef WLAN_FEATURE_DSRC
32 #define REG_DSRC_START_FREQ channel_map[MIN_DSRC_CHANNEL].center_freq
33 #define REG_DSRC_END_FREQ   channel_map[MAX_DSRC_CHANNEL].center_freq
34 #endif
35 
36 #define REG_ETSI_SRD_START_FREQ 5745
37 #define REG_ETSI_SRD_END_FREQ   5865
38 
39 /**
40  * reg_is_world_ctry_code() - Check if the given country code is WORLD regdomain
41  * @ctry_code: Country code value.
42  *
43  * Return: If country code is WORLD regdomain return true else false
44  */
45 bool reg_is_world_ctry_code(uint16_t ctry_code);
46 
47 #if defined(CONFIG_REG_CLIENT) && defined(CONFIG_CHAN_FREQ_API)
48 /**
49  * reg_chan_has_dfs_attribute_for_freq() - check channel frequency has dfs
50  * attribute or not
51  * @pdev: Pointer to physical dev
52  * @freq: channel frequency.
53  *
54  * This API gets initial dfs attribute flag of the channel frequency from
55  * regdomain
56  *
57  * Return: true if channel frequency is dfs, otherwise false
58  */
59 bool reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
60 					 qdf_freq_t freq);
61 
62 /**
63  * reg_is_passive_or_disable_for_pwrmode() - Check if the given channel is
64  * passive or disabled.
65  * @pdev: Pointer to physical dev
66  * @freq: Channel frequency
67  * @in_6g_pwr_mode: Input 6GHz power mode
68  *
69  * Return: true if channel frequency is passive or disabled, else false.
70  */
71 bool reg_is_passive_or_disable_for_pwrmode(
72 				struct wlan_objmgr_pdev *pdev,
73 				qdf_freq_t freq,
74 				enum supported_6g_pwr_types in_6g_pwr_mode);
75 #else
76 static inline bool
reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev * pdev,qdf_freq_t freq)77 reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
78 				    qdf_freq_t freq)
79 {
80 	return false;
81 }
82 
83 static inline bool
reg_is_passive_or_disable_for_pwrmode(struct wlan_objmgr_pdev * pdev,qdf_freq_t freq,enum supported_6g_pwr_types in_6g_pwr_mode)84 reg_is_passive_or_disable_for_pwrmode(
85 				struct wlan_objmgr_pdev *pdev,
86 				qdf_freq_t freq,
87 				enum supported_6g_pwr_types in_6g_pwr_mode)
88 {
89 	return false;
90 }
91 #endif /* defined(CONFIG_REG_CLIENT) && defined(CONFIG_CHAN_FREQ_API) */
92 
93 #ifdef DISABLE_CHANNEL_LIST
94 /**
95  * reg_disable_cached_channels() - Disable cached channels
96  * @pdev: The physical dev to cache the channels for
97  */
98 QDF_STATUS reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev);
99 /**
100  * reg_restore_cached_channels() - Restore disabled cached channels
101  * @pdev: The physical dev to cache the channels for
102  */
103 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev);
104 #else
105 static inline
reg_restore_cached_channels(struct wlan_objmgr_pdev * pdev)106 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
107 {
108 	return QDF_STATUS_SUCCESS;
109 }
110 
111 static inline
reg_disable_cached_channels(struct wlan_objmgr_pdev * pdev)112 QDF_STATUS reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev)
113 {
114 	return QDF_STATUS_SUCCESS;
115 }
116 #endif /* DISABLE_CHANNEL_LIST */
117 
118 #if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_FREQ_API)
119 /**
120  * reg_cache_channel_freq_state() - Cache the current state of the channels
121  * based on the channel center frequency
122  * @pdev: The physical dev to cache the channels for
123  * @channel_list: List of the channels for which states needs to be cached
124  * @num_channels: Number of channels in the list
125  *
126  */
127 QDF_STATUS reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
128 					uint32_t *channel_list,
129 					uint32_t num_channels);
130 #else
131 static inline
reg_cache_channel_freq_state(struct wlan_objmgr_pdev * pdev,uint32_t * channel_list,uint32_t num_channels)132 QDF_STATUS reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
133 					uint32_t *channel_list,
134 					uint32_t num_channels)
135 {
136 	return QDF_STATUS_SUCCESS;
137 }
138 #endif /* defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_FREQ_API) */
139 
140 #ifdef CONFIG_REG_CLIENT
141 /**
142  * reg_get_keep_6ghz_sta_cli_connection() - Get keep 6ghz sta cli
143  *                                               connection flag
144  * @pdev: The physical pdev to get keep_6ghz_sta_cli_connection
145  *
146  * Return: Return true if keep_6ghz_sta_cli_connection set else return false
147  */
148 bool reg_get_keep_6ghz_sta_cli_connection(struct wlan_objmgr_pdev *pdev);
149 
150 /**
151  * reg_set_keep_6ghz_sta_cli_connection() - Set keep 6ghz sta cli connection
152  *                                          flag
153  * @pdev: The physical pdev to get keep_6ghz_sta_cli_connection
154  * @keep_6ghz_sta_cli_connection: Parameter to set
155  *
156  * Return: QDF_STATUS
157  */
158 QDF_STATUS reg_set_keep_6ghz_sta_cli_connection(
159 					struct wlan_objmgr_pdev *pdev,
160 					bool keep_6ghz_sta_cli_connection);
161 
162 /**
163  * reg_set_band() - Sets the band information for the PDEV
164  * @pdev: The physical dev to set the band for
165  * @band_bitmap: The set band parameters to configure for the physical device
166  *
167  * Return: QDF_STATUS
168  */
169 QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev, uint32_t band_bitmap);
170 
171 /**
172  * reg_get_band() - Get the band information for the PDEV
173  * @pdev: The physical dev to get the band for
174  * @band_bitmap: The band parameters of the physical device
175  *
176  * Return: QDF_STATUS
177  */
178 QDF_STATUS reg_get_band(struct wlan_objmgr_pdev *pdev, uint32_t *band_bitmap);
179 
180 /**
181  * reg_set_fcc_constraint() - Apply fcc constraints on channels 12/13
182  * @pdev: The physical dev to set
183  * @fcc_constraint: true to set FCC constraint
184  *
185  * This function reduces the transmit power on channels 12 and 13, to comply
186  * with FCC regulations in the USA.
187  *
188  * Return: QDF_STATUS
189  */
190 QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
191 				  bool fcc_constraint);
192 
193 /**
194  * reg_get_fcc_constraint() - Check FCC constraint on given frequency
195  * @pdev: physical dev to get
196  * @freq: frequency to be checked
197  *
198  * Return: If FCC constraint is applied on given frequency return true
199  *	   else return false.
200  */
201 bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq);
202 
203 /**
204  * reg_get_country_max_allowed_bw() - get max allowed bw as per all reg rules
205  * of client
206  * @pdev: physical dev to get
207  *
208  * Return: max allowed channel width for current country code
209  */
210 uint32_t reg_get_country_max_allowed_bw(struct wlan_objmgr_pdev *pdev);
211 
212 /**
213  * reg_is_fcc_constraint_set() - Check if FCC constraint set
214  * @pdev: physical dev to get
215  *
216  * Return: True if FCC constraint is set, else false.
217  */
218 bool reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev);
219 
220 /**
221  * reg_is_6ghz_band_set - Check if 6 GHz band set
222  * @pdev: Pointer to pdev
223  *
224  * Return: True if 6 GHz band set else return flase
225  */
226 bool reg_is_6ghz_band_set(struct wlan_objmgr_pdev *pdev);
227 
228 /**
229  * reg_is_user_country_set_allowed() - Checks whether user country is allowed
230  * to set
231  * @psoc: psoc ptr
232  *
233  * Return: bool
234  */
235 bool reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc);
236 
237 /**
238  * reg_read_current_country() - Get the current regulatory country
239  * @psoc: The physical SoC to get current country from
240  * @country_code: the buffer to populate the country code into
241  *
242  * Return: QDF_STATUS
243  */
244 QDF_STATUS reg_read_current_country(struct wlan_objmgr_psoc *psoc,
245 				    uint8_t *country_code);
246 
247 /**
248  * reg_set_default_country() - Set the default regulatory country
249  * @psoc: The physical SoC to set default country for
250  * @country: The country code to configure
251  *
252  * Return: QDF_STATUS
253  */
254 QDF_STATUS reg_set_default_country(struct wlan_objmgr_psoc *psoc,
255 				   uint8_t *country);
256 
257 /**
258  * reg_is_world_alpha2 - is reg world mode
259  * @alpha2: country code pointer
260  *
261  * Return: true or false
262  */
263 bool reg_is_world_alpha2(uint8_t *alpha2);
264 
265 /**
266  * reg_is_us_alpha2 - is US country code
267  * @alpha2: country code pointer
268  *
269  * Return: true or false
270  */
271 bool reg_is_us_alpha2(uint8_t *alpha2);
272 
273 /**
274  * reg_is_etsi_alpha2 - is country code in EU
275  * @alpha2: country code pointer
276  *
277  * Return: true or false
278  */
279 bool reg_is_etsi_alpha2(uint8_t *alpha2);
280 
281 /**
282  * reg_ctry_support_vlp - Does country code supports VLP
283  * @alpha2: country code pointer
284  *
285  * Return: true or false
286  */
287 bool reg_ctry_support_vlp(uint8_t *alpha2);
288 
289 /**
290  * reg_set_country() - Set the current regulatory country
291  * @pdev: pdev device for country information
292  * @country: country value
293  *
294  * Return: QDF_STATUS
295  */
296 QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev, uint8_t *country);
297 
298 /**
299  * reg_reset_country() - Reset the regulatory country to default
300  * @psoc: The physical SoC to reset country for
301  *
302  * Return: QDF_STATUS
303  */
304 QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc);
305 
306 /**
307  * reg_get_domain_from_country_code() - Get regdomain from country code
308  * @reg_domain_ptr: Pointer to save regdomain
309  * @country_alpha2: country string
310  * @source: Country code source
311  *
312  * Return: QDF_STATUS
313  */
314 QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
315 					    const uint8_t *country_alpha2,
316 					    enum country_src source);
317 
318 #ifdef CONFIG_REG_CLIENT
319 /**
320  * reg_get_best_6g_power_type() - Return best power type for 6 GHz connection
321  * @psoc: pointer to psoc
322  * @pdev: pointer to pdev
323  * @pwr_type_6g: pointer to 6G power type
324  * @ap_pwr_type: AP's power type as advertised in HE ops IE
325  * @chan_freq: Connection channel frequency
326  *
327  * This function computes best power type for 6 GHz connection.
328  * SP power type is selected only if AP advertises SP and client supports SP.
329  * LPI power type is selected only if AP advertises LPI and client supports LPI.
330  * VLP power type is selected for the below cases,
331  * a) AP advertises VLP and client supports VLP.
332  * b) AP advertises SP but client doesn't support SP but supports VLP.
333  * c) AP advertises LPI but client doesn't support LPI but supports VLP.
334  *
335  * Return: QDF_STATUS
336  */
337 QDF_STATUS
338 reg_get_best_6g_power_type(struct wlan_objmgr_psoc *psoc,
339 			   struct wlan_objmgr_pdev *pdev,
340 			   enum reg_6g_ap_type *pwr_type_6g,
341 			   enum reg_6g_ap_type ap_pwr_type,
342 			   uint32_t chan_freq);
343 #endif
344 
345 /**
346  * reg_set_config_vars() - set configuration variables
347  * @psoc: psoc ptr
348  * @config_vars: configuration struct
349  *
350  * Return: QDF_STATUS
351  */
352 QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
353 			       struct reg_config_vars config_vars);
354 
355 /**
356  * reg_program_mas_chan_list() - Program the master channel list
357  * @psoc: Pointer to psoc structure
358  * @reg_channels: Pointer to reg channels
359  * @alpha2: country string
360  * @dfs_region: DFS region
361  */
362 void reg_program_mas_chan_list(struct wlan_objmgr_psoc *psoc,
363 			       struct regulatory_channel *reg_channels,
364 			       uint8_t *alpha2, enum dfs_reg dfs_region);
365 
366 /**
367  * reg_get_cc_and_src() - Get country string and country source
368  * @psoc: Pointer to psoc
369  * @alpha2: Pointer to save country string
370  *
371  * Return: country_src
372  */
373 enum country_src reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,
374 				    uint8_t *alpha2);
375 
376 /**
377  * reg_reset_ctry_pending_hints() - Reset all country pending hints
378  * @soc_reg: regulatory private object
379  *
380  * Return: None
381  */
382 void
383 reg_reset_ctry_pending_hints(struct wlan_regulatory_psoc_priv_obj *soc_reg);
384 
385 /**
386  * reg_set_curr_country() - Set current country update
387  * @soc_reg: regulatory private object
388  * @regulat_info: regulatory info from firmware
389  * @tx_ops: send operations for regulatory component
390  *
391  * During SSR or restart of wlan modules after interface change timer phase,
392  * this function is used to send the recent user/11d country code to firmware.
393  *
394  * Return: QDF_STATUS_SUCCESS if correct country is configured
395  * else return failure
396  * error code.
397  */
398 QDF_STATUS reg_set_curr_country(
399 		struct wlan_regulatory_psoc_priv_obj *soc_reg,
400 		struct cur_regulatory_info *regulat_info,
401 		struct wlan_lmac_if_reg_tx_ops *tx_ops);
402 
403 /**
404  * reg_ignore_default_country() - Ignore default country update
405  * @soc_reg: regulatory private object
406  * @regulat_info: regulatory info from firmware
407  *
408  * During SSR or restart of wlan modules after interface change timer phase,
409  * this function is used to ignore default country code from firmware.
410  *
411  * Return: If default country needs to be ignored return true else false.
412  */
413 bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
414 				struct cur_regulatory_info *regulat_info);
415 
416 #else
reg_read_current_country(struct wlan_objmgr_psoc * psoc,uint8_t * country_code)417 static inline QDF_STATUS reg_read_current_country(struct wlan_objmgr_psoc *psoc,
418 						  uint8_t *country_code)
419 {
420 	return QDF_STATUS_SUCCESS;
421 }
422 
reg_is_world_alpha2(uint8_t * alpha2)423 static inline bool reg_is_world_alpha2(uint8_t *alpha2)
424 {
425 	return false;
426 }
427 
reg_ctry_support_vlp(uint8_t * alpha2)428 static inline bool reg_ctry_support_vlp(uint8_t *alpha2)
429 {
430 	return false;
431 }
432 
reg_is_us_alpha2(uint8_t * alpha2)433 static inline bool reg_is_us_alpha2(uint8_t *alpha2)
434 {
435 	return false;
436 }
437 
reg_is_etsi_alpha2(uint8_t * alpha2)438 static inline bool reg_is_etsi_alpha2(uint8_t *alpha2)
439 {
440 	return false;
441 }
442 
reg_set_country(struct wlan_objmgr_pdev * pdev,uint8_t * country)443 static inline QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev,
444 					 uint8_t *country)
445 {
446 	return QDF_STATUS_SUCCESS;
447 }
448 
reg_reset_country(struct wlan_objmgr_psoc * psoc)449 static inline QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc)
450 {
451 	return QDF_STATUS_SUCCESS;
452 }
453 
reg_get_domain_from_country_code(v_REGDOMAIN_t * reg_domain_ptr,const uint8_t * country_alpha2,enum country_src source)454 static inline QDF_STATUS reg_get_domain_from_country_code(
455 	v_REGDOMAIN_t *reg_domain_ptr, const uint8_t *country_alpha2,
456 	enum country_src source)
457 {
458 	return QDF_STATUS_SUCCESS;
459 }
460 
reg_set_config_vars(struct wlan_objmgr_psoc * psoc,struct reg_config_vars config_vars)461 static inline QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
462 					     struct reg_config_vars config_vars)
463 {
464 	return QDF_STATUS_SUCCESS;
465 }
466 
reg_program_mas_chan_list(struct wlan_objmgr_psoc * psoc,struct regulatory_channel * reg_channels,uint8_t * alpha2,enum dfs_reg dfs_region)467 static inline void reg_program_mas_chan_list(
468 	struct wlan_objmgr_psoc *psoc,
469 	struct regulatory_channel *reg_channels,
470 	uint8_t *alpha2, enum dfs_reg dfs_region)
471 {
472 }
473 
reg_get_cc_and_src(struct wlan_objmgr_psoc * psoc,uint8_t * alpha2)474 static inline enum country_src reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,
475 						  uint8_t *alpha2)
476 {
477 		return SOURCE_UNKNOWN;
478 }
479 
480 static inline void
reg_reset_ctry_pending_hints(struct wlan_regulatory_psoc_priv_obj * soc_reg)481 reg_reset_ctry_pending_hints(struct wlan_regulatory_psoc_priv_obj *soc_reg)
482 {
483 }
484 
reg_set_curr_country(struct wlan_regulatory_psoc_priv_obj * soc_reg,struct cur_regulatory_info * regulat_info,struct wlan_lmac_if_reg_tx_ops * tx_ops)485 static inline QDF_STATUS reg_set_curr_country(
486 		struct wlan_regulatory_psoc_priv_obj *soc_reg,
487 		struct cur_regulatory_info *regulat_info,
488 		struct wlan_lmac_if_reg_tx_ops *tx_ops)
489 {
490 	return QDF_STATUS_SUCCESS;
491 }
492 
493 static inline
reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj * soc_reg,struct cur_regulatory_info * regulat_info)494 bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
495 				struct cur_regulatory_info *regulat_info)
496 {
497 	return false;
498 }
499 
500 static inline
reg_set_fcc_constraint(struct wlan_objmgr_pdev * pdev,bool fcc_constraint)501 QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
502 				  bool fcc_constraint)
503 {
504 	return QDF_STATUS_SUCCESS;
505 }
506 
507 static inline
reg_get_fcc_constraint(struct wlan_objmgr_pdev * pdev,uint32_t freq)508 bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq)
509 {
510 	return false;
511 }
512 
513 static inline
reg_is_6ghz_band_set(struct wlan_objmgr_pdev * pdev)514 bool reg_is_6ghz_band_set(struct wlan_objmgr_pdev *pdev)
515 {
516 	return true;
517 }
518 
519 static inline
reg_is_user_country_set_allowed(struct wlan_objmgr_psoc * psoc)520 bool reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc)
521 {
522 	return true;
523 }
524 
525 static inline
reg_get_country_max_allowed_bw(struct wlan_objmgr_pdev * pdev)526 uint32_t reg_get_country_max_allowed_bw(struct wlan_objmgr_pdev *pdev)
527 {
528 	return 0;
529 }
530 
531 static inline
reg_get_keep_6ghz_sta_cli_connection(struct wlan_objmgr_pdev * pdev)532 bool reg_get_keep_6ghz_sta_cli_connection(struct wlan_objmgr_pdev *pdev)
533 {
534 	return false;
535 }
536 
537 static inline
reg_set_keep_6ghz_sta_cli_connection(struct wlan_objmgr_pdev * pdev,bool keep_6ghz_sta_cli_connection)538 QDF_STATUS reg_set_keep_6ghz_sta_cli_connection(struct wlan_objmgr_pdev *pdev,
539 					bool keep_6ghz_sta_cli_connection)
540 {
541 	return QDF_STATUS_SUCCESS;
542 }
543 #endif /* CONFIG_REG_CLIENT */
544 
545 #if defined(WLAN_FEATURE_DSRC) && defined(CONFIG_REG_CLIENT)
546 /**
547  * reg_is_dsrc_freq() - Checks the channel frequency is DSRC or not
548  * @freq: Channel center frequency
549  *
550  * Return: true or false
551  */
552 #ifdef CONFIG_CHAN_FREQ_API
553 bool reg_is_dsrc_freq(qdf_freq_t freq);
554 #endif /* CONFIG_CHAN_FREQ_API*/
555 
reg_is_etsi_regdmn(struct wlan_objmgr_pdev * pdev)556 static inline bool reg_is_etsi_regdmn(struct wlan_objmgr_pdev *pdev)
557 {
558 	return false;
559 }
560 
561 /**
562  * reg_is_etsi_srd_chan_for_freq() - Checks the channel for ETSI13 srd ch
563  * frequency or not
564  * @freq: Channel center frequency
565  * @pdev: pdev ptr
566  *
567  * Return: true or false
568  */
569 static inline bool
reg_is_etsi_srd_chan_for_freq(struct wlan_objmgr_pdev * pdev,uint16_t freq)570 reg_is_etsi_srd_chan_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq)
571 {
572 	return false;
573 }
574 
575 static inline bool
reg_is_etsi_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev * pdev)576 reg_is_etsi_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev)
577 {
578 	return true;
579 }
580 #elif defined(CONFIG_REG_CLIENT)
reg_is_dsrc_freq(qdf_freq_t freq)581 static inline bool reg_is_dsrc_freq(qdf_freq_t freq)
582 {
583 	return false;
584 }
585 
586 #ifdef CONFIG_CHAN_FREQ_API
587 bool reg_is_etsi_srd_chan_for_freq(struct wlan_objmgr_pdev
588 				   *pdev, uint16_t freq);
589 #endif /*CONFIG_CHAN_FREQ_API */
590 
591 /**
592  * reg_is_etsi_regdmn() - Check if the current reg domain is
593  * ETSI13/ETSI18/ETSI20 or not
594  * @pdev: pdev ptr
595  *
596  * Return: true or false
597  */
598 bool reg_is_etsi_regdmn(struct wlan_objmgr_pdev *pdev);
599 
600 /**
601  * reg_is_etsi_srd_chan_allowed_master_mode() - Checks if regdmn is ETSI13
602  * and SRD channels are allowed in master mode or not.
603  *
604  * @pdev: pdev ptr
605  *
606  * Return: true or false
607  */
608 bool reg_is_etsi_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev);
609 #else
reg_is_dsrc_freq(qdf_freq_t freq)610 static inline bool reg_is_dsrc_freq(qdf_freq_t freq)
611 {
612 	return false;
613 }
614 
615 static inline
reg_is_etsi_srd_chan_for_freq(struct wlan_objmgr_pdev * pdev,uint16_t freq)616 bool reg_is_etsi_srd_chan_for_freq(struct wlan_objmgr_pdev *pdev,
617 				   uint16_t freq)
618 {
619 	return false;
620 }
621 
reg_is_etsi_regdmn(struct wlan_objmgr_pdev * pdev)622 static inline bool reg_is_etsi_regdmn(struct wlan_objmgr_pdev *pdev)
623 {
624 	return false;
625 }
626 
627 static inline bool
reg_is_etsi_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev * pdev)628 reg_is_etsi_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev)
629 {
630 	return false;
631 }
632 
633 #endif
634 
635 #if defined(CONFIG_REG_CLIENT) && defined(CONFIG_BAND_6GHZ)
636 /**
637  * reg_get_6ghz_cli_pwr_type_per_ap_pwr_type() - Find client power type
638  *                                               corresponding to AP power type
639  * @pdev: Pointer to pdev
640  * @ap_pwr_type: 6 GHz AP power type
641  * @cli_pwr_type: To be filled 6 GHz client power type pointer
642  *
643  * Return: QDF_STATUS
644  */
645 QDF_STATUS
646 reg_get_6ghz_cli_pwr_type_per_ap_pwr_type(
647 				struct wlan_objmgr_pdev *pdev,
648 				enum reg_6g_ap_type ap_pwr_type,
649 				enum supported_6g_pwr_types *cli_pwr_type);
650 #endif
651 #endif
652