1 /* 2 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef _WLAN_CFR_UCFG_API_H_ 20 #define _WLAN_CFR_UCFG_API_H_ 21 22 #include <wlan_objmgr_peer_obj.h> 23 #include <wlan_objmgr_pdev_obj.h> 24 #include <wlan_cfr_public_structs.h> 25 #include <wlan_cfr_utils_api.h> 26 27 #define MAX_CFR_PRD (10*60*1000) /* 10 minutes */ 28 29 /** 30 * ucfg_cfr_start_capture() - function to start cfr capture for connected client 31 * @pdev: pointer to pdev object 32 * @peer: pointer to peer object 33 * @cfr_params: config params to cfr capture 34 * 35 * Return: status of start capture. 36 */ 37 int ucfg_cfr_start_capture(struct wlan_objmgr_pdev *pdev, 38 struct wlan_objmgr_peer *peer, 39 struct cfr_capture_params *cfr_params); 40 41 /** 42 * ucfg_cfr_get_capture_status() - function to populate capture status 43 * @pdev: pointer to pdev object 44 * @status: capture status 45 * 46 * Return: none 47 */ 48 void ucfg_cfr_get_capture_status(struct wlan_objmgr_pdev *pdev, 49 enum cfr_capt_status *status); 50 51 /** 52 * ucfg_cfr_stop_capture() - function to stop cfr capture for connected client 53 * @pdev: pointer to pdev object 54 * @peer: pointer to peer object 55 * 56 * Return: status of stop capture. 57 */ 58 int ucfg_cfr_stop_capture(struct wlan_objmgr_pdev *pdev, 59 struct wlan_objmgr_peer *peer); 60 61 /** 62 * ucfg_cfr_start_capture_probe_req() - function to start cfr capture for 63 * unassociated clients 64 * @pdev: pointer to pdev object 65 * @unassoc_mac: mac address of un-associated client 66 * @cfr_params: config params to cfr capture 67 * 68 * Return: status of start capture. 69 */ 70 int ucfg_cfr_start_capture_probe_req(struct wlan_objmgr_pdev *pdev, 71 struct qdf_mac_addr *unassoc_mac, 72 struct cfr_capture_params *params); 73 74 /** 75 * ucfg_cfr_stop_capture_probe_req() - function to stop cfr capture for 76 * unassociated cleints 77 * @pdev: pointer to pdev object 78 * @unassoc_mac: mac address of un-associated client 79 * 80 * Return: status of stop capture. 81 */ 82 int ucfg_cfr_stop_capture_probe_req(struct wlan_objmgr_pdev *pdev, 83 struct qdf_mac_addr *unassoc_mac); 84 85 /** 86 * ucfg_cfr_list_peers() - Lists total number of peers with cfr capture enabled 87 * @pdev: pointer to pdev object 88 * 89 * Return: number of peers with cfr capture enabled 90 */ 91 int ucfg_cfr_list_peers(struct wlan_objmgr_pdev *pdev); 92 93 /** 94 * ucfg_cfr_set_timer() - function to enable cfr timer 95 * @pdev: pointer to pdev object 96 * @value: value to be set 97 * 98 * Return: status of timer enable 99 */ 100 int ucfg_cfr_set_timer(struct wlan_objmgr_pdev *pdev, uint32_t value); 101 102 /** 103 * ucfg_cfr_get_timer() - function to get cfr_timer_enable 104 * @pdev: pointer to pdev object 105 * 106 * Return: value of cfr_timer_enable 107 */ 108 int ucfg_cfr_get_timer(struct wlan_objmgr_pdev *pdev); 109 110 /** 111 * ucfg_cfr_stop_indication() - User space API to write cfr stop string 112 * @vdev - pointer to vdev object 113 * 114 * Write stop string and indicate to up layer. 115 * 116 * Return: status of write CFR stop string 117 */ 118 QDF_STATUS ucfg_cfr_stop_indication(struct wlan_objmgr_vdev *vdev); 119 120 #ifdef WLAN_CFR_ADRASTEA 121 /** 122 * ucfg_cfr_capture_data() - API called when HTT msg for CFR dump ind received 123 * @psoc: pointer to psoc object 124 * @vdev_id : vdev id 125 * @hdr: CFR header 126 * @mem_index: start offset index of dump in mem 127 * 128 * Return: None 129 */ 130 void ucfg_cfr_capture_data(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, 131 struct csi_cfr_header *hdr, uint32_t mem_index); 132 #else 133 static inline 134 void ucfg_cfr_capture_data(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, 135 struct csi_cfr_header *hdr, uint32_t mem_index) 136 { 137 } 138 #endif 139 140 #ifdef WLAN_ENH_CFR_ENABLE 141 /* Channel capture recipe filters */ 142 enum capture_type { 143 RCC_DIRECTED_FTM_FILTER, 144 RCC_ALL_FTM_ACK_FILTER, 145 RCC_DIRECTED_NDPA_NDP_FILTER, 146 RCC_NDPA_NDP_ALL_FILTER, 147 RCC_TA_RA_FILTER, 148 RCC_ALL_PACKET_FILTER, 149 RCC_DIS_ALL_MODE, 150 }; 151 152 /** 153 * ucfg_cfr_set_rcc_mode() - function to set RCC mode 154 * @vdev: pointer to vdev object 155 * @mode: capture type passed by user 156 * @value: Enable/Disable capture mode 157 * 158 * Return: status if the mode is set or not 159 */ 160 QDF_STATUS ucfg_cfr_set_rcc_mode(struct wlan_objmgr_vdev *vdev, 161 enum capture_type mode, uint8_t value); 162 163 /** 164 * ucfg_cfr_get_rcc_enabled() - function to get RCC mode 165 * @vdev: pointer to vdev object 166 * 167 * Return: if the rcc is enabled or not 168 */ 169 bool ucfg_cfr_get_rcc_enabled(struct wlan_objmgr_vdev *vdev); 170 171 /** 172 * ucfg_cfr_set_tara_config() - function to configure TA/RA address and mask 173 * @vdev: pointer to vdev object 174 * @params: user config 175 * 176 * Return: status 177 */ 178 QDF_STATUS ucfg_cfr_set_tara_config(struct wlan_objmgr_vdev *vdev, 179 struct cfr_wlanconfig_param *params); 180 181 /** 182 * ucfg_cfr_set_bw_nss() - function to configure nss and bandwidth 183 * @vdev: pointer to vdev object 184 * @params: user config 185 * 186 * Return: status 187 */ 188 QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev, 189 struct cfr_wlanconfig_param *params); 190 191 /** 192 * ucfg_cfr_set_frame_type_subtype() - function to configure frame type/subtype 193 * @vdev: pointer to vdev object 194 * @params: user config 195 * 196 * Return: status 197 */ 198 QDF_STATUS 199 ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev, 200 struct cfr_wlanconfig_param *params); 201 202 /** 203 * ucfg_cfr_set_capture_duration() - function to configure capture duration 204 * @vdev: pointer to vdev object 205 * @params: user config 206 * 207 * Return: status 208 */ 209 QDF_STATUS 210 ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev, 211 struct cfr_wlanconfig_param *params); 212 213 /** 214 * ucfg_cfr_set_capture_interval() - function to configure capture interval 215 * @vdev: pointer to vdev object 216 * @params: user config 217 * 218 * Return: status 219 */ 220 QDF_STATUS 221 ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev, 222 struct cfr_wlanconfig_param *params); 223 224 /** 225 * ucfg_cfr_set_tara_filterin_as_fp() - function to FP/MO filtering for m_TA_RA 226 * @vdev: pointer to vdev object 227 * @params: user config 228 * 229 * Return: status 230 */ 231 QDF_STATUS 232 ucfg_cfr_set_tara_filterin_as_fp(struct wlan_objmgr_vdev *vdev, 233 struct cfr_wlanconfig_param *params); 234 235 /** 236 * ucfg_cfr_set_capture_count() - function to configure capture count 237 * @vdev: pointer to vdev object 238 * @params: user config 239 * 240 * Return: status 241 */ 242 QDF_STATUS 243 ucfg_cfr_set_capture_count(struct wlan_objmgr_vdev *vdev, 244 struct cfr_wlanconfig_param *params); 245 246 /** 247 * ucfg_cfr_set_capture_interval_mode_sel() - function to configure capture 248 * interval mode nob 249 * @vdev: pointer to vdev object 250 * @params: user confi 251 * 252 * Return: status 253 */ 254 QDF_STATUS 255 ucfg_cfr_set_capture_interval_mode_sel(struct wlan_objmgr_vdev *vdev, 256 struct cfr_wlanconfig_param *params); 257 258 /** 259 * ucfg_cfr_set_en_bitmap() - function to configure 16-bit bitmap in TA_RA mode 260 * @vdev: pointer to vdev object 261 * @params: user config 262 * 263 * Return: status 264 */ 265 QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev, 266 struct cfr_wlanconfig_param *params); 267 268 /** 269 * ucfg_cfr_set_reset_bitmap() - function to clear all 9 params for all 16 270 * groups in TA_RA mode 271 * @vdev: pointer to vdev object 272 * @params: user config 273 * 274 * Return: status 275 */ 276 QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev, 277 struct cfr_wlanconfig_param *params); 278 279 /** 280 * ucfg_cfr_set_ul_mu_user_mask() - function to configure UL MU user mask 281 * @vdev: pointer to vdev object 282 * @params: user config 283 * 284 * Return: status 285 */ 286 QDF_STATUS 287 ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev, 288 struct cfr_wlanconfig_param *params); 289 290 /** 291 * ucfg_cfr_set_freeze_tlv_delay_cnt() - function to configure freeze TLV delay 292 * count threshold 293 * @vdev: pointer to vdev object 294 * @params: user config 295 * 296 * Return: status 297 */ 298 QDF_STATUS 299 ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev, 300 struct cfr_wlanconfig_param *params); 301 302 /** 303 * ucfg_cfr_committed_rcc_config() - function to commit user config 304 * @vdev: pointer to vdev object 305 * 306 * Return: status 307 */ 308 QDF_STATUS ucfg_cfr_committed_rcc_config(struct wlan_objmgr_vdev *vdev); 309 310 /** 311 * ucfg_cfr_get_cfg() - function to display user config 312 * @vdev: pointer to vdev object 313 * 314 * Return: status 315 */ 316 QDF_STATUS ucfg_cfr_get_cfg(struct wlan_objmgr_vdev *vdev); 317 318 /** 319 * ucfg_cfr_rcc_dump_dbg_counters() - function to display PPDU counters 320 * @vdev: pointer to vdev object 321 * 322 * Return: status 323 */ 324 QDF_STATUS ucfg_cfr_rcc_dump_dbg_counters(struct wlan_objmgr_vdev *vdev); 325 326 /** 327 * ucfg_cfr_rcc_clr_dbg_counters() - function to clear CFR PPDU counters 328 * @vdev: pointer to vdev object 329 * 330 * Return: status 331 */ 332 QDF_STATUS ucfg_cfr_rcc_clr_dbg_counters(struct wlan_objmgr_vdev *vdev); 333 334 /** 335 * ucfg_cfr_rcc_dump_lut() - function to display lookup table 336 * @vdev: pointer to vdev object 337 * 338 * Return: status 339 */ 340 QDF_STATUS ucfg_cfr_rcc_dump_lut(struct wlan_objmgr_vdev *vdev); 341 342 /** 343 * ucfg_cfr_subscribe_ppdu_desc() - User space interface to 344 * subscribe/unsubscribe WDI PPDU desc event 345 * @pdev: pointer to pdev_object 346 * @is_subscribe: subscribe or unsubscribei 347 * 348 * return QDF status 349 */ 350 QDF_STATUS ucfg_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, 351 bool is_subscribe); 352 #endif 353 #endif 354