1 /* 2 * Copyright (c) 2022-2023 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_responder() - twt get responder 31 * @psoc: psoc handle 32 * @val: pointer to the output variable 33 * 34 * return: QDF_STATUS 35 */ 36 QDF_STATUS 37 ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val); 38 39 /** 40 * ucfg_twt_get_twt_nudge_enabled() - get twt nudge enabled 41 * @psoc: psoc handle 42 * @val: pointer to the output variable 43 * 44 * return: QDF_STATUS 45 */ 46 QDF_STATUS 47 ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc, 48 bool *val); 49 50 /** 51 * ucfg_twt_get_all_twt_enabled() - get all twt enabled 52 * @psoc: psoc handle 53 * @val: pointer to the output variable 54 * 55 * return: QDF_STATUS 56 */ 57 QDF_STATUS 58 ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc, 59 bool *val); 60 61 /** 62 * ucfg_twt_check_all_twt_support() - Check if all TWT sessions capability is 63 * supported or not 64 * @psoc: Pointer to psoc object 65 * @dialog_id: dialod id 66 * 67 * Return: QDF Status 68 */ 69 QDF_STATUS 70 ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc, 71 uint32_t dialog_id); 72 73 /** 74 * ucfg_twt_get_twt_stats_enabled() - get twt stats enabled 75 * @psoc: psoc handle 76 * @val: pointer to the output variable 77 * 78 * return: QDF_STATUS 79 */ 80 QDF_STATUS 81 ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc *psoc, 82 bool *val); 83 84 /** 85 * ucfg_twt_get_twt_ack_supported() - get twt ack supported 86 * @psoc: psoc handle 87 * @val: pointer to the output variable 88 * 89 * return: QDF_STATUS 90 */ 91 QDF_STATUS 92 ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc *psoc, 93 bool *val); 94 95 /** 96 * ucfg_twt_requestor_disable() - twt requestor disable 97 * @psoc: psoc handle 98 * @req: twt disable request structure 99 * @context: context 100 * 101 * Following fields in request structure @twt_enable_param shall be 102 * filled by the user space/upper layer. if any field is not applicable 103 * then set it to 0. 104 * pdev_id; 105 * mbss_support; 106 * default_slot_size; 107 * congestion_thresh_setup; 108 * congestion_thresh_teardown; 109 * congestion_thresh_critical; 110 * interference_thresh_teardown; 111 * interference_thresh_setup; 112 * min_no_sta_setup; 113 * min_no_sta_teardown; 114 * no_of_bcast_mcast_slots; 115 * min_no_twt_slots; 116 * max_no_sta_twt; 117 * mode_check_interval; 118 * add_sta_slot_interval; 119 * remove_sta_slot_interval; 120 * ext_conf_present; 121 * b_twt_legacy_mbss_enable:1, 122 * b_twt_ax_mbss_enable:1; 123 * 124 * Following fields in request structure @twt_enable_param shall be 125 * filled by the UMAC TWT Component itself 126 * sta_cong_timer_ms; 127 * twt_role; 128 * twt_oper; 129 * b_twt_enable; 130 * 131 * return: QDF_STATUS 132 */ 133 QDF_STATUS 134 ucfg_twt_requestor_disable(struct wlan_objmgr_psoc *psoc, 135 struct twt_disable_param *req, 136 void *context); 137 138 /** 139 * ucfg_twt_responder_disable() - twt responder disable 140 * @psoc: psoc handle 141 * @req: twt disable request structure 142 * @context: context 143 * 144 * Following fields in request structure @twt_enable_param shall be 145 * filled by the user space/upper layer. if any field is not applicable 146 * then set it to 0. 147 * pdev_id; 148 * mbss_support; 149 * default_slot_size; 150 * congestion_thresh_setup; 151 * congestion_thresh_teardown; 152 * congestion_thresh_critical; 153 * interference_thresh_teardown; 154 * interference_thresh_setup; 155 * min_no_sta_setup; 156 * min_no_sta_teardown; 157 * no_of_bcast_mcast_slots; 158 * min_no_twt_slots; 159 * max_no_sta_twt; 160 * mode_check_interval; 161 * add_sta_slot_interval; 162 * remove_sta_slot_interval; 163 * ext_conf_present; 164 * b_twt_legacy_mbss_enable:1, 165 * b_twt_ax_mbss_enable:1; 166 * 167 * Following fields in request structure @twt_enable_param shall be 168 * filled by the UMAC TWT Component itself 169 * sta_cong_timer_ms; 170 * twt_role; 171 * twt_oper; 172 * b_twt_enable; 173 * 174 * return: QDF_STATUS 175 */ 176 QDF_STATUS 177 ucfg_twt_responder_disable(struct wlan_objmgr_psoc *psoc, 178 struct twt_disable_param *req, 179 void *context); 180 181 /** 182 * ucfg_twt_requestor_enable() - twt requestor enable 183 * @psoc: psoc handle 184 * @req: twt enable request structure 185 * @context: context 186 * 187 * Following fields in request structure @twt_enable_param shall be 188 * filled by the user space/upper layer. if any field is not applicable 189 * then set it to 0. 190 * pdev_id; 191 * mbss_support; 192 * default_slot_size; 193 * congestion_thresh_setup; 194 * congestion_thresh_teardown; 195 * congestion_thresh_critical; 196 * interference_thresh_teardown; 197 * interference_thresh_setup; 198 * min_no_sta_setup; 199 * min_no_sta_teardown; 200 * no_of_bcast_mcast_slots; 201 * min_no_twt_slots; 202 * max_no_sta_twt; 203 * mode_check_interval; 204 * add_sta_slot_interval; 205 * remove_sta_slot_interval; 206 * ext_conf_present; 207 * b_twt_legacy_mbss_enable:1, 208 * b_twt_ax_mbss_enable:1; 209 * 210 * Following fields in request structure @twt_enable_param shall be 211 * filled by the UMAC TWT Component itself 212 * sta_cong_timer_ms; 213 * twt_role; 214 * twt_oper; 215 * b_twt_enable; 216 * 217 * return: QDF_STATUS 218 */ 219 QDF_STATUS 220 ucfg_twt_requestor_enable(struct wlan_objmgr_psoc *psoc, 221 struct twt_enable_param *req, 222 void *context); 223 224 /** 225 * ucfg_twt_responder_enable() - twt responder enable 226 * @psoc: psoc handle 227 * @req: twt enable request structure 228 * @context: context 229 * 230 * Following fields in request structure @twt_enable_param shall be 231 * filled by the user space/upper layer. if any field is not applicable 232 * then set it to 0. 233 * pdev_id; 234 * mbss_support; 235 * default_slot_size; 236 * congestion_thresh_setup; 237 * congestion_thresh_teardown; 238 * congestion_thresh_critical; 239 * interference_thresh_teardown; 240 * interference_thresh_setup; 241 * min_no_sta_setup; 242 * min_no_sta_teardown; 243 * no_of_bcast_mcast_slots; 244 * min_no_twt_slots; 245 * max_no_sta_twt; 246 * mode_check_interval; 247 * add_sta_slot_interval; 248 * remove_sta_slot_interval; 249 * ext_conf_present; 250 * b_twt_legacy_mbss_enable:1, 251 * b_twt_ax_mbss_enable:1; 252 * 253 * Following fields in request structure @twt_enable_param shall be 254 * filled by the UMAC TWT Component itself 255 * sta_cong_timer_ms; 256 * twt_role; 257 * twt_oper; 258 * b_twt_enable; 259 * 260 * return: QDF_STATUS 261 */ 262 QDF_STATUS 263 ucfg_twt_responder_enable(struct wlan_objmgr_psoc *psoc, 264 struct twt_enable_param *req, 265 void *context); 266 267 /** 268 * ucfg_twt_set_peer_capabilities() - set twt peer capabilities 269 * @psoc: psoc handle 270 * @peer_mac: peer mac address 271 * @peer_cap: TWT peer capability bitmap. Refer enum 272 * wlan_twt_capabilities for representation. 273 * 274 * return: QDF_STATUS 275 */ 276 QDF_STATUS 277 ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc, 278 struct qdf_mac_addr *peer_mac, 279 uint8_t peer_cap); 280 281 /** 282 * ucfg_twt_get_peer_capabilities() - get twt peer capabilities 283 * @psoc: psoc handle 284 * @peer_mac: peer mac address 285 * @peer_cap: Pointer to output variable to hold TWT peer capability bitmap. 286 * Refer enum wlan_twt_capabilities for representation. 287 * 288 * return: QDF_STATUS 289 */ 290 QDF_STATUS 291 ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc, 292 struct qdf_mac_addr *peer_mac, 293 uint8_t *peer_cap); 294 295 /** 296 * ucfg_twt_get_restricted_twt_supported() - Get tgt restricted-twt 297 * support caps 298 * @psoc: psoc handle 299 * @val: pointer to get caps enabled/disabled 300 * 301 * return: QDF_STATUS 302 */ 303 QDF_STATUS ucfg_twt_get_restricted_twt_supported(struct wlan_objmgr_psoc *psoc, 304 bool *val); 305 #endif /* _WLAN_TWT_UCFG_API_H_ */ 306