xref: /wlan-driver/qca-wifi-host-cmn/cfg/inc/i_cfg_objmgr.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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 /**
20  * DOC: This file contains various object manager related wrappers and helpers
21  */
22 
23 #ifndef __CFG_OBJMGR_H
24 #define __CFG_OBJMGR_H
25 
26 #include "wlan_cmn.h"
27 #include "wlan_objmgr_global_obj.h"
28 #include "wlan_objmgr_psoc_obj.h"
29 
30 /* Private Data */
31 
32 #define cfg_psoc_get_priv(psoc) \
33 	wlan_objmgr_psoc_get_comp_private_obj((psoc), WLAN_UMAC_COMP_CONFIG)
34 #define cfg_psoc_set_priv(psoc, priv) \
35 	wlan_objmgr_psoc_component_obj_attach((psoc), WLAN_UMAC_COMP_CONFIG, \
36 					      (priv), QDF_STATUS_SUCCESS)
37 #define cfg_psoc_unset_priv(psoc, priv) \
38 	wlan_objmgr_psoc_component_obj_detach((psoc), WLAN_UMAC_COMP_CONFIG, \
39 					      (priv))
40 
41 /* event registration */
42 
43 #define cfg_psoc_register_create(callback) \
44 	wlan_objmgr_register_psoc_create_handler(WLAN_UMAC_COMP_CONFIG, \
45 						 (callback), NULL)
46 #define cfg_psoc_register_destroy(callback) \
47 	wlan_objmgr_register_psoc_destroy_handler(WLAN_UMAC_COMP_CONFIG, \
48 						  (callback), NULL)
49 
50 /* event de-registration */
51 
52 #define cfg_psoc_unregister_create(callback) \
53 	wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_CONFIG, \
54 						   (callback), NULL)
55 #define cfg_psoc_unregister_destroy(callback) \
56 	wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_CONFIG, \
57 						    (callback), NULL)
58 
59 #endif /* __CFG_OBJMGR_H */
60