1 /* 2 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: wlan_twt_ucfg_api.h 21 * This file provides TWT ucfg apis. 22 */ 23 #ifndef _WLAN_TWT_UCFG_API_H_ 24 #define _WLAN_TWT_UCFG_API_H_ 25 26 #include <wlan_objmgr_psoc_obj.h> 27 #include <wlan_twt_public_structs.h> 28 29 /** 30 * ucfg_twt_get_requestor() - twt get requestor 31 * @psoc: psoc handle 32 * @val: pointer to the output variable 33 * 34 * return: QDF_STATUS 35 */ 36 QDF_STATUS 37 ucfg_twt_get_requestor(struct wlan_objmgr_psoc *psoc, bool *val); 38 39 /** 40 * ucfg_twt_get_responder() - twt get responder 41 * @psoc: psoc handle 42 * @val: pointer to the output variable 43 * 44 * return: QDF_STATUS 45 */ 46 QDF_STATUS 47 ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val); 48 49 /** 50 * ucfg_twt_get_legacy_bcast_twt_support() - get legacy bcast support 51 * @psoc: psoc handle 52 * @val: pointer to the output variable 53 * 54 * return: QDF_STATUS 55 */ 56 QDF_STATUS 57 ucfg_twt_get_legacy_bcast_twt_support(struct wlan_objmgr_psoc *psoc, 58 bool *val); 59 60 /** 61 * ucfg_twt_get_twt_bcast_req_support() - get bcast requestor support 62 * @psoc: psoc handle 63 * @val: pointer to the output variable 64 * 65 * return: QDF_STATUS 66 */ 67 QDF_STATUS 68 ucfg_twt_get_twt_bcast_req_support(struct wlan_objmgr_psoc *psoc, 69 bool *val); 70 /** 71 * ucfg_twt_get_twt_bcast_res_support() - get bcast responder support 72 * @psoc: psoc handle 73 * @val: pointer to the output variable 74 * 75 * return: QDF_STATUS 76 */ 77 QDF_STATUS 78 ucfg_twt_get_twt_bcast_res_support(struct wlan_objmgr_psoc *psoc, 79 bool *val); 80 81 /** 82 * ucfg_twt_get_twt_nudge_enabled() - get twt nudge enabled 83 * @psoc: psoc handle 84 * @val: pointer to the output variable 85 * 86 * return: QDF_STATUS 87 */ 88 QDF_STATUS 89 ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc, 90 bool *val); 91 92 /** 93 * ucfg_twt_get_all_twt_enabled() - get all twt enabled 94 * @psoc: psoc handle 95 * @val: pointer to the output variable 96 * 97 * return: QDF_STATUS 98 */ 99 QDF_STATUS 100 ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc, 101 bool *val); 102 103 /** 104 * ucfg_twt_check_all_twt_support() - Check if all TWT sessions capability is 105 * supported or not 106 * @psoc: Pointer to psoc object 107 * @dialog_id: dialod id 108 * 109 * Return: QDF Status 110 */ 111 QDF_STATUS 112 ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc, 113 uint32_t dialog_id); 114 115 /** 116 * ucfg_twt_get_twt_stats_enabled() - get twt stats enabled 117 * @psoc: psoc handle 118 * @val: pointer to the output variable 119 * 120 * return: QDF_STATUS 121 */ 122 QDF_STATUS 123 ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc *psoc, 124 bool *val); 125 126 /** 127 * ucfg_twt_get_twt_ack_supported() - get twt ack supported 128 * @psoc: psoc handle 129 * @val: pointer to the output variable 130 * 131 * return: QDF_STATUS 132 */ 133 QDF_STATUS 134 ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc *psoc, 135 bool *val); 136 137 /** 138 * ucfg_twt_requestor_disable() - twt requestor disable 139 * @psoc: psoc handle 140 * @req: twt disable request structure 141 * @context: context 142 * 143 * Following fields in request structure @twt_enable_param shall be 144 * filled by the user space/upper layer. if any field is not applicable 145 * then set it to 0. 146 * pdev_id; 147 * mbss_support; 148 * default_slot_size; 149 * congestion_thresh_setup; 150 * congestion_thresh_teardown; 151 * congestion_thresh_critical; 152 * interference_thresh_teardown; 153 * interference_thresh_setup; 154 * min_no_sta_setup; 155 * min_no_sta_teardown; 156 * no_of_bcast_mcast_slots; 157 * min_no_twt_slots; 158 * max_no_sta_twt; 159 * mode_check_interval; 160 * add_sta_slot_interval; 161 * remove_sta_slot_interval; 162 * ext_conf_present; 163 * b_twt_legacy_mbss_enable:1, 164 * b_twt_ax_mbss_enable:1; 165 * 166 * Following fields in request structure @twt_enable_param shall be 167 * filled by the UMAC TWT Component itself 168 * sta_cong_timer_ms; 169 * twt_role; 170 * twt_oper; 171 * b_twt_enable; 172 * 173 * return: QDF_STATUS 174 */ 175 QDF_STATUS 176 ucfg_twt_requestor_disable(struct wlan_objmgr_psoc *psoc, 177 struct twt_disable_param *req, 178 void *context); 179 180 /** 181 * ucfg_twt_responder_disable() - twt responder disable 182 * @psoc: psoc handle 183 * @req: twt disable request structure 184 * @context: context 185 * 186 * Following fields in request structure @twt_enable_param shall be 187 * filled by the user space/upper layer. if any field is not applicable 188 * then set it to 0. 189 * pdev_id; 190 * mbss_support; 191 * default_slot_size; 192 * congestion_thresh_setup; 193 * congestion_thresh_teardown; 194 * congestion_thresh_critical; 195 * interference_thresh_teardown; 196 * interference_thresh_setup; 197 * min_no_sta_setup; 198 * min_no_sta_teardown; 199 * no_of_bcast_mcast_slots; 200 * min_no_twt_slots; 201 * max_no_sta_twt; 202 * mode_check_interval; 203 * add_sta_slot_interval; 204 * remove_sta_slot_interval; 205 * ext_conf_present; 206 * b_twt_legacy_mbss_enable:1, 207 * b_twt_ax_mbss_enable:1; 208 * 209 * Following fields in request structure @twt_enable_param shall be 210 * filled by the UMAC TWT Component itself 211 * sta_cong_timer_ms; 212 * twt_role; 213 * twt_oper; 214 * b_twt_enable; 215 * 216 * return: QDF_STATUS 217 */ 218 QDF_STATUS 219 ucfg_twt_responder_disable(struct wlan_objmgr_psoc *psoc, 220 struct twt_disable_param *req, 221 void *context); 222 223 /** 224 * ucfg_twt_requestor_enable() - twt requestor enable 225 * @psoc: psoc handle 226 * @req: twt enable request structure 227 * @context: context 228 * 229 * Following fields in request structure @twt_enable_param shall be 230 * filled by the user space/upper layer. if any field is not applicable 231 * then set it to 0. 232 * pdev_id; 233 * mbss_support; 234 * default_slot_size; 235 * congestion_thresh_setup; 236 * congestion_thresh_teardown; 237 * congestion_thresh_critical; 238 * interference_thresh_teardown; 239 * interference_thresh_setup; 240 * min_no_sta_setup; 241 * min_no_sta_teardown; 242 * no_of_bcast_mcast_slots; 243 * min_no_twt_slots; 244 * max_no_sta_twt; 245 * mode_check_interval; 246 * add_sta_slot_interval; 247 * remove_sta_slot_interval; 248 * ext_conf_present; 249 * b_twt_legacy_mbss_enable:1, 250 * b_twt_ax_mbss_enable:1; 251 * 252 * Following fields in request structure @twt_enable_param shall be 253 * filled by the UMAC TWT Component itself 254 * sta_cong_timer_ms; 255 * twt_role; 256 * twt_oper; 257 * b_twt_enable; 258 * 259 * return: QDF_STATUS 260 */ 261 QDF_STATUS 262 ucfg_twt_requestor_enable(struct wlan_objmgr_psoc *psoc, 263 struct twt_enable_param *req, 264 void *context); 265 266 /** 267 * ucfg_twt_responder_enable() - twt responder enable 268 * @psoc: psoc handle 269 * @req: twt enable request structure 270 * @context: context 271 * 272 * Following fields in request structure @twt_enable_param shall be 273 * filled by the user space/upper layer. if any field is not applicable 274 * then set it to 0. 275 * pdev_id; 276 * mbss_support; 277 * default_slot_size; 278 * congestion_thresh_setup; 279 * congestion_thresh_teardown; 280 * congestion_thresh_critical; 281 * interference_thresh_teardown; 282 * interference_thresh_setup; 283 * min_no_sta_setup; 284 * min_no_sta_teardown; 285 * no_of_bcast_mcast_slots; 286 * min_no_twt_slots; 287 * max_no_sta_twt; 288 * mode_check_interval; 289 * add_sta_slot_interval; 290 * remove_sta_slot_interval; 291 * ext_conf_present; 292 * b_twt_legacy_mbss_enable:1, 293 * b_twt_ax_mbss_enable:1; 294 * 295 * Following fields in request structure @twt_enable_param shall be 296 * filled by the UMAC TWT Component itself 297 * sta_cong_timer_ms; 298 * twt_role; 299 * twt_oper; 300 * b_twt_enable; 301 * 302 * return: QDF_STATUS 303 */ 304 QDF_STATUS 305 ucfg_twt_responder_enable(struct wlan_objmgr_psoc *psoc, 306 struct twt_enable_param *req, 307 void *context); 308 309 /** 310 * ucfg_twt_set_peer_capabilities() - set twt peer capabilities 311 * @psoc: psoc handle 312 * @peer_mac: peer mac address 313 * @peer_cap: TWT peer capability bitmap. Refer enum 314 * wlan_twt_capabilities for representation. 315 * 316 * return: QDF_STATUS 317 */ 318 QDF_STATUS 319 ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc, 320 struct qdf_mac_addr *peer_mac, 321 uint8_t peer_cap); 322 323 /** 324 * ucfg_twt_get_peer_capabilities() - get twt peer capabilities 325 * @psoc: psoc handle 326 * @peer_mac: peer mac address 327 * @peer_cap: Pointer to output variable to hold TWT peer capability bitmap. 328 * Refer enum wlan_twt_capabilities for representation. 329 * 330 * return: QDF_STATUS 331 */ 332 QDF_STATUS 333 ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc, 334 struct qdf_mac_addr *peer_mac, 335 uint8_t *peer_cap); 336 #endif /* _WLAN_TWT_UCFG_API_H_ */ 337