target_if_son.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * Copyright (c) 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. #include <target_if_son.h>
  20. #include <target_if.h>
  21. #include <wlan_lmac_if_def.h>
  22. #include <wmi_unified_api.h>
  23. #include <cdp_txrx_ctrl.h>
  24. #if QCA_SUPPORT_SON
  25. u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
  26. {
  27. return ol_if_peer_get_rate(peer, type);
  28. }
  29. bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
  30. {
  31. return true;
  32. }
  33. int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev,
  34. u_int32_t *sample_period,
  35. u_int32_t *num_of_sample)
  36. {
  37. return 0;
  38. }
  39. QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev,
  40. u_int8_t *macaddr,
  41. struct wlan_objmgr_vdev *vdev)
  42. {
  43. struct stats_request_params param = {0};
  44. struct wlan_objmgr_psoc *psoc = NULL;
  45. wmi_unified_t wmi_handle;
  46. psoc = wlan_pdev_get_psoc(pdev);
  47. if (!psoc)
  48. return QDF_STATUS_E_FAILURE;
  49. param.vdev_id = wlan_vdev_get_id(vdev);
  50. param.stats_id = WMI_HOST_REQUEST_INST_STAT;
  51. wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
  52. if (!wmi_handle)
  53. return QDF_STATUS_E_FAILURE;
  54. return wmi_unified_stats_request_send(wmi_handle, macaddr, &param);
  55. }
  56. int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev)
  57. {
  58. return 0;
  59. }
  60. int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev)
  61. {
  62. return 0;
  63. }
  64. void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres,
  65. u_int8_t status, int8_t rssi, u_int8_t subtype)
  66. {
  67. return;
  68. }
  69. void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres,
  70. u_int8_t status, u_int32_t rateKbps)
  71. {
  72. return;
  73. }
  74. void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
  75. {
  76. /* wlan son related function handler */
  77. tx_ops->son_tx_ops.son_enable = son_ol_enable;
  78. tx_ops->son_tx_ops.lmac_create = son_ol_lmac_create;
  79. tx_ops->son_tx_ops.lmac_destroy = son_ol_lmac_destroy;
  80. tx_ops->son_tx_ops.son_send_null = son_ol_send_null;
  81. tx_ops->son_tx_ops.son_rssi_update = son_ol_rx_rssi_update;
  82. tx_ops->son_tx_ops.son_rate_update = son_ol_rx_rate_update;
  83. tx_ops->son_tx_ops.son_sanity_util_intvl = son_ol_sanitize_util_invtl;
  84. tx_ops->son_tx_ops.get_peer_rate = son_ol_get_peer_rate;
  85. return;
  86. }
  87. #else
  88. void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
  89. {
  90. return;
  91. }
  92. int8_t son_ol_sanitize_util_intvl(struct wlan_objmgr_pdev *pdev,
  93. u_int32_t *sample_period,
  94. u_int32_t *num_of_sample)
  95. {
  96. return -EINVAL;
  97. }
  98. u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
  99. {
  100. return 0;
  101. }
  102. bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
  103. {
  104. return -EINVAL;
  105. }
  106. QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev,
  107. u_int8_t *macaddr,
  108. struct wlan_objmgr_vdev *vdev)
  109. {
  110. return QDF_STATUS_SUCCESS;
  111. }
  112. int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev,
  113. u_int32_t *sample_period,
  114. u_int32_t *num_of_sample)
  115. {
  116. return 0;
  117. }
  118. int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev)
  119. {
  120. return 0;
  121. }
  122. int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev)
  123. {
  124. return 0;
  125. }
  126. void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres,
  127. u_int8_t status, int8_t rssi, u_int8_t subtype)
  128. {
  129. return;
  130. }
  131. void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres,
  132. u_int8_t status, u_int32_t rateKbps)
  133. {
  134. return;
  135. }
  136. #endif