1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @brief Header containing work specific declarations for the
9  * Zephyr OS layer of the Wi-Fi driver.
10  */
11 
12 #ifndef __WORK_H__
13 #define __WORK_H__
14 
15 
16 extern struct k_work_q zep_wifi_bh_q;
17 
18 enum zep_work_type {
19 	ZEP_WORK_TYPE_BH,
20 	ZEP_WORK_TYPE_IRQ,
21 	ZEP_WORK_TYPE_TX_DONE,
22 	ZEP_WORK_TYPE_RX,
23 };
24 
25 struct zep_work_item {
26 	bool in_use;
27 	struct k_work work;
28 	unsigned long data;
29 	void (*callback)(unsigned long data);
30 	enum zep_work_type type;
31 };
32 
33 struct zep_work_item *work_alloc(enum zep_work_type);
34 
35 void work_init(struct zep_work_item *work, void (*callback)(unsigned long callbk_data),
36 		  unsigned long data);
37 
38 void work_schedule(struct zep_work_item *work);
39 
40 void work_kill(struct zep_work_item *work);
41 
42 void work_free(struct zep_work_item *work);
43 
44 #endif /* __WORK_H__ */
45