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