1 /* 2 * Copyright (c) 2017-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: dfs_partial_offload_radar.h 22 * This file contains partial offload specific dfs interfaces 23 */ 24 25 #ifndef _DFS_PARTIAL_OFFLOAD_RADAR_H_ 26 #define _DFS_PARTIAL_OFFLOAD_RADAR_H_ 27 28 /** 29 * dfs_get_po_radars() - Initialize the RADAR table for PO. 30 * @dfs: Pointer to wlan_dfs structure. 31 */ 32 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) 33 void dfs_get_po_radars(struct wlan_dfs *dfs); 34 #else 35 static inline void dfs_get_po_radars(struct wlan_dfs *dfs) 36 { 37 } 38 #endif 39 40 /** 41 * dfs_send_avg_params_to_fw - send avg radar parameters to FW. 42 * @dfs: Pointer to wlan_dfs structure. 43 * @params: Pointer to dfs_radar_found_params. 44 * 45 * Return: None 46 */ 47 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 48 void dfs_send_avg_params_to_fw(struct wlan_dfs *dfs, 49 struct dfs_radar_found_params *params); 50 #else 51 static inline 52 void dfs_send_avg_params_to_fw(struct wlan_dfs *dfs, 53 struct dfs_radar_found_params *params) 54 { 55 } 56 #endif 57 58 /** 59 * dfs_host_wait_timer_init() - Initialize dfs host status wait timer. 60 * @dfs: Pointer to wlan_dfs structure. 61 */ 62 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 63 void dfs_host_wait_timer_init(struct wlan_dfs *dfs); 64 #else 65 static inline void dfs_host_wait_timer_init(struct wlan_dfs *dfs) 66 { 67 } 68 #endif 69 70 /** 71 * dfs_set_override_status_timeout() - Change the dfs host status timeout. 72 * @dfs: Pointer to wlan_dfs structure. 73 * @status_timeout: timeout value. 74 * 75 * Return: QDF_STATUS 76 */ 77 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 78 QDF_STATUS dfs_set_override_status_timeout(struct wlan_dfs *dfs, 79 int status_timeout); 80 #else 81 static inline QDF_STATUS dfs_set_override_status_timeout(struct wlan_dfs *dfs, 82 int status_timeout) 83 { 84 return QDF_STATUS_SUCCESS; 85 } 86 #endif 87 88 /** 89 * dfs_get_override_status_timeout() - Get the dfs host status timeout value. 90 * @dfs: Pointer to wlan_dfs structure. 91 * @status_timeout: Pointer to timeout value. 92 * 93 * Return: QDF_STATUS 94 */ 95 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 96 QDF_STATUS dfs_get_override_status_timeout(struct wlan_dfs *dfs, 97 int *status_timeout); 98 #else 99 static inline 100 QDF_STATUS dfs_get_override_status_timeout(struct wlan_dfs *dfs, 101 int *status_timeout) 102 { 103 return QDF_STATUS_SUCCESS; 104 } 105 #endif 106 107 /** 108 * dfs_radarfound_action_fcc() - The dfs action on radar detection by host for 109 * FCC domain. 110 * @dfs: Pointer to wlan_dfs structure. 111 * @seg_id: segment id. 112 * @false_radar_found: Indicates if false radar is found. 113 * 114 * Return: None 115 */ 116 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 117 void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id, 118 int false_radar_found); 119 #else 120 static inline void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, 121 uint8_t seg_id, 122 int false_radar_found) 123 { 124 } 125 #endif 126 127 /** 128 * dfs_host_wait_timer_reset() - Stop dfs host wait timer. 129 * @dfs: Pointer to wlan_dfs structure. 130 */ 131 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 132 void dfs_host_wait_timer_reset(struct wlan_dfs *dfs); 133 #else 134 static inline void dfs_host_wait_timer_reset(struct wlan_dfs *dfs) 135 { 136 } 137 #endif 138 139 /** 140 * dfs_remove_spoof_channel_from_nol() - Remove the spoofed radar hit channel 141 * from NOL. 142 * @dfs: Pointer to wlan_dfs structure. 143 */ 144 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 145 void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs); 146 #else 147 static inline void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs) 148 { 149 } 150 #endif 151 152 /** 153 * dfs_reset_spoof_test() - reset the spoof test variables. 154 * @dfs: Pointer to wlan_dfs structure. 155 * 156 * Return: None. 157 */ 158 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 159 void dfs_reset_spoof_test(struct wlan_dfs *dfs); 160 #else 161 static inline void dfs_reset_spoof_test(struct wlan_dfs *dfs) 162 { 163 } 164 #endif 165 166 /** 167 * dfs_action_on_fw_radar_status_check() - The dfs action on host dfs 168 * confirmation by fw. 169 * @dfs: Pointer to wlan_dfs structure. 170 * @status: pointer to host dfs status. 171 * 172 * Return: None 173 */ 174 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 175 void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, 176 uint32_t *status); 177 #else 178 static inline void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, 179 uint32_t *status) 180 { 181 } 182 #endif 183 #endif /* _DFS_PARTIAL_OFFLOAD_RADAR_H_ */ 184