1 /*
2  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 #include <i_qdf_notifier.h>
17 #include <qdf_status.h>
18 #include <qdf_notifier.h>
19 
qdf_register_blocking_notifier_chain(qdf_blocking_notif_head * head,qdf_notif_block * qnb)20 QDF_STATUS qdf_register_blocking_notifier_chain(qdf_blocking_notif_head *head,
21 						qdf_notif_block *qnb)
22 {
23 	int ret;
24 
25 	ret = __qdf_register_blocking_notifier_chain(head, &qnb->notif_block);
26 
27 	return qdf_status_from_os_return(ret);
28 }
29 
qdf_unregister_blocking_notifier_chain(qdf_blocking_notif_head * head,qdf_notif_block * qnb)30 QDF_STATUS qdf_unregister_blocking_notifier_chain(qdf_blocking_notif_head *head,
31 						  qdf_notif_block *qnb)
32 {
33 	int ret;
34 
35 	ret = __qdf_unregister_blocking_notifier_chain(head,
36 						       &qnb->notif_block);
37 
38 	return qdf_status_from_os_return(ret);
39 }
40 
qdf_blocking_notfier_call(qdf_blocking_notif_head * head,unsigned long state,void * data)41 QDF_STATUS qdf_blocking_notfier_call(qdf_blocking_notif_head *head,
42 				     unsigned long state, void *data)
43 {
44 	int ret;
45 
46 	ret = __qdf_blocking_notfier_call(head, state, data);
47 
48 	return qdf_status_from_os_return(ret);
49 }
50 
qdf_register_atomic_notifier_chain(qdf_atomic_notif_head * head,qdf_notif_block * qnb)51 QDF_STATUS qdf_register_atomic_notifier_chain(qdf_atomic_notif_head *head,
52 					      qdf_notif_block *qnb)
53 {
54 	int ret;
55 
56 	ret = __qdf_register_atomic_notifier_chain(head, &qnb->notif_block);
57 
58 	return qdf_status_from_os_return(ret);
59 }
60 
qdf_unregister_atomic_notifier_chain(qdf_atomic_notif_head * head,qdf_notif_block * qnb)61 QDF_STATUS qdf_unregister_atomic_notifier_chain(qdf_atomic_notif_head *head,
62 						qdf_notif_block *qnb)
63 {
64 	int ret;
65 
66 	ret = __qdf_unregister_atomic_notifier_chain(head, &qnb->notif_block);
67 
68 	return qdf_status_from_os_return(ret);
69 }
70 
qdf_atomic_notfier_call(qdf_atomic_notif_head * head,unsigned long v,void * data)71 QDF_STATUS qdf_atomic_notfier_call(qdf_atomic_notif_head *head,
72 				   unsigned long v, void *data)
73 {
74 	int ret;
75 
76 	ret = __qdf_atomic_notifier_call(head, v, data);
77 
78 	return qdf_status_from_os_return(ret);
79 }
80