wmi_unified_smart_ant_api.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * Copyright (c) 2016-2018 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. #include "wmi_unified_priv.h"
  19. #include "wmi_unified_param.h"
  20. #include "qdf_module.h"
  21. /**
  22. * wmi_unified_set_ant_switch_tbl_cmd_send() - WMI ant switch tbl cmd function
  23. * @param wmi_handle : handle to WMI.
  24. * @param param : pointer to hold ant switch tbl param
  25. *
  26. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  27. */
  28. QDF_STATUS wmi_unified_set_ant_switch_tbl_cmd_send(void *wmi_hdl,
  29. struct ant_switch_tbl_params *param)
  30. {
  31. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  32. if (wmi_handle->ops->send_set_ant_switch_tbl_cmd)
  33. return wmi_handle->ops->send_set_ant_switch_tbl_cmd(wmi_handle,
  34. param);
  35. return QDF_STATUS_E_FAILURE;
  36. }
  37. /**
  38. * wmi_unified_smart_ant_enable_cmd_send() - WMI smart ant enable function
  39. * @param wmi_handle : handle to WMI.
  40. * @param param : pointer to hold antenna param
  41. *
  42. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  43. */
  44. QDF_STATUS wmi_unified_smart_ant_enable_cmd_send(void *wmi_hdl,
  45. struct smart_ant_enable_params *param)
  46. {
  47. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  48. if (wmi_handle->ops->send_smart_ant_enable_cmd)
  49. return wmi_handle->ops->send_smart_ant_enable_cmd(wmi_handle,
  50. param);
  51. return QDF_STATUS_E_FAILURE;
  52. }
  53. /**
  54. * wmi_unified_smart_ant_set_rx_ant_cmd_send() - WMI set rx antenna function
  55. * @param wmi_handle : handle to WMI.
  56. * @param param : pointer to hold antenna param
  57. *
  58. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  59. */
  60. QDF_STATUS wmi_unified_smart_ant_set_rx_ant_cmd_send(void *wmi_hdl,
  61. struct smart_ant_rx_ant_params *param)
  62. {
  63. wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
  64. if (wmi->ops->send_smart_ant_set_rx_ant_cmd)
  65. return wmi->ops->send_smart_ant_set_rx_ant_cmd(wmi, param);
  66. return QDF_STATUS_E_FAILURE;
  67. }
  68. /**
  69. * wmi_unified_smart_ant_set_tx_ant_cmd_send() - WMI set tx antenna function
  70. * @param wmi_handle : handle to WMI.
  71. * @param param : pointer to hold antenna param
  72. *
  73. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  74. */
  75. QDF_STATUS wmi_unified_smart_ant_set_tx_ant_cmd_send(void *wmi_hdl,
  76. uint8_t macaddr[IEEE80211_ADDR_LEN],
  77. struct smart_ant_tx_ant_params *param)
  78. {
  79. wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
  80. if (wmi->ops->send_smart_ant_set_tx_ant_cmd)
  81. return wmi->ops->send_smart_ant_set_tx_ant_cmd(wmi, macaddr,
  82. param);
  83. return QDF_STATUS_E_FAILURE;
  84. }
  85. /**
  86. * wmi_unified_smart_ant_set_training_info_cmd_send() - WMI set tx antenna function
  87. * @param wmi_handle : handle to WMI.
  88. * @param param : pointer to hold antenna param
  89. *
  90. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  91. */
  92. QDF_STATUS wmi_unified_smart_ant_set_training_info_cmd_send(void *wmi_hdl,
  93. uint8_t macaddr[IEEE80211_ADDR_LEN],
  94. struct smart_ant_training_info_params *param)
  95. {
  96. wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
  97. if (wmi->ops->send_smart_ant_set_training_info_cmd)
  98. return wmi->ops->send_smart_ant_set_training_info_cmd(wmi,
  99. macaddr, param);
  100. return QDF_STATUS_E_FAILURE;
  101. }
  102. /**
  103. * wmi_unified_smart_ant_node_config_cmd_send() - WMI set node config function
  104. * @param wmi_handle : handle to WMI.
  105. * @param macaddr : MAC address
  106. * @param param : pointer to hold node parameter
  107. *
  108. * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  109. */
  110. QDF_STATUS wmi_unified_smart_ant_node_config_cmd_send(void *wmi_hdl,
  111. uint8_t macaddr[IEEE80211_ADDR_LEN],
  112. struct smart_ant_node_config_params *param)
  113. {
  114. wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
  115. if (wmi->ops->send_smart_ant_set_node_config_cmd)
  116. return wmi->ops->send_smart_ant_set_node_config_cmd(wmi,
  117. macaddr, param);
  118. return QDF_STATUS_E_FAILURE;
  119. }