wlan_tdls_api.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /*
  2. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2024 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_is_tdls_session_present() - Get TDLS session status
  100. * @vdev: vdev pointer
  101. *
  102. * Return: QDF_STATUS_SUCCESS if success; other value if failed
  103. */
  104. QDF_STATUS
  105. wlan_is_tdls_session_present(struct wlan_objmgr_vdev *vdev);
  106. /**
  107. * wlan_tdls_update_tx_pkt_cnt() - update tx pkt count
  108. * @vdev: tdls vdev object
  109. * @mac_addr: peer mac address
  110. *
  111. * Return: None
  112. */
  113. void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  114. struct qdf_mac_addr *mac_addr);
  115. /**
  116. * wlan_tdls_update_rx_pkt_cnt() - update rx pkt count
  117. * @vdev: tdls vdev object
  118. * @mac_addr: peer mac address
  119. * @dest_mac_addr: dest mac address
  120. *
  121. * Return: None
  122. */
  123. void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  124. struct qdf_mac_addr *mac_addr,
  125. struct qdf_mac_addr *dest_mac_addr);
  126. /**
  127. * wlan_tdls_notify_start_bss_failure() - Notify TDLS module on start bss
  128. * failure
  129. * @psoc: Pointer to PSOC object
  130. *
  131. * Return: None
  132. */
  133. void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc);
  134. /**
  135. * wlan_tdls_notify_start_bss() - Notify TDLS module on start bss
  136. * @psoc: Pointer to PSOC object
  137. * @vdev: Vdev object pointer
  138. *
  139. * Return: None
  140. */
  141. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  142. struct wlan_objmgr_vdev *vdev);
  143. #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES
  144. /**
  145. * wlan_tdls_notify_channel_switch_complete() - Notify TDLS module about the
  146. * channel switch completion
  147. * @psoc: Pointer to PSOC object
  148. * @vdev_id: vdev id
  149. *
  150. * Return: None
  151. */
  152. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  153. uint8_t vdev_id);
  154. /**
  155. * wlan_tdls_notify_channel_switch_start() - Process channel switch start
  156. * for SAP/P2P GO vdev. For STA vdev, TDLS teardown happens, so explicit
  157. * disable off channel is not required.
  158. * @psoc: Pointer to PSOC object
  159. * @vdev: Pointer to current vdev on which CSA is triggered
  160. *
  161. * Return: None
  162. */
  163. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  164. struct wlan_objmgr_vdev *vdev);
  165. /**
  166. * wlan_tdls_handle_p2p_client_connect() - Handle P2P Client connect start
  167. * @psoc: Pointer to PSOC object
  168. * @vdev: Pointer to P2P client vdev
  169. *
  170. * Return: None
  171. */
  172. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  173. struct wlan_objmgr_vdev *vdev);
  174. #else
  175. static inline
  176. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  177. uint8_t vdev_id)
  178. {}
  179. static inline
  180. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  181. struct wlan_objmgr_vdev *vdev)
  182. {}
  183. static inline
  184. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  185. struct wlan_objmgr_vdev *vdev)
  186. {}
  187. #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */
  188. /**
  189. * wlan_tdls_increment_discovery_attempts() - Increment TDLS peer discovery
  190. * attempts
  191. * @psoc: Pointer to PSOC object
  192. * @vdev_id: Vdev id
  193. * @peer_addr: Peer mac address
  194. *
  195. * Return: None
  196. */
  197. void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc,
  198. uint8_t vdev_id,
  199. uint8_t *peer_addr);
  200. #else
  201. #ifdef FEATURE_SET
  202. static inline
  203. void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
  204. struct wlan_tdls_features *tdls_feature_set)
  205. {
  206. }
  207. #endif
  208. static inline
  209. bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
  210. {
  211. return false;
  212. }
  213. static inline QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc)
  214. {
  215. return QDF_STATUS_SUCCESS;
  216. }
  217. static inline void
  218. wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
  219. struct wlan_objmgr_vdev *vdev)
  220. {}
  221. static inline
  222. void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
  223. bool lfr_roam, bool user_disconnect,
  224. struct wlan_objmgr_vdev *vdev)
  225. {}
  226. static inline void
  227. wlan_tdls_notify_sta_connect(uint8_t vdev_id,
  228. bool tdls_chan_swit_prohibited,
  229. bool tdls_prohibited,
  230. struct wlan_objmgr_vdev *vdev) {}
  231. static inline void
  232. wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  233. struct qdf_mac_addr *mac_addr)
  234. {
  235. }
  236. static inline
  237. void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
  238. struct qdf_mac_addr *mac_addr,
  239. struct qdf_mac_addr *dest_mac_addr)
  240. {
  241. }
  242. static inline
  243. void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
  244. struct wlan_objmgr_vdev *vdev)
  245. {}
  246. static inline
  247. void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
  248. uint8_t vdev_id)
  249. {}
  250. static inline
  251. void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
  252. struct wlan_objmgr_vdev *vdev)
  253. {}
  254. static inline
  255. void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
  256. struct wlan_objmgr_vdev *vdev)
  257. {}
  258. static inline
  259. void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc)
  260. {}
  261. static inline
  262. void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc,
  263. uint8_t vdev_id,
  264. uint8_t *peer_addr)
  265. {}
  266. #endif
  267. #endif