xref: /wlan-driver/qca-wifi-host-cmn/umac/cmn_services/serialization/src/wlan_serialization_main_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2020 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: wlan_serialization_main.h
20  * This file contains all the prototype definitions necessary for the
21  * serialization component's internal functions
22  */
23 #ifndef __WLAN_SERIALIZATION_MAIN_I_H
24 #define __WLAN_SERIALIZATION_MAIN_I_H
25 
26 #include <wlan_objmgr_cmn.h>
27 #include <wlan_objmgr_psoc_obj.h>
28 #include <wlan_objmgr_pdev_obj.h>
29 #include <qdf_mc_timer.h>
30 
31 #define WLAN_SER_MAX_VDEVS WLAN_UMAC_PDEV_MAX_VDEVS
32 
33 #define WLAN_SER_MAX_ACTIVE_CMDS WLAN_SER_MAX_VDEVS
34 
35 #ifndef WLAN_SER_MAX_PENDING_CMDS
36 #define WLAN_SER_MAX_PENDING_CMDS (WLAN_SER_MAX_VDEVS * 4)
37 #endif
38 
39 #ifndef WLAN_SER_MAX_PENDING_CMDS_AP
40 #define WLAN_SER_MAX_PENDING_CMDS_AP \
41 	(WLAN_SER_MAX_PENDING_CMDS / WLAN_SER_MAX_VDEVS)
42 #endif
43 #ifndef WLAN_SER_MAX_PENDING_CMDS_STA
44 #define WLAN_SER_MAX_PENDING_CMDS_STA \
45 	(WLAN_SER_MAX_PENDING_CMDS / WLAN_SER_MAX_VDEVS)
46 #endif
47 
48 #define WLAN_SER_MAX_ACTIVE_SCAN_CMDS 8
49 #define WLAN_SER_MAX_PENDING_SCAN_CMDS 24
50 
51 #define WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS \
52 	(WLAN_SER_MAX_ACTIVE_CMDS + \
53 	 WLAN_SER_MAX_PENDING_CMDS + \
54 	 WLAN_SER_MAX_ACTIVE_SCAN_CMDS + \
55 	 WLAN_SER_MAX_PENDING_SCAN_CMDS)
56 
57 #define ser_alert(params...) \
58 	QDF_TRACE_FATAL(QDF_MODULE_ID_SERIALIZATION, params)
59 #define ser_err(params...) \
60 	QDF_TRACE_ERROR(QDF_MODULE_ID_SERIALIZATION, params)
61 #define ser_warn(params...) \
62 	QDF_TRACE_WARN(QDF_MODULE_ID_SERIALIZATION, params)
63 #define ser_info(params...) \
64 	QDF_TRACE_INFO(QDF_MODULE_ID_SERIALIZATION, params)
65 #define ser_debug(params...) \
66 	QDF_TRACE_DEBUG(QDF_MODULE_ID_SERIALIZATION, params)
67 #define ser_enter() \
68 	QDF_TRACE_ENTER(QDF_MODULE_ID_SERIALIZATION, "enter")
69 #define ser_exit() \
70 	QDF_TRACE_EXIT(QDF_MODULE_ID_SERIALIZATION, "exit")
71 
72 #define ser_err_no_fl(params...) \
73 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
74 
75 /*
76  * Rate limited serialization logging api
77  */
78 #define ser_err_rl(params...) \
79 	QDF_TRACE_ERROR_RL(QDF_MODULE_ID_SERIALIZATION, params)
80 #define ser_debug_rl(params...) \
81 	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_SERIALIZATION, params)
82 
83 #define ser_debug_hex(ptr, size) \
84 	qdf_trace_hex_dump(QDF_MODULE_ID_SERIALIZATION, \
85 			   QDF_TRACE_LEVEL_DEBUG, ptr, size)
86 /**
87  * struct serialization_legacy_callback - to handle legacy serialization cb
88  * @serialization_purge_cmd_list: function ptr to be filled by serialization
89  *				  module
90  *
91  * Some of the legacy modules wants to call API to purge the commands in
92  * order to handle backward compatibility.
93  */
94 struct serialization_legacy_callback {
95 	void (*serialization_purge_cmd_list)(struct wlan_objmgr_psoc *,
96 					     struct wlan_objmgr_vdev *,
97 					     bool, bool, bool, bool, bool);
98 };
99 #endif
100