1 /*
2 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 /**
19 * DOC: dfs_confirm_radar.h
20 * This file contains false radar detection specific dfs interfaces.
21 */
22
23 #ifndef _DFS_CONFIRM_RADAR_H_
24 #define _DFS_CONFIRM_RADAR_H_
25
26 #include "dfs_internal.h"
27
28 #define DFS_INVALID_PRI_LIMIT 100 /* should we use 135? */
29 /* The time interval between two successive pulses
30 * in case of w53 chirp type can be as low as 50us.
31 * Experimentally the PRI limit was found to be as
32 * low as 15us.
33 */
34 #define DFS_INVALID_PRI_LIMIT_MKKN 15
35 #define FRAC_PRI_SCORE_ARRAY_SIZE 40
36
37 /**
38 * dfs_is_real_radar() - This function checks for fractional PRI and jitter in
39 * sidx index to determine if the radar is real or not.
40 * @dfs: Pointer to dfs structure.
41 * @rf: Pointer to dfs_filter structure.
42 * @ext_chan_flag: ext chan flags.
43 *
44 * Return : true if real RADAR else false.
45 */
46 #ifdef CONFIG_EXT_RADAR_PROCESS
47 bool dfs_is_real_radar(struct wlan_dfs *dfs,
48 struct dfs_filter *rf,
49 int ext_chan_flag);
50 #endif /* CONFIG_EXT_RADAR_PROCESS */
51
52 /**
53 * dfs_get_ext_filter() - This function gets the external radar filter table.
54 * @domain: The dfs domain for which the external radar table is needed.
55 * @num_radars: Output argument. Stores the numbers of filters in the filter.
56 * table.
57 *
58 * Return: Pointer to the radar table.
59 */
60 #ifdef CONFIG_EXT_RADAR_PROCESS
61 struct dfs_pulse *dfs_get_ext_filter(enum DFS_DOMAIN domain,
62 uint8_t *num_radars);
63 #else
dfs_get_ext_filter(enum DFS_DOMAIN domain,uint8_t * num_radars)64 static inline struct dfs_pulse *dfs_get_ext_filter(enum DFS_DOMAIN domain,
65 uint8_t *num_radars)
66 {
67 return NULL;
68 }
69 #endif /* CONFIG_EXT_RADAR_PROCESS */
70 #endif
71