xref: /wlan-driver/qcacld-3.0/components/target_if/fw_offload/src/target_if_fwol.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: target interface APIs for fw offload
22  *
23  */
24 
25 #include "qdf_mem.h"
26 #include "target_if.h"
27 #include "qdf_status.h"
28 #include "wmi_unified_api.h"
29 #include "wmi_unified_priv.h"
30 #include "wmi_unified_param.h"
31 #include "wlan_objmgr_psoc_obj.h"
32 #include "wlan_utility.h"
33 #include "wlan_defs.h"
34 #include "wlan_fwol_public_structs.h"
35 #include "wlan_fw_offload_main.h"
36 #include "target_if_fwol.h"
37 
38 #ifdef WLAN_FEATURE_ELNA
39 /**
40  * target_if_fwol_set_elna_bypass() - send set eLNA bypass request to FW
41  * @psoc: pointer to PSOC object
42  * @req: set eLNA bypass request
43  *
44  * Return: QDF_STATUS_SUCCESS on success
45  */
46 static QDF_STATUS
target_if_fwol_set_elna_bypass(struct wlan_objmgr_psoc * psoc,struct set_elna_bypass_request * req)47 target_if_fwol_set_elna_bypass(struct wlan_objmgr_psoc *psoc,
48 			       struct set_elna_bypass_request *req)
49 {
50 	QDF_STATUS status;
51 	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
52 
53 	if (!wmi_handle) {
54 		target_if_err("Invalid wmi_handle");
55 		return QDF_STATUS_E_INVAL;
56 	}
57 
58 	status = wmi_unified_send_set_elna_bypass_cmd(wmi_handle, req);
59 	if (status)
60 		target_if_err("Failed to set eLNA bypass %d", status);
61 
62 	return status;
63 }
64 
65 /**
66  * target_if_fwol_get_elna_bypass() - send get eLNA bypass request to FW
67  * @psoc: pointer to PSOC object
68  * @req: get eLNA bypass request
69  *
70  * Return: QDF_STATUS_SUCCESS on success
71  */
72 static QDF_STATUS
target_if_fwol_get_elna_bypass(struct wlan_objmgr_psoc * psoc,struct get_elna_bypass_request * req)73 target_if_fwol_get_elna_bypass(struct wlan_objmgr_psoc *psoc,
74 			       struct get_elna_bypass_request *req)
75 {
76 	QDF_STATUS status;
77 	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
78 
79 	if (!wmi_handle) {
80 		target_if_err("Invalid wmi_handle");
81 		return QDF_STATUS_E_INVAL;
82 	}
83 
84 	status = wmi_unified_send_get_elna_bypass_cmd(wmi_handle, req);
85 	if (status)
86 		target_if_err("Failed to set eLNA bypass %d", status);
87 
88 	return status;
89 }
90 
91 /**
92  * target_if_fwol_get_elna_bypass_resp() - handler for get eLNA bypass response
93  * @scn: scn handle
94  * @event_buf: pointer to the event buffer
95  * @len: length of the buffer
96  *
97  * Return: 0 on success
98  */
target_if_fwol_get_elna_bypass_resp(ol_scn_t scn,uint8_t * event_buf,uint32_t len)99 static int target_if_fwol_get_elna_bypass_resp(ol_scn_t scn, uint8_t *event_buf,
100 					       uint32_t len)
101 {
102 	QDF_STATUS status;
103 	struct get_elna_bypass_response resp;
104 	struct wlan_objmgr_psoc *psoc;
105 	wmi_unified_t wmi_handle;
106 	struct wlan_fwol_psoc_obj *fwol_obj;
107 	struct wlan_fwol_rx_ops *rx_ops;
108 
109 	target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, event_buf, len);
110 	if (!scn || !event_buf) {
111 		target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
112 		return -EINVAL;
113 	}
114 
115 	psoc = target_if_get_psoc_from_scn_hdl(scn);
116 	if (!psoc) {
117 		target_if_err("null psoc");
118 		return -EINVAL;
119 	}
120 
121 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
122 	if (!wmi_handle) {
123 		target_if_err("Invalid wmi_handle");
124 		return -EINVAL;
125 	}
126 
127 	fwol_obj = fwol_get_psoc_obj(psoc);
128 	if (!fwol_obj) {
129 		target_if_err("Failed to get FWOL Obj");
130 		return -EINVAL;
131 	}
132 
133 	rx_ops = &fwol_obj->rx_ops;
134 	if (rx_ops->get_elna_bypass_resp) {
135 		status = wmi_extract_get_elna_bypass_resp(wmi_handle,
136 							  event_buf, &resp);
137 		if (QDF_IS_STATUS_ERROR(status)) {
138 			target_if_err("Failed to extract eLNA bypass");
139 			return -EINVAL;
140 		}
141 		status = rx_ops->get_elna_bypass_resp(psoc, &resp);
142 		if (status != QDF_STATUS_SUCCESS) {
143 			target_if_err("get_elna_bypass_resp failed.");
144 			return -EINVAL;
145 		}
146 	} else {
147 		target_if_fatal("No get_elna_bypass_resp callback");
148 		return -EINVAL;
149 	}
150 
151 	return 0;
152 };
153 
154 static void
target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)155 target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc *psoc,
156 					   void *arg)
157 {
158 	QDF_STATUS rc;
159 
160 	rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
161 					wmi_get_elna_bypass_event_id,
162 					target_if_fwol_get_elna_bypass_resp);
163 	if (QDF_IS_STATUS_ERROR(rc))
164 		target_if_debug("Failed to register get eLNA bypass event cb");
165 }
166 
167 static void
target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)168 target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc *psoc,
169 					     void *arg)
170 {
171 	QDF_STATUS rc;
172 
173 	rc = wmi_unified_unregister_event_handler(
174 					    get_wmi_unified_hdl_from_psoc(psoc),
175 					    wmi_get_elna_bypass_event_id);
176 	if (QDF_IS_STATUS_ERROR(rc))
177 		target_if_debug("Failed to unregister get eLNA bypass event cb");
178 }
179 
180 static void
target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops * tx_ops)181 target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
182 {
183 	tx_ops->set_elna_bypass = target_if_fwol_set_elna_bypass;
184 	tx_ops->get_elna_bypass = target_if_fwol_get_elna_bypass;
185 }
186 #else
187 static void
target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)188 target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc *psoc,
189 					   void *arg)
190 {
191 }
192 
193 static void
target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)194 target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc *psoc,
195 					     void *arg)
196 {
197 }
198 
199 static void
target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops * tx_ops)200 target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
201 {
202 }
203 #endif /* WLAN_FEATURE_ELNA */
204 
205 #ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
206 /**
207  * target_if_fwol_send_dscp_up_map_to_fw() - send dscp up map to FW
208  * @psoc: pointer to PSOC object
209  * @dscp_to_up_map: DSCP to UP map array
210  *
211  * Return: QDF_STATUS_SUCCESS on success
212  */
213 static QDF_STATUS
target_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_psoc * psoc,uint32_t * dscp_to_up_map)214 target_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_psoc *psoc,
215 				     uint32_t *dscp_to_up_map)
216 {
217 	QDF_STATUS status;
218 	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
219 
220 	if (!wmi_handle) {
221 		target_if_err("Invalid wmi_handle");
222 		return QDF_STATUS_E_INVAL;
223 	}
224 
225 	status = wmi_unified_send_dscp_tip_map_cmd(wmi_handle, dscp_to_up_map);
226 	if (status)
227 		target_if_err("Failed to send dscp_up_map_to_fw %d", status);
228 
229 	return status;
230 }
231 
232 static void
target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops * tx_ops)233 target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
234 {
235 	tx_ops->send_dscp_up_map_to_fw = target_if_fwol_send_dscp_up_map_to_fw;
236 }
237 #else
238 static void
target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops * tx_ops)239 target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
240 {
241 }
242 #endif
243 
244 #ifdef THERMAL_STATS_SUPPORT
245 /**
246  * target_if_fwol_get_thermal_stats() - send get thermal stats request to FW
247  * @psoc: pointer to PSOC object
248  * @req_type: get thermal stats request type
249  * @therm_stats_offset: thermal temp stats offset for each temp range
250  *
251  * Return: QDF_STATUS_SUCCESS on success
252  */
253 static QDF_STATUS
target_if_fwol_get_thermal_stats(struct wlan_objmgr_psoc * psoc,enum thermal_stats_request_type req_type,uint8_t therm_stats_offset)254 target_if_fwol_get_thermal_stats(struct wlan_objmgr_psoc *psoc,
255 				 enum thermal_stats_request_type req_type,
256 				 uint8_t therm_stats_offset)
257 {
258 	QDF_STATUS status;
259 	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
260 
261 	if (!wmi_handle) {
262 		target_if_err("Invalid wmi_handle");
263 		return QDF_STATUS_E_INVAL;
264 	}
265 
266 	status = wmi_unified_send_get_thermal_stats_cmd(wmi_handle, req_type,
267 							therm_stats_offset);
268 	if (status)
269 		target_if_err("Failed to send get thermal stats cmd %d",
270 			      status);
271 
272 	return status;
273 }
274 
275 static void
target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops * tx_ops)276 target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
277 {
278 	tx_ops->get_thermal_stats = target_if_fwol_get_thermal_stats;
279 }
280 
281 static QDF_STATUS
target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc * psoc,struct wlan_fwol_rx_ops * rx_ops,struct thermal_throttle_info * info)282 target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc *psoc,
283 					    struct wlan_fwol_rx_ops *rx_ops,
284 					    struct thermal_throttle_info *info)
285 {
286 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
287 
288 	if (rx_ops->get_thermal_stats_resp && info->therm_throt_levels)
289 		status = rx_ops->get_thermal_stats_resp(psoc, info);
290 
291 	return status;
292 }
293 
294 static bool
target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj * fwol_obj)295 target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj *fwol_obj)
296 {
297 	return (fwol_obj->capability_info.fw_thermal_stats_cap &&
298 		fwol_obj->cfg.thermal_temp_cfg.therm_stats_offset);
299 }
300 #else
301 static void
target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops * tx_ops)302 target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
303 {
304 }
305 
306 #ifdef FW_THERMAL_THROTTLE_SUPPORT
307 static QDF_STATUS
target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc * psoc,struct wlan_fwol_rx_ops * rx_ops,struct thermal_throttle_info * info)308 target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc *psoc,
309 					    struct wlan_fwol_rx_ops *rx_ops,
310 					    struct thermal_throttle_info *info)
311 {
312 	return QDF_STATUS_E_NOSUPPORT;
313 }
314 
315 static bool
target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj * fwol_obj)316 target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj *fwol_obj)
317 {
318 	return false;
319 }
320 #endif
321 #endif
322 
323 #if defined FW_THERMAL_THROTTLE_SUPPORT || defined THERMAL_STATS_SUPPORT
324 QDF_STATUS
target_if_fwol_notify_thermal_throttle(struct wlan_objmgr_psoc * psoc,struct thermal_throttle_info * info)325 target_if_fwol_notify_thermal_throttle(struct wlan_objmgr_psoc *psoc,
326 				       struct thermal_throttle_info *info)
327 {
328 	struct wlan_fwol_psoc_obj *fwol_obj;
329 	struct wlan_fwol_rx_ops *rx_ops;
330 	QDF_STATUS status;
331 
332 	fwol_obj = fwol_get_psoc_obj(psoc);
333 	if (!fwol_obj) {
334 		target_if_err("Failed to get FWOL Obj");
335 		return QDF_STATUS_E_INVAL;
336 	}
337 
338 	rx_ops = &fwol_obj->rx_ops;
339 	if (!rx_ops) {
340 		target_if_err("rx_ops Null");
341 		return QDF_STATUS_E_INVAL;
342 	}
343 
344 	if (!info) {
345 		target_if_err("info Null");
346 		return QDF_STATUS_E_INVAL;
347 	}
348 
349 	if (rx_ops->notify_thermal_throttle_handler) {
350 		if (info->level == THERMAL_UNKNOWN) {
351 			target_if_debug("Invalid thermal target lvl");
352 			return QDF_STATUS_E_INVAL;
353 		}
354 		status = rx_ops->notify_thermal_throttle_handler(psoc, info);
355 		if (QDF_IS_STATUS_ERROR(status)) {
356 			target_if_debug("notify thermal_throttle failed.");
357 			return QDF_STATUS_E_INVAL;
358 		}
359 	} else {
360 		target_if_debug("No notify thermal_throttle callback");
361 		return QDF_STATUS_E_INVAL;
362 	}
363 
364 	return status;
365 }
366 
367 /**
368  * target_if_fwol_thermal_throttle_event_handler() - handler for thermal
369  *  throttle event
370  * @scn: scn handle
371  * @event_buf: pointer to the event buffer
372  * @len: length of the buffer
373  *
374  * Return: 0 on success
375  */
376 static int
target_if_fwol_thermal_throttle_event_handler(ol_scn_t scn,uint8_t * event_buf,uint32_t len)377 target_if_fwol_thermal_throttle_event_handler(ol_scn_t scn, uint8_t *event_buf,
378 					      uint32_t len)
379 {
380 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
381 	struct thermal_throttle_info info = {0};
382 	struct wlan_objmgr_psoc *psoc;
383 	wmi_unified_t wmi_handle;
384 	struct wlan_fwol_psoc_obj *fwol_obj;
385 	struct wlan_fwol_rx_ops *rx_ops;
386 
387 	target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, event_buf, len);
388 	if (!scn || !event_buf) {
389 		target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
390 		return -EINVAL;
391 	}
392 
393 	psoc = target_if_get_psoc_from_scn_hdl(scn);
394 	if (!psoc) {
395 		target_if_err("null psoc");
396 		return -EINVAL;
397 	}
398 
399 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
400 	if (!wmi_handle) {
401 		target_if_err("Invalid wmi_handle");
402 		return -EINVAL;
403 	}
404 
405 	fwol_obj = fwol_get_psoc_obj(psoc);
406 	if (!fwol_obj) {
407 		target_if_err("Failed to get FWOL Obj");
408 		return -EINVAL;
409 	}
410 
411 	status = wmi_extract_thermal_stats(wmi_handle,
412 					   event_buf,
413 					   &info.temperature,
414 					   &info.level,
415 					   &info.therm_throt_levels,
416 					   info.level_info,
417 					   &info.pdev_id);
418 	if (QDF_IS_STATUS_ERROR(status)) {
419 		target_if_debug("Failed to convert thermal target level");
420 		return -EINVAL;
421 	}
422 	rx_ops = &fwol_obj->rx_ops;
423 	if (!rx_ops) {
424 		target_if_debug("rx_ops Null");
425 		return -EINVAL;
426 	}
427 
428 	status = target_if_fwol_handle_thermal_lvl_stats_evt(psoc, rx_ops,
429 							     &info);
430 	if (QDF_IS_STATUS_ERROR(status))
431 		target_if_debug("thermal stats level response failed.");
432 
433 	if (rx_ops->notify_thermal_throttle_handler)
434 	{
435 		if (info.level == THERMAL_UNKNOWN) {
436 			target_if_debug("Failed to convert thermal target lvl");
437 			return -EINVAL;
438 		}
439 		status = rx_ops->notify_thermal_throttle_handler(psoc, &info);
440 		if (QDF_IS_STATUS_ERROR(status)) {
441 			target_if_debug("notify thermal_throttle failed.");
442 			return -EINVAL;
443 		}
444 	} else {
445 		target_if_debug("No notify thermal_throttle callback");
446 		return -EINVAL;
447 	}
448 	return 0;
449 }
450 
451 /**
452  * target_if_fwol_register_thermal_throttle_handler() - Register handler for
453  * thermal throttle stats firmware event
454  * @psoc: psoc object
455  *
456  * Return: void
457  */
458 static void
target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc * psoc)459 target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc)
460 {
461 	QDF_STATUS status;
462 	struct wlan_fwol_psoc_obj *fwol_obj;
463 
464 	fwol_obj = fwol_get_psoc_obj(psoc);
465 	if (!fwol_obj) {
466 		target_if_err("Failed to get FWOL Obj");
467 		return;
468 	}
469 	if (!fwol_obj->cfg.thermal_temp_cfg.thermal_mitigation_enable &&
470 	    !target_if_fwol_is_thermal_stats_enable(fwol_obj)) {
471 		target_if_debug("thermal mitigation or stats offload not enabled");
472 		return;
473 	}
474 	status = wmi_unified_register_event_handler(
475 				get_wmi_unified_hdl_from_psoc(psoc),
476 				wmi_tt_stats_event_id,
477 				target_if_fwol_thermal_throttle_event_handler,
478 				WMI_RX_SERIALIZER_CTX);
479 	if (QDF_IS_STATUS_ERROR(status))
480 		target_if_debug("Failed to register thermal stats event cb");
481 }
482 
483 /**
484  * target_if_fwol_unregister_thermal_throttle_handler() - Unregister handler for
485  * thermal throttle stats firmware event
486  * @psoc: psoc object
487  *
488  * Return: void
489  */
490 static void
target_if_fwol_unregister_thermal_throttle_handler(struct wlan_objmgr_psoc * psoc)491 target_if_fwol_unregister_thermal_throttle_handler(
492 					struct wlan_objmgr_psoc *psoc)
493 {
494 	QDF_STATUS status;
495 
496 	status = wmi_unified_unregister_event_handler(
497 				get_wmi_unified_hdl_from_psoc(psoc),
498 				wmi_tt_stats_event_id);
499 	if (QDF_IS_STATUS_ERROR(status))
500 		target_if_debug("Failed to unregister thermal stats event cb");
501 }
502 #else
503 static void
target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc * psoc)504 target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc)
505 {
506 }
507 
508 static void
target_if_fwol_unregister_thermal_throttle_handler(struct wlan_objmgr_psoc * psoc)509 target_if_fwol_unregister_thermal_throttle_handler(
510 					struct wlan_objmgr_psoc *psoc)
511 {
512 }
513 #endif
514 
515 #ifdef WLAN_FEATURE_MDNS_OFFLOAD
516 /**
517  * target_if_fwol_set_mdns_config() - Set mdns Config to FW
518  * @psoc: pointer to PSOC object
519  * @mdns_info: pointer to mdns config info
520  *
521  * Return: QDF_STATUS_SUCCESS on success
522  */
523 static QDF_STATUS
target_if_fwol_set_mdns_config(struct wlan_objmgr_psoc * psoc,struct mdns_config_info * mdns_info)524 target_if_fwol_set_mdns_config(struct wlan_objmgr_psoc *psoc,
525 			       struct mdns_config_info *mdns_info)
526 {
527 	QDF_STATUS status;
528 	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
529 
530 	if (!wmi_handle) {
531 		target_if_err("Invalid wmi_handle");
532 		return QDF_STATUS_E_INVAL;
533 	}
534 
535 	status = wmi_unified_send_set_mdns_config_cmd(wmi_handle,
536 						      mdns_info);
537 	if (QDF_IS_STATUS_ERROR(status))
538 		target_if_err("Failed to set mDNS Config %d", status);
539 
540 	return status;
541 }
542 
543 static void
target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops * tx_ops)544 target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
545 {
546 	tx_ops->set_mdns_config = target_if_fwol_set_mdns_config;
547 }
548 #else
549 static void
target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops * tx_ops)550 target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
551 {
552 }
553 #endif /* WLAN_FEATURE_MDNS_OFFLOAD */
554 
555 QDF_STATUS
target_if_fwol_register_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)556 target_if_fwol_register_event_handler(struct wlan_objmgr_psoc *psoc,
557 				      void *arg)
558 {
559 	target_if_fwol_register_elna_event_handler(psoc, arg);
560 	target_if_fwol_register_thermal_throttle_handler(psoc);
561 
562 	return QDF_STATUS_SUCCESS;
563 }
564 
565 QDF_STATUS
target_if_fwol_unregister_event_handler(struct wlan_objmgr_psoc * psoc,void * arg)566 target_if_fwol_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
567 					void *arg)
568 {
569 	target_if_fwol_unregister_thermal_throttle_handler(psoc);
570 	target_if_fwol_unregister_elna_event_handler(psoc, arg);
571 
572 	return QDF_STATUS_SUCCESS;
573 }
574 
target_if_fwol_register_tx_ops(struct wlan_fwol_tx_ops * tx_ops)575 QDF_STATUS target_if_fwol_register_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
576 {
577 	target_if_fwol_register_elna_tx_ops(tx_ops);
578 	target_if_fwol_register_dscp_up_tx_ops(tx_ops);
579 	target_if_fwol_register_mdns_tx_ops(tx_ops);
580 	target_if_fwol_register_thermal_stats_tx_ops(tx_ops);
581 
582 	tx_ops->reg_evt_handler = target_if_fwol_register_event_handler;
583 	tx_ops->unreg_evt_handler = target_if_fwol_unregister_event_handler;
584 
585 	return QDF_STATUS_SUCCESS;
586 }
587 
588