1 /* 2 * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. 3 * 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: This file has the DFS dispatcher API which is exposed to outside of DFS 22 * component. 23 */ 24 25 #ifndef _WLAN_DFS_UTILS_API_H_ 26 #define _WLAN_DFS_UTILS_API_H_ 27 28 #include "wlan_dfs_ucfg_api.h" 29 #include "wlan_reg_services_api.h" 30 #include <wlan_objmgr_vdev_obj.h> 31 32 /* Add channel to nol */ 33 #define DFS_NOL_SET 1 34 35 /* Remove channel from nol */ 36 #define DFS_NOL_RESET 0 37 38 /* Mark nol-history flag for the channel */ 39 #define DFS_NOL_HISTORY_SET 1 40 41 /* Clear nol-history flag from the channel */ 42 #define DFS_NOL_HISTORY_RESET 0 43 44 /* Max nol channels */ 45 #define DFS_MAX_NOL_CHANNEL 80 46 47 /* WLAN 2.4GHz start freq */ 48 #define DFS_24_GHZ_BASE_FREQ (2407) 49 50 /* WLAN 5GHz start freq */ 51 #define DFS_5_GHZ_BASE_FREQ (5000) 52 53 /* WLAN 2.4 GHz channel number 6 */ 54 #define DFS_24_GHZ_CHANNEL_6 (6) 55 56 /* WLAN 2.4 GHz channel number 14 */ 57 #define DFS_24_GHZ_CHANNEL_14 (14) 58 59 /* WLAN 2.4 GHz channel number 15 */ 60 #define DFS_24_GHZ_CHANNEL_15 (15) 61 62 /* WLAN 2.4 GHz channel number 27 */ 63 #define DFS_24_GHZ_CHANNEL_27 (27) 64 65 /* WLAN 5GHz channel number 170 */ 66 #define DFS_5_GHZ_CHANNEL_170 (170) 67 68 /* WLAN 5MHz channel spacing */ 69 #define DFS_CHAN_SPACING_5MHZ (5) 70 71 /* WLAN 20Hz channel spacing */ 72 #define DFS_CHAN_SPACING_20MHZ (20) 73 74 /* WLAN 2.4GHz channel number 14 freq */ 75 #define DFS_CHAN_14_FREQ (2484) 76 77 /* WLAN 2.4GHz channel number 15 freq */ 78 #define DFS_CHAN_15_FREQ (2512) 79 80 /* WLAN 5GHz channel number 170 freq */ 81 #define DFS_CHAN_170_FREQ (5852) 82 83 84 85 extern struct dfs_to_mlme global_dfs_to_mlme; 86 87 /** 88 * utils_dfs_cac_valid_reset() - Cancels the dfs_cac_valid_timer timer. 89 * @pdev: Pointer to DFS pdev object. 90 * @prevchan_ieee: Prevchan number. 91 * @prevchan_flags: Prevchan flags. 92 * 93 * Wrapper function for dfs_cac_valid_reset(). This function called from 94 * outside of DFS component. 95 */ 96 97 QDF_STATUS utils_dfs_cac_valid_reset(struct wlan_objmgr_pdev *pdev, 98 uint8_t prevchan_ieee, 99 uint32_t prevchan_flags); 100 101 /** 102 * utils_dfs_reset() - Reset DFS members. 103 * @pdev: Pointer to DFS pdev object. 104 */ 105 QDF_STATUS utils_dfs_reset(struct wlan_objmgr_pdev *pdev); 106 107 /** 108 * utils_dfs_freq_is_in_nol() - check if given channel in nol list 109 * @pdev: Pointer to DFS pdev object 110 * @freq: channel frequency 111 * 112 * check if given channel in nol list. 113 * 114 * Return: true if channel in nol, false else 115 */ 116 bool utils_dfs_freq_is_in_nol(struct wlan_objmgr_pdev *pdev, uint32_t freq); 117 118 /** 119 * utils_dfs_reset_precaclists() - Clears and initiakizes precac_required_list, 120 * precac_done_list and precac_nol_list. 121 * @pdev: Pointer to DFS pdev object. 122 * 123 * Wrapper function for dfs_reset_precaclists(). This function called from 124 * outside of DFS component. 125 */ 126 QDF_STATUS utils_dfs_reset_precaclists(struct wlan_objmgr_pdev *pdev); 127 128 /** 129 * utils_dfs_reset_etsi_precaclists() - Clears and initializes etsi 130 * precac_required_list, 131 * etsi precac_done_list and 132 * etsi precac_nol_list. 133 * @pdev: Pointer to DFS pdev object. 134 * 135 * Wrapper function for dfs_reset_etsiprecaclists(). This function called from 136 * outside of DFS component. 137 */ 138 #ifdef QCA_SUPPORT_ETSI_PRECAC_DFS 139 QDF_STATUS utils_dfs_reset_etsi_precaclists(struct wlan_objmgr_pdev *pdev); 140 #else 141 static inline QDF_STATUS utils_dfs_reset_etsi_precaclists( 142 struct wlan_objmgr_pdev *pdev) 143 { 144 return QDF_STATUS_SUCCESS; 145 } 146 #endif 147 148 /** 149 * utils_dfs_cancel_precac_timer() - Cancel the precac timer. 150 * @pdev: Pointer to DFS pdev object. 151 * 152 * wrapper function for dfs_cancel_precac_timer(). this function called from 153 * outside of dfs component. 154 */ 155 QDF_STATUS utils_dfs_cancel_precac_timer(struct wlan_objmgr_pdev *pdev); 156 157 /** 158 * utils_dfs_start_precac_timer() - Start the precac timer. 159 * @pdev: Pointer to DFS pdev object. 160 * 161 * Wrapper function for dfs_start_precac_timer(). This function called from 162 * outside of dfs component. 163 * 164 * Return: 165 * * QDF_STATUS_E_FAILURE: Failed to start timer. 166 * * QDF_STATUS_SUCCESS: Timer started successfully. 167 */ 168 QDF_STATUS utils_dfs_start_precac_timer(struct wlan_objmgr_pdev *pdev); 169 170 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT 171 /** 172 * utils_dfs_precac_decide_pref_chan() - Choose preferred channel 173 * @pdev: Pointer to DFS pdev object. 174 * @ch_ieee: Pointer to channel number 175 176 * Wrapper function for dfs_decide_precac_preferred_chan(). This 177 * function called from outside of dfs component. 178 * 179 * Return: 180 * * QDF_STATUS_E_FAILURE: Failed to decide preferred channel. 181 * * QDF_STATUS_SUCCESS: Set preferred channel successfully. 182 */ 183 QDF_STATUS utils_dfs_precac_decide_pref_chan(struct wlan_objmgr_pdev *pdev, 184 uint8_t *ch_ieee); 185 #endif 186 187 /** 188 * utils_dfs_cancel_cac_timer() - Cancels the CAC timer. 189 * @pdev: Pointer to DFS pdev object. 190 * 191 * wrapper function for dfs_cancel_cac_timer(). this 192 * function called from outside of dfs component. 193 */ 194 QDF_STATUS utils_dfs_cancel_cac_timer(struct wlan_objmgr_pdev *pdev); 195 196 /** 197 * utils_dfs_start_cac_timer() - Starts the CAC timer. 198 * @pdev: Pointer to DFS pdev object. 199 * 200 * wrapper function for dfs_start_cac_timer(). this 201 * function called from outside of dfs component. 202 */ 203 QDF_STATUS utils_dfs_start_cac_timer(struct wlan_objmgr_pdev *pdev); 204 205 /** 206 * utils_dfs_cac_stop() - Clear the AP CAC timer. 207 * @pdev: Pointer to DFS pdev object. 208 * 209 * wrapper function for dfs_cac_stop(). this 210 * function called from outside of dfs component. 211 */ 212 QDF_STATUS utils_dfs_cac_stop(struct wlan_objmgr_pdev *pdev); 213 214 /** 215 * utils_dfs_stacac_stop() - Clear the STA CAC timer. 216 * @pdev: Pointer to DFS pdev object. 217 * 218 * wrapper function for dfs_stacac_stop(). this 219 * function called from outside of dfs component. 220 */ 221 QDF_STATUS utils_dfs_stacac_stop(struct wlan_objmgr_pdev *pdev); 222 223 /** 224 * utils_dfs_get_usenol() - Returns use_nol flag. 225 * @pdev: Pointer to DFS pdev object. 226 * @usenol: Pointer to usenol value. 227 * 228 * wrapper function for dfs_get_usenol(). this 229 * function called from outside of dfs component. 230 */ 231 QDF_STATUS utils_dfs_get_usenol(struct wlan_objmgr_pdev *pdev, 232 uint16_t *usenol); 233 234 /** 235 * utils_dfs_radar_disable() - Disables the radar. 236 * @pdev: Pointer to DFS pdev object. 237 * 238 * wrapper function for dfs_radar_disable(). this 239 * function called from outside of dfs component. 240 */ 241 QDF_STATUS utils_dfs_radar_disable(struct wlan_objmgr_pdev *pdev); 242 243 /** 244 * utils_dfs_set_update_nol_flag() - Sets update_nol flag. 245 * @pdev: Pointer to DFS pdev object. 246 * @val: update_nol flag. 247 * 248 * wrapper function for dfs_set_update_nol_flag(). this 249 * function called from outside of dfs component. 250 */ 251 QDF_STATUS utils_dfs_set_update_nol_flag(struct wlan_objmgr_pdev *pdev, 252 bool val); 253 254 /** 255 * utils_dfs_get_update_nol_flag() - Returns update_nol flag. 256 * @pdev: Pointer to DFS pdev object. 257 * @nol_flag: Fill nol_flag in this variable. 258 * 259 * wrapper function for dfs_get_update_nol_flag(). this 260 * function called from outside of dfs component. 261 */ 262 QDF_STATUS utils_dfs_get_update_nol_flag(struct wlan_objmgr_pdev *pdev, 263 bool *nol_flag); 264 265 /** 266 * utils_dfs_get_dfs_use_nol() - Get usenol. 267 * @pdev: Pointer to DFS pdev object. 268 * @dfs_use_nol: Pointer to dfs_use_nol. 269 * 270 * wrapper function for dfs_get_dfs_use_nol(). this 271 * function called from outside of dfs component. 272 */ 273 QDF_STATUS utils_dfs_get_dfs_use_nol(struct wlan_objmgr_pdev *pdev, 274 int *dfs_use_nol); 275 276 /** 277 * utils_dfs_get_nol_timeout() - Get NOL timeout. 278 * @pdev: Pointer to DFS pdev object. 279 * @dfs_nol_timeout: Pointer to dfs_nol_timeout. 280 * 281 * wrapper function for dfs_get_nol_timeout(). this 282 * function called from outside of dfs component. 283 */ 284 QDF_STATUS utils_dfs_get_nol_timeout(struct wlan_objmgr_pdev *pdev, 285 int *dfs_nol_timeout); 286 287 /** 288 * utils_dfs_nol_addchan() - Add channel to NOL. 289 * @pdev: Pointer to DFS pdev object. 290 * @chan: channel t o add NOL. 291 * @dfs_nol_timeout: NOL timeout. 292 * 293 * wrapper function for dfs_nol_addchan(). this 294 * function called from outside of dfs component. 295 */ 296 QDF_STATUS utils_dfs_nol_addchan(struct wlan_objmgr_pdev *pdev, 297 uint16_t freq, 298 uint32_t dfs_nol_timeout); 299 300 /** 301 * utils_dfs_nol_update() - NOL update 302 * @pdev: Pointer to DFS pdev object. 303 * 304 * wrapper function for dfs_nol_update(). this 305 * function called from outside of dfs component. 306 */ 307 QDF_STATUS utils_dfs_nol_update(struct wlan_objmgr_pdev *pdev); 308 309 /** 310 * utils_dfs_second_segment_radar_disable() - Disables the second segment radar. 311 * @pdev: Pointer to DFS pdev object. 312 * 313 * This is called when AP detects the radar, to (potentially) disable 314 * the radar code. 315 */ 316 QDF_STATUS utils_dfs_second_segment_radar_disable( 317 struct wlan_objmgr_pdev *pdev); 318 319 /** 320 * utils_dfs_fetch_nol_ie_info() - Fills the arguments with NOL information 321 * needed for sending RCSA. 322 * pdev: Pointer to DFS pdev object. 323 * nol_ie_bandwidth: Minimum DFS subchannel Bandwidth. 324 * nol_ie_startfreq: Radar affected channel list start subchannel's centre 325 * frequency. 326 * nol_ie_bitmap: Bitmap of radar affected subchannels. 327 */ 328 QDF_STATUS utils_dfs_fetch_nol_ie_info(struct wlan_objmgr_pdev *pdev, 329 uint8_t *nol_ie_bandwidth, 330 uint16_t *nol_ie_startfreq, 331 uint8_t *nol_ie_bitmap); 332 333 /** 334 * utils_dfs_set_rcsa_flags() - Set flags that are required for sending 335 * RCSA and NOL IE. 336 * pdev: Pointer to DFS pdev object. 337 * is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not. 338 * is_nol_ie_sent: Boolean to check if NOL IE should be sent or not. 339 */ 340 341 QDF_STATUS utils_dfs_set_rcsa_flags(struct wlan_objmgr_pdev *pdev, 342 bool is_rcsa_ie_sent, 343 bool is_nol_ie_sent); 344 345 /** 346 * utils_dfs_get_rcsa_flags() - Get flags that are required for sending 347 * RCSA and NOL IE. 348 * pdev: Pointer to DFS pdev object. 349 * is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not. 350 * is_nol_ie_sent: Boolean to check if NOL IE should be sent or not. 351 */ 352 353 QDF_STATUS utils_dfs_get_rcsa_flags(struct wlan_objmgr_pdev *pdev, 354 bool *is_rcsa_ie_sent, 355 bool *is_nol_ie_sent); 356 357 /** 358 * utils_dfs_process_nol_ie_bitmap() - Update NOL with external radar 359 * information. 360 * pdev: Pointer to DFS pdev object. 361 * nol_ie_bandwidth: Minimum DFS subchannel Bandwidth. 362 * nol_ie_startfreq: Radar affected channel list start channel's 363 * centre frequency. 364 * nol_ie_bitmap: Bitmap of radar affected subchannels. 365 * 366 * Return: True if NOL IE should be propagated, else false. 367 */ 368 bool utils_dfs_process_nol_ie_bitmap(struct wlan_objmgr_pdev *pdev, 369 uint8_t nol_ie_bandwidth, 370 uint16_t nol_ie_startfreq, 371 uint8_t nol_ie_bitmap); 372 373 /** 374 * utils_dfs_bw_reduce() - Set bw reduce. 375 * @pdev: Pointer to DFS pdev object. 376 * @bw_reduce: Fill bw_reduce value in this variable. 377 * 378 * Return: QDF_STATUS 379 */ 380 QDF_STATUS utils_dfs_bw_reduce(struct wlan_objmgr_pdev *pdev, 381 bool bw_reduce); 382 383 /** 384 * utils_dfs_is_bw_reduce() - Get bw reduce. 385 * @pdev: Pointer to DFS pdev object. 386 * @bw_reduce: Pointer to get bw_reduce value. 387 * 388 * Return: QDF_STATUS 389 */ 390 QDF_STATUS utils_dfs_is_bw_reduce(struct wlan_objmgr_pdev *pdev, 391 bool *bw_reduce); 392 /** 393 * utils_dfs_set_cac_timer_running() - Sets the cac timer running. 394 * @pdev: Pointer to DFS pdev object. 395 * @val: Set this value to dfs_cac_timer_running variable. 396 */ 397 QDF_STATUS utils_dfs_set_cac_timer_running(struct wlan_objmgr_pdev *pdev, 398 int val); 399 400 /** 401 * utils_dfs_get_nol_chfreq_and_chwidth() - Sets the cac timer running. 402 * @pdev: Pointer to DFS pdev object. 403 * @nollist: Pointer to NOL channel entry. 404 * @nol_chfreq: Pointer to save channel frequency. 405 * @nol_chwidth: Pointer to save channel width. 406 * @index: Index into nol list. 407 */ 408 QDF_STATUS utils_dfs_get_nol_chfreq_and_chwidth(struct wlan_objmgr_pdev *pdev, 409 void *nollist, 410 uint32_t *nol_chfreq, 411 uint32_t *nol_chwidth, 412 int index); 413 414 /** 415 * utils_dfs_get_random_channel() - Get random channel. 416 * @pdev: Pointer to DFS pdev object. 417 * @flags: random channel selection flags. 418 * @ch_params: current channel params. 419 * @hw_mode: current operating mode. 420 * @target_chan: Pointer to target_chan. 421 * @acs_info: acs range info. 422 * 423 * wrapper function for get_random_chan(). this 424 * function called from outside of dfs component. 425 * 426 * Return: QDF_STATUS 427 */ 428 QDF_STATUS utils_dfs_get_random_channel(struct wlan_objmgr_pdev *pdev, 429 uint16_t flags, struct ch_params *ch_params, 430 uint32_t *hw_mode, uint8_t *target_chan, 431 struct dfs_acs_info *acs_info); 432 433 /** 434 * utils_dfs_bw_reduced_channel() - Get BW reduced channel. 435 * @pdev: Pointer to DFS pdev object. 436 * @ch_params: current channel params. 437 * @hw_mode: current operating mode. 438 * @target_chan: Pointer to target_chan. 439 * 440 * wrapper function for get bw_reduced_channel. this 441 * function called from outside of dfs component. 442 * 443 * Return: QDF_STATUS 444 */ 445 QDF_STATUS utils_dfs_bw_reduced_channel(struct wlan_objmgr_pdev *pdev, 446 struct ch_params *ch_params, 447 uint32_t *hw_mode, 448 uint8_t *target_chan); 449 /** 450 * utils_dfs_init_nol() - Initialize nol from platform driver. 451 * @pdev: pdev handler. 452 * 453 * Initialize nol from platform driver. 454 * 455 * Return: None 456 */ 457 #ifdef QCA_DFS_NOL_PLATFORM_DRV_SUPPORT 458 void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev); 459 #else 460 static inline void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev) 461 { 462 } 463 #endif 464 /** 465 * utils_dfs_save_nol() - save nol list to platform driver. 466 * @pdev: pdev handler. 467 * 468 * Save nol list to platform driver. 469 * 470 * Return: None 471 */ 472 void utils_dfs_save_nol(struct wlan_objmgr_pdev *pdev); 473 474 /** 475 * utils_dfs_print_nol_channels() - log nol channels. 476 * @pdev: pdev handler. 477 * 478 * log nol channels. 479 * 480 * Return: None 481 */ 482 #ifdef DFS_COMPONENT_ENABLE 483 void utils_dfs_print_nol_channels(struct wlan_objmgr_pdev *pdev); 484 #else 485 static inline void utils_dfs_print_nol_channels(struct wlan_objmgr_pdev *pdev) 486 { 487 } 488 #endif 489 490 /** 491 * utils_dfs_clear_nol_channels() - clear nol list. 492 * @pdev: pdev handler. 493 * 494 * log nol channels. 495 * 496 * Return: None 497 */ 498 void utils_dfs_clear_nol_channels(struct wlan_objmgr_pdev *pdev); 499 500 /** 501 * utils_is_dfs_ch() - is channel dfs. 502 * @pdev: pdev handler. 503 * 504 * is channel dfs. 505 * 506 * Return: True if channel dfs, else false. 507 */ 508 static inline bool utils_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan) 509 { 510 return wlan_reg_is_dfs_ch(pdev, chan); 511 } 512 /** 513 * utils_dfs_reg_update_nol_ch() - set nol channel 514 * 515 * @pdev: pdev ptr 516 * @ch_list: channel list to be returned 517 * @num_ch: number of channels 518 * @nol_ch: nol flag 519 * 520 * Return: void 521 */ 522 void utils_dfs_reg_update_nol_ch(struct wlan_objmgr_pdev *pdev, 523 uint8_t *ch_list, 524 uint8_t num_ch, 525 bool nol_ch); 526 527 /** 528 * utils_dfs_freq_to_chan () - convert channel freq to channel number 529 * @freq: frequency 530 * 531 * Return: channel number 532 */ 533 uint8_t utils_dfs_freq_to_chan(uint32_t freq); 534 535 /** 536 * utils_dfs_chan_to_freq () - convert channel number to frequency 537 * @chan: channel number 538 * 539 * Return: frequency 540 */ 541 #ifdef DFS_COMPONENT_ENABLE 542 uint32_t utils_dfs_chan_to_freq(uint8_t chan); 543 #else 544 static inline uint32_t utils_dfs_chan_to_freq(uint8_t chan) 545 { 546 return 0; 547 } 548 #endif 549 /** 550 * utils_dfs_update_cur_chan_flags() - Update DFS channel flag and flagext. 551 * @pdev: Pointer to DFS pdev object. 552 * @flags: New channel flags 553 * @flagext: New Extended flags 554 * 555 * Return: QDF_STATUS 556 */ 557 QDF_STATUS utils_dfs_update_cur_chan_flags(struct wlan_objmgr_pdev *pdev, 558 uint64_t flags, 559 uint16_t flagext); 560 561 #ifdef QCA_MCL_DFS_SUPPORT 562 /** 563 * utils_dfs_mark_leaking_ch() - to mark channel leaking in to nol 564 * @pdev: Pointer to pdev structure. 565 * @ch_width: channel width 566 * @temp_ch_lst_sz: the target channel list 567 * @temp_ch_lst: the target channel list 568 * 569 * This function removes the channels from temp channel list that 570 * (if selected as target channel) will cause leakage in one of 571 * the NOL channels 572 * 573 * Return: QDF_STATUS 574 */ 575 QDF_STATUS utils_dfs_mark_leaking_ch(struct wlan_objmgr_pdev *pdev, 576 enum phy_ch_width ch_width, 577 uint8_t temp_ch_lst_sz, 578 uint8_t *temp_ch_lst); 579 #else 580 static inline QDF_STATUS utils_dfs_mark_leaking_ch 581 (struct wlan_objmgr_pdev *pdev, 582 enum phy_ch_width ch_width, 583 uint8_t temp_ch_lst_sz, 584 uint8_t *temp_ch_lst) 585 { 586 return QDF_STATUS_SUCCESS; 587 } 588 #endif 589 /** 590 * utils_get_dfsdomain() - Get DFS domain. 591 * @pdev: Pointer to PDEV structure. 592 * 593 * Return: DFS domain. 594 */ 595 int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev); 596 597 /** 598 * utils_dfs_get_cur_rd() - Get current regdomain. 599 * @pdev: pdev ptr 600 * 601 * Return: Regdomain pair id. 602 */ 603 uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev); 604 605 /** 606 * utils_dfs_is_spoof_check_failed() - get spoof check status. 607 * @pdev: pdev ptr 608 * @is_spoof_check_failed: pointer containing the status. 609 * 610 * Return: QDF_STATUS. 611 */ 612 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 613 QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev, 614 bool *is_spoof_check_failed); 615 #else 616 static inline 617 QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev, 618 bool *is_spoof_check_failed) 619 { 620 return QDF_STATUS_SUCCESS; 621 } 622 #endif 623 624 /** 625 * dfs_get_num_chans() - Get the number of channels supported by the regulatory. 626 * 627 * Return: Number of supported channels. 628 */ 629 int dfs_get_num_chans(void); 630 631 /** 632 * utils_dfs_get_chan_list() - Get channel list from regdb. 633 * @pdev: Pointer to DFS pdev object. 634 * @clist: Pointer to current channel list 635 * @num_chan: number of channels in the current channel list. 636 */ 637 void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, 638 void *clist, 639 uint32_t *num_chan); 640 641 /** 642 * utils_dfs_get_nol_history_chan_list() - Get nol_history channels from regdb 643 * component. 644 * @pdev: Pointer to pdev structure. 645 * @clist: Pointer to channel list. 646 * @num_chan: number of channels. 647 */ 648 void utils_dfs_get_nol_history_chan_list(struct wlan_objmgr_pdev *pdev, 649 void *clist, uint32_t *num_chan); 650 651 /** 652 * utils_dfs_reg_update_nol_history_ch() - set nol history channel 653 * 654 * @pdev: pdev ptr 655 * @ch_list: channel list to be returned 656 * @num_ch: number of channels 657 * @nol_history_ch: nol history flag 658 * 659 * Return: void 660 */ 661 void utils_dfs_reg_update_nol_history_ch(struct wlan_objmgr_pdev *pdev, 662 uint8_t *ch_list, 663 uint8_t num_ch, 664 bool nol_history_ch); 665 666 /** 667 * utils_dfs_check_for_cac_start() - Check for DFS CAC start conditions. 668 * @pdev: pdev ptr 669 * @continue_current_cac: If AP can start CAC then this variable indicates 670 * whether to continue with the current CAC or restart the CAC. This variable 671 * is valid only if this function returns true. 672 * 673 * Return: true if AP can start or continue the current CAC, else false. 674 */ 675 bool utils_dfs_check_for_cac_start(struct wlan_objmgr_pdev *pdev, 676 bool *continue_current_cac); 677 678 /** utils_dfs_is_precac_done() - Check if precac has been done in chosen channel 679 * @pdev: Pointer to DFS pdev object. 680 * @wlan_chan: Pointer to wlan channel object that can be accessed by other 681 * components. 682 * Wrapper function for dfs_is_precac_done(). This API is called from outside 683 * the dfs component. 684 * 685 * Return: 686 * * True :If precac is done on channel. 687 * * False:If precac is not done on channel. 688 */ 689 bool utils_dfs_is_precac_done(struct wlan_objmgr_pdev *pdev, 690 struct wlan_channel *wlan_chan); 691 /** 692 * utils_dfs_get_disable_radar_marking - Retrieve the value of disable radar 693 * marking. 694 * @pdev: Pointer to DFS pdev object. 695 * @dis_radar_marking: pointer to retrieve the value of disable_radar_marking. 696 */ 697 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD) 698 QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev, 699 bool *disable_radar_marking); 700 #else 701 static inline 702 QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev, 703 bool *disable_radar_marking) 704 { 705 return QDF_STATUS_SUCCESS; 706 } 707 #endif 708 709 /** 710 * utils_dfs_clear_cac_started_chan() - Clear dfs cac started channel. 711 * @pdev: pdev ptr 712 */ 713 void utils_dfs_clear_cac_started_chan(struct wlan_objmgr_pdev *pdev); 714 #endif /* _WLAN_DFS_UTILS_API_H_ */ 715