spectral_module.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2011,2017-2020 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. #include<linux/module.h>
  20. #include <wlan_spectral_utils_api.h>
  21. #include <qdf_types.h>
  22. #include<wlan_global_lmac_if_api.h>
  23. #include "spectral_defs_i.h"
  24. #include <dispatcher_init_deinit.h>
  25. MODULE_LICENSE("Dual BSD/GPL");
  26. struct dispatcher_spectral_ops sops = {
  27. .spectral_pdev_open_handler = spectral_pdev_open,
  28. .spectral_psoc_open_handler = wlan_spectral_psoc_open,
  29. .spectral_psoc_close_handler = wlan_spectral_psoc_close,
  30. .spectral_psoc_enable_handler = wlan_spectral_psoc_enable,
  31. .spectral_psoc_disable_handler = wlan_spectral_psoc_disable,
  32. };
  33. /**
  34. * spectral_init_module() - Initialize Spectral module
  35. *
  36. * Return: None
  37. */
  38. #ifndef QCA_SINGLE_WIFI_3_0
  39. static int __init spectral_init_module(void)
  40. #else
  41. int spectral_init_module(void)
  42. #endif
  43. {
  44. spectral_info("qca_spectral module loaded");
  45. wlan_spectral_init();
  46. /* register spectral rxops */
  47. wlan_lmac_if_sptrl_set_rx_ops_register_cb
  48. (wlan_lmac_if_sptrl_register_rx_ops);
  49. dispatcher_register_spectral_ops_handler(&sops);
  50. return 0;
  51. }
  52. /**
  53. * spectral_exit_module() - De-initialize and exit Spectral module
  54. *
  55. * Return: None
  56. */
  57. #ifndef QCA_SINGLE_WIFI_3_0
  58. static void __exit spectral_exit_module(void)
  59. #else
  60. void spectral_exit_module(void)
  61. #endif
  62. {
  63. wlan_spectral_deinit();
  64. spectral_info("qca_spectral module unloaded");
  65. }
  66. #ifndef QCA_SINGLE_WIFI_3_0
  67. module_init(spectral_init_module);
  68. module_exit(spectral_exit_module);
  69. #endif