wlan_tdls_api.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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_failure() - Notify TDLS module on start bss
  120. * failure
  121. * @psoc: Pointer to PSOC object
  122. *
  123. * Return: None
  124. */
  125. void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc);
  126. /**
  127. * wlan_tdls_notify_start_bss() - Notify TDLS module on start bss
  128. * @psoc: Pointer to PSOC object
  129. * @vdev: Vdev object pointer
  130. *
  131. * Return: None
  132. */
  133. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  134. struct wlan_objmgr_vdev *vdev);
  135. #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES
  136. /**
  137. * wlan_tdls_notify_channel_switch_complete() - Notify TDLS module about the
  138. * channel switch completion
  139. * @psoc: Pointer to PSOC object
  140. * @vdev_id: vdev id
  141. *
  142. * Return: None
  143. */
  144. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  145. uint8_t vdev_id);
  146. /**
  147. * wlan_tdls_notify_channel_switch_start() - Process channel switch start
  148. * for SAP/P2P GO vdev. For STA vdev, TDLS teardown happens, so explicit
  149. * disable off channel is not required.
  150. * @psoc: Pointer to PSOC object
  151. * @vdev: Pointer to current vdev on which CSA is triggered
  152. *
  153. * Return: None
  154. */
  155. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  156. struct wlan_objmgr_vdev *vdev);
  157. /**
  158. * wlan_tdls_handle_p2p_client_connect() - Handle P2P Client connect start
  159. * @psoc: Pointer to PSOC object
  160. * @vdev: Pointer to P2P client vdev
  161. *
  162. * Return: None
  163. */
  164. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  165. struct wlan_objmgr_vdev *vdev);
  166. #else
  167. static inline
  168. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  169. uint8_t vdev_id)
  170. {}
  171. static inline
  172. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  173. struct wlan_objmgr_vdev *vdev)
  174. {}
  175. static inline
  176. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  177. struct wlan_objmgr_vdev *vdev)
  178. {}
  179. #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */
  180. #else
  181. #ifdef FEATURE_SET
  182. static inline
  183. void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
  184. struct wlan_tdls_features *tdls_feature_set)
  185. {
  186. }
  187. #endif
  188. static inline
  189. bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
  190. {
  191. return false;
  192. }
  193. static inline QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc)
  194. {
  195. return QDF_STATUS_SUCCESS;
  196. }
  197. static inline void
  198. wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
  199. struct wlan_objmgr_vdev *vdev)
  200. {}
  201. static inline
  202. void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
  203. bool lfr_roam, bool user_disconnect,
  204. struct wlan_objmgr_vdev *vdev)
  205. {}
  206. static inline void
  207. wlan_tdls_notify_sta_connect(uint8_t vdev_id,
  208. bool tdls_chan_swit_prohibited,
  209. bool tdls_prohibited,
  210. struct wlan_objmgr_vdev *vdev) {}
  211. static inline void
  212. wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  213. struct qdf_mac_addr *mac_addr)
  214. {
  215. }
  216. static inline
  217. void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  218. struct qdf_mac_addr *mac_addr,
  219. struct qdf_mac_addr *dest_mac_addr)
  220. {
  221. }
  222. static inline
  223. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  224. struct wlan_objmgr_vdev *vdev)
  225. {}
  226. static inline
  227. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  228. uint8_t vdev_id)
  229. {}
  230. static inline
  231. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  232. struct wlan_objmgr_vdev *vdev)
  233. {}
  234. static inline
  235. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  236. struct wlan_objmgr_vdev *vdev)
  237. {}
  238. static inline
  239. void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc)
  240. {}
  241. #endif
  242. #endif