xref: /wlan-driver/qca-wifi-host-cmn/qdf/inc/qdf_defer.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022,2024 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: qdf_defer.h
22*5113495bSYour Name  * This file abstracts deferred execution API's.
23*5113495bSYour Name  */
24*5113495bSYour Name 
25*5113495bSYour Name #ifndef __QDF_DEFER_H
26*5113495bSYour Name #define __QDF_DEFER_H
27*5113495bSYour Name 
28*5113495bSYour Name #include <qdf_types.h>
29*5113495bSYour Name #include <i_qdf_defer.h>
30*5113495bSYour Name 
31*5113495bSYour Name /*
32*5113495bSYour Name  * TODO This implements work queues (worker threads, kernel threads etc.).
33*5113495bSYour Name  * Note that there is no cancel on a scheduled work. You cannot free a work
34*5113495bSYour Name  * item if its queued. You cannot know if a work item is queued or not unless
35*5113495bSYour Name  * its running, hence you know its not queued.
36*5113495bSYour Name  *
37*5113495bSYour Name  * so if, say, a module is asked to unload itself, how exactly will it make
38*5113495bSYour Name  * sure that the work's not queued, for OS'es that dont provide such a
39*5113495bSYour Name  * mechanism??
40*5113495bSYour Name  */
41*5113495bSYour Name 
42*5113495bSYour Name /*
43*5113495bSYour Name  * Representation of a work queue.
44*5113495bSYour Name  */
45*5113495bSYour Name typedef __qdf_work_t     qdf_work_t;
46*5113495bSYour Name typedef __qdf_workqueue_t     qdf_workqueue_t;
47*5113495bSYour Name 
48*5113495bSYour Name /*
49*5113495bSYour Name  * Representation of a bottom half.
50*5113495bSYour Name  */
51*5113495bSYour Name typedef __qdf_bh_t       qdf_bh_t;
52*5113495bSYour Name 
53*5113495bSYour Name #ifdef ENHANCED_OS_ABSTRACTION
54*5113495bSYour Name /**
55*5113495bSYour Name  * qdf_create_bh - creates the bottom half deferred handler
56*5113495bSYour Name  * @bh: pointer to bottom
57*5113495bSYour Name  * @func: deferred function to run at bottom half interrupt context.
58*5113495bSYour Name  * @arg: argument for the deferred function
59*5113495bSYour Name  * Return: none
60*5113495bSYour Name  */
61*5113495bSYour Name void
62*5113495bSYour Name qdf_create_bh(qdf_bh_t  *bh, qdf_defer_fn_t  func, void  *arg);
63*5113495bSYour Name 
64*5113495bSYour Name /**
65*5113495bSYour Name  * qdf_sched_bh - schedule a bottom half (DPC)
66*5113495bSYour Name  * @bh: pointer to bottom
67*5113495bSYour Name  * Return: none
68*5113495bSYour Name  */
69*5113495bSYour Name void qdf_sched_bh(qdf_bh_t *bh);
70*5113495bSYour Name 
71*5113495bSYour Name /**
72*5113495bSYour Name  * qdf_destroy_bh - destroy the bh (synchronous)
73*5113495bSYour Name  * @bh: pointer to bottom
74*5113495bSYour Name  * Return: none
75*5113495bSYour Name  */
76*5113495bSYour Name void qdf_destroy_bh(qdf_bh_t *bh);
77*5113495bSYour Name 
78*5113495bSYour Name /**
79*5113495bSYour Name  * qdf_create_workqueue - create a workqueue, This runs in non-interrupt
80*5113495bSYour Name  * context, so can be preempted by H/W & S/W intr
81*5113495bSYour Name  * @name: string
82*5113495bSYour Name  *
83*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
84*5113495bSYour Name  */
85*5113495bSYour Name qdf_workqueue_t *qdf_create_workqueue(char *name);
86*5113495bSYour Name 
87*5113495bSYour Name /**
88*5113495bSYour Name  * qdf_create_singlethread_workqueue() - create a single threaded workqueue
89*5113495bSYour Name  * @name: string
90*5113495bSYour Name  *
91*5113495bSYour Name  * This API creates a dedicated work queue with a single worker thread to avoid
92*5113495bSYour Name  * wasting unnecessary resources when works which needs to be submitted in this
93*5113495bSYour Name  * queue are not very critical and frequent.
94*5113495bSYour Name  *
95*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
96*5113495bSYour Name  */
97*5113495bSYour Name qdf_workqueue_t *qdf_create_singlethread_workqueue(char *name);
98*5113495bSYour Name 
99*5113495bSYour Name /**
100*5113495bSYour Name  * qdf_alloc_unbound_workqueue - allocate an unbound workqueue
101*5113495bSYour Name  * @name: string
102*5113495bSYour Name  *
103*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
104*5113495bSYour Name  */
105*5113495bSYour Name qdf_workqueue_t *qdf_alloc_unbound_workqueue(char *name);
106*5113495bSYour Name 
107*5113495bSYour Name /**
108*5113495bSYour Name  * qdf_destroy_workqueue - Destroy the workqueue
109*5113495bSYour Name  * @hdl: OS handle
110*5113495bSYour Name  * @wqueue: pointer to workqueue
111*5113495bSYour Name  *
112*5113495bSYour Name  * Return: none
113*5113495bSYour Name  */
114*5113495bSYour Name void qdf_destroy_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue);
115*5113495bSYour Name 
116*5113495bSYour Name /**
117*5113495bSYour Name  * qdf_cancel_work() - Cancel a work
118*5113495bSYour Name  * @work: pointer to work
119*5113495bSYour Name  *
120*5113495bSYour Name  * Cancel work and wait for its execution to finish.
121*5113495bSYour Name  * This function can be used even if the work re-queues
122*5113495bSYour Name  * itself or migrates to another workqueue. On return
123*5113495bSYour Name  * from this function, work is guaranteed to be not
124*5113495bSYour Name  * pending or executing on any CPU. The caller must
125*5113495bSYour Name  * ensure that the workqueue on which work was last
126*5113495bSYour Name  * queued can't be destroyed before this function returns.
127*5113495bSYour Name  *
128*5113495bSYour Name  * Return: true if work was pending, false otherwise
129*5113495bSYour Name  */
130*5113495bSYour Name bool qdf_cancel_work(qdf_work_t *work);
131*5113495bSYour Name 
132*5113495bSYour Name /**
133*5113495bSYour Name  * qdf_disable_work - disable the deferred task (synchronous)
134*5113495bSYour Name  * @work: pointer to work
135*5113495bSYour Name  *
136*5113495bSYour Name  * Return: unsigned int
137*5113495bSYour Name  */
138*5113495bSYour Name uint32_t qdf_disable_work(qdf_work_t *work);
139*5113495bSYour Name 
140*5113495bSYour Name /**
141*5113495bSYour Name  * qdf_flush_work - Flush a deferred task on non-interrupt context
142*5113495bSYour Name  * @work: pointer to work
143*5113495bSYour Name  *
144*5113495bSYour Name  * Wait until work has finished execution. work is guaranteed to be
145*5113495bSYour Name  * idle on return if it hasn't been requeued since flush started.
146*5113495bSYour Name  *
147*5113495bSYour Name  * Return: none
148*5113495bSYour Name  */
149*5113495bSYour Name void qdf_flush_work(qdf_work_t *work);
150*5113495bSYour Name 
151*5113495bSYour Name /**
152*5113495bSYour Name  * qdf_create_work - create a work/task queue, This runs in non-interrupt
153*5113495bSYour Name  * context, so can be preempted by H/W & S/W intr
154*5113495bSYour Name  * @hdl: OS handle
155*5113495bSYour Name  * @work: pointer to work
156*5113495bSYour Name  * @func: deferred function to run at bottom half non-interrupt context.
157*5113495bSYour Name  * @arg: argument for the deferred function
158*5113495bSYour Name  *
159*5113495bSYour Name  * Return: QDF status
160*5113495bSYour Name  */
161*5113495bSYour Name QDF_STATUS qdf_create_work(qdf_handle_t hdl, qdf_work_t  *work,
162*5113495bSYour Name 			   qdf_defer_fn_t  func, void  *arg);
163*5113495bSYour Name 
164*5113495bSYour Name /**
165*5113495bSYour Name  * qdf_sched_work - Schedule a deferred task on non-interrupt context
166*5113495bSYour Name  * @hdl: OS handle
167*5113495bSYour Name  * @work: pointer to work
168*5113495bSYour Name  *
169*5113495bSYour Name  * Return: false if work was already on a queue, true otherwise
170*5113495bSYour Name  */
171*5113495bSYour Name bool qdf_sched_work(qdf_handle_t hdl, qdf_work_t *work);
172*5113495bSYour Name 
173*5113495bSYour Name /**
174*5113495bSYour Name  * qdf_queue_work - Queue the work/task
175*5113495bSYour Name  * @hdl: OS handle
176*5113495bSYour Name  * @wqueue: pointer to workqueue
177*5113495bSYour Name  * @work: pointer to work
178*5113495bSYour Name  *
179*5113495bSYour Name  * Return: false if work was already on a queue, true otherwise
180*5113495bSYour Name  */
181*5113495bSYour Name bool
182*5113495bSYour Name qdf_queue_work(qdf_handle_t hdl, qdf_workqueue_t *wqueue, qdf_work_t *work);
183*5113495bSYour Name 
184*5113495bSYour Name /**
185*5113495bSYour Name  * qdf_flush_workqueue - flush the workqueue
186*5113495bSYour Name  * @hdl: OS handle
187*5113495bSYour Name  * @wqueue: pointer to workqueue
188*5113495bSYour Name  *
189*5113495bSYour Name  * Return: none
190*5113495bSYour Name  */
191*5113495bSYour Name void qdf_flush_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue);
192*5113495bSYour Name 
193*5113495bSYour Name /**
194*5113495bSYour Name  * qdf_destroy_work - destroy the deferred task (synchronous)
195*5113495bSYour Name  * @hdl: OS handle
196*5113495bSYour Name  * @work: pointer to work
197*5113495bSYour Name  *
198*5113495bSYour Name  * Return: none
199*5113495bSYour Name  */
200*5113495bSYour Name void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work);
201*5113495bSYour Name 
202*5113495bSYour Name /**
203*5113495bSYour Name  * qdf_local_bh_disable - Disables softirq and tasklet processing
204*5113495bSYour Name  * on the local processor
205*5113495bSYour Name  *
206*5113495bSYour Name  * Return: none
207*5113495bSYour Name  */
208*5113495bSYour Name void qdf_local_bh_disable(void);
209*5113495bSYour Name 
210*5113495bSYour Name /**
211*5113495bSYour Name  * qdf_local_bh_enable - Disables softirq and tasklet processing
212*5113495bSYour Name  * on the local processor
213*5113495bSYour Name  *
214*5113495bSYour Name  * Return: none
215*5113495bSYour Name  */
216*5113495bSYour Name void qdf_local_bh_enable(void);
217*5113495bSYour Name 
218*5113495bSYour Name #else
219*5113495bSYour Name /**
220*5113495bSYour Name  * qdf_create_bh - creates the bottom half deferred handler
221*5113495bSYour Name  * @bh: pointer to bottom
222*5113495bSYour Name  * @func: deferred function to run at bottom half interrupt context.
223*5113495bSYour Name  * @arg: argument for the deferred function
224*5113495bSYour Name  * Return: none
225*5113495bSYour Name  */
226*5113495bSYour Name static inline void
qdf_create_bh(qdf_bh_t * bh,qdf_defer_fn_t func,void * arg)227*5113495bSYour Name qdf_create_bh(qdf_bh_t  *bh, qdf_defer_fn_t  func, void  *arg)
228*5113495bSYour Name {
229*5113495bSYour Name 	__qdf_init_bh(bh, func, arg);
230*5113495bSYour Name }
231*5113495bSYour Name 
232*5113495bSYour Name /**
233*5113495bSYour Name  * qdf_sched_bh - schedule a bottom half (DPC)
234*5113495bSYour Name  * @bh: pointer to bottom
235*5113495bSYour Name  * Return: none
236*5113495bSYour Name  */
qdf_sched_bh(qdf_bh_t * bh)237*5113495bSYour Name static inline void qdf_sched_bh(qdf_bh_t *bh)
238*5113495bSYour Name {
239*5113495bSYour Name 	__qdf_sched_bh(bh);
240*5113495bSYour Name }
241*5113495bSYour Name 
242*5113495bSYour Name /**
243*5113495bSYour Name  * qdf_destroy_bh - destroy the bh (synchronous)
244*5113495bSYour Name  * @bh: pointer to bottom
245*5113495bSYour Name  * Return: none
246*5113495bSYour Name  */
qdf_destroy_bh(qdf_bh_t * bh)247*5113495bSYour Name static inline void qdf_destroy_bh(qdf_bh_t *bh)
248*5113495bSYour Name {
249*5113495bSYour Name 	__qdf_disable_bh(bh);
250*5113495bSYour Name }
251*5113495bSYour Name 
252*5113495bSYour Name /**
253*5113495bSYour Name  * qdf_local_bh_disable - Disables softirq and tasklet processing
254*5113495bSYour Name  * on the local processor
255*5113495bSYour Name  *
256*5113495bSYour Name  * Return: none
257*5113495bSYour Name  */
qdf_local_bh_disable(void)258*5113495bSYour Name static inline void qdf_local_bh_disable(void)
259*5113495bSYour Name {
260*5113495bSYour Name 	__qdf_local_bh_disable();
261*5113495bSYour Name }
262*5113495bSYour Name 
263*5113495bSYour Name /**
264*5113495bSYour Name  * qdf_local_bh_enable - Enables softirq and tasklet processing
265*5113495bSYour Name  * on the local processor
266*5113495bSYour Name  *
267*5113495bSYour Name  * Return: none
268*5113495bSYour Name  */
qdf_local_bh_enable(void)269*5113495bSYour Name static inline void qdf_local_bh_enable(void)
270*5113495bSYour Name {
271*5113495bSYour Name 	__qdf_local_bh_enable();
272*5113495bSYour Name }
273*5113495bSYour Name 
274*5113495bSYour Name /*********************Non-Interrupt Context deferred Execution***************/
275*5113495bSYour Name 
276*5113495bSYour Name /**
277*5113495bSYour Name  * qdf_create_work - create a work/task queue, This runs in non-interrupt
278*5113495bSYour Name  * context, so can be preempted by H/W & S/W intr
279*5113495bSYour Name  * @hdl: OS handle
280*5113495bSYour Name  * @work: pointer to work
281*5113495bSYour Name  * @func: deferred function to run at bottom half non-interrupt context.
282*5113495bSYour Name  * @arg: argument for the deferred function
283*5113495bSYour Name  *
284*5113495bSYour Name  * Return: QDF status
285*5113495bSYour Name  */
qdf_create_work(qdf_handle_t hdl,qdf_work_t * work,qdf_defer_fn_t func,void * arg)286*5113495bSYour Name static inline QDF_STATUS qdf_create_work(qdf_handle_t hdl, qdf_work_t  *work,
287*5113495bSYour Name 				   qdf_defer_fn_t  func, void  *arg)
288*5113495bSYour Name {
289*5113495bSYour Name 	return __qdf_init_work(work, func, arg);
290*5113495bSYour Name }
291*5113495bSYour Name 
292*5113495bSYour Name /**
293*5113495bSYour Name  * qdf_create_workqueue - create a workqueue, This runs in non-interrupt
294*5113495bSYour Name  * context, so can be preempted by H/W & S/W intr
295*5113495bSYour Name  * @name: string
296*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
297*5113495bSYour Name  */
qdf_create_workqueue(char * name)298*5113495bSYour Name static inline qdf_workqueue_t *qdf_create_workqueue(char *name)
299*5113495bSYour Name {
300*5113495bSYour Name 	return  __qdf_create_workqueue(name);
301*5113495bSYour Name }
302*5113495bSYour Name 
303*5113495bSYour Name /**
304*5113495bSYour Name  * qdf_create_singlethread_workqueue() - create a single threaded workqueue
305*5113495bSYour Name  * @name: string
306*5113495bSYour Name  *
307*5113495bSYour Name  * This API creates a dedicated work queue with a single worker thread to avoid
308*5113495bSYour Name  * wasting unnecessary resources when works which needs to be submitted in this
309*5113495bSYour Name  * queue are not very critical and frequent.
310*5113495bSYour Name  *
311*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
312*5113495bSYour Name  */
qdf_create_singlethread_workqueue(char * name)313*5113495bSYour Name static inline qdf_workqueue_t *qdf_create_singlethread_workqueue(char *name)
314*5113495bSYour Name {
315*5113495bSYour Name 	return  __qdf_create_singlethread_workqueue(name);
316*5113495bSYour Name }
317*5113495bSYour Name 
318*5113495bSYour Name /**
319*5113495bSYour Name  * qdf_alloc_high_prior_ordered_workqueue - alloc high-prior ordered workqueue
320*5113495bSYour Name  * @name: string
321*5113495bSYour Name  *
322*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
323*5113495bSYour Name  */
324*5113495bSYour Name static inline
qdf_alloc_high_prior_ordered_workqueue(char * name)325*5113495bSYour Name qdf_workqueue_t *qdf_alloc_high_prior_ordered_workqueue(char *name)
326*5113495bSYour Name {
327*5113495bSYour Name 	return __qdf_alloc_high_prior_ordered_workqueue(name);
328*5113495bSYour Name }
329*5113495bSYour Name 
330*5113495bSYour Name /**
331*5113495bSYour Name  * qdf_alloc_unbound_workqueue - allocate an unbound workqueue
332*5113495bSYour Name  * @name: string
333*5113495bSYour Name  *
334*5113495bSYour Name  * Return: pointer of type qdf_workqueue_t
335*5113495bSYour Name  */
qdf_alloc_unbound_workqueue(char * name)336*5113495bSYour Name static inline qdf_workqueue_t *qdf_alloc_unbound_workqueue(char *name)
337*5113495bSYour Name {
338*5113495bSYour Name 	return  __qdf_alloc_unbound_workqueue(name);
339*5113495bSYour Name }
340*5113495bSYour Name 
341*5113495bSYour Name /**
342*5113495bSYour Name  * qdf_queue_work - Queue the work/task
343*5113495bSYour Name  * @hdl: OS handle
344*5113495bSYour Name  * @wqueue: pointer to workqueue
345*5113495bSYour Name  * @work: pointer to work
346*5113495bSYour Name  * Return: false if work was already on a queue, true otherwise
347*5113495bSYour Name  */
348*5113495bSYour Name static inline bool
qdf_queue_work(qdf_handle_t hdl,qdf_workqueue_t * wqueue,qdf_work_t * work)349*5113495bSYour Name qdf_queue_work(qdf_handle_t hdl, qdf_workqueue_t *wqueue, qdf_work_t *work)
350*5113495bSYour Name {
351*5113495bSYour Name 	return __qdf_queue_work(wqueue, work);
352*5113495bSYour Name }
353*5113495bSYour Name 
354*5113495bSYour Name /**
355*5113495bSYour Name  * qdf_flush_workqueue - flush the workqueue
356*5113495bSYour Name  * @hdl: OS handle
357*5113495bSYour Name  * @wqueue: pointer to workqueue
358*5113495bSYour Name  * Return: none
359*5113495bSYour Name  */
qdf_flush_workqueue(qdf_handle_t hdl,qdf_workqueue_t * wqueue)360*5113495bSYour Name static inline void qdf_flush_workqueue(qdf_handle_t hdl,
361*5113495bSYour Name 				       qdf_workqueue_t *wqueue)
362*5113495bSYour Name {
363*5113495bSYour Name 	return  __qdf_flush_workqueue(wqueue);
364*5113495bSYour Name }
365*5113495bSYour Name 
366*5113495bSYour Name /**
367*5113495bSYour Name  * qdf_destroy_workqueue - Destroy the workqueue
368*5113495bSYour Name  * @hdl: OS handle
369*5113495bSYour Name  * @wqueue: pointer to workqueue
370*5113495bSYour Name  * Return: none
371*5113495bSYour Name  */
qdf_destroy_workqueue(qdf_handle_t hdl,qdf_workqueue_t * wqueue)372*5113495bSYour Name static inline void qdf_destroy_workqueue(qdf_handle_t hdl,
373*5113495bSYour Name 					 qdf_workqueue_t *wqueue)
374*5113495bSYour Name {
375*5113495bSYour Name 	return  __qdf_destroy_workqueue(wqueue);
376*5113495bSYour Name }
377*5113495bSYour Name 
378*5113495bSYour Name /**
379*5113495bSYour Name  * qdf_sched_work - Schedule a deferred task on non-interrupt context
380*5113495bSYour Name  * @hdl: OS handle
381*5113495bSYour Name  * @work: pointer to work
382*5113495bSYour Name  *
383*5113495bSYour Name  * Return: false if work was already on a queue, true otherwise
384*5113495bSYour Name  */
qdf_sched_work(qdf_handle_t hdl,qdf_work_t * work)385*5113495bSYour Name static inline bool qdf_sched_work(qdf_handle_t hdl, qdf_work_t *work)
386*5113495bSYour Name {
387*5113495bSYour Name 	return __qdf_sched_work(work);
388*5113495bSYour Name }
389*5113495bSYour Name 
390*5113495bSYour Name /**
391*5113495bSYour Name  * qdf_cancel_work() - Cancel a work
392*5113495bSYour Name  * @work: pointer to work
393*5113495bSYour Name  *
394*5113495bSYour Name  * Cancel work and wait for its execution to finish.
395*5113495bSYour Name  * This function can be used even if the work re-queues
396*5113495bSYour Name  * itself or migrates to another workqueue. On return
397*5113495bSYour Name  * from this function, work is guaranteed to be not
398*5113495bSYour Name  * pending or executing on any CPU. The caller must
399*5113495bSYour Name  * ensure that the workqueue on which work was last
400*5113495bSYour Name  * queued can't be destroyed before this function returns.
401*5113495bSYour Name  *
402*5113495bSYour Name  * Return: true if work was pending, false otherwise
403*5113495bSYour Name  */
qdf_cancel_work(qdf_work_t * work)404*5113495bSYour Name static inline bool qdf_cancel_work(qdf_work_t *work)
405*5113495bSYour Name {
406*5113495bSYour Name 	return __qdf_cancel_work(work);
407*5113495bSYour Name }
408*5113495bSYour Name 
409*5113495bSYour Name /**
410*5113495bSYour Name  * qdf_flush_work - Flush a deferred task on non-interrupt context
411*5113495bSYour Name  * @work: pointer to work
412*5113495bSYour Name  *
413*5113495bSYour Name  * Wait until work has finished execution. work is guaranteed to be
414*5113495bSYour Name  * idle on return if it hasn't been requeued since flush started.
415*5113495bSYour Name  *
416*5113495bSYour Name  * Return: none
417*5113495bSYour Name  */
qdf_flush_work(qdf_work_t * work)418*5113495bSYour Name static inline void qdf_flush_work(qdf_work_t *work)
419*5113495bSYour Name {
420*5113495bSYour Name 	__qdf_flush_work(work);
421*5113495bSYour Name }
422*5113495bSYour Name 
423*5113495bSYour Name /**
424*5113495bSYour Name  * qdf_disable_work - disable the deferred task (synchronous)
425*5113495bSYour Name  * @work: pointer to work
426*5113495bSYour Name  * Return: unsigned int
427*5113495bSYour Name  */
qdf_disable_work(qdf_work_t * work)428*5113495bSYour Name static inline uint32_t qdf_disable_work(qdf_work_t *work)
429*5113495bSYour Name {
430*5113495bSYour Name 	return __qdf_disable_work(work);
431*5113495bSYour Name }
432*5113495bSYour Name 
433*5113495bSYour Name /**
434*5113495bSYour Name  * qdf_destroy_work - destroy the deferred task (synchronous)
435*5113495bSYour Name  * @hdl: OS handle
436*5113495bSYour Name  * @work: pointer to work
437*5113495bSYour Name  * Return: none
438*5113495bSYour Name  */
qdf_destroy_work(qdf_handle_t hdl,qdf_work_t * work)439*5113495bSYour Name static inline void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work)
440*5113495bSYour Name {
441*5113495bSYour Name 	__qdf_disable_work(work);
442*5113495bSYour Name }
443*5113495bSYour Name #endif
444*5113495bSYour Name 
445*5113495bSYour Name #endif /*_QDF_DEFER_H*/
446