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, ¶ms); 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 #ifdef QCA_DFS_BW_PUNCTURE 1317 uint16_t wlan_reg_find_nearest_puncture_pattern(enum phy_ch_width bw, 1318 uint16_t proposed_bitmap) 1319 { 1320 return reg_find_nearest_puncture_pattern(bw, proposed_bitmap); 1321 } 1322 #endif /* QCA_DFS_BW_PUNCTURE */ 1323 1324 QDF_STATUS wlan_reg_extract_puncture_by_bw(enum phy_ch_width ori_bw, 1325 uint16_t ori_puncture_bitmap, 1326 qdf_freq_t freq, 1327 qdf_freq_t cen320_freq, 1328 enum phy_ch_width new_bw, 1329 uint16_t *new_puncture_bitmap) 1330 { 1331 return reg_extract_puncture_by_bw(ori_bw, ori_puncture_bitmap, freq, 1332 cen320_freq, new_bw, 1333 new_puncture_bitmap); 1334 } 1335 1336 void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params, 1337 bool is_create_punc_bitmap) 1338 { 1339 reg_set_create_punc_bitmap(ch_params, is_create_punc_bitmap); 1340 } 1341 #endif /* WLAN_FEATURE_11BE */ 1342 1343 enum channel_state 1344 wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev, 1345 qdf_freq_t freq) 1346 { 1347 return reg_get_channel_state_for_freq(pdev, freq); 1348 } 1349 1350 #ifdef CONFIG_REG_6G_PWRMODE 1351 enum channel_state 1352 wlan_reg_get_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev, 1353 qdf_freq_t freq, 1354 enum supported_6g_pwr_types 1355 in_6g_pwr_type) 1356 { 1357 return reg_get_channel_state_for_pwrmode(pdev, freq, in_6g_pwr_type); 1358 } 1359 #endif 1360 1361 #ifdef CONFIG_REG_CLIENT 1362 enum channel_state wlan_reg_get_channel_state_from_secondary_list_for_freq( 1363 struct wlan_objmgr_pdev *pdev, 1364 qdf_freq_t freq) 1365 { 1366 return reg_get_channel_state_from_secondary_list_for_freq(pdev, freq); 1367 } 1368 1369 QDF_STATUS 1370 wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev, 1371 struct channel_power *ch_list, 1372 uint8_t *num_chan, 1373 enum supported_6g_pwr_types in_6g_pwr_type) 1374 { 1375 return reg_get_channel_list_with_power(pdev, ch_list, num_chan, 1376 in_6g_pwr_type); 1377 } 1378 #endif 1379 1380 uint8_t wlan_reg_get_channel_reg_power_for_freq(struct wlan_objmgr_pdev *pdev, 1381 qdf_freq_t freq) 1382 { 1383 return reg_get_channel_reg_power_for_freq(pdev, freq); 1384 } 1385 1386 enum reg_wifi_band wlan_reg_freq_to_band(qdf_freq_t freq) 1387 { 1388 return reg_freq_to_band(freq); 1389 } 1390 qdf_export_symbol(wlan_reg_freq_to_band); 1391 1392 qdf_freq_t wlan_reg_min_chan_freq(void) 1393 { 1394 return reg_min_chan_freq(); 1395 } 1396 1397 qdf_freq_t wlan_reg_max_chan_freq(void) 1398 { 1399 return reg_max_chan_freq(); 1400 } 1401 1402 void wlan_reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev, 1403 qdf_freq_t freq, 1404 uint16_t chan_width, 1405 bool global_tbl_lookup, 1406 uint16_t behav_limit, 1407 uint8_t *op_class, 1408 uint8_t *chan_num) 1409 { 1410 return reg_freq_width_to_chan_op_class(pdev, freq, chan_width, 1411 global_tbl_lookup, 1412 behav_limit, 1413 op_class, 1414 chan_num); 1415 } 1416 1417 void wlan_reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev, 1418 qdf_freq_t freq, 1419 uint16_t chan_width, 1420 bool global_tbl_lookup, 1421 uint16_t behav_limit, 1422 uint8_t *op_class, 1423 uint8_t *chan_num) 1424 { 1425 reg_freq_width_to_chan_op_class_auto(pdev, freq, chan_width, 1426 global_tbl_lookup, 1427 behav_limit, 1428 op_class, 1429 chan_num); 1430 } 1431 1432 qdf_export_symbol(wlan_reg_freq_width_to_chan_op_class_auto); 1433 1434 void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev, 1435 qdf_freq_t freq, 1436 bool global_tbl_lookup, 1437 uint16_t behav_limit, 1438 uint8_t *op_class, 1439 uint8_t *chan_num) 1440 { 1441 return reg_freq_to_chan_op_class(pdev, freq, 1442 global_tbl_lookup, 1443 behav_limit, 1444 op_class, 1445 chan_num); 1446 } 1447 1448 bool wlan_reg_is_freq_in_country_opclass(struct wlan_objmgr_pdev *pdev, 1449 const uint8_t country[3], 1450 uint8_t op_class, 1451 qdf_freq_t chan_freq) 1452 { 1453 return reg_is_freq_in_country_opclass(pdev, country, 1454 op_class, chan_freq); 1455 } 1456 1457 enum channel_state 1458 wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev, 1459 uint16_t freq, 1460 enum phy_ch_width bw, 1461 const 1462 struct bonded_channel_freq 1463 **bonded_chan_ptr_ptr) 1464 { 1465 /* 1466 * Get channel frequencies and state from regulatory 1467 */ 1468 return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw, 1469 bonded_chan_ptr_ptr); 1470 } 1471 1472 #ifdef CONFIG_REG_6G_PWRMODE 1473 enum channel_state 1474 wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode( 1475 struct wlan_objmgr_pdev *pdev, 1476 uint16_t freq, 1477 enum phy_ch_width bw, 1478 const 1479 struct bonded_channel_freq 1480 **bonded_chan_ptr_ptr, 1481 enum supported_6g_pwr_types 1482 in_6g_pwr_mode) 1483 { 1484 /* 1485 * Get channel frequencies and state from regulatory 1486 */ 1487 return reg_get_5g_bonded_channel_for_pwrmode(pdev, freq, bw, 1488 bonded_chan_ptr_ptr, 1489 in_6g_pwr_mode); 1490 } 1491 1492 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode); 1493 #endif 1494 1495 #if defined(WLAN_FEATURE_11BE) && defined(CONFIG_REG_CLIENT) 1496 enum channel_state 1497 wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev, 1498 qdf_freq_t freq, 1499 enum phy_ch_width bw, 1500 qdf_freq_t sec_freq) 1501 { 1502 if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) 1503 return reg_get_2g_bonded_channel_state_for_freq(pdev, freq, 1504 sec_freq, bw); 1505 if (bw == CH_WIDTH_320MHZ) { 1506 const struct bonded_channel_freq *bonded_chan_ptr_ptr = NULL; 1507 1508 return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw, 1509 &bonded_chan_ptr_ptr); 1510 } else { 1511 struct ch_params params = {0}; 1512 1513 params.ch_width = bw; 1514 1515 return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, 1516 ¶ms); 1517 } 1518 } 1519 1520 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq); 1521 1522 #else 1523 enum channel_state 1524 wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev, 1525 qdf_freq_t freq, 1526 enum phy_ch_width bw, 1527 qdf_freq_t sec_freq) 1528 { 1529 if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) { 1530 return reg_get_2g_bonded_channel_state_for_freq(pdev, freq, 1531 sec_freq, bw); 1532 } else { 1533 struct ch_params params = {0}; 1534 1535 params.ch_width = bw; 1536 1537 return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, 1538 ¶ms); 1539 } 1540 } 1541 1542 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq); 1543 1544 #ifdef CONFIG_REG_6G_PWRMODE 1545 enum channel_state 1546 wlan_reg_get_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev, 1547 qdf_freq_t freq, 1548 enum phy_ch_width bw, 1549 qdf_freq_t sec_freq, 1550 enum supported_6g_pwr_types 1551 in_6g_pwr_mode) 1552 { 1553 if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) { 1554 return reg_get_2g_bonded_channel_state_for_freq(pdev, freq, 1555 sec_freq, bw); 1556 } else { 1557 struct ch_params params = {0}; 1558 1559 params.ch_width = bw; 1560 1561 return reg_get_5g_bonded_channel_state_for_pwrmode(pdev, freq, 1562 ¶ms, 1563 in_6g_pwr_mode); 1564 } 1565 } 1566 1567 qdf_export_symbol(wlan_reg_get_bonded_channel_state_for_pwrmode); 1568 #endif 1569 #endif 1570 #endif /* CONFIG CHAN FREQ API */ 1571 1572 uint16_t wlan_reg_get_op_class_width(struct wlan_objmgr_pdev *pdev, 1573 uint8_t op_class, 1574 bool global_tbl_lookup) 1575 { 1576 return reg_get_op_class_width(pdev, op_class, 1577 global_tbl_lookup); 1578 } 1579 1580 bool wlan_reg_is_5ghz_op_class(const uint8_t *country, uint8_t op_class) 1581 { 1582 return reg_is_5ghz_op_class(country, op_class); 1583 } 1584 1585 bool wlan_reg_is_2ghz_op_class(const uint8_t *country, uint8_t op_class) 1586 { 1587 return reg_is_2ghz_op_class(country, op_class); 1588 } 1589 1590 bool wlan_reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, 1591 uint8_t op_class) 1592 { 1593 return reg_is_6ghz_op_class(pdev, op_class); 1594 } 1595 1596 #ifdef CONFIG_REG_CLIENT 1597 bool wlan_reg_is_6ghz_supported(struct wlan_objmgr_psoc *psoc) 1598 { 1599 return reg_is_6ghz_supported(psoc); 1600 } 1601 #endif 1602 1603 #ifdef HOST_OPCLASS_EXT 1604 qdf_freq_t 1605 wlan_reg_country_chan_opclass_to_freq(struct wlan_objmgr_pdev *pdev, 1606 const uint8_t country[3], 1607 uint8_t chan, uint8_t op_class, 1608 bool strict) 1609 { 1610 return reg_country_chan_opclass_to_freq(pdev, country, chan, op_class, 1611 strict); 1612 } 1613 #endif 1614 1615 uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan, 1616 uint8_t op_class, 1617 bool global_tbl_lookup) 1618 { 1619 if (!chan || !op_class) 1620 return 0; 1621 1622 return reg_chan_opclass_to_freq(chan, op_class, global_tbl_lookup); 1623 } 1624 1625 qdf_freq_t wlan_reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class, 1626 bool global_tbl_lookup) 1627 { 1628 if (!chan || !op_class) 1629 return 0; 1630 1631 return reg_chan_opclass_to_freq_auto(chan, op_class, global_tbl_lookup); 1632 } 1633 1634 #ifdef CHECK_REG_PHYMODE 1635 enum reg_phymode wlan_reg_get_max_phymode(struct wlan_objmgr_pdev *pdev, 1636 enum reg_phymode phy_in, 1637 qdf_freq_t freq) 1638 { 1639 return reg_get_max_phymode(pdev, phy_in, freq); 1640 } 1641 #endif /* CHECK_REG_PHYMODE */ 1642 1643 #ifdef CONFIG_REG_CLIENT 1644 enum band_info wlan_reg_band_bitmap_to_band_info(uint32_t band_bitmap) 1645 { 1646 return reg_band_bitmap_to_band_info(band_bitmap); 1647 } 1648 #endif 1649 1650 #if defined(CONFIG_BAND_6GHZ) 1651 QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev, 1652 bool *reg_rnr_tpe_usable) 1653 { 1654 return reg_get_rnr_tpe_usable(pdev, reg_rnr_tpe_usable); 1655 } 1656 1657 QDF_STATUS wlan_reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev, 1658 bool *reg_unspecified_ap_usable) 1659 { 1660 return reg_get_unspecified_ap_usable(pdev, reg_unspecified_ap_usable); 1661 } 1662 1663 QDF_STATUS 1664 wlan_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev, 1665 enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type) 1666 { 1667 return reg_get_cur_6g_ap_pwr_type(pdev, reg_cur_6g_ap_pwr_type); 1668 } 1669 1670 qdf_export_symbol(wlan_reg_get_cur_6g_ap_pwr_type); 1671 1672 QDF_STATUS 1673 wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev, 1674 enum reg_6g_client_type 1675 *reg_cur_6g_client_mobility_type) 1676 { 1677 return reg_get_cur_6g_client_type(pdev, 1678 reg_cur_6g_client_mobility_type); 1679 } 1680 1681 bool wlan_reg_is_6g_psd_power(struct wlan_objmgr_pdev *pdev) 1682 { 1683 return reg_is_6g_psd_power(pdev); 1684 } 1685 1686 QDF_STATUS wlan_reg_get_6g_chan_ap_power(struct wlan_objmgr_pdev *pdev, 1687 qdf_freq_t chan_freq, bool *is_psd, 1688 uint16_t *tx_power, 1689 uint16_t *eirp_psd_power) 1690 { 1691 return reg_get_6g_chan_ap_power(pdev, chan_freq, is_psd, 1692 tx_power, eirp_psd_power); 1693 } 1694 1695 qdf_export_symbol(wlan_reg_get_6g_chan_ap_power); 1696 1697 QDF_STATUS 1698 wlan_reg_get_client_power_for_connecting_ap(struct wlan_objmgr_pdev *pdev, 1699 enum reg_6g_ap_type ap_type, 1700 qdf_freq_t chan_freq, 1701 bool is_psd, uint16_t *tx_power, 1702 uint16_t *eirp_psd_power) 1703 { 1704 return reg_get_client_power_for_connecting_ap(pdev, ap_type, chan_freq, 1705 is_psd, tx_power, 1706 eirp_psd_power); 1707 } 1708 1709 QDF_STATUS 1710 wlan_reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev, 1711 enum reg_6g_client_type client_type, 1712 qdf_freq_t chan_freq, 1713 bool *is_psd, uint16_t *tx_power, 1714 uint16_t *eirp_psd_power) 1715 { 1716 return reg_get_client_power_for_6ghz_ap(pdev, client_type, chan_freq, 1717 is_psd, tx_power, 1718 eirp_psd_power); 1719 } 1720 1721 enum reg_6g_ap_type 1722 wlan_reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) 1723 { 1724 return reg_decide_6g_ap_pwr_type(pdev); 1725 } 1726 1727 QDF_STATUS 1728 wlan_reg_set_ap_pwr_and_update_chan_list(struct wlan_objmgr_pdev *pdev, 1729 enum reg_6g_ap_type ap_pwr_type) 1730 { 1731 return reg_set_ap_pwr_and_update_chan_list(pdev, ap_pwr_type); 1732 } 1733 1734 qdf_export_symbol(wlan_reg_set_ap_pwr_and_update_chan_list); 1735 1736 QDF_STATUS wlan_reg_get_superchan_entry( 1737 struct wlan_objmgr_pdev *pdev, 1738 enum channel_enum chan_enum, 1739 const struct super_chan_info **p_sup_chan_entry) 1740 { 1741 return reg_get_superchan_entry(pdev, chan_enum, p_sup_chan_entry); 1742 } 1743 1744 enum supported_6g_pwr_types 1745 wlan_reg_conv_6g_ap_type_to_supported_6g_pwr_types(enum reg_6g_ap_type 1746 ap_pwr_type) 1747 { 1748 return reg_conv_6g_ap_type_to_supported_6g_pwr_types(ap_pwr_type); 1749 } 1750 1751 enum supported_6g_pwr_types 1752 wlan_reg_get_best_6g_pwr_type(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) 1753 { 1754 return reg_get_best_6g_pwr_type(pdev, freq); 1755 } 1756 1757 enum reg_6g_ap_type 1758 wlan_reg_conv_supported_6g_pwr_type_to_ap_pwr_type(enum supported_6g_pwr_types 1759 in_6g_pwr_type) 1760 { 1761 return reg_convert_supported_6g_pwr_type_to_ap_pwr_type(in_6g_pwr_type); 1762 } 1763 #endif /* CONFIG_BAND_6GHZ */ 1764 1765 bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc) 1766 { 1767 return reg_is_ext_tpc_supported(psoc); 1768 } 1769 1770 #ifdef CONFIG_AFC_SUPPORT 1771 bool wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev) 1772 { 1773 return reg_is_afc_power_event_received(pdev); 1774 } 1775 1776 qdf_export_symbol(wlan_reg_is_afc_power_event_received); 1777 1778 bool wlan_reg_is_afc_done(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) 1779 { 1780 return reg_is_afc_done(pdev, freq); 1781 } 1782 1783 qdf_export_symbol(wlan_reg_is_afc_done); 1784 1785 QDF_STATUS wlan_reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev, 1786 uint64_t *req_id) 1787 { 1788 return reg_get_afc_req_id(pdev, req_id); 1789 } 1790 1791 qdf_export_symbol(wlan_reg_get_afc_req_id); 1792 1793 bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev) 1794 { 1795 return reg_is_afc_expiry_event_received(pdev); 1796 } 1797 1798 qdf_export_symbol(wlan_reg_is_afc_expiry_event_received); 1799 1800 bool wlan_reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev) 1801 { 1802 return reg_is_noaction_on_afc_pwr_evt(pdev); 1803 } 1804 1805 QDF_STATUS 1806 wlan_reg_get_afc_dev_deploy_type(struct wlan_objmgr_pdev *pdev, 1807 enum reg_afc_dev_deploy_type *afc_dev_type) 1808 { 1809 return reg_get_afc_dev_deploy_type(pdev, afc_dev_type); 1810 } 1811 1812 qdf_export_symbol(wlan_reg_get_afc_dev_deploy_type); 1813 1814 bool 1815 wlan_reg_is_sta_connect_allowed(struct wlan_objmgr_pdev *pdev, 1816 enum reg_6g_ap_type root_ap_pwr_mode) 1817 { 1818 return reg_is_sta_connect_allowed(pdev, root_ap_pwr_mode); 1819 } 1820 1821 qdf_export_symbol(wlan_reg_is_sta_connect_allowed); 1822 #endif /* CONFIG_AFC_SUPPORT */ 1823 1824 QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev, 1825 enum phy_ch_width ch_width, 1826 bool *is_supported) 1827 { 1828 return reg_is_chwidth_supported(pdev, ch_width, is_supported); 1829 } 1830 1831 qdf_export_symbol(wlan_reg_is_chwidth_supported); 1832 1833 #ifdef CONFIG_BAND_6GHZ 1834 qdf_freq_t wlan_reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev) 1835 { 1836 return reg_get_thresh_priority_freq(pdev); 1837 } 1838 1839 QDF_STATUS wlan_reg_psd_2_eirp(struct wlan_objmgr_pdev *pdev, 1840 int16_t psd, 1841 uint16_t ch_bw, 1842 int16_t *eirp) 1843 { 1844 return reg_psd_2_eirp(pdev, psd, ch_bw, eirp); 1845 } 1846 1847 qdf_export_symbol(wlan_reg_psd_2_eirp); 1848 1849 QDF_STATUS wlan_reg_eirp_2_psd(struct wlan_objmgr_pdev *pdev, uint16_t ch_bw, 1850 int16_t eirp, int16_t *psd) 1851 { 1852 return reg_eirp_2_psd(pdev, ch_bw, eirp, psd); 1853 } 1854 1855 enum reg_6g_ap_type 1856 wlan_reg_get_best_pwr_mode(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq, 1857 qdf_freq_t cen320, 1858 uint16_t bw) 1859 { 1860 return reg_get_best_pwr_mode(pdev, freq, cen320, bw); 1861 } 1862 1863 qdf_export_symbol(wlan_reg_get_best_pwr_mode); 1864 1865 uint8_t wlan_reg_get_eirp_pwr(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq, 1866 qdf_freq_t cen320, uint16_t bw, 1867 enum reg_6g_ap_type ap_pwr_type) 1868 { 1869 return reg_get_eirp_pwr(pdev, freq, cen320, bw, ap_pwr_type); 1870 } 1871 1872 qdf_export_symbol(wlan_reg_get_eirp_pwr); 1873 1874 #endif /* CONFIG_BAND_6GHZ */ 1875 1876 enum phy_ch_width wlan_reg_find_chwidth_from_bw(uint16_t bw) 1877 { 1878 return reg_find_chwidth_from_bw(bw); 1879 } 1880 1881 #ifdef WLAN_FEATURE_11BE 1882 enum channel_state 1883 wlan_reg_get_chan_state_for_320(struct wlan_objmgr_pdev *pdev, 1884 uint16_t freq, 1885 qdf_freq_t center_320, 1886 enum phy_ch_width ch_width, 1887 const struct bonded_channel_freq 1888 **bonded_chan_ptr_ptr, 1889 enum supported_6g_pwr_types in_6g_pwr_type, 1890 bool treat_nol_chan_as_disabled) 1891 { 1892 return reg_get_chan_state_for_320(pdev, freq, center_320, 1893 ch_width, bonded_chan_ptr_ptr, 1894 in_6g_pwr_type, 1895 treat_nol_chan_as_disabled); 1896 } 1897 #endif 1898 1899 #ifdef CONFIG_BAND_6GHZ 1900 bool wlan_is_sup_chan_entry_afc_done(struct wlan_objmgr_pdev *pdev, 1901 enum channel_enum chan_idx, 1902 enum supported_6g_pwr_types in_6g_pwr_mode) 1903 { 1904 return reg_is_sup_chan_entry_afc_done(pdev, chan_idx, in_6g_pwr_mode); 1905 } 1906 1907 qdf_export_symbol(wlan_is_sup_chan_entry_afc_done); 1908 1909 QDF_STATUS 1910 wlan_reg_display_super_chan_list(struct wlan_objmgr_pdev *pdev) 1911 { 1912 return reg_display_super_chan_list(pdev); 1913 } 1914 #endif 1915