son_api.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC : contains interface prototypes for son api
  18. */
  19. #ifndef _SON_API_H_
  20. #define _SON_API_H_
  21. #include <qdf_types.h>
  22. #include <wlan_objmgr_peer_obj.h>
  23. #include <wlan_objmgr_pdev_obj.h>
  24. #include <reg_services_public_struct.h>
  25. /**
  26. * wlan_son_get_chan_flag() - get chan flag
  27. * @pdev: pointer to pdev
  28. * @freq: qdf_freq_t
  29. * @flag_160: If true, 160 channel info will be obtained;
  30. * otherwise 80+80, 80 channel info will be obtained
  31. * @chan_params: chan parameters
  32. *
  33. * Return: combination of enum qca_wlan_vendor_channel_prop_flags and
  34. * enum qca_wlan_vendor_channel_prop_flags_2
  35. */
  36. uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
  37. qdf_freq_t freq, bool flag_160,
  38. struct ch_params *chan_params);
  39. /**
  40. * wlan_son_peer_set_kickout_allow() - set the peer is allowed to kickout
  41. * @vdev: pointer to vdev
  42. * @peer: pointer to peer
  43. * @kickout_allow: kickout_allow to set
  44. *
  45. * Return: QDF_STATUS_SUCCESS on Success else failure.
  46. */
  47. QDF_STATUS wlan_son_peer_set_kickout_allow(struct wlan_objmgr_vdev *vdev,
  48. struct wlan_objmgr_peer *peer,
  49. bool kickout_allow);
  50. #ifdef WLAN_FEATURE_SON
  51. /**
  52. * wlan_son_peer_is_kickout_allow() - Is peer is allowed to kickout
  53. * @vdev: pointer to vdev
  54. * @macaddr: mac addr of the peer
  55. *
  56. * Return: True if it is allowed to kickout.
  57. */
  58. bool wlan_son_peer_is_kickout_allow(struct wlan_objmgr_vdev *vdev,
  59. uint8_t *macaddr);
  60. /**
  61. * wlan_son_ind_assoc_req_frm() - indicate assoc req frame to son
  62. * @vdev: pointer to vdev
  63. * @is_reassoc: true if it is reassoc req
  64. * @frame: frame body
  65. * @frame_len: frame body length
  66. * @status: assoc req frame is handled successfully
  67. *
  68. * Return: Void
  69. */
  70. void wlan_son_ind_assoc_req_frm(struct wlan_objmgr_vdev *vdev,
  71. uint8_t *macaddr, bool is_reassoc,
  72. uint8_t *frame, uint16_t frame_len,
  73. QDF_STATUS status);
  74. /**
  75. * wlan_son_deliver_tx_power() - notify son module of tx power
  76. * @vdev: vdev
  77. * @max_pwr: max power in dBm unit
  78. *
  79. * Return: 0 if event is sent successfully
  80. */
  81. int wlan_son_deliver_tx_power(struct wlan_objmgr_vdev *vdev,
  82. int32_t max_pwr);
  83. /**
  84. * wlan_son_deliver_vdev_stop() - notify son module of vdev stop
  85. * @vdev: vdev
  86. *
  87. * Return: 0 if event is sent successfully
  88. */
  89. int wlan_son_deliver_vdev_stop(struct wlan_objmgr_vdev *vdev);
  90. /**
  91. * wlan_son_deliver_inst_rssi() - notify son module of inst rssi
  92. * @vdev: vdev
  93. * @peer: peer device
  94. * @irssi: inst rssi above the noise floor in dB unit
  95. *
  96. * Return: 0 if event is sent successfully
  97. */
  98. int wlan_son_deliver_inst_rssi(struct wlan_objmgr_vdev *vdev,
  99. struct wlan_objmgr_peer *peer,
  100. uint32_t irssi);
  101. #else
  102. static inline bool wlan_son_peer_is_kickout_allow(struct wlan_objmgr_vdev *vdev,
  103. uint8_t *macaddr)
  104. {
  105. return true;
  106. }
  107. static inline
  108. void wlan_son_ind_assoc_req_frm(struct wlan_objmgr_vdev *vdev,
  109. uint8_t *macaddr, bool is_reassoc,
  110. uint8_t *frame, uint16_t frame_len,
  111. QDF_STATUS status)
  112. {
  113. }
  114. static inline
  115. int wlan_son_deliver_tx_power(struct wlan_objmgr_vdev *vdev,
  116. int32_t max_pwr)
  117. {
  118. return -EINVAL;
  119. }
  120. static inline
  121. int wlan_son_deliver_vdev_stop(struct wlan_objmgr_vdev *vdev)
  122. {
  123. return -EINVAL;
  124. }
  125. static inline
  126. int wlan_son_deliver_inst_rssi(struct wlan_objmgr_vdev *vdev,
  127. struct wlan_objmgr_peer *peer,
  128. uint32_t irssi)
  129. {
  130. return -EINVAL;
  131. }
  132. #endif /*WLAN_FEATURE_SON*/
  133. #endif