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