1 /*
2 * Copyright (c) 2012-2018, 2021 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: i_qdf_module.h
21 * Linux-specific definitions for QDF module API's
22 */
23
24 #include <linux/module.h>
25 #include <qdf_perf.h>
26 #include <qdf_trace.h>
27 #include <qdf_nbuf.h>
28 #include <qdf_mem.h>
29 #include <qdf_event.h>
30 #include <qdf_talloc.h>
31
32 MODULE_AUTHOR("Qualcomm Atheros Inc.");
33 MODULE_DESCRIPTION("Qualcomm Atheros Device Framework Module");
34 MODULE_LICENSE("Dual BSD/GPL");
35
36 #ifndef EXPORT_SYMTAB
37 #define EXPORT_SYMTAB
38 #endif
39
40 /**
41 * qdf_mod_init() - module initialization
42 *
43 * Return: int
44 */
45 #ifndef QCA_SINGLE_WIFI_3_0
qdf_mod_init(void)46 static int __init qdf_mod_init(void)
47 #else
48 int qdf_mod_init(void)
49 #endif
50 {
51 qdf_initialize_module_param_from_ini();
52 qdf_shared_print_ctrl_init();
53 qdf_debugfs_init();
54 qdf_mem_init();
55 qdf_talloc_feature_init();
56 qdf_logging_init();
57 qdf_perfmod_init();
58 qdf_nbuf_mod_init();
59 qdf_frag_mod_init();
60 qdf_event_list_init();
61
62 return 0;
63 }
64
65 #ifndef QCA_SINGLE_WIFI_3_0
66 module_init(qdf_mod_init);
67 #endif
68 /**
69 * qdf_mod_exit() - module remove
70 *
71 * Return: int
72 */
73 #ifndef QCA_SINGLE_WIFI_3_0
qdf_mod_exit(void)74 static void __exit qdf_mod_exit(void)
75 #else
76 void qdf_mod_exit(void)
77 #endif
78 {
79 qdf_event_list_destroy();
80 qdf_frag_mod_exit();
81 qdf_nbuf_mod_exit();
82 qdf_perfmod_exit();
83 qdf_logging_exit();
84 qdf_talloc_feature_deinit();
85 qdf_mem_exit();
86 qdf_debugfs_exit();
87 qdf_shared_print_ctrl_cleanup();
88 }
89
90 #ifndef QCA_SINGLE_WIFI_3_0
91 module_exit(qdf_mod_exit);
92 #endif
93