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: Declare private data structures and APIs which shall be used 21 * internally only in twt component. 22 * 23 * Note: This API should be never accessed out of twt component. 24 */ 25 26 #ifndef _WLAN_TWT_PRIV_H_ 27 #define _WLAN_TWT_PRIV_H_ 28 29 #include <wlan_twt_public_structs.h> 30 #include <wlan_twt_ext_defs.h> 31 #include <wlan_twt_ext_type.h> 32 33 /** 34 * struct twt_tgt_caps - 35 * @twt_requestor: twt requestor 36 * @twt_responder: twt responder 37 * @legacy_bcast_twt_support: legacy bcast twt support 38 * @twt_bcast_req_support: bcast requestor support 39 * @twt_bcast_res_support: bcast responder support 40 * @twt_nudge_enabled: twt nudge enabled 41 * @all_twt_enabled: all twt enabled 42 * @twt_stats_enabled: twt stats enabled 43 * @twt_ack_supported: twt ack supported 44 */ 45 struct twt_tgt_caps { 46 bool twt_requestor; 47 bool twt_responder; 48 bool legacy_bcast_twt_support; 49 bool twt_bcast_req_support; 50 bool twt_bcast_res_support; 51 bool twt_nudge_enabled; 52 bool all_twt_enabled; 53 bool twt_stats_enabled; 54 bool twt_ack_supported; 55 }; 56 57 /** 58 * struct twt_psoc_priv_obj - 59 * @cfg_params: cfg params 60 * @twt_caps: twt caps 61 * @enable_context: enable context 62 * @disable_context: disable context 63 */ 64 struct twt_psoc_priv_obj { 65 psoc_twt_ext_cfg_params_t cfg_params; 66 struct twt_tgt_caps twt_caps; 67 struct twt_en_dis_context enable_context; 68 struct twt_en_dis_context disable_context; 69 }; 70 71 /** 72 * struct twt_vdev_priv_obj - 73 * @twt_wait_for_notify: wait for notify 74 */ 75 struct twt_vdev_priv_obj { 76 bool twt_wait_for_notify; 77 }; 78 79 /** 80 * struct twt_session - 81 * @dialog_id: dialog id 82 * @state: state 83 * @setup_done: setup done 84 * @active_cmd: active command 85 * @twt_ack_ctx: twt ack context 86 */ 87 struct twt_session { 88 uint8_t dialog_id; 89 uint8_t state; 90 bool setup_done; 91 enum wlan_twt_commands active_cmd; 92 void *twt_ack_ctx; 93 }; 94 95 /** 96 * struct twt_peer_priv_obj - 97 * @twt_peer_lock: peer lock 98 * @peer_capability: peer capability 99 * @num_twt_sessions: number of twt sessions 100 * @session_info: session info 101 */ 102 struct twt_peer_priv_obj { 103 qdf_mutex_t twt_peer_lock; 104 uint8_t peer_capability; 105 uint8_t num_twt_sessions; 106 struct twt_session session_info 107 [WLAN_MAX_TWT_SESSIONS_PER_PEER]; 108 }; 109 110 #endif /* End of _WLAN_TWT_PRIV_H_ */ 111 112