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_info_send() - API to send cfr info 96 * @pdev: pointer to pdev_object 97 * @head: pointer to cfr info head 98 * @hlen: head len 99 * @data: pointer to cfr info data 100 * @dlen: data len 101 * @tail: pointer to cfr info tail 102 * @tlen: tail len 103 * 104 * Return: success/failure of cfr info send 105 */ 106 uint32_t tgt_cfr_info_send(struct wlan_objmgr_pdev *pdev, void *head, 107 size_t hlen, void *data, size_t dlen, void *tail, 108 size_t tlen); 109 110 #ifdef WLAN_ENH_CFR_ENABLE 111 /** 112 * tgt_cfr_config_rcc() - API to set RCC 113 * @pdev: pointer to pdev_object 114 * @rcc_param: rcc configurations 115 * 116 * Return: succcess / failure 117 */ 118 QDF_STATUS tgt_cfr_config_rcc(struct wlan_objmgr_pdev *pdev, 119 struct cfr_rcc_param *rcc_param); 120 121 /** 122 * tgt_cfr_start_lut_age_timer() - API to start timer to flush aged out LUT 123 * entries 124 * @pdev: pointer to pdev_object 125 * 126 * Return: None 127 */ 128 void tgt_cfr_start_lut_age_timer(struct wlan_objmgr_pdev *pdev); 129 130 /** 131 * tgt_cfr_stop_lut_age_timer() - API to stop timer to flush aged out LUT 132 * entries 133 * @pdev: pointer to pdev_object 134 * 135 * Return: None 136 */ 137 void tgt_cfr_stop_lut_age_timer(struct wlan_objmgr_pdev *pdev); 138 139 /** 140 * tgt_cfr_default_ta_ra_cfg() - API to configure default values in TA_RA mode 141 * entries 142 * @pdev: pointer to pdev_object 143 * 144 * Return: none 145 */ 146 void tgt_cfr_default_ta_ra_cfg(struct wlan_objmgr_pdev *pdev, 147 struct cfr_rcc_param *rcc_param, 148 bool allvalid, uint16_t reset_cfg); 149 150 /** 151 * tgt_cfr_dump_lut_enh() - Print all LUT entries 152 * @pdev: pointer to pdev_object 153 */ 154 void tgt_cfr_dump_lut_enh(struct wlan_objmgr_pdev *pdev); 155 156 /** 157 * tgt_cfr_rx_tlv_process() - Process PPDU status TLVs 158 * @pdev_obj: pointer to pdev_object 159 * @nbuf: pointer to cdp_rx_indication_ppdu 160 */ 161 void tgt_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf); 162 163 /** 164 * tgt_cfr_update_global_cfg() - Update global config after successful commit 165 * @pdev: pointer to pdev_object 166 */ 167 void tgt_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev); 168 169 /** 170 * tgt_cfr_subscribe_ppdu_desc() - Target interface to 171 * subscribe/unsubscribe WDI PPDU desc event 172 * @pdev: pointer to pdev_object 173 * @is_subscribe: subscribe or unsubscribei 174 * 175 * return QDF status 176 */ 177 QDF_STATUS tgt_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev, 178 bool is_subscribe); 179 #endif 180 #endif 181