wlan_tdls_api.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*
  2. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 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. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /*
  18. * DOC: contains tdls link teardown declarations
  19. */
  20. #ifndef _WLAN_TDLS_API_H_
  21. #define _WLAN_TDLS_API_H_
  22. #include "wlan_objmgr_psoc_obj.h"
  23. #include "wlan_objmgr_pdev_obj.h"
  24. #include "wlan_objmgr_vdev_obj.h"
  25. #ifdef FEATURE_WLAN_TDLS
  26. #ifdef WLAN_FEATURE_11BE_MLO
  27. /**
  28. * wlan_tdls_is_fw_11be_mlo_capable() - Get TDLS 11be mlo capab
  29. * @psoc: psoc context
  30. *
  31. * Return: True if 11be mlo capable
  32. */
  33. bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc);
  34. #else
  35. static inline
  36. bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
  37. {
  38. return false;
  39. }
  40. #endif
  41. #ifdef FEATURE_SET
  42. /**
  43. * wlan_tdls_get_features_info() - Get tdls features info
  44. * @psoc: psoc context
  45. * @tdls_feature_set: TDLS feature set info structure
  46. *
  47. * Return: None
  48. */
  49. void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
  50. struct wlan_tdls_features *tdls_feature_set);
  51. #endif
  52. /**
  53. * wlan_tdls_teardown_links() - notify TDLS module to teardown all TDLS links
  54. * @psoc: psoc object
  55. *
  56. * Return: QDF_STATUS
  57. */
  58. QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc);
  59. /**
  60. * wlan_tdls_check_and_teardown_links_sync() - teardown all the TDLS links
  61. * @psoc: psoc object
  62. * @vdev: Vdev object pointer
  63. *
  64. * Return: None
  65. */
  66. void wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
  67. struct wlan_objmgr_vdev *vdev);
  68. /**
  69. * wlan_tdls_notify_sta_disconnect() - notify sta disconnect
  70. * @vdev_id: pointer to soc object
  71. * @lfr_roam: indicate, whether disconnect due to lfr roam
  72. * @user_disconnect: disconnect from user space
  73. * @vdev: vdev object manager
  74. *
  75. * Notify sta disconnect event to TDLS component
  76. *
  77. * Return: QDF_STATUS
  78. */
  79. void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
  80. bool lfr_roam, bool user_disconnect,
  81. struct wlan_objmgr_vdev *vdev);
  82. /**
  83. * wlan_tdls_notify_sta_connect() - notify sta connect to TDLS
  84. * @vdev_id: pointer to soc object
  85. * @tdls_chan_swit_prohibited: indicates channel switch capability
  86. * @tdls_prohibited: indicates tdls allowed or not
  87. * @vdev: vdev object manager
  88. *
  89. * Notify sta connect event to TDLS component
  90. *
  91. * Return: None
  92. */
  93. void
  94. wlan_tdls_notify_sta_connect(uint8_t vdev_id,
  95. bool tdls_chan_swit_prohibited,
  96. bool tdls_prohibited,
  97. struct wlan_objmgr_vdev *vdev);
  98. /**
  99. * wlan_tdls_update_tx_pkt_cnt() - update tx pkt count
  100. * @vdev: tdls vdev object
  101. * @mac_addr: peer mac address
  102. *
  103. * Return: None
  104. */
  105. void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  106. struct qdf_mac_addr *mac_addr);
  107. /**
  108. * wlan_tdls_update_rx_pkt_cnt() - update rx pkt count
  109. * @vdev: tdls vdev object
  110. * @mac_addr: peer mac address
  111. * @dest_mac_addr: dest mac address
  112. *
  113. * Return: None
  114. */
  115. void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  116. struct qdf_mac_addr *mac_addr,
  117. struct qdf_mac_addr *dest_mac_addr);
  118. /**
  119. * wlan_tdls_notify_start_bss() - Notify TDLS module on start bss
  120. * @psoc: Pointer to PSOC object
  121. * @vdev: Vdev object pointer
  122. *
  123. * Return: None
  124. */
  125. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  126. struct wlan_objmgr_vdev *vdev);
  127. #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES
  128. /**
  129. * wlan_tdls_notify_channel_switch_complete() - Notify TDLS module about the
  130. * channel switch completion
  131. * @psoc: Pointer to PSOC object
  132. * @vdev_id: vdev id
  133. *
  134. * Return: None
  135. */
  136. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  137. uint8_t vdev_id);
  138. /**
  139. * wlan_tdls_notify_channel_switch_start() - Process channel switch start
  140. * for SAP/P2P GO vdev. For STA vdev, TDLS teardown happens, so explicit
  141. * disable off channel is not required.
  142. * @psoc: Pointer to PSOC object
  143. * @vdev: Pointer to current vdev on which CSA is triggered
  144. *
  145. * Return: None
  146. */
  147. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  148. struct wlan_objmgr_vdev *vdev);
  149. /**
  150. * wlan_tdls_handle_p2p_client_connect() - Handle P2P Client connect start
  151. * @psoc: Pointer to PSOC object
  152. * @vdev: Pointer to P2P client vdev
  153. *
  154. * Return: None
  155. */
  156. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  157. struct wlan_objmgr_vdev *vdev);
  158. #else
  159. static inline
  160. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  161. uint8_t vdev_id)
  162. {}
  163. static inline
  164. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  165. struct wlan_objmgr_vdev *vdev)
  166. {}
  167. static inline
  168. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  169. struct wlan_objmgr_vdev *vdev)
  170. {}
  171. #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */
  172. #else
  173. #ifdef FEATURE_SET
  174. static inline
  175. void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
  176. struct wlan_tdls_features *tdls_feature_set)
  177. {
  178. }
  179. #endif
  180. static inline
  181. bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
  182. {
  183. return false;
  184. }
  185. static inline QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc)
  186. {
  187. return QDF_STATUS_SUCCESS;
  188. }
  189. static inline void
  190. wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
  191. struct wlan_objmgr_vdev *vdev)
  192. {}
  193. static inline
  194. void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
  195. bool lfr_roam, bool user_disconnect,
  196. struct wlan_objmgr_vdev *vdev)
  197. {}
  198. static inline void
  199. wlan_tdls_notify_sta_connect(uint8_t vdev_id,
  200. bool tdls_chan_swit_prohibited,
  201. bool tdls_prohibited,
  202. struct wlan_objmgr_vdev *vdev) {}
  203. static inline void
  204. wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  205. struct qdf_mac_addr *mac_addr)
  206. {
  207. }
  208. static inline
  209. void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  210. struct qdf_mac_addr *mac_addr,
  211. struct qdf_mac_addr *dest_mac_addr)
  212. {
  213. }
  214. static inline
  215. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  216. struct wlan_objmgr_vdev *vdev)
  217. {}
  218. static inline
  219. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  220. uint8_t vdev_id)
  221. {}
  222. static inline
  223. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  224. struct wlan_objmgr_vdev *vdev)
  225. {}
  226. static inline
  227. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  228. struct wlan_objmgr_vdev *vdev)
  229. {}
  230. #endif
  231. #endif