xref: /wlan-dirver/qca-wifi-host-cmn/spectral/core/spectral_module.c (revision 503663c6daafffe652fa360bde17243568cd6d2a)
1 /*
2  * Copyright (c) 2011,2017-2019 The Linux Foundation. All rights reserved.
3  *
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include<linux/module.h>
21 #include <wlan_spectral_utils_api.h>
22 #include <qdf_types.h>
23 #include<wlan_global_lmac_if_api.h>
24 #include "spectral_defs_i.h"
25 #include <dispatcher_init_deinit.h>
26 
27 MODULE_LICENSE("Dual BSD/GPL");
28 
29 /**
30  * spectral_init_module() - Initialize Spectral module
31  *
32  * Return: None
33  */
34 
35 #ifndef QCA_SINGLE_WIFI_3_0
36 static int __init spectral_init_module(void)
37 #else
38 int spectral_init_module(void)
39 #endif
40 {
41 	spectral_info("qca_spectral module loaded");
42 	wlan_spectral_init();
43 	/* register spectral rxops */
44 	wlan_lmac_if_sptrl_set_rx_ops_register_cb
45 	    (wlan_lmac_if_sptrl_register_rx_ops);
46 	/* register spectral pdev open handler */
47 	dispatcher_register_spectral_pdev_open_handler(
48 		spectral_pdev_open);
49 
50 	return 0;
51 }
52 
53 /**
54  * spectral_exit_module() - De-initialize and exit Spectral module
55  *
56  * Return: None
57  */
58 #ifndef QCA_SINGLE_WIFI_3_0
59 static void __exit spectral_exit_module(void)
60 #else
61 void spectral_exit_module(void)
62 #endif
63 {
64 	wlan_spectral_deinit();
65 	spectral_info("qca_spectral module unloaded");
66 }
67 
68 #ifndef QCA_SINGLE_WIFI_3_0
69 module_init(spectral_init_module);
70 module_exit(spectral_exit_module);
71 #endif
72