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_TGT_API_H_ 20 #define _WLAN_CFR_TGT_API_H_ 21 22 #include <wlan_objmgr_peer_obj.h> 23 #include <wlan_objmgr_pdev_obj.h> 24 #include <wlan_objmgr_cmn.h> 25 #include <qdf_types.h> 26 27 /* tgt layer has APIs in application, to access functions in target 28 * through tx_ops. 29 */ 30 31 /** 32 * tgt_cfr_init_pdev() - API that registers CFR to handlers. 33 * @pdev: pointer to pdev_object 34 * 35 * Return: success/failure of init 36 */ 37 int tgt_cfr_init_pdev(struct wlan_objmgr_pdev *pdev); 38 39 /** 40 * tgt_cfr_deinit_pdev() - API that de-registers CFR to handlers. 41 * @pdev: pointer to pdev_object 42 * 43 * Return: success/failure of de-init 44 */ 45 int tgt_cfr_deinit_pdev(struct wlan_objmgr_pdev *pdev); 46 47 /** 48 * tgt_cfr_get_target_type() - API to determine target type. 49 * @psoc: pointer to psoc_object 50 * 51 * Return: enum value of target type 52 */ 53 int tgt_cfr_get_target_type(struct wlan_objmgr_psoc *psoc); 54 55 /** 56 * tgt_cfr_start_capture() - API to start cfr capture on a peer. 57 * @pdev: pointer to pdev_object 58 * @peer: pointer to peer_object 59 * @cfr_params: pointer to config cfr_params 60 * 61 * Return: success/failure of start capture 62 */ 63 int tgt_cfr_start_capture(struct wlan_objmgr_pdev *pdev, 64 struct wlan_objmgr_peer *peer, 65 struct cfr_capture_params *cfr_params); 66 67 /** 68 * tgt_cfr_stop_capture() - API to stop cfr capture on a peer. 69 * @pdev: pointer to pdev_object 70 * @peer: pointer to peer_object 71 * 72 * Return: success/failure of stop capture 73 */ 74 int tgt_cfr_stop_capture(struct wlan_objmgr_pdev *pdev, 75 struct wlan_objmgr_peer *peer); 76 77 /** 78 * tgt_cfr_enable_cfr_timer() - API to enable cfr timer 79 * @pdev: pointer to pdev_object 80 * @cfr_timer: Amount of time this timer has to run. If 0, it disables timer. 81 * 82 * Return: success/failure of timer enable 83 */ 84 int 85 tgt_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev, uint32_t cfr_timer); 86 87 /** 88 * tgt_cfr_support_set() - API to set cfr support 89 * @psoc: pointer to psoc_object 90 * @value: value to be set 91 */ 92 void tgt_cfr_support_set(struct wlan_objmgr_psoc *psoc, uint32_t value); 93 94 /** 95 * tgt_cfr_capture_count_support_set() - API to set capture_count support 96 * @psoc: pointer to psoc_object 97 * @value: value to be set 98 * 99 * Return: success/failure 100 */ 101 QDF_STATUS 102 tgt_cfr_capture_count_support_set(struct wlan_objmgr_psoc *psoc, 103 uint32_t value); 104 105 /** 106 * tgt_cfr_mo_marking_support_set() - API to set MO marking support 107 * @psoc: pointer to psoc_object 108 * @value: value to be set 109 * 110 * Return: success/failure 111 */ 112 QDF_STATUS 113 tgt_cfr_mo_marking_support_set(struct wlan_objmgr_psoc *psoc, uint32_t value); 114 115 /** 116 * tgt_cfr_info_send() - API to send cfr info 117 * @pdev: pointer to pdev_object 118 * @head: pointer to cfr info head 119 * @hlen: head len 120 * @data: pointer to cfr info data 121 * @dlen: data len 122 * @tail: pointer to cfr info tail 123 * @tlen: tail len 124 * 125 * Return: success/failure of cfr info send 126 */ 127 uint32_t tgt_cfr_info_send(struct wlan_objmgr_pdev *pdev, void *head, 128 size_t hlen, void *data, size_t dlen, void *tail, 129 size_t tlen); 130 131 #ifdef WLAN_ENH_CFR_ENABLE 132 /** 133 * tgt_cfr_config_rcc() - API to set RCC 134 * @pdev: pointer to pdev_object 135 * @rcc_param: rcc configurations 136 * 137 * Return: succcess / failure 138 */ 139 QDF_STATUS tgt_cfr_config_rcc(struct wlan_objmgr_pdev *pdev, 140 struct cfr_rcc_param *rcc_param); 141 142 /** 143 * tgt_cfr_start_lut_age_timer() - API to start timer to flush aged out LUT 144 * entries 145 * @pdev: pointer to pdev_object 146 * 147 * Return: None 148 */ 149 void tgt_cfr_start_lut_age_timer(struct wlan_objmgr_pdev *pdev); 150 151 /** 152 * tgt_cfr_stop_lut_age_timer() - API to stop timer to flush aged out LUT 153 * entries 154 * @pdev: pointer to pdev_object 155 * 156 * Return: None 157 */ 158 void tgt_cfr_stop_lut_age_timer(struct wlan_objmgr_pdev *pdev); 159 160 /** 161 * tgt_cfr_default_ta_ra_cfg() - API to configure default values in TA_RA mode 162 * entries 163 * @pdev: pointer to pdev_object 164 * 165 * Return: none 166 */ 167 void tgt_cfr_default_ta_ra_cfg(struct wlan_objmgr_pdev *pdev, 168 struct cfr_rcc_param *rcc_param, 169 bool allvalid, uint16_t reset_cfg); 170 171 /** 172 * tgt_cfr_dump_lut_enh() - Print all LUT entries 173 * @pdev: pointer to pdev_object 174 */ 175 void tgt_cfr_dump_lut_enh(struct wlan_objmgr_pdev *pdev); 176 177 /** 178 * tgt_cfr_rx_tlv_process() - Process PPDU status TLVs 179 * @pdev_obj: pointer to pdev_object 180 * @nbuf: pointer to cdp_rx_indication_ppdu 181 */ 182 void tgt_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf); 183 184 /** 185 * tgt_cfr_update_global_cfg() - Update global config after successful commit 186 * @pdev: pointer to pdev_object 187 */ 188 void tgt_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev); 189 190 /** 191 * tgt_cfr_subscribe_ppdu_desc() - Target interface to 192 * subscribe/unsubscribe WDI PPDU desc event 193 * @pdev: pointer to pdev_object 194 * @is_subscribe: subscribe or unsubscribei 195 * 196 * return QDF status 197 */ 198 QDF_STATUS tgt_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, 199 bool is_subscribe); 200 #endif 201 #endif 202