wmi_unified_dfs_api.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (c) 2017-2018 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. * DOC: Implement API's specific to DFS component.
  21. */
  22. #include <qdf_status.h>
  23. #include <qdf_module.h>
  24. #include <wmi_unified_api.h>
  25. #include <wmi_unified_priv.h>
  26. #include <wlan_dfs_utils_api.h>
  27. #include <wmi_unified_dfs_api.h>
  28. #include <init_deinit_lmac.h>
  29. QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
  30. uint8_t *evt_buf,
  31. uint32_t *vdev_id,
  32. uint32_t len)
  33. {
  34. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  35. if (wmi_handle && wmi_handle->ops->extract_dfs_cac_complete_event)
  36. return wmi_handle->ops->extract_dfs_cac_complete_event(
  37. wmi_handle, evt_buf, vdev_id, len);
  38. return QDF_STATUS_E_FAILURE;
  39. }
  40. qdf_export_symbol(wmi_extract_dfs_cac_complete_event);
  41. QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
  42. uint8_t *evt_buf,
  43. struct radar_found_info *radar_found,
  44. uint32_t len)
  45. {
  46. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  47. if (wmi_handle && wmi_handle->ops->extract_dfs_radar_detection_event)
  48. return wmi_handle->ops->extract_dfs_radar_detection_event(
  49. wmi_handle, evt_buf, radar_found, len);
  50. return QDF_STATUS_E_FAILURE;
  51. }
  52. #ifdef QCA_MCL_DFS_SUPPORT
  53. QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl,
  54. uint8_t *evt_buf,
  55. struct radar_event_info *wlan_radar_event,
  56. uint32_t len)
  57. {
  58. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  59. if (wmi_handle->ops->extract_wlan_radar_event_info)
  60. return wmi_handle->ops->extract_wlan_radar_event_info(
  61. wmi_handle, evt_buf, wlan_radar_event, len);
  62. return QDF_STATUS_E_FAILURE;
  63. }
  64. qdf_export_symbol(wmi_extract_dfs_radar_detection_event);
  65. #endif
  66. #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
  67. QDF_STATUS wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol,
  68. struct wlan_objmgr_pdev *pdev)
  69. {
  70. struct pdev_params pparam;
  71. int pdev_idx;
  72. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  73. pdev_idx = lmac_get_pdev_idx(pdev);
  74. if (pdev_idx < 0)
  75. return QDF_STATUS_E_FAILURE;
  76. qdf_mem_set(&pparam, sizeof(pparam), 0);
  77. pparam.param_id = wmi_pdev_param_use_nol;
  78. pparam.param_value = usenol;
  79. return wmi_unified_pdev_param_send(wmi_handle, &pparam, pdev_idx);
  80. }
  81. QDF_STATUS
  82. wmi_send_subchan_marking_pdev_param(void *wmi_hdl,
  83. bool subchanmark,
  84. struct wlan_objmgr_pdev *pdev)
  85. {
  86. struct pdev_params pparam;
  87. int pdev_idx;
  88. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  89. pdev_idx = lmac_get_pdev_idx(pdev);
  90. if (pdev_idx < 0)
  91. return QDF_STATUS_E_FAILURE;
  92. qdf_mem_set(&pparam, sizeof(pparam), 0);
  93. pparam.param_id = wmi_pdev_param_sub_channel_marking;
  94. pparam.param_value = subchanmark;
  95. return wmi_unified_pdev_param_send(wmi_handle, &pparam, pdev_idx);
  96. }
  97. #endif