xref: /wlan-dirver/qca-wifi-host-cmn/umac/regulatory/dispatcher/src/wlan_reg_services_api.c (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 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  * @file wlan_reg_services_api.c
23  * @brief contains regulatory service functions
24  */
25 
26 
27 #include <qdf_status.h>
28 #include <qdf_types.h>
29 #include <qdf_module.h>
30 #include <wlan_cmn.h>
31 #include <reg_services_public_struct.h>
32 #include <wlan_reg_services_api.h>
33 #include <wlan_objmgr_psoc_obj.h>
34 #include <wlan_objmgr_pdev_obj.h>
35 #include "../../core/src/reg_priv_objs.h"
36 #include "../../core/src/reg_utils.h"
37 #include "../../core/src/reg_services_common.h"
38 #include "../../core/src/reg_db.h"
39 #include "../../core/src/reg_db_parser.h"
40 #include <../../core/src/reg_build_chan_list.h>
41 #include <../../core/src/reg_opclass.h>
42 #include <../../core/src/reg_callbacks.h>
43 #include <../../core/src/reg_offload_11d_scan.h>
44 #include <wlan_objmgr_global_obj.h>
45 
46 /**
47  * wlan_reg_read_default_country() - Read the default country for the regdomain
48  * @country: pointer to the country code.
49  *
50  * Return: None
51  */
52 QDF_STATUS wlan_reg_read_default_country(struct wlan_objmgr_psoc *psoc,
53 					 uint8_t *country)
54 {
55 	/*
56 	 * Get the default country information
57 	 */
58 	return reg_read_default_country(psoc, country);
59 }
60 
61 QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
62 					 uint8_t *country)
63 {
64 	/*
65 	 * Get the current country information
66 	 */
67 	return reg_read_current_country(psoc, country);
68 }
69 
70 QDF_STATUS wlan_reg_get_max_5g_bw_from_country_code(
71 					struct wlan_objmgr_pdev *pdev,
72 					uint16_t cc,
73 					uint16_t *max_bw_5g)
74 {
75 	/*
76 	 * Get the max 5G bandwidth from country code
77 	 */
78 	return reg_get_max_5g_bw_from_country_code(pdev, cc, max_bw_5g);
79 }
80 
81 QDF_STATUS wlan_reg_get_max_5g_bw_from_regdomain(
82 					struct wlan_objmgr_pdev *pdev,
83 					uint16_t regdmn,
84 					uint16_t *max_bw_5g)
85 {
86 	/*
87 	 * Get the max 5G bandwidth from regdomain pair value
88 	 */
89 	return reg_get_max_5g_bw_from_regdomain(pdev, regdmn, max_bw_5g);
90 }
91 
92 QDF_STATUS wlan_reg_get_max_bw_5G_for_fo(struct wlan_objmgr_pdev *pdev)
93 {
94 	return reg_get_max_bw_5G_for_fo(pdev);
95 }
96 
97 bool wlan_reg_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc)
98 {
99 	return reg_is_regdb_offloaded(psoc);
100 }
101 
102 QDF_STATUS wlan_reg_get_pwrmode_chan_list(struct wlan_objmgr_pdev *pdev,
103 					  struct regulatory_channel *chan_list,
104 					  enum supported_6g_pwr_types
105 					  in_6g_pwr_mode)
106 {
107 	return reg_get_pwrmode_chan_list(pdev, chan_list, in_6g_pwr_mode);
108 }
109 
110 qdf_export_symbol(wlan_reg_get_pwrmode_chan_list);
111 
112 #ifdef CONFIG_REG_CLIENT
113 QDF_STATUS
114 wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
115 				    uint8_t *ap_ctry, uint8_t *sta_ctry,
116 				    enum reg_6g_ap_type *pwr_type_6g,
117 				    bool *ctry_code_match,
118 				    enum reg_6g_ap_type ap_pwr_type)
119 {
120 	return reg_get_6g_power_type_for_ctry(psoc, ap_ctry, sta_ctry,
121 					      pwr_type_6g, ctry_code_match,
122 					      ap_pwr_type);
123 }
124 #endif
125 
126 /**
127  * wlan_reg_get_dfs_region () - Get the current dfs region
128  * @dfs_reg: pointer to dfs region
129  *
130  * Return: Status
131  */
132 QDF_STATUS wlan_reg_get_dfs_region(struct wlan_objmgr_pdev *pdev,
133 			     enum dfs_reg *dfs_reg)
134 {
135 	/*
136 	 * Get the current dfs region
137 	 */
138 	reg_get_current_dfs_region(pdev, dfs_reg);
139 
140 	return QDF_STATUS_SUCCESS;
141 }
142 
143 bool wlan_reg_is_chan_disabled_and_not_nol(struct regulatory_channel *chan)
144 {
145 	return reg_is_chan_disabled_and_not_nol(chan);
146 }
147 
148 QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
149 		struct regulatory_channel *chan_list)
150 {
151 	return reg_get_current_chan_list(pdev, chan_list);
152 }
153 
154 qdf_export_symbol(wlan_reg_get_current_chan_list);
155 
156 bool wlan_reg_is_freq_enabled(struct wlan_objmgr_pdev *pdev,
157 			      qdf_freq_t freq,
158 			      enum supported_6g_pwr_types in_6g_pwr_mode)
159 {
160 	return reg_is_freq_enabled(pdev, freq, in_6g_pwr_mode);
161 }
162 
163 bool wlan_reg_is_freq_idx_enabled(struct wlan_objmgr_pdev *pdev,
164 				  enum channel_enum freq_idx,
165 				  enum supported_6g_pwr_types in_6g_pwr_mode)
166 {
167 	return reg_is_freq_idx_enabled(pdev, freq_idx, in_6g_pwr_mode);
168 }
169 
170 #ifdef CONFIG_REG_CLIENT
171 QDF_STATUS wlan_reg_get_secondary_current_chan_list(
172 					struct wlan_objmgr_pdev *pdev,
173 					struct regulatory_channel *chan_list)
174 {
175 	return reg_get_secondary_current_chan_list(pdev, chan_list);
176 }
177 #endif
178 
179 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
180 QDF_STATUS wlan_reg_get_6g_afc_chan_list(struct wlan_objmgr_pdev *pdev,
181 					 struct regulatory_channel *chan_list)
182 {
183 	return reg_get_6g_afc_chan_list(pdev, chan_list);
184 }
185 
186 qdf_export_symbol(wlan_reg_get_6g_afc_chan_list);
187 
188 QDF_STATUS
189 wlan_reg_get_6g_afc_mas_chan_list(struct wlan_objmgr_pdev *pdev,
190 				  struct regulatory_channel *chan_list)
191 {
192 	return reg_get_6g_afc_mas_chan_list(pdev, chan_list);
193 }
194 
195 qdf_export_symbol(wlan_reg_get_6g_afc_mas_chan_list);
196 #endif
197 
198 /**
199  * wlan_reg_get_bw_value() - give bandwidth value
200  * bw: bandwidth enum
201  *
202  * Return: uint16_t
203  */
204 uint16_t wlan_reg_get_bw_value(enum phy_ch_width bw)
205 {
206 	return reg_get_bw_value(bw);
207 }
208 
209 qdf_export_symbol(wlan_reg_get_bw_value);
210 
211 /**
212  * wlan_reg_set_dfs_region () - Get the current dfs region
213  * @dfs_reg: pointer to dfs region
214  *
215  * Return: None
216  */
217 void wlan_reg_set_dfs_region(struct wlan_objmgr_pdev *pdev,
218 			     enum dfs_reg dfs_reg)
219 {
220 	reg_set_dfs_region(pdev, dfs_reg);
221 }
222 
223 QDF_STATUS wlan_reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
224 		const uint8_t *country_alpha2, enum country_src source)
225 {
226 
227 	return reg_get_domain_from_country_code(reg_domain_ptr,
228 			country_alpha2, source);
229 }
230 
231 
232 uint16_t wlan_reg_dmn_get_opclass_from_channel(uint8_t *country,
233 					       uint8_t channel,
234 					       uint8_t offset)
235 {
236 	return reg_dmn_get_opclass_from_channel(country, channel,
237 						offset);
238 }
239 
240 uint8_t wlan_reg_get_band_cap_from_op_class(const uint8_t *country,
241 					    uint8_t num_of_opclass,
242 					    const uint8_t *opclass)
243 {
244 	return reg_get_band_cap_from_op_class(country,
245 					      num_of_opclass, opclass);
246 }
247 
248 uint8_t wlan_reg_get_opclass_from_freq_width(uint8_t *country,
249 					     qdf_freq_t freq,
250 					     uint16_t ch_width,
251 					     uint16_t behav_limit)
252 {
253 	return reg_dmn_get_opclass_from_freq_width(country, freq, ch_width,
254 						   behav_limit);
255 }
256 
257 void wlan_reg_dmn_print_channels_in_opclass(uint8_t *country,
258 					    uint8_t opclass)
259 {
260 	reg_dmn_print_channels_in_opclass(country, opclass);
261 }
262 
263 uint16_t wlan_reg_dmn_get_chanwidth_from_opclass(uint8_t *country,
264 						 uint8_t channel,
265 						 uint8_t opclass)
266 {
267 	return reg_dmn_get_chanwidth_from_opclass(country, channel,
268 						  opclass);
269 }
270 
271 uint16_t wlan_reg_dmn_get_chanwidth_from_opclass_auto(uint8_t *country,
272 						      uint8_t channel,
273 						      uint8_t opclass)
274 {
275 	return reg_dmn_get_chanwidth_from_opclass_auto(country, channel,
276 						       opclass);
277 }
278 
279 uint16_t wlan_reg_dmn_set_curr_opclasses(uint8_t num_classes,
280 					 uint8_t *class)
281 {
282 	return reg_dmn_set_curr_opclasses(num_classes, class);
283 }
284 
285 uint16_t wlan_reg_dmn_get_curr_opclasses(uint8_t *num_classes,
286 					 uint8_t *class)
287 {
288 	return reg_dmn_get_curr_opclasses(num_classes, class);
289 }
290 
291 QDF_STATUS
292 wlan_reg_get_opclass_details(struct wlan_objmgr_pdev *pdev,
293 			     struct regdmn_ap_cap_opclass_t *reg_ap_cap,
294 			     uint8_t *n_opclasses,
295 			     uint8_t max_supp_op_class,
296 			     bool global_tbl_lookup)
297 {
298 	return reg_get_opclass_details(pdev, reg_ap_cap, n_opclasses,
299 				       max_supp_op_class,
300 				       global_tbl_lookup);
301 }
302 
303 QDF_STATUS
304 wlan_reg_get_opclass_for_cur_hwmode(struct wlan_objmgr_pdev *pdev,
305 				    struct regdmn_ap_cap_opclass_t *reg_ap_cap,
306 				    uint8_t *n_opclasses,
307 				    uint8_t max_supp_op_class,
308 				    bool global_tbl_lookup,
309 				    enum phy_ch_width max_chwidth,
310 				    bool is_80p80_supp)
311 {
312 	return reg_get_opclass_for_cur_hwmode(pdev, reg_ap_cap, n_opclasses,
313 					      max_supp_op_class,
314 					      global_tbl_lookup,
315 					      max_chwidth,
316 					      is_80p80_supp);
317 }
318 
319 enum country_src wlan_reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,
320 					 uint8_t *alpha)
321 {
322 	return reg_get_cc_and_src(psoc, alpha);
323 }
324 
325 QDF_STATUS wlan_regulatory_init(void)
326 {
327 	QDF_STATUS status;
328 
329 	status = wlan_objmgr_register_psoc_create_handler(
330 		WLAN_UMAC_COMP_REGULATORY,
331 		wlan_regulatory_psoc_obj_created_notification, NULL);
332 	if (status != QDF_STATUS_SUCCESS) {
333 		reg_err("failed to register reg psoc obj create handler");
334 		return status;
335 	}
336 
337 	status = wlan_objmgr_register_psoc_destroy_handler(
338 		WLAN_UMAC_COMP_REGULATORY,
339 		wlan_regulatory_psoc_obj_destroyed_notification, NULL);
340 	if (status != QDF_STATUS_SUCCESS) {
341 		reg_err("failed to register reg psoc obj create handler");
342 		goto unreg_psoc_create;
343 	}
344 
345 	status = wlan_objmgr_register_pdev_create_handler(
346 		WLAN_UMAC_COMP_REGULATORY,
347 		wlan_regulatory_pdev_obj_created_notification, NULL);
348 	if (status != QDF_STATUS_SUCCESS) {
349 		reg_err("failed to register reg psoc obj create handler");
350 		goto unreg_psoc_destroy;
351 	}
352 
353 	status = wlan_objmgr_register_pdev_destroy_handler(
354 		WLAN_UMAC_COMP_REGULATORY,
355 		wlan_regulatory_pdev_obj_destroyed_notification, NULL);
356 	if (status != QDF_STATUS_SUCCESS) {
357 		reg_err("failed to register reg psoc obj create handler");
358 		goto unreg_pdev_create;
359 	}
360 	channel_map = channel_map_global;
361 	reg_debug("regulatory handlers registered with obj mgr");
362 
363 	return status;
364 
365 unreg_pdev_create:
366 	status = wlan_objmgr_unregister_pdev_create_handler(
367 		WLAN_UMAC_COMP_REGULATORY,
368 		wlan_regulatory_pdev_obj_created_notification,
369 		NULL);
370 
371 unreg_psoc_destroy:
372 	status = wlan_objmgr_unregister_psoc_destroy_handler(
373 		WLAN_UMAC_COMP_REGULATORY,
374 		wlan_regulatory_psoc_obj_destroyed_notification,
375 		NULL);
376 
377 unreg_psoc_create:
378 	status = wlan_objmgr_unregister_psoc_create_handler(
379 		WLAN_UMAC_COMP_REGULATORY,
380 		wlan_regulatory_psoc_obj_created_notification,
381 		NULL);
382 
383 	return QDF_STATUS_E_FAILURE;
384 }
385 
386 QDF_STATUS wlan_regulatory_deinit(void)
387 {
388 	QDF_STATUS status, ret_status = QDF_STATUS_SUCCESS;
389 
390 	status = wlan_objmgr_unregister_pdev_destroy_handler(
391 		WLAN_UMAC_COMP_REGULATORY,
392 		wlan_regulatory_pdev_obj_destroyed_notification, NULL);
393 	if (status != QDF_STATUS_SUCCESS) {
394 		reg_err("failed to unregister reg pdev obj destroy handler");
395 		ret_status = status;
396 	}
397 
398 	status = wlan_objmgr_unregister_pdev_create_handler(
399 		WLAN_UMAC_COMP_REGULATORY,
400 		wlan_regulatory_pdev_obj_created_notification, NULL);
401 	if (status != QDF_STATUS_SUCCESS) {
402 		reg_err("failed to unregister reg pdev obj create handler");
403 		ret_status = status;
404 	}
405 
406 	status = wlan_objmgr_unregister_psoc_destroy_handler(
407 		WLAN_UMAC_COMP_REGULATORY,
408 		wlan_regulatory_psoc_obj_destroyed_notification, NULL);
409 	if (status != QDF_STATUS_SUCCESS) {
410 		reg_err("failed to unregister reg psoc obj destroy handler");
411 		ret_status = status;
412 	}
413 
414 	status = wlan_objmgr_unregister_psoc_create_handler(
415 			WLAN_UMAC_COMP_REGULATORY,
416 			wlan_regulatory_psoc_obj_created_notification, NULL);
417 	if (status != QDF_STATUS_SUCCESS) {
418 		reg_err("failed to unregister reg psoc obj create handler");
419 		ret_status = status;
420 	}
421 
422 	reg_debug("deregistered callbacks with obj mgr");
423 
424 	return ret_status;
425 }
426 
427 #ifdef CONFIG_BAND_6GHZ
428 static void
429 regulatory_assign_register_master_ext_handler(struct wlan_objmgr_psoc *psoc,
430 					struct wlan_lmac_if_reg_tx_ops *tx_ops)
431 {
432 	if (tx_ops->register_master_ext_handler)
433 		tx_ops->register_master_ext_handler(psoc, NULL);
434 }
435 
436 static void
437 regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
438 					struct wlan_lmac_if_reg_tx_ops *tx_ops)
439 {
440 	if (tx_ops->unregister_master_ext_handler)
441 		tx_ops->unregister_master_ext_handler(psoc, NULL);
442 }
443 
444 QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(
445 					struct wlan_objmgr_pdev *pdev,
446 					enum reg_6g_ap_type ap_pwr_type,
447 					struct regulatory_channel *chan_list)
448 {
449 	return  reg_get_6g_ap_master_chan_list(pdev, ap_pwr_type, chan_list);
450 }
451 
452 #ifdef CONFIG_REG_CLIENT
453 const char *wlan_reg_get_power_string(enum reg_6g_ap_type power_type)
454 {
455 	return reg_get_power_string(power_type);
456 }
457 #endif
458 
459 qdf_export_symbol(wlan_reg_get_6g_ap_master_chan_list);
460 
461 #ifdef CONFIG_AFC_SUPPORT
462 static void regulatory_assign_register_afc_event_handler(
463 		struct wlan_objmgr_psoc *psoc,
464 		struct wlan_lmac_if_reg_tx_ops *tx_ops)
465 {
466 	if (tx_ops->register_afc_event_handler)
467 		tx_ops->register_afc_event_handler(psoc, NULL);
468 }
469 
470 static void regulatory_assign_unregister_afc_event_handler(
471 		struct wlan_objmgr_psoc *psoc,
472 		struct wlan_lmac_if_reg_tx_ops *tx_ops)
473 {
474 	if (tx_ops->unregister_afc_event_handler)
475 		tx_ops->unregister_afc_event_handler(psoc, NULL);
476 }
477 #else
478 static void regulatory_assign_register_afc_event_handler(
479 		struct wlan_objmgr_psoc *psoc,
480 		struct wlan_lmac_if_reg_tx_ops *tx_ops)
481 {
482 }
483 
484 static void regulatory_assign_unregister_afc_event_handler(
485 		struct wlan_objmgr_psoc *psoc,
486 		struct wlan_lmac_if_reg_tx_ops *tx_ops)
487 {
488 }
489 #endif
490 #else
491 static inline void
492 regulatory_assign_register_master_ext_handler(struct wlan_objmgr_psoc *psoc,
493 					      struct wlan_lmac_if_reg_tx_ops *tx_ops)
494 {
495 }
496 
497 static inline void
498 regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
499 						struct wlan_lmac_if_reg_tx_ops *tx_ops)
500 {
501 }
502 
503 static void
504 regulatory_assign_register_afc_event_handler(struct wlan_objmgr_psoc *psoc,
505 					     struct wlan_lmac_if_reg_tx_ops *tx_ops)
506 {
507 }
508 
509 static void
510 regulatory_assign_unregister_afc_event_handler(struct wlan_objmgr_psoc *psoc,
511 					       struct wlan_lmac_if_reg_tx_ops *tx_ops)
512 {
513 }
514 #endif
515 
516 QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc)
517 {
518 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
519 
520 	tx_ops = reg_get_psoc_tx_ops(psoc);
521 	if (tx_ops->register_master_handler)
522 		tx_ops->register_master_handler(psoc, NULL);
523 	regulatory_assign_register_master_ext_handler(psoc, tx_ops);
524 	regulatory_assign_register_afc_event_handler(psoc, tx_ops);
525 	if (tx_ops->register_11d_new_cc_handler)
526 		tx_ops->register_11d_new_cc_handler(psoc, NULL);
527 	if (tx_ops->register_ch_avoid_event_handler)
528 		tx_ops->register_ch_avoid_event_handler(psoc, NULL);
529 
530 	return QDF_STATUS_SUCCESS;
531 }
532 
533 QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
534 {
535 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
536 
537 	tx_ops = reg_get_psoc_tx_ops(psoc);
538 	if (tx_ops->unregister_11d_new_cc_handler)
539 		tx_ops->unregister_11d_new_cc_handler(psoc, NULL);
540 	if (tx_ops->unregister_master_handler)
541 		tx_ops->unregister_master_handler(psoc, NULL);
542 	regulatory_assign_unregister_master_ext_handler(psoc, tx_ops);
543 	regulatory_assign_unregister_afc_event_handler(psoc, tx_ops);
544 	if (tx_ops->unregister_ch_avoid_event_handler)
545 		tx_ops->unregister_ch_avoid_event_handler(psoc, NULL);
546 
547 	return QDF_STATUS_SUCCESS;
548 }
549 
550 #ifdef CONFIG_REG_CLIENT
551 /**
552  * reg_is_cntry_set_pending() - Check if country set is pending
553  * @pdev: Pointer to pdev object.
554  * @psoc: Pointer to psoc object.
555  */
556 static bool reg_is_cntry_set_pending(struct wlan_objmgr_pdev *pdev,
557 				     struct wlan_objmgr_psoc *psoc)
558 {
559 	struct wlan_regulatory_psoc_priv_obj *soc_reg;
560 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
561 	uint8_t phy_id;
562 
563 	soc_reg = reg_get_psoc_obj(psoc);
564 
565 	if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
566 		reg_err("psoc reg component is NULL");
567 		return false;
568 	}
569 
570 	tx_ops = reg_get_psoc_tx_ops(psoc);
571 
572 	if (tx_ops->get_phy_id_from_pdev_id)
573 		tx_ops->get_phy_id_from_pdev_id(
574 					psoc,
575 					wlan_objmgr_pdev_get_pdev_id(pdev),
576 					&phy_id);
577 	else
578 		phy_id = wlan_objmgr_pdev_get_pdev_id(pdev);
579 
580 	return (soc_reg->new_user_ctry_pending[phy_id] ||
581 		soc_reg->new_init_ctry_pending[phy_id] ||
582 		soc_reg->new_11d_ctry_pending[phy_id] ||
583 		soc_reg->world_country_pending[phy_id]);
584 }
585 #else
586 static inline bool reg_is_cntry_set_pending(struct wlan_objmgr_pdev *pdev,
587 					    struct wlan_objmgr_psoc *psoc)
588 {
589 	return false;
590 }
591 #endif
592 
593 QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev)
594 {
595 	struct wlan_objmgr_psoc *parent_psoc;
596 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
597 
598 	pdev_priv_obj = reg_get_pdev_obj(pdev);
599 
600 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
601 		reg_err("reg pdev private obj is NULL");
602 		return QDF_STATUS_E_FAILURE;
603 	}
604 
605 	pdev_priv_obj->pdev_opened = true;
606 
607 	parent_psoc = wlan_pdev_get_psoc(pdev);
608 
609 	if (reg_is_cntry_set_pending(pdev, parent_psoc))
610 		return QDF_STATUS_SUCCESS;
611 
612 	reg_send_scheduler_msg_nb(parent_psoc, pdev);
613 
614 	return QDF_STATUS_SUCCESS;
615 }
616 
617 QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev)
618 {
619 	struct wlan_objmgr_psoc *psoc;
620 	struct wlan_regulatory_psoc_priv_obj *soc_reg;
621 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
622 
623 	pdev_priv_obj = reg_get_pdev_obj(pdev);
624 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
625 		reg_err("reg pdev private obj is NULL");
626 		return QDF_STATUS_E_FAILURE;
627 	}
628 
629 	pdev_priv_obj->pdev_opened = false;
630 
631 	psoc = wlan_pdev_get_psoc(pdev);
632 	soc_reg = reg_get_psoc_obj(psoc);
633 	if (!soc_reg) {
634 		reg_err("reg psoc private obj is NULL");
635 		return QDF_STATUS_E_FAULT;
636 	}
637 
638 	reg_reset_ctry_pending_hints(soc_reg);
639 
640 	return QDF_STATUS_SUCCESS;
641 }
642 
643 uint8_t wlan_reg_freq_to_chan(struct wlan_objmgr_pdev *pdev,
644 			      qdf_freq_t freq)
645 {
646 	return reg_freq_to_chan(pdev, freq);
647 }
648 
649 qdf_export_symbol(wlan_reg_freq_to_chan);
650 
651 qdf_freq_t wlan_reg_legacy_chan_to_freq(struct wlan_objmgr_pdev *pdev,
652 					uint8_t chan_num)
653 {
654 	return reg_legacy_chan_to_freq(pdev, chan_num);
655 }
656 
657 QDF_STATUS wlan_reg_set_country(struct wlan_objmgr_pdev *pdev,
658 				       uint8_t *country)
659 {
660 	return reg_set_country(pdev, country);
661 }
662 
663 QDF_STATUS wlan_reg_set_11d_country(struct wlan_objmgr_pdev *pdev,
664 				    uint8_t *country)
665 {
666 	return reg_set_11d_country(pdev, country);
667 }
668 
669 bool wlan_reg_is_world(uint8_t *country)
670 {
671 	return reg_is_world_alpha2(country);
672 }
673 
674 bool wlan_reg_is_us(uint8_t *country)
675 {
676 	return reg_is_us_alpha2(country);
677 }
678 
679 bool wlan_reg_is_etsi(uint8_t *country)
680 {
681 	return reg_is_etsi_alpha2(country);
682 }
683 
684 bool wlan_reg_ctry_support_vlp(uint8_t *country)
685 {
686 	return reg_ctry_support_vlp(country);
687 }
688 
689 void wlan_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
690 					    void *cbk, void *arg)
691 {
692 	reg_register_chan_change_callback(psoc, (reg_chan_change_callback)cbk,
693 					  arg);
694 
695 }
696 
697 void wlan_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc,
698 					      void *cbk)
699 {
700 	reg_unregister_chan_change_callback(psoc,
701 					    (reg_chan_change_callback)cbk);
702 }
703 
704 bool wlan_reg_is_11d_offloaded(struct wlan_objmgr_psoc *psoc)
705 {
706 	return reg_is_11d_offloaded(psoc);
707 }
708 
709 bool wlan_reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc)
710 {
711 	return reg_11d_enabled_on_host(psoc);
712 }
713 
714 bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev)
715 {
716 	return reg_is_etsi13_regdmn(pdev);
717 }
718 
719 bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
720 						     *pdev)
721 {
722 	return reg_is_etsi13_srd_chan_allowed_master_mode(pdev);
723 }
724 
725 bool wlan_reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq)
726 {
727 	return reg_get_fcc_constraint(pdev, freq);
728 }
729 
730 QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev,
731 		uint64_t *chip_mode)
732 {
733 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
734 
735 	pdev_priv_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
736 			WLAN_UMAC_COMP_REGULATORY);
737 
738 	if (!pdev_priv_obj) {
739 		reg_err("reg pdev private obj is NULL");
740 		return QDF_STATUS_E_FAULT;
741 	}
742 
743 	*chip_mode = pdev_priv_obj->wireless_modes;
744 
745 	return QDF_STATUS_SUCCESS;
746 }
747 
748 QDF_STATUS wlan_reg_get_phybitmap(struct wlan_objmgr_pdev *pdev,
749 				  uint16_t *phybitmap)
750 {
751 	return reg_get_phybitmap(pdev, phybitmap);
752 }
753 
754 bool wlan_reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc)
755 {
756 	return reg_is_11d_scan_inprogress(psoc);
757 }
758 
759 QDF_STATUS wlan_reg_get_freq_range(struct wlan_objmgr_pdev *pdev,
760 		qdf_freq_t *low_2g,
761 		qdf_freq_t *high_2g,
762 		qdf_freq_t *low_5g,
763 		qdf_freq_t *high_5g)
764 {
765 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
766 
767 	pdev_priv_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
768 			WLAN_UMAC_COMP_REGULATORY);
769 
770 	if (!pdev_priv_obj) {
771 		reg_err("reg pdev private obj is NULL");
772 		return QDF_STATUS_E_FAULT;
773 	}
774 
775 	if (low_2g)
776 		*low_2g = pdev_priv_obj->range_2g_low;
777 
778 	if (high_2g)
779 		*high_2g = pdev_priv_obj->range_2g_high;
780 
781 	if (low_5g)
782 		*low_5g = pdev_priv_obj->range_5g_low;
783 
784 	if (high_5g)
785 		*high_5g = pdev_priv_obj->range_5g_high;
786 
787 	return QDF_STATUS_SUCCESS;
788 }
789 
790 struct wlan_lmac_if_reg_tx_ops *
791 wlan_reg_get_tx_ops(struct wlan_objmgr_psoc *psoc)
792 {
793 	return reg_get_psoc_tx_ops(psoc);
794 }
795 
796 qdf_export_symbol(wlan_reg_get_tx_ops);
797 
798 QDF_STATUS wlan_reg_get_curr_regdomain(struct wlan_objmgr_pdev *pdev,
799 		struct cur_regdmn_info *cur_regdmn)
800 {
801 	return reg_get_curr_regdomain(pdev, cur_regdmn);
802 }
803 
804 uint8_t wlan_reg_max_5ghz_ch_num(void)
805 {
806 	return reg_max_5ghz_ch_num();
807 }
808 
809 #ifdef CONFIG_CHAN_FREQ_API
810 qdf_freq_t wlan_reg_min_24ghz_chan_freq(void)
811 {
812 	return reg_min_24ghz_chan_freq();
813 }
814 
815 qdf_freq_t wlan_reg_max_24ghz_chan_freq(void)
816 {
817 	return reg_max_24ghz_chan_freq();
818 }
819 
820 qdf_freq_t wlan_reg_min_5ghz_chan_freq(void)
821 {
822 	return reg_min_5ghz_chan_freq();
823 }
824 
825 qdf_freq_t wlan_reg_max_5ghz_chan_freq(void)
826 {
827 	return reg_max_5ghz_chan_freq();
828 }
829 #endif /* CONFIG_CHAN_FREQ_API */
830 
831 bool wlan_reg_is_24ghz_ch_freq(qdf_freq_t freq)
832 {
833 	return reg_is_24ghz_ch_freq(freq);
834 }
835 
836 bool wlan_reg_is_5ghz_ch_freq(qdf_freq_t freq)
837 {
838 	return reg_is_5ghz_ch_freq(freq);
839 }
840 
841 bool wlan_reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq)
842 {
843 	return reg_is_range_overlap_2g(low_freq, high_freq);
844 }
845 
846 bool wlan_reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq)
847 {
848 	return reg_is_range_overlap_5g(low_freq, high_freq);
849 }
850 
851 bool wlan_reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
852 {
853 	return reg_is_freq_indoor(pdev, freq);
854 }
855 
856 uint16_t wlan_reg_get_min_chwidth(struct wlan_objmgr_pdev *pdev,
857 				  qdf_freq_t freq)
858 {
859 	return reg_get_min_chwidth(pdev, freq);
860 }
861 
862 uint16_t wlan_reg_get_max_chwidth(struct wlan_objmgr_pdev *pdev,
863 				  qdf_freq_t freq)
864 {
865 	return reg_get_max_chwidth(pdev, freq);
866 }
867 
868 enum phy_ch_width
869 wlan_reg_get_next_lower_bandwidth(enum phy_ch_width ch_width)
870 {
871 	return get_next_lower_bandwidth(ch_width);
872 }
873 
874 #ifdef CONFIG_REG_CLIENT
875 bool wlan_reg_is_freq_indoor_in_secondary_list(struct wlan_objmgr_pdev *pdev,
876 					       qdf_freq_t freq)
877 {
878 	return reg_is_freq_indoor_in_secondary_list(pdev, freq);
879 }
880 #endif
881 
882 #ifdef CONFIG_BAND_6GHZ
883 bool wlan_reg_is_6ghz_chan_freq(uint16_t freq)
884 {
885 	return reg_is_6ghz_chan_freq(freq);
886 }
887 
888 #ifdef CONFIG_6G_FREQ_OVERLAP
889 bool wlan_reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
890 {
891 	return reg_is_range_only6g(low_freq, high_freq);
892 }
893 
894 bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
895 {
896 	return reg_is_range_overlap_6g(low_freq, high_freq);
897 }
898 #endif
899 
900 uint16_t wlan_reg_min_6ghz_chan_freq(void)
901 {
902 	return reg_min_6ghz_chan_freq();
903 }
904 
905 uint16_t wlan_reg_max_6ghz_chan_freq(void)
906 {
907 	return reg_max_6ghz_chan_freq();
908 }
909 
910 bool wlan_reg_is_6ghz_psc_chan_freq(uint16_t freq)
911 {
912 	return reg_is_6ghz_psc_chan_freq(freq);
913 }
914 
915 bool wlan_reg_is_6g_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
916 {
917 	return reg_is_6g_freq_indoor(pdev, freq);
918 }
919 
920 QDF_STATUS
921 wlan_reg_get_max_txpower_for_6g_tpe(struct wlan_objmgr_pdev *pdev,
922 				    qdf_freq_t freq, uint8_t bw,
923 				    enum reg_6g_ap_type reg_ap,
924 				    enum reg_6g_client_type reg_client,
925 				    bool is_psd,
926 				    uint8_t *tx_power)
927 {
928 	return reg_get_max_txpower_for_6g_tpe(pdev, freq, bw,
929 					      reg_ap,
930 					      reg_client, is_psd,
931 					      tx_power);
932 }
933 #endif /* CONFIG_BAND_6GHZ */
934 
935 uint16_t
936 wlan_reg_get_band_channel_list(struct wlan_objmgr_pdev *pdev,
937 			       uint8_t band_mask,
938 			       struct regulatory_channel *channel_list)
939 {
940 	if (!pdev) {
941 		reg_err("pdev object is NULL");
942 		return 0;
943 	}
944 
945 	return reg_get_band_channel_list(pdev, band_mask, channel_list);
946 }
947 
948 #ifdef CONFIG_REG_6G_PWRMODE
949 uint16_t
950 wlan_reg_get_band_channel_list_for_pwrmode(struct wlan_objmgr_pdev *pdev,
951 					   uint8_t band_mask,
952 					   struct regulatory_channel
953 					   *channel_list,
954 					   enum supported_6g_pwr_types
955 					   in_6g_pwr_type)
956 {
957 	if (!pdev) {
958 		reg_err("pdev object is NULL");
959 		return 0;
960 	}
961 
962 	return reg_get_band_channel_list_for_pwrmode(pdev, band_mask,
963 						     channel_list,
964 						     in_6g_pwr_type);
965 }
966 #endif
967 
968 #ifdef CONFIG_REG_CLIENT
969 uint16_t
970 wlan_reg_get_secondary_band_channel_list(struct wlan_objmgr_pdev *pdev,
971 					 uint8_t band_mask,
972 					 struct regulatory_channel
973 					 *channel_list)
974 {
975 	if (!pdev) {
976 		reg_err("pdev object is NULL");
977 		return 0;
978 	}
979 
980 	return reg_get_secondary_band_channel_list(pdev, band_mask,
981 						   channel_list);
982 }
983 #endif
984 
985 qdf_freq_t wlan_reg_chan_band_to_freq(struct wlan_objmgr_pdev *pdev,
986 				      uint8_t chan, uint8_t band_mask)
987 {
988 	return reg_chan_band_to_freq(pdev, chan, band_mask);
989 }
990 
991 qdf_export_symbol(wlan_reg_chan_band_to_freq);
992 
993 #ifdef CONFIG_49GHZ_CHAN
994 bool wlan_reg_is_49ghz_freq(qdf_freq_t freq)
995 {
996 	return reg_is_49ghz_freq(freq);
997 }
998 #endif /* CONFIG_49GHZ_CHAN */
999 
1000 uint8_t wlan_reg_ch_num(uint32_t ch_enum)
1001 {
1002 	return reg_ch_num(ch_enum);
1003 }
1004 
1005 qdf_freq_t wlan_reg_ch_to_freq(uint32_t ch_enum)
1006 {
1007 	return reg_ch_to_freq(ch_enum);
1008 }
1009 
1010 #ifdef WLAN_REG_PARTIAL_OFFLOAD
1011 bool wlan_reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev)
1012 {
1013 	return reg_is_regdmn_en302502_applicable(pdev);
1014 }
1015 #endif
1016 
1017 /**
1018  * wlan_reg_modify_pdev_chan_range() - Compute current channel list for the
1019  * modified regcap.
1020  * @pdev: pointer to struct wlan_objmgr_pdev
1021  *
1022  */
1023 QDF_STATUS wlan_reg_modify_pdev_chan_range(struct wlan_objmgr_pdev *pdev)
1024 {
1025 	return reg_modify_pdev_chan_range(pdev);
1026 }
1027 
1028 QDF_STATUS wlan_reg_update_pdev_wireless_modes(struct wlan_objmgr_pdev *pdev,
1029 					       uint64_t wireless_modes)
1030 {
1031 	return reg_update_pdev_wireless_modes(pdev, wireless_modes);
1032 }
1033 #ifdef DISABLE_UNII_SHARED_BANDS
1034 QDF_STATUS wlan_reg_disable_chan_coex(struct wlan_objmgr_pdev *pdev,
1035 				      uint8_t unii_5g_bitmap)
1036 {
1037 	return reg_disable_chan_coex(pdev, unii_5g_bitmap);
1038 }
1039 #endif
1040 
1041 #ifdef CONFIG_CHAN_FREQ_API
1042 bool wlan_reg_is_same_band_freqs(qdf_freq_t freq1, qdf_freq_t freq2)
1043 {
1044 	return reg_is_same_band_freqs(freq1, freq2);
1045 }
1046 
1047 enum channel_enum wlan_reg_get_chan_enum_for_freq(qdf_freq_t freq)
1048 {
1049 	return reg_get_chan_enum_for_freq(freq);
1050 }
1051 
1052 bool wlan_reg_is_freq_present_in_cur_chan_list(struct wlan_objmgr_pdev *pdev,
1053 					       qdf_freq_t freq)
1054 {
1055 	return reg_is_freq_present_in_cur_chan_list(pdev, freq);
1056 }
1057 
1058 bool wlan_reg_is_etsi13_srd_chan_for_freq(struct wlan_objmgr_pdev *pdev,
1059 					  qdf_freq_t freq)
1060 {
1061 	return reg_is_etsi13_srd_chan_for_freq(pdev, freq);
1062 }
1063 
1064 bool wlan_reg_is_dsrc_freq(qdf_freq_t freq)
1065 {
1066 	return reg_is_dsrc_freq(freq);
1067 }
1068 
1069 void wlan_reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
1070 				     uint16_t *chan_freq_list,
1071 				     uint8_t num_ch,
1072 				     bool nol_ch)
1073 {
1074 	reg_update_nol_ch_for_freq(pdev, chan_freq_list, num_ch, nol_ch);
1075 }
1076 
1077 void wlan_reg_update_nol_history_ch_for_freq(struct wlan_objmgr_pdev *pdev,
1078 					     uint16_t *ch_list,
1079 					     uint8_t num_ch,
1080 					     bool nol_history_ch)
1081 {
1082 	reg_update_nol_history_ch_for_freq(pdev,
1083 					   ch_list,
1084 					   num_ch,
1085 					   nol_history_ch);
1086 }
1087 
1088 bool wlan_reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
1089 {
1090 	return reg_is_dfs_for_freq(pdev, freq);
1091 }
1092 
1093 bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
1094 					     qdf_freq_t freq)
1095 {
1096 	return reg_is_passive_or_disable_for_freq(pdev, freq);
1097 }
1098 
1099 bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev,
1100 				  qdf_freq_t freq)
1101 {
1102 	return reg_is_disable_for_freq(pdev, freq);
1103 }
1104 
1105 #ifdef CONFIG_REG_6G_PWRMODE
1106 bool wlan_reg_is_disable_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1107 				     qdf_freq_t freq,
1108 				     enum supported_6g_pwr_types in_6g_pwr_mode)
1109 {
1110 	return reg_is_disable_for_pwrmode(pdev, freq, in_6g_pwr_mode);
1111 }
1112 #endif
1113 
1114 #ifdef CONFIG_REG_CLIENT
1115 bool wlan_reg_is_disable_in_secondary_list_for_freq(
1116 						struct wlan_objmgr_pdev *pdev,
1117 						qdf_freq_t freq)
1118 {
1119 	return reg_is_disable_in_secondary_list_for_freq(pdev, freq);
1120 }
1121 
1122 bool wlan_reg_is_enable_in_secondary_list_for_freq(
1123 						struct wlan_objmgr_pdev *pdev,
1124 						qdf_freq_t freq)
1125 {
1126 	return reg_is_enable_in_secondary_list_for_freq(pdev, freq);
1127 }
1128 
1129 bool wlan_reg_is_dfs_in_secondary_list_for_freq(struct wlan_objmgr_pdev *pdev,
1130 						qdf_freq_t freq)
1131 {
1132 	return reg_is_dfs_in_secondary_list_for_freq(pdev, freq);
1133 }
1134 #endif
1135 
1136 bool wlan_reg_is_passive_for_freq(struct wlan_objmgr_pdev *pdev,
1137 				  qdf_freq_t freq)
1138 {
1139 	return reg_is_passive_for_freq(pdev, freq);
1140 }
1141 
1142 QDF_STATUS
1143 wlan_reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
1144 					      struct channel_power *ch_list,
1145 					      uint8_t *num_chan)
1146 {
1147 	return reg_get_channel_list_with_power_for_freq(pdev,
1148 							ch_list,
1149 							num_chan);
1150 }
1151 
1152 bool
1153 wlan_reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
1154 					 qdf_freq_t freq)
1155 {
1156 	return reg_chan_has_dfs_attribute_for_freq(pdev, freq);
1157 }
1158 
1159 enum channel_state
1160 wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
1161 					      qdf_freq_t freq,
1162 					      enum phy_ch_width bw)
1163 {
1164 	struct ch_params params = {0};
1165 
1166 	if (reg_is_ch_width_320(bw)) {
1167 		const struct bonded_channel_freq *bonded_chan_ptr_ptr = NULL;
1168 
1169 		return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
1170 							  &bonded_chan_ptr_ptr);
1171 	}
1172 
1173 	params.ch_width = bw;
1174 
1175 	return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params);
1176 }
1177 
1178 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
1179 
1180 
1181 #ifdef CONFIG_REG_6G_PWRMODE
1182 enum channel_state
1183 wlan_reg_get_5g_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1184 						 qdf_freq_t freq,
1185 						 struct ch_params *ch_params,
1186 						 enum supported_6g_pwr_types
1187 						 in_6g_pwr_type)
1188 {
1189 	enum phy_ch_width bw;
1190 
1191 	if (!ch_params) {
1192 		reg_err_rl("Invalid ch_params");
1193 		return CHANNEL_STATE_INVALID;
1194 	}
1195 	bw = ch_params->ch_width;
1196 
1197 	if (reg_is_ch_width_320(bw)) {
1198 		const struct bonded_channel_freq *bonded_ch_ptr_ptr = NULL;
1199 
1200 		return reg_get_5g_bonded_channel_for_pwrmode(pdev, freq, bw,
1201 							     &bonded_ch_ptr_ptr,
1202 							     in_6g_pwr_type);
1203 	}
1204 
1205 	return reg_get_5g_bonded_channel_state_for_pwrmode(pdev, freq,
1206 							   ch_params,
1207 							   in_6g_pwr_type);
1208 }
1209 #else
1210 enum channel_state
1211 wlan_reg_get_5g_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1212 						 qdf_freq_t freq,
1213 						 struct ch_params *ch_params,
1214 						 enum supported_6g_pwr_types
1215 						 in_6g_pwr_type)
1216 {
1217 	enum phy_ch_width bw;
1218 
1219 	if (!ch_params) {
1220 		reg_err_rl("Invalid ch_params");
1221 		return CHANNEL_STATE_INVALID;
1222 	}
1223 	bw = ch_params->ch_width;
1224 
1225 	if (reg_is_ch_width_320(bw)) {
1226 		const struct bonded_channel_freq *bonded_ch_ptr_ptr = NULL;
1227 
1228 		return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
1229 							  &bonded_ch_ptr_ptr);
1230 	}
1231 
1232 	return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, ch_params);
1233 }
1234 #endif
1235 
1236 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_pwrmode);
1237 
1238 enum channel_state
1239 wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
1240 					      qdf_freq_t freq,
1241 					      qdf_freq_t sec_ch_freq,
1242 					      enum phy_ch_width bw)
1243 {
1244 	return reg_get_2g_bonded_channel_state_for_freq(pdev,
1245 							freq,
1246 							sec_ch_freq,
1247 							bw);
1248 }
1249 
1250 void wlan_reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
1251 					  qdf_freq_t freq,
1252 					  qdf_freq_t sec_ch_2g_freq,
1253 					  struct ch_params *ch_params)
1254 {
1255 	reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params,
1256 					true);
1257 }
1258 
1259 qdf_export_symbol(wlan_reg_set_channel_params_for_freq);
1260 
1261 #ifdef CONFIG_REG_6G_PWRMODE
1262 void wlan_reg_set_channel_params_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1263 					     qdf_freq_t freq,
1264 					     qdf_freq_t sec_ch_2g_freq,
1265 					     struct ch_params *ch_params,
1266 					     enum supported_6g_pwr_types
1267 					     in_6g_pwr_mode)
1268 {
1269 	reg_set_channel_params_for_pwrmode(pdev, freq, sec_ch_2g_freq,
1270 					   ch_params,
1271 					   in_6g_pwr_mode, true);
1272 }
1273 
1274 qdf_export_symbol(wlan_reg_set_channel_params_for_pwrmode);
1275 #endif
1276 
1277 #ifdef WLAN_FEATURE_11BE
1278 void wlan_reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
1279 				qdf_freq_t freq,
1280 				qdf_freq_t sec_ch_2g_freq,
1281 				enum phy_ch_width ch_width,
1282 				qdf_freq_t band_center_320,
1283 				struct reg_channel_list *chan_list,
1284 				bool treat_nol_chan_as_disabled)
1285 {
1286 	reg_fill_channel_list(pdev, freq, sec_ch_2g_freq, ch_width,
1287 			      band_center_320, chan_list,
1288 			      treat_nol_chan_as_disabled);
1289 }
1290 
1291 #ifdef CONFIG_REG_6G_PWRMODE
1292 void
1293 wlan_reg_fill_channel_list_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1294 				       qdf_freq_t freq,
1295 				       qdf_freq_t sec_ch_2g_freq,
1296 				       enum phy_ch_width ch_width,
1297 				       qdf_freq_t band_center_320,
1298 				       struct reg_channel_list *chan_list,
1299 				       enum supported_6g_pwr_types
1300 				       in_6g_pwr_type,
1301 				       bool treat_nol_chan_as_disabled)
1302 {
1303 	reg_fill_channel_list_for_pwrmode(pdev, freq, sec_ch_2g_freq, ch_width,
1304 					  band_center_320, chan_list,
1305 					  in_6g_pwr_type,
1306 					  treat_nol_chan_as_disabled);
1307 }
1308 #endif /* CONFIG_REG_6G_PWRMODE */
1309 
1310 bool wlan_reg_is_punc_bitmap_valid(enum phy_ch_width bw,
1311 				   uint16_t puncture_bitmap)
1312 {
1313 	return reg_is_punc_bitmap_valid(bw, puncture_bitmap);
1314 }
1315 
1316 QDF_STATUS wlan_reg_extract_puncture_by_bw(enum phy_ch_width ori_bw,
1317 					   uint16_t ori_puncture_bitmap,
1318 					   qdf_freq_t freq,
1319 					   qdf_freq_t cen320_freq,
1320 					   enum phy_ch_width new_bw,
1321 					   uint16_t *new_puncture_bitmap)
1322 {
1323 	return reg_extract_puncture_by_bw(ori_bw, ori_puncture_bitmap, freq,
1324 					  cen320_freq, new_bw,
1325 					  new_puncture_bitmap);
1326 }
1327 
1328 void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
1329 				     bool is_create_punc_bitmap)
1330 {
1331 	reg_set_create_punc_bitmap(ch_params, is_create_punc_bitmap);
1332 }
1333 #endif /* WLAN_FEATURE_11BE */
1334 
1335 enum channel_state
1336 wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
1337 				    qdf_freq_t freq)
1338 {
1339 	return reg_get_channel_state_for_freq(pdev, freq);
1340 }
1341 
1342 #ifdef CONFIG_REG_6G_PWRMODE
1343 enum channel_state
1344 wlan_reg_get_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1345 				       qdf_freq_t freq,
1346 				       enum supported_6g_pwr_types
1347 				       in_6g_pwr_type)
1348 {
1349 	return reg_get_channel_state_for_pwrmode(pdev, freq, in_6g_pwr_type);
1350 }
1351 #endif
1352 
1353 #ifdef CONFIG_REG_CLIENT
1354 enum channel_state wlan_reg_get_channel_state_from_secondary_list_for_freq(
1355 						struct wlan_objmgr_pdev *pdev,
1356 						qdf_freq_t freq)
1357 {
1358 	return reg_get_channel_state_from_secondary_list_for_freq(pdev, freq);
1359 }
1360 
1361 QDF_STATUS
1362 wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
1363 				     struct channel_power *ch_list,
1364 				     uint8_t *num_chan,
1365 				     enum supported_6g_pwr_types in_6g_pwr_type)
1366 {
1367 	return reg_get_channel_list_with_power(pdev, ch_list, num_chan,
1368 					       in_6g_pwr_type);
1369 }
1370 #endif
1371 
1372 uint8_t wlan_reg_get_channel_reg_power_for_freq(struct wlan_objmgr_pdev *pdev,
1373 						qdf_freq_t freq)
1374 {
1375 	return reg_get_channel_reg_power_for_freq(pdev, freq);
1376 }
1377 
1378 enum reg_wifi_band wlan_reg_freq_to_band(qdf_freq_t freq)
1379 {
1380 	return reg_freq_to_band(freq);
1381 }
1382 qdf_export_symbol(wlan_reg_freq_to_band);
1383 
1384 qdf_freq_t wlan_reg_min_chan_freq(void)
1385 {
1386 	return reg_min_chan_freq();
1387 }
1388 
1389 qdf_freq_t wlan_reg_max_chan_freq(void)
1390 {
1391 	return reg_max_chan_freq();
1392 }
1393 
1394 void wlan_reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
1395 					  qdf_freq_t freq,
1396 					  uint16_t chan_width,
1397 					  bool global_tbl_lookup,
1398 					  uint16_t behav_limit,
1399 					  uint8_t *op_class,
1400 					  uint8_t *chan_num)
1401 {
1402 	return reg_freq_width_to_chan_op_class(pdev, freq, chan_width,
1403 					       global_tbl_lookup,
1404 					       behav_limit,
1405 					       op_class,
1406 					       chan_num);
1407 }
1408 
1409 void wlan_reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
1410 					       qdf_freq_t freq,
1411 					       uint16_t chan_width,
1412 					       bool global_tbl_lookup,
1413 					       uint16_t behav_limit,
1414 					       uint8_t *op_class,
1415 					       uint8_t *chan_num)
1416 {
1417 	reg_freq_width_to_chan_op_class_auto(pdev, freq, chan_width,
1418 					     global_tbl_lookup,
1419 					     behav_limit,
1420 					     op_class,
1421 					     chan_num);
1422 }
1423 
1424 qdf_export_symbol(wlan_reg_freq_width_to_chan_op_class_auto);
1425 
1426 void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
1427 				    qdf_freq_t freq,
1428 				    bool global_tbl_lookup,
1429 				    uint16_t behav_limit,
1430 				    uint8_t *op_class,
1431 				    uint8_t *chan_num)
1432 {
1433 	return reg_freq_to_chan_op_class(pdev, freq,
1434 					 global_tbl_lookup,
1435 					 behav_limit,
1436 					 op_class,
1437 					 chan_num);
1438 }
1439 
1440 bool wlan_reg_is_freq_in_country_opclass(struct wlan_objmgr_pdev *pdev,
1441 					 const uint8_t country[3],
1442 					 uint8_t op_class,
1443 					 qdf_freq_t chan_freq)
1444 {
1445 	return reg_is_freq_in_country_opclass(pdev, country,
1446 					      op_class, chan_freq);
1447 }
1448 
1449 enum channel_state
1450 wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
1451 						  uint16_t freq,
1452 						  enum phy_ch_width bw,
1453 						  const
1454 						  struct bonded_channel_freq
1455 						  **bonded_chan_ptr_ptr)
1456 {
1457 	/*
1458 	 * Get channel frequencies and state from regulatory
1459 	 */
1460 	return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
1461 						  bonded_chan_ptr_ptr);
1462 }
1463 
1464 #ifdef CONFIG_REG_6G_PWRMODE
1465 enum channel_state
1466 wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode(
1467 						  struct wlan_objmgr_pdev *pdev,
1468 						  uint16_t freq,
1469 						  enum phy_ch_width bw,
1470 						  const
1471 						  struct bonded_channel_freq
1472 						  **bonded_chan_ptr_ptr,
1473 						  enum supported_6g_pwr_types
1474 						  in_6g_pwr_mode)
1475 {
1476 	/*
1477 	 * Get channel frequencies and state from regulatory
1478 	 */
1479 	return reg_get_5g_bonded_channel_for_pwrmode(pdev, freq, bw,
1480 						     bonded_chan_ptr_ptr,
1481 						     in_6g_pwr_mode);
1482 }
1483 
1484 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode);
1485 #endif
1486 
1487 #if defined(WLAN_FEATURE_11BE) && defined(CONFIG_REG_CLIENT)
1488 enum channel_state
1489 wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
1490 					   qdf_freq_t freq,
1491 					   enum phy_ch_width bw,
1492 					   qdf_freq_t sec_freq)
1493 {
1494 	if (WLAN_REG_IS_24GHZ_CH_FREQ(freq))
1495 		return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
1496 						       sec_freq, bw);
1497 	if (bw == CH_WIDTH_320MHZ) {
1498 		const struct bonded_channel_freq *bonded_chan_ptr_ptr = NULL;
1499 
1500 		return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
1501 							  &bonded_chan_ptr_ptr);
1502 	} else {
1503 		struct ch_params params = {0};
1504 
1505 		params.ch_width = bw;
1506 
1507 		return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
1508 								&params);
1509 	}
1510 }
1511 
1512 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
1513 
1514 #else
1515 enum channel_state
1516 wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
1517 					   qdf_freq_t freq,
1518 					   enum phy_ch_width bw,
1519 					   qdf_freq_t sec_freq)
1520 {
1521 	if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) {
1522 		return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
1523 						       sec_freq, bw);
1524 	} else {
1525 		struct ch_params params = {0};
1526 
1527 		params.ch_width = bw;
1528 
1529 		return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
1530 								&params);
1531 	}
1532 }
1533 
1534 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
1535 
1536 #ifdef CONFIG_REG_6G_PWRMODE
1537 enum channel_state
1538 wlan_reg_get_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
1539 					      qdf_freq_t freq,
1540 					      enum phy_ch_width bw,
1541 					      qdf_freq_t sec_freq,
1542 					      enum supported_6g_pwr_types
1543 					      in_6g_pwr_mode)
1544 {
1545 	if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) {
1546 		return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
1547 						       sec_freq, bw);
1548 	} else {
1549 		struct ch_params params = {0};
1550 
1551 		params.ch_width = bw;
1552 
1553 		return reg_get_5g_bonded_channel_state_for_pwrmode(pdev, freq,
1554 								&params,
1555 								in_6g_pwr_mode);
1556 	}
1557 }
1558 
1559 qdf_export_symbol(wlan_reg_get_bonded_channel_state_for_pwrmode);
1560 #endif
1561 #endif
1562 #endif /* CONFIG CHAN FREQ API */
1563 
1564 uint16_t wlan_reg_get_op_class_width(struct wlan_objmgr_pdev *pdev,
1565 				     uint8_t op_class,
1566 				     bool global_tbl_lookup)
1567 {
1568 	return reg_get_op_class_width(pdev, op_class,
1569 				      global_tbl_lookup);
1570 }
1571 
1572 bool wlan_reg_is_5ghz_op_class(const uint8_t *country, uint8_t op_class)
1573 {
1574 	return reg_is_5ghz_op_class(country, op_class);
1575 }
1576 
1577 bool wlan_reg_is_2ghz_op_class(const uint8_t *country, uint8_t op_class)
1578 {
1579 	return reg_is_2ghz_op_class(country, op_class);
1580 }
1581 
1582 bool wlan_reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev,
1583 			       uint8_t op_class)
1584 {
1585 	return reg_is_6ghz_op_class(pdev, op_class);
1586 }
1587 
1588 #ifdef CONFIG_REG_CLIENT
1589 bool wlan_reg_is_6ghz_supported(struct wlan_objmgr_psoc *psoc)
1590 {
1591 	return reg_is_6ghz_supported(psoc);
1592 }
1593 #endif
1594 
1595 #ifdef HOST_OPCLASS_EXT
1596 qdf_freq_t
1597 wlan_reg_country_chan_opclass_to_freq(struct wlan_objmgr_pdev *pdev,
1598 				      const uint8_t country[3],
1599 				      uint8_t chan, uint8_t op_class,
1600 				      bool strict)
1601 {
1602 	return reg_country_chan_opclass_to_freq(pdev, country, chan, op_class,
1603 						strict);
1604 }
1605 #endif
1606 
1607 uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan,
1608 				       uint8_t op_class,
1609 				       bool global_tbl_lookup)
1610 {
1611 	if (!chan || !op_class)
1612 		return 0;
1613 
1614 	return reg_chan_opclass_to_freq(chan, op_class, global_tbl_lookup);
1615 }
1616 
1617 qdf_freq_t wlan_reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
1618 					      bool global_tbl_lookup)
1619 {
1620 	if (!chan || !op_class)
1621 		return 0;
1622 
1623 	return reg_chan_opclass_to_freq_auto(chan, op_class, global_tbl_lookup);
1624 }
1625 
1626 #ifdef CHECK_REG_PHYMODE
1627 enum reg_phymode wlan_reg_get_max_phymode(struct wlan_objmgr_pdev *pdev,
1628 					  enum reg_phymode phy_in,
1629 					  qdf_freq_t freq)
1630 {
1631 	return reg_get_max_phymode(pdev, phy_in, freq);
1632 }
1633 #endif /* CHECK_REG_PHYMODE */
1634 
1635 #ifdef CONFIG_REG_CLIENT
1636 enum band_info wlan_reg_band_bitmap_to_band_info(uint32_t band_bitmap)
1637 {
1638 	return reg_band_bitmap_to_band_info(band_bitmap);
1639 }
1640 #endif
1641 
1642 #if defined(CONFIG_BAND_6GHZ)
1643 QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
1644 				       bool *reg_rnr_tpe_usable)
1645 {
1646 	return reg_get_rnr_tpe_usable(pdev, reg_rnr_tpe_usable);
1647 }
1648 
1649 QDF_STATUS wlan_reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
1650 					      bool *reg_unspecified_ap_usable)
1651 {
1652 	return reg_get_unspecified_ap_usable(pdev, reg_unspecified_ap_usable);
1653 }
1654 
1655 QDF_STATUS
1656 wlan_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
1657 				enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type)
1658 {
1659 	return reg_get_cur_6g_ap_pwr_type(pdev, reg_cur_6g_ap_pwr_type);
1660 }
1661 
1662 qdf_export_symbol(wlan_reg_get_cur_6g_ap_pwr_type);
1663 
1664 QDF_STATUS
1665 wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
1666 				enum reg_6g_client_type
1667 				*reg_cur_6g_client_mobility_type)
1668 {
1669 	return reg_get_cur_6g_client_type(pdev,
1670 					  reg_cur_6g_client_mobility_type);
1671 }
1672 
1673 bool wlan_reg_is_6g_psd_power(struct wlan_objmgr_pdev *pdev)
1674 {
1675 	return reg_is_6g_psd_power(pdev);
1676 }
1677 
1678 QDF_STATUS wlan_reg_get_6g_chan_ap_power(struct wlan_objmgr_pdev *pdev,
1679 					 qdf_freq_t chan_freq, bool *is_psd,
1680 					 uint16_t *tx_power,
1681 					 uint16_t *eirp_psd_power)
1682 {
1683 	return reg_get_6g_chan_ap_power(pdev, chan_freq, is_psd,
1684 					tx_power, eirp_psd_power);
1685 }
1686 
1687 qdf_export_symbol(wlan_reg_get_6g_chan_ap_power);
1688 
1689 QDF_STATUS
1690 wlan_reg_get_client_power_for_connecting_ap(struct wlan_objmgr_pdev *pdev,
1691 					    enum reg_6g_ap_type ap_type,
1692 					    qdf_freq_t chan_freq,
1693 					    bool *is_psd, uint16_t *tx_power,
1694 					    uint16_t *eirp_psd_power)
1695 {
1696 	return reg_get_client_power_for_connecting_ap(pdev, ap_type, chan_freq,
1697 						      is_psd, tx_power,
1698 						      eirp_psd_power);
1699 }
1700 
1701 QDF_STATUS
1702 wlan_reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev,
1703 				      enum reg_6g_client_type client_type,
1704 				      qdf_freq_t chan_freq,
1705 				      bool *is_psd, uint16_t *tx_power,
1706 				      uint16_t *eirp_psd_power)
1707 {
1708 	return reg_get_client_power_for_6ghz_ap(pdev, client_type, chan_freq,
1709 						is_psd, tx_power,
1710 						eirp_psd_power);
1711 }
1712 
1713 enum reg_6g_ap_type
1714 wlan_reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
1715 {
1716 	return reg_decide_6g_ap_pwr_type(pdev);
1717 }
1718 
1719 QDF_STATUS
1720 wlan_reg_set_ap_pwr_and_update_chan_list(struct wlan_objmgr_pdev *pdev,
1721 					 enum reg_6g_ap_type ap_pwr_type)
1722 {
1723 	return reg_set_ap_pwr_and_update_chan_list(pdev, ap_pwr_type);
1724 }
1725 
1726 qdf_export_symbol(wlan_reg_set_ap_pwr_and_update_chan_list);
1727 
1728 QDF_STATUS wlan_reg_get_superchan_entry(
1729 		struct wlan_objmgr_pdev *pdev,
1730 		enum channel_enum chan_enum,
1731 		const struct super_chan_info **p_sup_chan_entry)
1732 {
1733 	return reg_get_superchan_entry(pdev, chan_enum, p_sup_chan_entry);
1734 }
1735 
1736 enum supported_6g_pwr_types
1737 wlan_reg_conv_6g_ap_type_to_supported_6g_pwr_types(enum reg_6g_ap_type
1738 						   ap_pwr_type)
1739 {
1740 	return reg_conv_6g_ap_type_to_supported_6g_pwr_types(ap_pwr_type);
1741 }
1742 
1743 enum supported_6g_pwr_types
1744 wlan_reg_get_best_6g_pwr_type(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
1745 {
1746 	return reg_get_best_6g_pwr_type(pdev, freq);
1747 }
1748 
1749 enum reg_6g_ap_type
1750 wlan_reg_conv_supported_6g_pwr_type_to_ap_pwr_type(enum supported_6g_pwr_types
1751 						  in_6g_pwr_type)
1752 {
1753 	return reg_convert_supported_6g_pwr_type_to_ap_pwr_type(in_6g_pwr_type);
1754 }
1755 #endif /* CONFIG_BAND_6GHZ */
1756 
1757 bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)
1758 {
1759 	return reg_is_ext_tpc_supported(psoc);
1760 }
1761 
1762 #ifdef CONFIG_AFC_SUPPORT
1763 bool wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev)
1764 {
1765 	return reg_is_afc_power_event_received(pdev);
1766 }
1767 
1768 qdf_export_symbol(wlan_reg_is_afc_power_event_received);
1769 
1770 bool wlan_reg_is_afc_done(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
1771 {
1772 	return reg_is_afc_done(pdev, freq);
1773 }
1774 
1775 qdf_export_symbol(wlan_reg_is_afc_done);
1776 
1777 QDF_STATUS wlan_reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev,
1778 				   uint64_t *req_id)
1779 {
1780 	return reg_get_afc_req_id(pdev, req_id);
1781 }
1782 
1783 qdf_export_symbol(wlan_reg_get_afc_req_id);
1784 
1785 bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev)
1786 {
1787 	return reg_is_afc_expiry_event_received(pdev);
1788 }
1789 
1790 qdf_export_symbol(wlan_reg_is_afc_expiry_event_received);
1791 
1792 bool wlan_reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev)
1793 {
1794 	return reg_is_noaction_on_afc_pwr_evt(pdev);
1795 }
1796 
1797 QDF_STATUS
1798 wlan_reg_get_afc_dev_deploy_type(struct wlan_objmgr_pdev *pdev,
1799 				 enum reg_afc_dev_deploy_type *afc_dev_type)
1800 {
1801 	return reg_get_afc_dev_deploy_type(pdev, afc_dev_type);
1802 }
1803 
1804 qdf_export_symbol(wlan_reg_get_afc_dev_deploy_type);
1805 
1806 bool
1807 wlan_reg_is_sta_connect_allowed(struct wlan_objmgr_pdev *pdev,
1808 				enum reg_6g_ap_type root_ap_pwr_mode)
1809 {
1810 	return reg_is_sta_connect_allowed(pdev, root_ap_pwr_mode);
1811 }
1812 
1813 qdf_export_symbol(wlan_reg_is_sta_connect_allowed);
1814 #endif /* CONFIG_AFC_SUPPORT */
1815 
1816 QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev,
1817 					 enum phy_ch_width ch_width,
1818 					 bool *is_supported)
1819 {
1820 	return reg_is_chwidth_supported(pdev, ch_width, is_supported);
1821 }
1822 
1823 qdf_export_symbol(wlan_reg_is_chwidth_supported);
1824 
1825 #ifdef CONFIG_BAND_6GHZ
1826 qdf_freq_t wlan_reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev)
1827 {
1828 	return reg_get_thresh_priority_freq(pdev);
1829 }
1830 
1831 QDF_STATUS wlan_reg_psd_2_eirp(struct wlan_objmgr_pdev *pdev,
1832 			       int16_t psd,
1833 			       uint16_t ch_bw,
1834 			       int16_t *eirp)
1835 {
1836 	return reg_psd_2_eirp(pdev, psd, ch_bw, eirp);
1837 }
1838 
1839 qdf_export_symbol(wlan_reg_psd_2_eirp);
1840 
1841 QDF_STATUS wlan_reg_eirp_2_psd(struct wlan_objmgr_pdev *pdev, uint16_t ch_bw,
1842 			       int16_t eirp, int16_t *psd)
1843 {
1844 	return reg_eirp_2_psd(pdev, ch_bw, eirp, psd);
1845 }
1846 
1847 enum reg_6g_ap_type
1848 wlan_reg_get_best_pwr_mode(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
1849 			   qdf_freq_t cen320,
1850 			   uint16_t bw)
1851 {
1852 	return reg_get_best_pwr_mode(pdev, freq, cen320, bw);
1853 }
1854 
1855 qdf_export_symbol(wlan_reg_get_best_pwr_mode);
1856 
1857 uint8_t wlan_reg_get_eirp_pwr(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
1858 			      qdf_freq_t cen320, uint16_t bw,
1859 			      enum reg_6g_ap_type ap_pwr_type)
1860 {
1861 	return reg_get_eirp_pwr(pdev, freq, cen320, bw, ap_pwr_type);
1862 }
1863 
1864 qdf_export_symbol(wlan_reg_get_eirp_pwr);
1865 
1866 #endif /* CONFIG_BAND_6GHZ */
1867 
1868 enum phy_ch_width wlan_reg_find_chwidth_from_bw(uint16_t bw)
1869 {
1870 	return reg_find_chwidth_from_bw(bw);
1871 }
1872 
1873 #ifdef WLAN_FEATURE_11BE
1874 enum channel_state
1875 wlan_reg_get_chan_state_for_320(struct wlan_objmgr_pdev *pdev,
1876 				uint16_t freq,
1877 				qdf_freq_t center_320,
1878 				enum phy_ch_width ch_width,
1879 				const struct bonded_channel_freq
1880 				**bonded_chan_ptr_ptr,
1881 				enum supported_6g_pwr_types in_6g_pwr_type,
1882 				bool treat_nol_chan_as_disabled)
1883 {
1884 	return reg_get_chan_state_for_320(pdev, freq, center_320,
1885 					  ch_width, bonded_chan_ptr_ptr,
1886 					  in_6g_pwr_type,
1887 					  treat_nol_chan_as_disabled);
1888 }
1889 #endif
1890 
1891 #ifdef CONFIG_BAND_6GHZ
1892 bool wlan_is_sup_chan_entry_afc_done(struct wlan_objmgr_pdev *pdev,
1893 				     enum channel_enum chan_idx,
1894 				     enum supported_6g_pwr_types in_6g_pwr_mode)
1895 {
1896 	return reg_is_sup_chan_entry_afc_done(pdev, chan_idx, in_6g_pwr_mode);
1897 }
1898 
1899 qdf_export_symbol(wlan_is_sup_chan_entry_afc_done);
1900 #endif
1901