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 26 #define MAX_CFR_PRD (10*60*1000) /* 10 minutes */ 27 28 /** 29 * ucfg_cfr_start_capture() - function to start cfr capture for connected client 30 * @pdev: pointer to pdev object 31 * @peer: pointer to peer object 32 * @cfr_params: config params to cfr capture 33 * 34 * Return: status of start capture. 35 */ 36 int ucfg_cfr_start_capture(struct wlan_objmgr_pdev *pdev, 37 struct wlan_objmgr_peer *peer, 38 struct cfr_capture_params *cfr_params); 39 40 /** 41 * ucfg_cfr_get_capture_status() - function to populate capture status 42 * @pdev: pointer to pdev object 43 * @status: capture status 44 * 45 * Return: none 46 */ 47 void ucfg_cfr_get_capture_status(struct wlan_objmgr_pdev *pdev, 48 enum cfr_capt_status *status); 49 50 /** 51 * ucfg_cfr_stop_capture() - function to stop cfr capture for connected client 52 * @pdev: pointer to pdev object 53 * @peer: pointer to peer object 54 * 55 * Return: status of stop capture. 56 */ 57 int ucfg_cfr_stop_capture(struct wlan_objmgr_pdev *pdev, 58 struct wlan_objmgr_peer *peer); 59 60 /** 61 * ucfg_cfr_start_capture_probe_req() - function to start cfr capture for 62 * unassociated clients 63 * @pdev: pointer to pdev object 64 * @unassoc_mac: mac address of un-associated client 65 * @cfr_params: config params to cfr capture 66 * 67 * Return: status of start capture. 68 */ 69 int ucfg_cfr_start_capture_probe_req(struct wlan_objmgr_pdev *pdev, 70 struct qdf_mac_addr *unassoc_mac, 71 struct cfr_capture_params *params); 72 73 /** 74 * ucfg_cfr_stop_capture_probe_req() - function to stop cfr capture for 75 * unassociated cleints 76 * @pdev: pointer to pdev object 77 * @unassoc_mac: mac address of un-associated client 78 * 79 * Return: status of stop capture. 80 */ 81 int ucfg_cfr_stop_capture_probe_req(struct wlan_objmgr_pdev *pdev, 82 struct qdf_mac_addr *unassoc_mac); 83 84 /** 85 * ucfg_cfr_list_peers() - Lists total number of peers with cfr capture enabled 86 * @pdev: pointer to pdev object 87 * 88 * Return: number of peers with cfr capture enabled 89 */ 90 int ucfg_cfr_list_peers(struct wlan_objmgr_pdev *pdev); 91 92 /** 93 * ucfg_cfr_set_timer() - function to enable cfr timer 94 * @pdev: pointer to pdev object 95 * @value: value to be set 96 * 97 * Return: status of timer enable 98 */ 99 int ucfg_cfr_set_timer(struct wlan_objmgr_pdev *pdev, uint32_t value); 100 101 /** 102 * ucfg_cfr_get_timer() - function to get cfr_timer_enable 103 * @pdev: pointer to pdev object 104 * 105 * Return: value of cfr_timer_enable 106 */ 107 int ucfg_cfr_get_timer(struct wlan_objmgr_pdev *pdev); 108 109 /** 110 * ucfg_cfr_stop_indication() - User space API to write cfr stop string 111 * @vdev - pointer to vdev object 112 * 113 * Write stop string and indicate to up layer. 114 * 115 * Return: status of write CFR stop string 116 */ 117 QDF_STATUS ucfg_cfr_stop_indication(struct wlan_objmgr_vdev *vdev); 118 119 #ifdef WLAN_ENH_CFR_ENABLE 120 /* Channel capture recipe filters */ 121 enum capture_type { 122 RCC_DIRECTED_FTM_FILTER, 123 RCC_ALL_FTM_ACK_FILTER, 124 RCC_DIRECTED_NDPA_NDP_FILTER, 125 RCC_NDPA_NDP_ALL_FILTER, 126 RCC_TA_RA_FILTER, 127 RCC_ALL_PACKET_FILTER, 128 RCC_DIS_ALL_MODE, 129 }; 130 131 /** 132 * ucfg_cfr_set_rcc_mode() - function to set RCC mode 133 * @vdev: pointer to vdev object 134 * @mode: capture type passed by user 135 * @value: Enable/Disable capture mode 136 * 137 * Return: status if the mode is set or not 138 */ 139 QDF_STATUS ucfg_cfr_set_rcc_mode(struct wlan_objmgr_vdev *vdev, 140 enum capture_type mode, uint8_t value); 141 142 /** 143 * ucfg_cfr_get_rcc_enabled() - function to get RCC mode 144 * @vdev: pointer to vdev object 145 * 146 * Return: if the rcc is enabled or not 147 */ 148 bool ucfg_cfr_get_rcc_enabled(struct wlan_objmgr_vdev *vdev); 149 150 /** 151 * ucfg_cfr_set_tara_config() - function to configure TA/RA address and mask 152 * @vdev: pointer to vdev object 153 * @params: user config 154 * 155 * Return: status 156 */ 157 QDF_STATUS ucfg_cfr_set_tara_config(struct wlan_objmgr_vdev *vdev, 158 struct cfr_wlanconfig_param *params); 159 160 /** 161 * ucfg_cfr_set_bw_nss() - function to configure nss and bandwidth 162 * @vdev: pointer to vdev object 163 * @params: user config 164 * 165 * Return: status 166 */ 167 QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev, 168 struct cfr_wlanconfig_param *params); 169 170 /** 171 * ucfg_cfr_set_frame_type_subtype() - function to configure frame type/subtype 172 * @vdev: pointer to vdev object 173 * @params: user config 174 * 175 * Return: status 176 */ 177 QDF_STATUS 178 ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev, 179 struct cfr_wlanconfig_param *params); 180 181 /** 182 * ucfg_cfr_set_capture_duration() - function to configure capture duration 183 * @vdev: pointer to vdev object 184 * @params: user config 185 * 186 * Return: status 187 */ 188 QDF_STATUS 189 ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev, 190 struct cfr_wlanconfig_param *params); 191 192 /** 193 * ucfg_cfr_set_capture_interval() - function to configure capture interval 194 * @vdev: pointer to vdev object 195 * @params: user config 196 * 197 * Return: status 198 */ 199 QDF_STATUS 200 ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev, 201 struct cfr_wlanconfig_param *params); 202 203 /** 204 * ucfg_cfr_set_en_bitmap() - function to configure 16-bit bitmap in TA_RA mode 205 * @vdev: pointer to vdev object 206 * @params: user config 207 * 208 * Return: status 209 */ 210 QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev, 211 struct cfr_wlanconfig_param *params); 212 213 /** 214 * ucfg_cfr_set_reset_bitmap() - function to clear all 9 params for all 16 215 * groups in TA_RA mode 216 * @vdev: pointer to vdev object 217 * @params: user config 218 * 219 * Return: status 220 */ 221 QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev, 222 struct cfr_wlanconfig_param *params); 223 224 /** 225 * ucfg_cfr_set_ul_mu_user_mask() - function to configure UL MU user mask 226 * @vdev: pointer to vdev object 227 * @params: user config 228 * 229 * Return: status 230 */ 231 QDF_STATUS 232 ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev, 233 struct cfr_wlanconfig_param *params); 234 235 /** 236 * ucfg_cfr_set_freeze_tlv_delay_cnt() - function to configure freeze TLV delay 237 * count threshold 238 * @vdev: pointer to vdev object 239 * @params: user config 240 * 241 * Return: status 242 */ 243 QDF_STATUS 244 ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev, 245 struct cfr_wlanconfig_param *params); 246 247 /** 248 * ucfg_cfr_committed_rcc_config() - function to commit user config 249 * @vdev: pointer to vdev object 250 * 251 * Return: status 252 */ 253 QDF_STATUS ucfg_cfr_committed_rcc_config(struct wlan_objmgr_vdev *vdev); 254 255 /** 256 * ucfg_cfr_get_cfg() - function to display user config 257 * @vdev: pointer to vdev object 258 * 259 * Return: status 260 */ 261 QDF_STATUS ucfg_cfr_get_cfg(struct wlan_objmgr_vdev *vdev); 262 263 /** 264 * ucfg_cfr_rcc_dump_dbg_counters() - function to display PPDU counters 265 * @vdev: pointer to vdev object 266 * 267 * Return: status 268 */ 269 QDF_STATUS ucfg_cfr_rcc_dump_dbg_counters(struct wlan_objmgr_vdev *vdev); 270 271 /** 272 * ucfg_cfr_rcc_clr_dbg_counters() - function to clear CFR PPDU counters 273 * @vdev: pointer to vdev object 274 * 275 * Return: status 276 */ 277 QDF_STATUS ucfg_cfr_rcc_clr_dbg_counters(struct wlan_objmgr_vdev *vdev); 278 279 /** 280 * ucfg_cfr_rcc_dump_lut() - function to display lookup table 281 * @vdev: pointer to vdev object 282 * 283 * Return: status 284 */ 285 QDF_STATUS ucfg_cfr_rcc_dump_lut(struct wlan_objmgr_vdev *vdev); 286 287 /** 288 * ucfg_cfr_subscribe_ppdu_desc() - User space interface to 289 * subscribe/unsubscribe WDI PPDU desc event 290 * @pdev: pointer to pdev_object 291 * @is_subscribe: subscribe or unsubscribei 292 * 293 * return QDF status 294 */ 295 QDF_STATUS ucfg_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, 296 bool is_subscribe); 297 #endif 298 #endif 299