xref: /wlan-driver/qca-wifi-host-cmn/qdf/linux/src/i_qdf_notifier.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name  /**
18*5113495bSYour Name   * DOC: i_qdf_notifier.h
19*5113495bSYour Name   *
20*5113495bSYour Name   * Linux-specific definitions for use by QDF notifier APIs
21*5113495bSYour Name   */
22*5113495bSYour Name 
23*5113495bSYour Name #ifndef __I_QDF_NOTIFIER_H
24*5113495bSYour Name #define __I_QDF_NOTIFIER_H
25*5113495bSYour Name 
26*5113495bSYour Name #include <linux/notifier.h>
27*5113495bSYour Name 
28*5113495bSYour Name typedef struct blocking_notifier_head __qdf_blocking_notif_head;
29*5113495bSYour Name typedef struct atomic_notifier_head __qdf_atomic_notif_head;
30*5113495bSYour Name typedef struct notifier_block __qdf_notifier_block;
31*5113495bSYour Name #define qdf_blocking_notifier_init(p) BLOCKING_NOTIFIER_HEAD(p);
32*5113495bSYour Name #define qdf_atomic_notifier_init(p) ATOMIC_NOTIFIER_HEAD(p);
33*5113495bSYour Name 
34*5113495bSYour Name static inline int
__qdf_register_blocking_notifier_chain(__qdf_blocking_notif_head * head,__qdf_notifier_block * qnb)35*5113495bSYour Name __qdf_register_blocking_notifier_chain(__qdf_blocking_notif_head *head,
36*5113495bSYour Name 				       __qdf_notifier_block *qnb)
37*5113495bSYour Name {
38*5113495bSYour Name 	return blocking_notifier_chain_register(head, qnb);
39*5113495bSYour Name }
40*5113495bSYour Name 
41*5113495bSYour Name static inline int
__qdf_unregister_blocking_notifier_chain(__qdf_blocking_notif_head * head,__qdf_notifier_block * qnb)42*5113495bSYour Name __qdf_unregister_blocking_notifier_chain(__qdf_blocking_notif_head *head,
43*5113495bSYour Name 					 __qdf_notifier_block *qnb)
44*5113495bSYour Name {
45*5113495bSYour Name 	return blocking_notifier_chain_unregister(head, qnb);
46*5113495bSYour Name }
47*5113495bSYour Name 
48*5113495bSYour Name static inline int
__qdf_blocking_notfier_call(__qdf_blocking_notif_head * head,unsigned long v,void * data)49*5113495bSYour Name __qdf_blocking_notfier_call(__qdf_blocking_notif_head *head,
50*5113495bSYour Name 			    unsigned long v, void *data)
51*5113495bSYour Name {
52*5113495bSYour Name 	return blocking_notifier_call_chain(head, v, data);
53*5113495bSYour Name }
54*5113495bSYour Name 
55*5113495bSYour Name static inline int
__qdf_register_atomic_notifier_chain(__qdf_atomic_notif_head * head,__qdf_notifier_block * qnb)56*5113495bSYour Name __qdf_register_atomic_notifier_chain(__qdf_atomic_notif_head *head,
57*5113495bSYour Name 				     __qdf_notifier_block *qnb)
58*5113495bSYour Name {
59*5113495bSYour Name 	return atomic_notifier_chain_register(head, qnb);
60*5113495bSYour Name }
61*5113495bSYour Name 
62*5113495bSYour Name static inline int
__qdf_unregister_atomic_notifier_chain(__qdf_atomic_notif_head * head,__qdf_notifier_block * qnb)63*5113495bSYour Name __qdf_unregister_atomic_notifier_chain(__qdf_atomic_notif_head *head,
64*5113495bSYour Name 				       __qdf_notifier_block *qnb)
65*5113495bSYour Name {
66*5113495bSYour Name 	return atomic_notifier_chain_unregister(head, qnb);
67*5113495bSYour Name }
68*5113495bSYour Name 
69*5113495bSYour Name static inline int
__qdf_atomic_notifier_call(__qdf_atomic_notif_head * head,unsigned long v,void * data)70*5113495bSYour Name __qdf_atomic_notifier_call(__qdf_atomic_notif_head *head,
71*5113495bSYour Name 			   unsigned long v, void *data)
72*5113495bSYour Name {
73*5113495bSYour Name 	return atomic_notifier_call_chain(head, v, data);
74*5113495bSYour Name }
75*5113495bSYour Name 
76*5113495bSYour Name #endif
77