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 /* 19 * DOC: contains tdls link teardown declarations 20 */ 21 #ifndef _WLAN_TDLS_API_H_ 22 #define _WLAN_TDLS_API_H_ 23 24 #include "wlan_objmgr_psoc_obj.h" 25 #include "wlan_objmgr_pdev_obj.h" 26 #include "wlan_objmgr_vdev_obj.h" 27 28 #ifdef FEATURE_WLAN_TDLS 29 #ifdef WLAN_FEATURE_11BE_MLO 30 /** 31 * wlan_tdls_is_fw_11be_mlo_capable() - Get TDLS 11be mlo capab 32 * @psoc: psoc context 33 * 34 * Return: True if 11be mlo capable 35 */ 36 bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc); 37 #else 38 static inline 39 bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc) 40 { 41 return false; 42 } 43 #endif 44 #ifdef FEATURE_SET 45 /** 46 * wlan_tdls_get_features_info() - Get tdls features info 47 * @psoc: psoc context 48 * @tdls_feature_set: TDLS feature set info structure 49 * 50 * Return: None 51 */ 52 53 void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc, 54 struct wlan_tdls_features *tdls_feature_set); 55 #endif 56 57 /** 58 * wlan_tdls_teardown_links() - notify TDLS module to teardown all TDLS links 59 * @psoc: psoc object 60 * 61 * Return: QDF_STATUS 62 */ 63 QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc); 64 65 /** 66 * wlan_tdls_check_and_teardown_links_sync() - teardown all the TDLS links 67 * @psoc: psoc object 68 * @vdev: Vdev object pointer 69 * 70 * Return: None 71 */ 72 void wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc, 73 struct wlan_objmgr_vdev *vdev); 74 75 /** 76 * wlan_tdls_notify_sta_disconnect() - notify sta disconnect 77 * @vdev_id: pointer to soc object 78 * @lfr_roam: indicate, whether disconnect due to lfr roam 79 * @user_disconnect: disconnect from user space 80 * @vdev: vdev object manager 81 * 82 * Notify sta disconnect event to TDLS component 83 * 84 * Return: QDF_STATUS 85 */ 86 void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id, 87 bool lfr_roam, bool user_disconnect, 88 struct wlan_objmgr_vdev *vdev); 89 90 /** 91 * wlan_tdls_notify_sta_connect() - notify sta connect to TDLS 92 * @vdev_id: pointer to soc object 93 * @tdls_chan_swit_prohibited: indicates channel switch capability 94 * @tdls_prohibited: indicates tdls allowed or not 95 * @vdev: vdev object manager 96 * 97 * Notify sta connect event to TDLS component 98 * 99 * Return: None 100 */ 101 void 102 wlan_tdls_notify_sta_connect(uint8_t vdev_id, 103 bool tdls_chan_swit_prohibited, 104 bool tdls_prohibited, 105 struct wlan_objmgr_vdev *vdev); 106 107 /** 108 * wlan_tdls_update_tx_pkt_cnt() - update tx pkt count 109 * @vdev: tdls vdev object 110 * @mac_addr: peer mac address 111 * 112 * Return: None 113 */ 114 void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev, 115 struct qdf_mac_addr *mac_addr); 116 117 /** 118 * wlan_tdls_update_rx_pkt_cnt() - update rx pkt count 119 * @vdev: tdls vdev object 120 * @mac_addr: peer mac address 121 * @dest_mac_addr: dest mac address 122 * 123 * Return: None 124 */ 125 void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, 126 struct qdf_mac_addr *mac_addr, 127 struct qdf_mac_addr *dest_mac_addr); 128 /** 129 * wlan_tdls_notify_start_bss_failure() - Notify TDLS module on start bss 130 * failure 131 * @psoc: Pointer to PSOC object 132 * 133 * Return: None 134 */ 135 void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc); 136 137 /** 138 * wlan_tdls_notify_start_bss() - Notify TDLS module on start bss 139 * @psoc: Pointer to PSOC object 140 * @vdev: Vdev object pointer 141 * 142 * Return: None 143 */ 144 void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc, 145 struct wlan_objmgr_vdev *vdev); 146 147 #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES 148 /** 149 * wlan_tdls_notify_channel_switch_complete() - Notify TDLS module about the 150 * channel switch completion 151 * @psoc: Pointer to PSOC object 152 * @vdev_id: vdev id 153 * 154 * Return: None 155 */ 156 void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc, 157 uint8_t vdev_id); 158 159 /** 160 * wlan_tdls_notify_channel_switch_start() - Process channel switch start 161 * for SAP/P2P GO vdev. For STA vdev, TDLS teardown happens, so explicit 162 * disable off channel is not required. 163 * @psoc: Pointer to PSOC object 164 * @vdev: Pointer to current vdev on which CSA is triggered 165 * 166 * Return: None 167 */ 168 void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc, 169 struct wlan_objmgr_vdev *vdev); 170 171 /** 172 * wlan_tdls_handle_p2p_client_connect() - Handle P2P Client connect start 173 * @psoc: Pointer to PSOC object 174 * @vdev: Pointer to P2P client vdev 175 * 176 * Return: None 177 */ 178 void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc, 179 struct wlan_objmgr_vdev *vdev); 180 #else 181 static inline 182 void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc, 183 uint8_t vdev_id) 184 {} 185 186 static inline 187 void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc, 188 struct wlan_objmgr_vdev *vdev) 189 {} 190 191 static inline 192 void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc, 193 struct wlan_objmgr_vdev *vdev) 194 {} 195 #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */ 196 197 /** 198 * wlan_tdls_increment_discovery_attempts() - Increment TDLS peer discovery 199 * attempts 200 * @psoc: Pointer to PSOC object 201 * @vdev_id: Vdev id 202 * @peer_addr: Peer mac address 203 * 204 * Return: None 205 */ 206 void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc, 207 uint8_t vdev_id, 208 uint8_t *peer_addr); 209 #else 210 211 #ifdef FEATURE_SET 212 static inline 213 void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc, 214 struct wlan_tdls_features *tdls_feature_set) 215 { 216 } 217 #endif 218 219 static inline 220 bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc) 221 { 222 return false; 223 } 224 225 static inline QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc) 226 { 227 return QDF_STATUS_SUCCESS; 228 } 229 230 static inline void 231 wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc, 232 struct wlan_objmgr_vdev *vdev) 233 {} 234 235 static inline 236 void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id, 237 bool lfr_roam, bool user_disconnect, 238 struct wlan_objmgr_vdev *vdev) 239 {} 240 241 static inline void 242 wlan_tdls_notify_sta_connect(uint8_t vdev_id, 243 bool tdls_chan_swit_prohibited, 244 bool tdls_prohibited, 245 struct wlan_objmgr_vdev *vdev) {} 246 247 static inline void 248 wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev, 249 struct qdf_mac_addr *mac_addr) 250 { 251 } 252 253 static inline 254 void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, 255 struct qdf_mac_addr *mac_addr, 256 struct qdf_mac_addr *dest_mac_addr) 257 { 258 } 259 260 static inline 261 void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc, 262 struct wlan_objmgr_vdev *vdev) 263 {} 264 265 static inline 266 void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc, 267 uint8_t vdev_id) 268 {} 269 270 static inline 271 void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc, 272 struct wlan_objmgr_vdev *vdev) 273 {} 274 275 static inline 276 void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc, 277 struct wlan_objmgr_vdev *vdev) 278 {} 279 280 static inline 281 void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc) 282 {} 283 284 static inline 285 void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc, 286 uint8_t vdev_id, 287 uint8_t *peer_addr) 288 {} 289 #endif 290 #endif 291