xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/obj_mgr/inc/wlan_objmgr_debug.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1  /*
2   * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3   *
4   * Permission to use, copy, modify, and/or distribute this software for
5   * any purpose with or without fee is hereby granted, provided that the
6   * above copyright notice and this permission notice appear in all
7   * copies.
8   *
9   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16   * PERFORMANCE OF THIS SOFTWARE.
17   */
18  /**
19   * DOC: Public Data Structures to perform debug operations
20   * on object manager
21   */
22 
23 #ifndef _WLAN_OBJMGR_DEBUG_H_
24 #define _WLAN_OBJMGR_DEBUG_H_
25 
26 #include <qdf_timer.h>
27 
28 #ifdef WLAN_OBJMGR_DEBUG
29 
30 /**
31  * wlan_objmgr_notify_log_delete()- insert
32  *  logically deleted object into list
33  * @obj:           object to be inserted
34  * @obj_type:      type of object to be inserted
35  *
36  * Return: void
37  */
38 void wlan_objmgr_notify_log_delete(void *obj,
39 				   enum wlan_objmgr_obj_type obj_type);
40 
41 /**
42  * wlan_objmgr_notify_destroy() - remove
43  *  logically deleted object from list
44  * @obj:           object to be removed
45  * @obj_type:      type of object to be removed
46  *
47  * Return: void
48  */
49 void wlan_objmgr_notify_destroy(void *obj,
50 				enum wlan_objmgr_obj_type obj_type);
51 
52 /**
53  * wlan_objmgr_debug_info_init() - initialize
54  *  the logically deleted list object
55  * Caller need to protect with global object lock
56  *
57  * Return: void
58  */
59 void wlan_objmgr_debug_info_init(void);
60 
61 /**
62  * wlan_objmgr_debug_info_deinit() - deinitialize
63  *  the logically deleted list object
64  *
65  * Return: void
66  */
67 void wlan_objmgr_debug_info_deinit(void);
68 
69 
70 #else
71 
72 static inline void
73 wlan_objmgr_notify_log_delete(void *obj,
74 			      enum wlan_objmgr_obj_type obj_type)
75 {
76 }
77 
78 static inline void
79 wlan_objmgr_notify_destroy(void *obj,
80 			   enum wlan_objmgr_obj_type obj_typ)
81 {
82 }
83 
84 static inline void
85 wlan_objmgr_debug_info_init(void)
86 {
87 }
88 
89 static inline void
90 wlan_objmgr_debug_info_deinit(void)
91 {
92 }
93 
94 #endif /*WLAN_OBJMGR_DEBUG*/
95 
96 #endif /*_WLAN_OBJMGR_DEBUG_H_*/
97