xref: /wlan-driver/qca-wifi-host-cmn/umac/cmn_services/obj_mgr/inc/wlan_objmgr_debug.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name  /*
2*5113495bSYour Name   * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
3*5113495bSYour Name   *
4*5113495bSYour Name   * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name   * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name   * above copyright notice and this permission notice appear in all
7*5113495bSYour Name   * copies.
8*5113495bSYour Name   *
9*5113495bSYour Name   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name   * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name   */
18*5113495bSYour Name  /**
19*5113495bSYour Name   * DOC: Public Data Structures to perform debug operations
20*5113495bSYour Name   * on object manager
21*5113495bSYour Name   */
22*5113495bSYour Name 
23*5113495bSYour Name #ifndef _WLAN_OBJMGR_DEBUG_H_
24*5113495bSYour Name #define _WLAN_OBJMGR_DEBUG_H_
25*5113495bSYour Name 
26*5113495bSYour Name #include <qdf_timer.h>
27*5113495bSYour Name 
28*5113495bSYour Name #ifdef WLAN_OBJMGR_DEBUG
29*5113495bSYour Name 
30*5113495bSYour Name /**
31*5113495bSYour Name  * wlan_objmgr_notify_log_delete()- insert
32*5113495bSYour Name  *  logically deleted object into list
33*5113495bSYour Name  * @obj:           object to be inserted
34*5113495bSYour Name  * @obj_type:      type of object to be inserted
35*5113495bSYour Name  *
36*5113495bSYour Name  * Return: void
37*5113495bSYour Name  */
38*5113495bSYour Name void wlan_objmgr_notify_log_delete(void *obj,
39*5113495bSYour Name 				   enum wlan_objmgr_obj_type obj_type);
40*5113495bSYour Name 
41*5113495bSYour Name /**
42*5113495bSYour Name  * wlan_objmgr_notify_destroy() - remove
43*5113495bSYour Name  *  logically deleted object from list
44*5113495bSYour Name  * @obj:           object to be removed
45*5113495bSYour Name  * @obj_type:      type of object to be removed
46*5113495bSYour Name  *
47*5113495bSYour Name  * Return: void
48*5113495bSYour Name  */
49*5113495bSYour Name void wlan_objmgr_notify_destroy(void *obj,
50*5113495bSYour Name 				enum wlan_objmgr_obj_type obj_type);
51*5113495bSYour Name 
52*5113495bSYour Name /**
53*5113495bSYour Name  * wlan_objmgr_debug_info_init() - initialize
54*5113495bSYour Name  *  the logically deleted list object
55*5113495bSYour Name  * Caller need to protect with global object lock
56*5113495bSYour Name  *
57*5113495bSYour Name  * Return: void
58*5113495bSYour Name  */
59*5113495bSYour Name void wlan_objmgr_debug_info_init(void);
60*5113495bSYour Name 
61*5113495bSYour Name /**
62*5113495bSYour Name  * wlan_objmgr_debug_info_deinit() - deinitialize
63*5113495bSYour Name  *  the logically deleted list object
64*5113495bSYour Name  *
65*5113495bSYour Name  * Return: void
66*5113495bSYour Name  */
67*5113495bSYour Name void wlan_objmgr_debug_info_deinit(void);
68*5113495bSYour Name 
69*5113495bSYour Name 
70*5113495bSYour Name #else
71*5113495bSYour Name 
72*5113495bSYour Name static inline void
wlan_objmgr_notify_log_delete(void * obj,enum wlan_objmgr_obj_type obj_type)73*5113495bSYour Name wlan_objmgr_notify_log_delete(void *obj,
74*5113495bSYour Name 			      enum wlan_objmgr_obj_type obj_type)
75*5113495bSYour Name {
76*5113495bSYour Name }
77*5113495bSYour Name 
78*5113495bSYour Name static inline void
wlan_objmgr_notify_destroy(void * obj,enum wlan_objmgr_obj_type obj_typ)79*5113495bSYour Name wlan_objmgr_notify_destroy(void *obj,
80*5113495bSYour Name 			   enum wlan_objmgr_obj_type obj_typ)
81*5113495bSYour Name {
82*5113495bSYour Name }
83*5113495bSYour Name 
84*5113495bSYour Name static inline void
wlan_objmgr_debug_info_init(void)85*5113495bSYour Name wlan_objmgr_debug_info_init(void)
86*5113495bSYour Name {
87*5113495bSYour Name }
88*5113495bSYour Name 
89*5113495bSYour Name static inline void
wlan_objmgr_debug_info_deinit(void)90*5113495bSYour Name wlan_objmgr_debug_info_deinit(void)
91*5113495bSYour Name {
92*5113495bSYour Name }
93*5113495bSYour Name 
94*5113495bSYour Name #endif /*WLAN_OBJMGR_DEBUG*/
95*5113495bSYour Name 
96*5113495bSYour Name #ifdef WLAN_OBJMGR_REF_ID_TRACE
97*5113495bSYour Name /**
98*5113495bSYour Name  * wlan_objmgr_trace_ref() - Save trace info to list
99*5113495bSYour Name  * @func_head: head object of function list
100*5113495bSYour Name  * @trace: trace object
101*5113495bSYour Name  * @func: function name
102*5113495bSYour Name  * @line: line number
103*5113495bSYour Name  *
104*5113495bSYour Name  * API to trace func and line information for reference
105*5113495bSYour Name  * and dereference
106*5113495bSYour Name  *
107*5113495bSYour Name  * Return: void
108*5113495bSYour Name  */
109*5113495bSYour Name void
110*5113495bSYour Name wlan_objmgr_trace_ref(struct wlan_objmgr_trace_func **func_head,
111*5113495bSYour Name 		      struct wlan_objmgr_trace *trace,
112*5113495bSYour Name 		      const char *func, int line);
113*5113495bSYour Name 
114*5113495bSYour Name /**
115*5113495bSYour Name  * wlan_objmgr_trace_init_lock() - Initialize trace spinlock
116*5113495bSYour Name  * @trace: trace object
117*5113495bSYour Name  *
118*5113495bSYour Name  * API to initialize trace spin lock
119*5113495bSYour Name  *
120*5113495bSYour Name  * Return: void
121*5113495bSYour Name  */
122*5113495bSYour Name void wlan_objmgr_trace_init_lock(struct wlan_objmgr_trace *trace);
123*5113495bSYour Name 
124*5113495bSYour Name /**
125*5113495bSYour Name  * wlan_objmgr_trace_deinit_lock() - Deinitialize trace spinlock
126*5113495bSYour Name  * @trace: trace object
127*5113495bSYour Name  *
128*5113495bSYour Name  * API to deinitialize trace spin lock
129*5113495bSYour Name  *
130*5113495bSYour Name  * Return: void
131*5113495bSYour Name  */
132*5113495bSYour Name void wlan_objmgr_trace_deinit_lock(struct wlan_objmgr_trace *trace);
133*5113495bSYour Name 
134*5113495bSYour Name /**
135*5113495bSYour Name  * wlan_objmgr_trace_del_ref_list() - Delete reference trace list
136*5113495bSYour Name  * @trace: trace object
137*5113495bSYour Name  *
138*5113495bSYour Name  * API to delete trace list
139*5113495bSYour Name  *
140*5113495bSYour Name  * Return: void
141*5113495bSYour Name  */
142*5113495bSYour Name void wlan_objmgr_trace_del_ref_list(struct wlan_objmgr_trace *trace);
143*5113495bSYour Name #endif /*WLAN_OBJMGR_REF_ID_TRACE*/
144*5113495bSYour Name 
145*5113495bSYour Name #endif /*_WLAN_OBJMGR_DEBUG_H_*/
146