1 /*
2 * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
3 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 /**
19 * DOC: wlan_cm_tgt_if_tx_api.h
20 *
21 * This file contains connection manager tx ops related functions
22 */
23
24 #ifndef CM_TGT_IF_TX_API_H__
25 #define CM_TGT_IF_TX_API_H__
26
27 #include "wlan_cm_roam_public_struct.h"
28
29 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
30 #ifdef WLAN_FEATURE_11BE_MLO
31 /**
32 * wlan_cm_tgt_send_roam_mlo_config() - Send roam mlo config to firmware
33 * @psoc: psoc pointer
34 * @vdev_id: vdev id
35 * @req: roam mlo config parameter
36 *
37 * Return: QDF_STATUS
38 */
39 QDF_STATUS wlan_cm_tgt_send_roam_mlo_config(struct wlan_objmgr_psoc *psoc,
40 uint8_t vdev_id,
41 struct wlan_roam_mlo_config *req);
42 #else
43 static inline
wlan_cm_tgt_send_roam_mlo_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,struct wlan_roam_mlo_config * req)44 QDF_STATUS wlan_cm_tgt_send_roam_mlo_config(struct wlan_objmgr_psoc *psoc,
45 uint8_t vdev_id,
46 struct wlan_roam_mlo_config *req)
47 {
48 return QDF_STATUS_SUCCESS;
49 }
50 #endif
51
52 /**
53 * wlan_cm_roam_send_set_vdev_pcl() - Send vdev set pcl command to firmware
54 * @psoc: PSOC pointer
55 * @pcl_req: Set pcl request structure pointer
56 *
57 * Return: QDF_STATUS
58 */
59 QDF_STATUS
60 wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc,
61 struct set_pcl_req *pcl_req);
62
63 /**
64 * wlan_cm_tgt_send_roam_rt_stats_config() - Send roam event stats config
65 * command to FW
66 * @psoc: psoc pointer
67 * @req: roam stats config parameter
68 *
69 * Return: QDF_STATUS
70 */
71 QDF_STATUS wlan_cm_tgt_send_roam_rt_stats_config(struct wlan_objmgr_psoc *psoc,
72 struct roam_disable_cfg *req);
73
74 /**
75 * wlan_cm_tgt_send_roam_ho_delay_config() - Send roam HO delay config command
76 * to FW
77 * @psoc: psoc pointer
78 * @vdev_id: vdev id
79 * @roam_ho_delay: roam hand-off delay value
80 *
81 * Return: QDF_STATUS
82 */
83 QDF_STATUS wlan_cm_tgt_send_roam_ho_delay_config(struct wlan_objmgr_psoc *psoc,
84 uint8_t vdev_id,
85 uint16_t roam_ho_delay);
86
87 /**
88 * wlan_cm_tgt_exclude_rm_partial_scan_freq() - Exclude the channels in roam
89 * full scan that are already scanned as part of partial scan.
90 * @psoc: psoc pointer
91 * @vdev_id: vdev id
92 * @exclude_rm_partial_scan_freq: Exclude the channels in roam full scan that
93 * are already scanned as part of partial scan.
94 *
95 * Return: QDF_STATUS
96 */
97 QDF_STATUS
98 wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
99 uint8_t vdev_id,
100 uint8_t exclude_rm_partial_scan_freq);
101
102 /**
103 * wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc() - Include the 6 GHz channels
104 * in roam full scan only on prior discovery of any 6 GHz support in the
105 * environment.
106 * @psoc: PSOC pointer
107 * @vdev_id: vdev ID
108 * @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan:
109 * 1 - Include only on prior discovery of any 6 GHz support in the environment
110 * 0 - Include all the supported 6 GHz channels by default
111 *
112 * Return: QDF_STATUS
113 */
114 QDF_STATUS wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(
115 struct wlan_objmgr_psoc *psoc,
116 uint8_t vdev_id,
117 uint8_t roam_full_scan_6ghz_on_disc);
118
119 /**
120 * wlan_cm_tgt_send_roam_scan_offload_rssi_params() - Set the RSSI parameters
121 * for roam offload scan
122 * @vdev: Pointer to vdev object
123 * @roam_rssi_params: structure containing parameters for roam offload scan
124 * based on RSSI
125 *
126 * Return: QDF_STATUS
127 */
128 QDF_STATUS
129 wlan_cm_tgt_send_roam_scan_offload_rssi_params(
130 struct wlan_objmgr_vdev *vdev,
131 struct wlan_roam_offload_scan_rssi_params *roam_rssi_params);
132
133 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
134 /**
135 * wlan_cm_tgt_send_roam_linkspeed_state() - Send roam link speed state
136 * command to FW
137 * @psoc: psoc pointer
138 * @req: roam stats config parameter
139 *
140 * Return: QDF_STATUS
141 */
142 QDF_STATUS wlan_cm_tgt_send_roam_linkspeed_state(struct wlan_objmgr_psoc *psoc,
143 struct roam_disable_cfg *req);
144 #endif
145 #else
146 static inline QDF_STATUS
wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc * psoc,struct set_pcl_req * pcl_req)147 wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc,
148 struct set_pcl_req *pcl_req)
149 {
150 return QDF_STATUS_E_FAILURE;
151 }
152
153 static inline QDF_STATUS
wlan_cm_tgt_send_roam_rt_stats_config(struct wlan_objmgr_psoc * psoc,struct roam_disable_cfg * req)154 wlan_cm_tgt_send_roam_rt_stats_config(struct wlan_objmgr_psoc *psoc,
155 struct roam_disable_cfg *req)
156 {
157 return QDF_STATUS_E_FAILURE;
158 }
159
160 static inline
wlan_cm_tgt_send_roam_mlo_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,struct wlan_roam_mlo_config * req)161 QDF_STATUS wlan_cm_tgt_send_roam_mlo_config(struct wlan_objmgr_psoc *psoc,
162 uint8_t vdev_id,
163 struct wlan_roam_mlo_config *req)
164 {
165 return QDF_STATUS_SUCCESS;
166 }
167
168 static inline QDF_STATUS
wlan_cm_tgt_send_roam_ho_delay_config(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint16_t roam_ho_delay)169 wlan_cm_tgt_send_roam_ho_delay_config(struct wlan_objmgr_psoc *psoc,
170 uint8_t vdev_id, uint16_t roam_ho_delay)
171 {
172 return QDF_STATUS_E_FAILURE;
173 }
174
175 static inline QDF_STATUS
wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t exclude_rm_partial_scan_freq)176 wlan_cm_tgt_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc,
177 uint8_t vdev_id,
178 uint8_t exclude_rm_partial_scan_freq)
179 {
180 return QDF_STATUS_E_FAILURE;
181 }
182
183 static inline QDF_STATUS
wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t roam_full_scan_6ghz_on_disc)184 wlan_cm_tgt_send_roam_full_scan_6ghz_on_disc(
185 struct wlan_objmgr_psoc *psoc,
186 uint8_t vdev_id,
187 uint8_t roam_full_scan_6ghz_on_disc)
188 {
189 return QDF_STATUS_E_FAILURE;
190 }
191 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
192
193 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
194 /**
195 * wlan_cm_tgt_send_roam_vendor_handoff_config() - Send vendor handoff config
196 * command to firmware
197 * @psoc: PSOC pointer
198 * @req: vendor handoff command params
199 *
200 * Return: QDF_STATUS
201 */
202 QDF_STATUS
203 wlan_cm_tgt_send_roam_vendor_handoff_config(struct wlan_objmgr_psoc *psoc,
204 struct vendor_handoff_cfg *req);
205 #endif
206
207 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
208
209 #define CFG_DISABLE_4WAY_HS_OFFLOAD_DEFAULT BIT(0)
210
211 /**
212 * wlan_cm_tgt_send_roam_offload_init() - Send wmi_vdev_param_roam_fw_offload
213 * to init/deinit roaming module at firmware
214 * @psoc: PSOC pointer
215 * @vdev_id: vdev id
216 * @is_init: true if roam module is to be initialized else false for deinit
217 *
218 * Return: QDF_STATUS
219 */
220 QDF_STATUS wlan_cm_tgt_send_roam_offload_init(struct wlan_objmgr_psoc *psoc,
221 uint8_t vdev_id, bool is_init);
222
223 /**
224 * wlan_cm_tgt_send_roam_start_req() - Send roam start command to firmware
225 * @psoc: psoc pointer
226 * @vdev_id: vdev id
227 * @req: roam start config parameter
228 *
229 * Return: QDF_STATUS
230 */
231 QDF_STATUS wlan_cm_tgt_send_roam_start_req(struct wlan_objmgr_psoc *psoc,
232 uint8_t vdev_id,
233 struct wlan_roam_start_config *req);
234
235 /**
236 * wlan_cm_tgt_send_roam_stop_req() - Send roam stop command to firmware
237 * @psoc: psoc pointer
238 * @vdev_id: vdev id
239 * @req: roam stop config parameter
240 *
241 * Return: QDF_STATUS
242 */
243 QDF_STATUS wlan_cm_tgt_send_roam_stop_req(struct wlan_objmgr_psoc *psoc,
244 uint8_t vdev_id,
245 struct wlan_roam_stop_config *req);
246
247 /**
248 * wlan_cm_tgt_send_roam_update_req() - Send roam update command to firmware
249 * @psoc: psoc pointer
250 * @vdev_id: vdev id
251 * @req: roam update config parameter
252 *
253 * Return: QDF_STATUS
254 */
255 QDF_STATUS wlan_cm_tgt_send_roam_update_req(struct wlan_objmgr_psoc *psoc,
256 uint8_t vdev_id,
257 struct wlan_roam_update_config *req);
258 /**
259 * wlan_cm_tgt_send_roam_freqs() - Send roam frequencies to firmware
260 * @psoc: psoc pointer
261 * @vdev_id: vdev id
262 * @req: roam frequency list to be sent to fw
263 *
264 * Return: QDF_STATUS
265 */
266 QDF_STATUS
267 wlan_cm_tgt_send_roam_freqs(struct wlan_objmgr_psoc *psoc,
268 uint8_t vdev_id,
269 struct wlan_roam_scan_channel_list *req);
270
271 /**
272 * wlan_cm_tgt_send_roam_abort_req() - Send roam abort command to firmware
273 * @psoc: psoc pointer
274 * @vdev_id: vdev id
275 *
276 * Return: QDF_STATUS
277 */
278 QDF_STATUS wlan_cm_tgt_send_roam_abort_req(struct wlan_objmgr_psoc *psoc,
279 uint8_t vdev_id);
280
281 /**
282 * wlan_cm_tgt_send_roam_per_config() - Send roam per config command to FW
283 * @psoc: psoc pointer
284 * @vdev_id: vdev id
285 * @req: per roam config parameter
286 *
287 * Return: QDF_STATUS
288 */
289 QDF_STATUS wlan_cm_tgt_send_roam_per_config(struct wlan_objmgr_psoc *psoc,
290 uint8_t vdev_id,
291 struct wlan_per_roam_config_req *req);
292
293 /**
294 * wlan_cm_tgt_send_roam_triggers() - Send roam trigger command to FW
295 * @psoc: psoc pointer
296 * @vdev_id: vdev id
297 * @req: roam trigger parameter
298 *
299 * Return: QDF_STATUS
300 */
301 QDF_STATUS wlan_cm_tgt_send_roam_triggers(struct wlan_objmgr_psoc *psoc,
302 uint8_t vdev_id,
303 struct wlan_roam_triggers *req);
304
305 /**
306 * wlan_cm_tgt_send_roam_invoke_req() - Send roam trigger command to FW
307 * @psoc: psoc pointer
308 * @roam_invoke_req: roam invoke parameter
309 *
310 * Return: QDF_STATUS
311 */
312 QDF_STATUS
313 wlan_cm_tgt_send_roam_invoke_req(struct wlan_objmgr_psoc *psoc,
314 struct roam_invoke_req *roam_invoke_req);
315
316 /**
317 * wlan_cm_tgt_send_roam_sync_complete_cmd() - Send roam sync command to FW
318 * @psoc: psoc pointer
319 * @vdev_id: vdev id
320 *
321 * Return: QDF_STATUS
322 */
323 QDF_STATUS
324 wlan_cm_tgt_send_roam_sync_complete_cmd(struct wlan_objmgr_psoc *psoc,
325 uint8_t vdev_id);
326 #endif
327
328 /**
329 * wlan_cm_tgt_send_roam_disable_config() - Send roam disable config command
330 * to FW
331 * @psoc: psoc pointer
332 * @vdev_id: vdev id
333 * @req: roam disable config parameter
334 *
335 * Return: QDF_STATUS
336 */
337 QDF_STATUS wlan_cm_tgt_send_roam_disable_config(struct wlan_objmgr_psoc *psoc,
338 uint8_t vdev_id,
339 struct roam_disable_cfg *req);
340 #endif /* CM_TGT_IF_TX_API_H__ */
341