xref: /wlan-dirver/qca-wifi-host-cmn/scheduler/inc/scheduler_api.h (revision 70a19e16789e308182f63b15c75decec7bf0b342)
1cd395495SRajeev Kumar /*
2f28396d0SVivek  * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
3*70a19e16SJeff Johnson  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4cd395495SRajeev Kumar  *
5cd395495SRajeev Kumar  * Permission to use, copy, modify, and/or distribute this software for
6cd395495SRajeev Kumar  * any purpose with or without fee is hereby granted, provided that the
7cd395495SRajeev Kumar  * above copyright notice and this permission notice appear in all
8cd395495SRajeev Kumar  * copies.
9cd395495SRajeev Kumar  *
10cd395495SRajeev Kumar  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11cd395495SRajeev Kumar  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12cd395495SRajeev Kumar  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13cd395495SRajeev Kumar  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14cd395495SRajeev Kumar  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15cd395495SRajeev Kumar  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16cd395495SRajeev Kumar  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17cd395495SRajeev Kumar  * PERFORMANCE OF THIS SOFTWARE.
18cd395495SRajeev Kumar  */
19cd395495SRajeev Kumar 
20cd395495SRajeev Kumar #if !defined(__SCHEDULER_API_H)
21cd395495SRajeev Kumar #define __SCHEDULER_API_H
22cd395495SRajeev Kumar 
23cd395495SRajeev Kumar #include <qdf_event.h>
24cd395495SRajeev Kumar #include <qdf_types.h>
25cd395495SRajeev Kumar #include <qdf_lock.h>
26cd395495SRajeev Kumar #include <qdf_mc_timer.h>
27cd395495SRajeev Kumar #include <qdf_status.h>
28cd395495SRajeev Kumar 
29cd395495SRajeev Kumar /* Controller thread various event masks
30cd395495SRajeev Kumar  * MC_POST_EVENT_MASK: wake up thread after posting message
31cd395495SRajeev Kumar  * MC_SUSPEND_EVENT_MASK: signal thread to suspend during kernel pm suspend
32cd395495SRajeev Kumar  * MC_SHUTDOWN_EVENT_MASK: signal thread to shutdown and exit during unload
33cd395495SRajeev Kumar  */
34cd395495SRajeev Kumar #define MC_POST_EVENT_MASK               0x001
35cd395495SRajeev Kumar #define MC_SUSPEND_EVENT_MASK            0x002
36cd395495SRajeev Kumar #define MC_SHUTDOWN_EVENT_MASK           0x010
37cd395495SRajeev Kumar 
38cd395495SRajeev Kumar /*
39cd395495SRajeev Kumar  * Cookie for timer messages.  Note that anyone posting a timer message
40cd395495SRajeev Kumar  * has to write the COOKIE in the reserved field of the message.  The
41cd395495SRajeev Kumar  * timer queue handler relies on this COOKIE
42cd395495SRajeev Kumar  */
43cd395495SRajeev Kumar #define SYS_MSG_COOKIE      0xFACE
44cd395495SRajeev Kumar 
45302a1d97Sgaurank kathpalia #define scheduler_get_src_id(qid)       (((qid) >> 20) & 0x3FF)
46302a1d97Sgaurank kathpalia #define scheduler_get_dest_id(qid)      (((qid) >> 10) & 0x3FF)
47302a1d97Sgaurank kathpalia #define scheduler_get_que_id(qid)       ((qid) & 0x3FF)
48302a1d97Sgaurank kathpalia #define scheduler_get_qid(src, dest, que_id)    ((que_id) | ((dest) << 10) |\
49302a1d97Sgaurank kathpalia 					     ((src) << 20))
506e4b9c54Sgaurank kathpalia 
51cd395495SRajeev Kumar typedef enum {
52cd395495SRajeev Kumar 	SYS_MSG_ID_MC_TIMER,
53cd395495SRajeev Kumar 	SYS_MSG_ID_FTM_RSP,
54cd395495SRajeev Kumar 	SYS_MSG_ID_QVIT,
555c57a890SPoddar, Siddarth 	SYS_MSG_ID_DATA_STALL_MSG,
56c3b7a68dSNaveen Rawat 	SYS_MSG_ID_UMAC_STOP,
57cd395495SRajeev Kumar } SYS_MSG_ID;
58cd395495SRajeev Kumar 
59a86b23eeSLincoln Tran struct scheduler_msg;
60a86b23eeSLincoln Tran typedef QDF_STATUS (*scheduler_msg_process_fn_t)(struct scheduler_msg *msg);
61a86b23eeSLincoln Tran typedef void (*hdd_suspend_callback)(void);
62a86b23eeSLincoln Tran 
63cd395495SRajeev Kumar /**
64cd395495SRajeev Kumar  * struct scheduler_msg: scheduler message structure
65cd395495SRajeev Kumar  * @type: message type
66cd395495SRajeev Kumar  * @reserved: reserved field
67f227fb74SVivek  * @bodyval: message body val
68cd395495SRajeev Kumar  * @bodyptr: message body pointer based on the type either a bodyptr pointer
69cd395495SRajeev Kumar  *     into memory or bodyval as a 32 bit data is used. bodyptr is always a
70cd395495SRajeev Kumar  *     freeable pointer, one should always make sure that bodyptr is always
71cd395495SRajeev Kumar  *     freeable.
72cd395495SRajeev Kumar  * Messages should use either bodyptr or bodyval; not both !!!
73cd395495SRajeev Kumar  * @callback: callback to be called by scheduler thread once message is posted
74cd395495SRajeev Kumar  *   and scheduler thread has started processing the message.
75928e3ecaSRajeev Kumar  * @flush_callback: flush callback which will be invoked during driver unload
76928e3ecaSRajeev Kumar  *   such that component can release the ref count of common global objects
77928e3ecaSRajeev Kumar  *   like PSOC, PDEV, VDEV and PEER. A component needs to populate flush
78928e3ecaSRajeev Kumar  *   callback in message body pointer for those messages which have taken ref
79928e3ecaSRajeev Kumar  *   count for above mentioned common objects.
80c7ee85c4SDustin Brown  * @node: list node for queue membership
81dae10a5fSDustin Brown  * @queue_id: Id of the queue the message was added to
82dae10a5fSDustin Brown  * @queue_depth: depth of the queue when the message was queued
83dae10a5fSDustin Brown  * @queued_at_us: timestamp when the message was queued in microseconds
84cd395495SRajeev Kumar  */
85cd395495SRajeev Kumar struct scheduler_msg {
86cd395495SRajeev Kumar 	uint16_t type;
87cd395495SRajeev Kumar 	uint16_t reserved;
88cd395495SRajeev Kumar 	uint32_t bodyval;
89f227fb74SVivek 	void *bodyptr;
90a86b23eeSLincoln Tran 	scheduler_msg_process_fn_t callback;
91a86b23eeSLincoln Tran 	scheduler_msg_process_fn_t flush_callback;
92c7ee85c4SDustin Brown 	qdf_list_node_t node;
93dae10a5fSDustin Brown #ifdef WLAN_SCHED_HISTORY_SIZE
94dae10a5fSDustin Brown 	QDF_MODULE_ID queue_id;
95dae10a5fSDustin Brown 	uint32_t queue_depth;
96dae10a5fSDustin Brown 	uint64_t queued_at_us;
97dae10a5fSDustin Brown #endif /* WLAN_SCHED_HISTORY_SIZE */
98cd395495SRajeev Kumar };
99cd395495SRajeev Kumar 
100901120c0Ssandhu struct sched_qdf_mc_timer_cb_wrapper;
101901120c0Ssandhu 
102901120c0Ssandhu /**
103901120c0Ssandhu  * scheduler_qdf_mc_timer_init() - initialize and fill callback and data
104901120c0Ssandhu  * @timer_callback: callback to timer
105901120c0Ssandhu  * @data: data pointer
106901120c0Ssandhu  *
107901120c0Ssandhu  * Return: return pointer to struct sched_qdf_mc_timer_cb_wrapper
108901120c0Ssandhu  */
109901120c0Ssandhu struct sched_qdf_mc_timer_cb_wrapper *scheduler_qdf_mc_timer_init(
110901120c0Ssandhu 		qdf_mc_timer_callback_t timer_callback,
111901120c0Ssandhu 		void *data);
112901120c0Ssandhu 
113901120c0Ssandhu /**
114*70a19e16SJeff Johnson  * scheduler_qdf_mc_timer_deinit_return_data_ptr() - deinitialize callback and
115*70a19e16SJeff Johnson  *                                                   return data
116901120c0Ssandhu  * @wrapper_ptr: wrapper ptr
117901120c0Ssandhu  *
118*70a19e16SJeff Johnson  * Return: original data supplied to scheduler_qdf_mc_timer_init()
119901120c0Ssandhu  */
120901120c0Ssandhu void *scheduler_qdf_mc_timer_deinit_return_data_ptr(
121901120c0Ssandhu 		struct sched_qdf_mc_timer_cb_wrapper *wrapper_ptr);
122901120c0Ssandhu 
123901120c0Ssandhu /**
124901120c0Ssandhu  * scheduler_qdf_mc_timer_callback_t_wrapper() - wrapper for mc timer callbacks
125901120c0Ssandhu  * @msg: message pointer
126901120c0Ssandhu  *
127901120c0Ssandhu  * Return: None
128901120c0Ssandhu  */
129901120c0Ssandhu QDF_STATUS scheduler_qdf_mc_timer_callback_t_wrapper(struct scheduler_msg *msg);
130901120c0Ssandhu 
131f28396d0SVivek /**
132f28396d0SVivek  * sched_history_print() - print scheduler history
133f28396d0SVivek  *
134f28396d0SVivek  * This API prints the scheduler history.
135f28396d0SVivek  *
136f28396d0SVivek  * Return: None
137f28396d0SVivek  */
138f28396d0SVivek void sched_history_print(void);
139f28396d0SVivek 
140cd395495SRajeev Kumar /**
141cd395495SRajeev Kumar  * scheduler_init() - initialize control path scheduler
142cd395495SRajeev Kumar  *
143cd395495SRajeev Kumar  * This API initializes control path scheduler.
144cd395495SRajeev Kumar  *
145cd395495SRajeev Kumar  * Return: QDF status
146cd395495SRajeev Kumar  */
147cd395495SRajeev Kumar QDF_STATUS scheduler_init(void);
148cd395495SRajeev Kumar 
149cd395495SRajeev Kumar /**
150cd395495SRajeev Kumar  * scheduler_deinit() - de-initialize control path scheduler
151cd395495SRajeev Kumar  *
152cd395495SRajeev Kumar  * This API de-initializes control path scheduler.
153cd395495SRajeev Kumar  *
154cd395495SRajeev Kumar  * Return: QDF status
155cd395495SRajeev Kumar  */
156cd395495SRajeev Kumar QDF_STATUS scheduler_deinit(void);
157cd395495SRajeev Kumar 
158cd395495SRajeev Kumar /**
159e0c9f669SDustin Brown  * scheduler_enable() - start the scheduler module
160e0c9f669SDustin Brown  *
161e0c9f669SDustin Brown  * Ready the scheduler module to service requests, and start the scheduler's
162e0c9f669SDustin Brown  * message processing thread. Must only be called after scheduler_init().
163e0c9f669SDustin Brown  *
164e0c9f669SDustin Brown  * Return: QDF_STATUS
165e0c9f669SDustin Brown  */
166e0c9f669SDustin Brown QDF_STATUS scheduler_enable(void);
167e0c9f669SDustin Brown 
168e0c9f669SDustin Brown /**
169e0c9f669SDustin Brown  * scheduler_disable() - stop the scheduler module
170e0c9f669SDustin Brown  *
171e0c9f669SDustin Brown  * Stop the scheduler module from servicing requests, and terminate the
172e0c9f669SDustin Brown  * scheduler's message processing thread. Must be called before
173e0c9f669SDustin Brown  * scheduler_deinit().
174e0c9f669SDustin Brown  *
175e0c9f669SDustin Brown  * Return: QDF_STATUS
176e0c9f669SDustin Brown  */
177e0c9f669SDustin Brown QDF_STATUS scheduler_disable(void);
178e0c9f669SDustin Brown 
179e0c9f669SDustin Brown /**
180cd395495SRajeev Kumar  * scheduler_register_module() - register input module/queue id
181cd395495SRajeev Kumar  * @qid: queue id to get registered
182cd395495SRajeev Kumar  * @callback: queue message to be called when a message is posted
183cd395495SRajeev Kumar  *
184cd395495SRajeev Kumar  * Return: QDF status
185cd395495SRajeev Kumar  */
186cd395495SRajeev Kumar QDF_STATUS scheduler_register_module(QDF_MODULE_ID qid,
187cd395495SRajeev Kumar 		scheduler_msg_process_fn_t callback);
188cd395495SRajeev Kumar 
189cd395495SRajeev Kumar /**
190cd395495SRajeev Kumar  * scheduler_deregister_module() - deregister input module/queue id
191cd395495SRajeev Kumar  * @qid: queue id to get deregistered
192cd395495SRajeev Kumar  *
193cd395495SRajeev Kumar  * Return: QDF status
194cd395495SRajeev Kumar  */
195cd395495SRajeev Kumar QDF_STATUS scheduler_deregister_module(QDF_MODULE_ID qid);
196cd395495SRajeev Kumar 
197cd395495SRajeev Kumar /**
198cd395495SRajeev Kumar  * scheduler_post_msg_by_priority() - post messages by priority
1996e4b9c54Sgaurank kathpalia  * @qid: queue id to which the message has to be posted.
2004865edfdSJeff Johnson  * @msg: message pointer
201cd395495SRajeev Kumar  * @is_high_priority: set to true for high priority message else false
202cd395495SRajeev Kumar  *
203cd395495SRajeev Kumar  * Return: QDF status
204cd395495SRajeev Kumar  */
2056e4b9c54Sgaurank kathpalia QDF_STATUS scheduler_post_msg_by_priority(uint32_t qid,
2066e4b9c54Sgaurank kathpalia 					  struct scheduler_msg *msg,
2076e4b9c54Sgaurank kathpalia 					  bool is_high_priority);
208cd395495SRajeev Kumar 
209cd395495SRajeev Kumar /**
210cd395495SRajeev Kumar  * scheduler_post_msg() - post normal messages(no priority)
2116e4b9c54Sgaurank kathpalia  * @qid: queue id to which the message has to be posted.
2124865edfdSJeff Johnson  * @msg: message pointer
213cd395495SRajeev Kumar  *
214cd395495SRajeev Kumar  * Return: QDF status
215cd395495SRajeev Kumar  */
2166e4b9c54Sgaurank kathpalia static inline QDF_STATUS scheduler_post_msg(uint32_t qid,
217cd395495SRajeev Kumar 					    struct scheduler_msg *msg)
218cd395495SRajeev Kumar {
219cd395495SRajeev Kumar 	return scheduler_post_msg_by_priority(qid, msg, false);
220cd395495SRajeev Kumar }
221cd395495SRajeev Kumar 
222cd395495SRajeev Kumar /**
223*70a19e16SJeff Johnson  * scheduler_post_message_debug() - post normal messages(no priority)
2246e4b9c54Sgaurank kathpalia  * @src_id: Source module of the message
2256e4b9c54Sgaurank kathpalia  * @dest_id: Destination module of the message
226302a1d97Sgaurank kathpalia  * @que_id: Queue to which the message has to posted.
2276e4b9c54Sgaurank kathpalia  * @msg: message pointer
228*70a19e16SJeff Johnson  * @line: caller line number
229*70a19e16SJeff Johnson  * @func: caller function
2306e4b9c54Sgaurank kathpalia  *
2316e4b9c54Sgaurank kathpalia  * This function will mask the src_id, and destination id to qid of
2326e4b9c54Sgaurank kathpalia  * scheduler_post_msg
233*70a19e16SJeff Johnson  *
2346e4b9c54Sgaurank kathpalia  * Return: QDF status
2356e4b9c54Sgaurank kathpalia  */
2361397a33fSMadhvapathi Sriram QDF_STATUS scheduler_post_message_debug(QDF_MODULE_ID src_id,
2376e4b9c54Sgaurank kathpalia 					QDF_MODULE_ID dest_id,
238302a1d97Sgaurank kathpalia 					QDF_MODULE_ID que_id,
2391397a33fSMadhvapathi Sriram 					struct scheduler_msg *msg,
2401397a33fSMadhvapathi Sriram 					int line,
2411397a33fSMadhvapathi Sriram 					const char *func);
2421397a33fSMadhvapathi Sriram 
243*70a19e16SJeff Johnson /**
244*70a19e16SJeff Johnson  * scheduler_post_message() - post normal messages(no priority)
245*70a19e16SJeff Johnson  * @src_id: Source module of the message
246*70a19e16SJeff Johnson  * @dest_id: Destination module of the message
247*70a19e16SJeff Johnson  * @que_id: Queue to which the message has to posted.
248*70a19e16SJeff Johnson  * @msg: message pointer
249*70a19e16SJeff Johnson  *
250*70a19e16SJeff Johnson  * This function will mask the src_id, and destination id to qid of
251*70a19e16SJeff Johnson  * scheduler_post_msg
252*70a19e16SJeff Johnson  *
253*70a19e16SJeff Johnson  * Return: QDF status
254*70a19e16SJeff Johnson  */
2551397a33fSMadhvapathi Sriram #define scheduler_post_message(src_id, dest_id, que_id, msg) \
2561397a33fSMadhvapathi Sriram 	scheduler_post_message_debug(src_id, dest_id, que_id, msg, \
2571397a33fSMadhvapathi Sriram 				     __LINE__, __func__)
2586e4b9c54Sgaurank kathpalia 
2596e4b9c54Sgaurank kathpalia /**
260cd395495SRajeev Kumar  * scheduler_resume() - resume scheduler thread
261cd395495SRajeev Kumar  *
262cd395495SRajeev Kumar  * Complete scheduler thread resume wait event such that scheduler
263cd395495SRajeev Kumar  * thread can wake up and process message queues
264cd395495SRajeev Kumar  *
265cd395495SRajeev Kumar  * Return: none
266cd395495SRajeev Kumar  */
267cd395495SRajeev Kumar void scheduler_resume(void);
268cd395495SRajeev Kumar 
269cd395495SRajeev Kumar /**
270*70a19e16SJeff Johnson  * scheduler_set_watchdog_timeout() - set scheduler timeout for msg processing
271*70a19e16SJeff Johnson  * @timeout: timeout value in milliseconds
27297f44cd3SVivek  *
27397f44cd3SVivek  * Configure the timeout for triggering the scheduler watchdog timer
27497f44cd3SVivek  * in milliseconds
27597f44cd3SVivek  *
27697f44cd3SVivek  * Return: none
27797f44cd3SVivek  */
27897f44cd3SVivek void scheduler_set_watchdog_timeout(uint32_t timeout);
27997f44cd3SVivek 
28097f44cd3SVivek /**
281cd395495SRajeev Kumar  * scheduler_register_hdd_suspend_callback() - suspend callback to hdd
282*70a19e16SJeff Johnson  * @callback: hdd callback to be called when controller thread is suspended
283cd395495SRajeev Kumar  *
284cd395495SRajeev Kumar  * Return: none
285cd395495SRajeev Kumar  */
286cd395495SRajeev Kumar void scheduler_register_hdd_suspend_callback(hdd_suspend_callback callback);
287cd395495SRajeev Kumar 
288cd395495SRajeev Kumar /**
289cd395495SRajeev Kumar  * scheduler_wake_up_controller_thread() - wake up controller thread
290cd395495SRajeev Kumar  *
291cd395495SRajeev Kumar  * Wake up controller thread to process a critical message.
292cd395495SRajeev Kumar  *
293cd395495SRajeev Kumar  * Return: none
294cd395495SRajeev Kumar  */
295cd395495SRajeev Kumar void scheduler_wake_up_controller_thread(void);
296cd395495SRajeev Kumar 
297cd395495SRajeev Kumar /**
298cd395495SRajeev Kumar  * scheduler_set_event_mask() - set given event mask
299cd395495SRajeev Kumar  * @event_mask: event mask to set
300cd395495SRajeev Kumar  *
301cd395495SRajeev Kumar  * Set given event mask such that controller scheduler thread can do
302cd395495SRajeev Kumar  * specified work after wake up.
303cd395495SRajeev Kumar  *
304cd395495SRajeev Kumar  * Return: none
305cd395495SRajeev Kumar  */
306cd395495SRajeev Kumar void scheduler_set_event_mask(uint32_t event_mask);
307cd395495SRajeev Kumar 
308cd395495SRajeev Kumar /**
309cd395495SRajeev Kumar  * scheduler_clear_event_mask() - clear given event mask
310cd395495SRajeev Kumar  * @event_mask: event mask to set
311cd395495SRajeev Kumar  *
312cd395495SRajeev Kumar  * Return: none
313cd395495SRajeev Kumar  */
314cd395495SRajeev Kumar void scheduler_clear_event_mask(uint32_t event_mask);
315cd395495SRajeev Kumar 
316cd395495SRajeev Kumar /**
317cd395495SRajeev Kumar  * scheduler_target_if_mq_handler() - top level message queue handler for
318cd395495SRajeev Kumar  *                                    target_if message queue
319cd395495SRajeev Kumar  * @msg: pointer to actual message being handled
320cd395495SRajeev Kumar  *
321cd395495SRajeev Kumar  * Return: none
322cd395495SRajeev Kumar  */
323cd395495SRajeev Kumar QDF_STATUS scheduler_target_if_mq_handler(struct scheduler_msg *msg);
324cd395495SRajeev Kumar 
325cd395495SRajeev Kumar /**
326cd395495SRajeev Kumar  * scheduler_os_if_mq_handler() - top level message queue handler for
327cd395495SRajeev Kumar  *                                os_if message queue
328cd395495SRajeev Kumar  * @msg: pointer to actual message being handled
329cd395495SRajeev Kumar  *
330cd395495SRajeev Kumar  * Return: none
331cd395495SRajeev Kumar  */
332cd395495SRajeev Kumar QDF_STATUS scheduler_os_if_mq_handler(struct scheduler_msg *msg);
333cd395495SRajeev Kumar 
334cd395495SRajeev Kumar /**
335cd395495SRajeev Kumar  * scheduler_timer_q_mq_handler() - top level message queue handler for
336cd395495SRajeev Kumar  *                                timer queue
337cd395495SRajeev Kumar  * @msg: pointer to actual message being handled
338cd395495SRajeev Kumar  *
339cd395495SRajeev Kumar  * Return: none
340cd395495SRajeev Kumar  */
341cd395495SRajeev Kumar QDF_STATUS scheduler_timer_q_mq_handler(struct scheduler_msg *msg);
342cd395495SRajeev Kumar 
343cd395495SRajeev Kumar /**
3446e2fed8fSSantosh Anbu  * scheduler_mlme_mq_handler() - top level message queue handler for
3456e2fed8fSSantosh Anbu  *                               mlme queue
3466e2fed8fSSantosh Anbu  * @msg: pointer to actual message being handled
3476e2fed8fSSantosh Anbu  *
3486e2fed8fSSantosh Anbu  * Return: QDF status
3496e2fed8fSSantosh Anbu  */
3506e2fed8fSSantosh Anbu QDF_STATUS scheduler_mlme_mq_handler(struct scheduler_msg *msg);
3516e2fed8fSSantosh Anbu 
3526e2fed8fSSantosh Anbu /**
3536ecd284eSVignesh Viswanathan  * scheduler_scan_mq_handler() - top level message queue handler for
3546ecd284eSVignesh Viswanathan  *                               scan queue
3556ecd284eSVignesh Viswanathan  * @msg: pointer to actual message being handled
3566ecd284eSVignesh Viswanathan  *
3576ecd284eSVignesh Viswanathan  * Return: QDF status
3586ecd284eSVignesh Viswanathan  */
3596ecd284eSVignesh Viswanathan QDF_STATUS scheduler_scan_mq_handler(struct scheduler_msg *msg);
3606ecd284eSVignesh Viswanathan 
3616ecd284eSVignesh Viswanathan /**
362cd395495SRajeev Kumar  * scheduler_register_wma_legacy_handler() - register legacy wma handler
363cd395495SRajeev Kumar  * @callback: legacy wma handler to be called for WMA messages
364cd395495SRajeev Kumar  *
365cd395495SRajeev Kumar  * Return: QDF status
366cd395495SRajeev Kumar  */
367cd395495SRajeev Kumar QDF_STATUS scheduler_register_wma_legacy_handler(scheduler_msg_process_fn_t
368cd395495SRajeev Kumar 						callback);
369cd395495SRajeev Kumar 
370cd395495SRajeev Kumar /**
371cd395495SRajeev Kumar  * scheduler_register_sys_legacy_handler() - register legacy sys handler
372cd395495SRajeev Kumar  * @callback: legacy sys handler to be called for sys messages
373cd395495SRajeev Kumar  *
374cd395495SRajeev Kumar  * Return: QDF status
375cd395495SRajeev Kumar  */
376cd395495SRajeev Kumar QDF_STATUS scheduler_register_sys_legacy_handler(scheduler_msg_process_fn_t
377cd395495SRajeev Kumar 						callback);
378cd395495SRajeev Kumar /**
379dce49ecfSKrunal Soni  * scheduler_deregister_sys_legacy_handler() - deregister legacy sys handler
380dce49ecfSKrunal Soni  *
381dce49ecfSKrunal Soni  * Return: QDF status
382dce49ecfSKrunal Soni  */
383dce49ecfSKrunal Soni QDF_STATUS scheduler_deregister_sys_legacy_handler(void);
384e7e6e374SRajeev Kumar 
385dce49ecfSKrunal Soni /**
386dce49ecfSKrunal Soni  * scheduler_deregister_wma_legacy_handler() - deregister legacy wma handler
387dce49ecfSKrunal Soni  *
388dce49ecfSKrunal Soni  * Return: QDF status
389dce49ecfSKrunal Soni  */
390dce49ecfSKrunal Soni QDF_STATUS scheduler_deregister_wma_legacy_handler(void);
391e7e6e374SRajeev Kumar 
392dce49ecfSKrunal Soni /**
393cd395495SRajeev Kumar  * scheduler_mc_timer_callback() - timer callback, gets called at time out
394ad85c389SAshish Kumar Dhanotiya  * @timer: holds the mc timer object.
395cd395495SRajeev Kumar  *
396cd395495SRajeev Kumar  * Return: None
397cd395495SRajeev Kumar  */
398ad85c389SAshish Kumar Dhanotiya void scheduler_mc_timer_callback(qdf_mc_timer_t *timer);
399e7e6e374SRajeev Kumar 
40087a8e445SVignesh Viswanathan /**
40187a8e445SVignesh Viswanathan  * scheduler_get_queue_size() - Get the current size of the scheduler queue
40287a8e445SVignesh Viswanathan  * @qid: Queue ID for which the size is requested
40387a8e445SVignesh Viswanathan  * @size: Pointer to size where the size would be returned to the caller
40487a8e445SVignesh Viswanathan  *
40587a8e445SVignesh Viswanathan  * This API finds the size of the scheduler queue for the given Queue ID
40687a8e445SVignesh Viswanathan  *
40787a8e445SVignesh Viswanathan  * Return: QDF Status
40887a8e445SVignesh Viswanathan  */
40987a8e445SVignesh Viswanathan QDF_STATUS scheduler_get_queue_size(QDF_MODULE_ID qid, uint32_t *size);
410cd395495SRajeev Kumar #endif
411