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
17 /*
18 * DOC: contains core interface manager function definitions
19 */
20 #include "wlan_if_mgr_main.h"
21 #include "wlan_objmgr_global_obj.h"
22
wlan_if_mgr_init(void)23 QDF_STATUS wlan_if_mgr_init(void)
24 {
25 QDF_STATUS status;
26
27 status = wlan_objmgr_register_psoc_create_handler(WLAN_UMAC_COMP_IF_MGR,
28 wlan_if_mgr_psoc_created_notification, NULL);
29 if (QDF_IS_STATUS_ERROR(status)) {
30 ifmgr_err("Failed to register psoc create handler");
31 goto fail_create_psoc;
32 }
33
34 status = wlan_objmgr_register_psoc_destroy_handler(
35 WLAN_UMAC_COMP_IF_MGR,
36 wlan_if_mgr_psoc_destroyed_notification, NULL);
37 if (QDF_IS_STATUS_ERROR(status)) {
38 ifmgr_err("Failed to create psoc delete handler");
39 goto fail_psoc_destroy;
40 }
41 ifmgr_debug("interface mgr psoc create and delete handler registered with objmgr");
42
43 return status;
44
45 fail_psoc_destroy:
46 wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_IF_MGR,
47 wlan_if_mgr_psoc_created_notification, NULL);
48 fail_create_psoc:
49 return status;
50 }
51
wlan_if_mgr_deinit(void)52 QDF_STATUS wlan_if_mgr_deinit(void)
53 {
54 QDF_STATUS status;
55
56 status = wlan_objmgr_unregister_psoc_create_handler(
57 WLAN_UMAC_COMP_IF_MGR,
58 wlan_if_mgr_psoc_created_notification, NULL);
59 if (QDF_IS_STATUS_ERROR(status))
60 ifmgr_err("Failed to deregister psoc create handler");
61
62 status = wlan_objmgr_unregister_psoc_destroy_handler(
63 WLAN_UMAC_COMP_IF_MGR,
64 wlan_if_mgr_psoc_destroyed_notification, NULL);
65 if (QDF_IS_STATUS_ERROR(status))
66 ifmgr_err("Failed to deregister psoc delete handler");
67
68 ifmgr_debug("interface mgr psoc create and delete handler deregistered with objmgr");
69
70 return status;
71 }
72
wlan_if_mgr_psoc_created_notification(struct wlan_objmgr_psoc * psoc,void * arg_list)73 QDF_STATUS wlan_if_mgr_psoc_created_notification(struct wlan_objmgr_psoc *psoc,
74 void *arg_list)
75 {
76 QDF_STATUS status = QDF_STATUS_SUCCESS;
77
78 return status;
79 }
80
81 QDF_STATUS
wlan_if_mgr_psoc_destroyed_notification(struct wlan_objmgr_psoc * psoc,void * arg_list)82 wlan_if_mgr_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
83 void *arg_list)
84 {
85 QDF_STATUS status = QDF_STATUS_SUCCESS;
86
87 return status;
88 }
89
90