xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: wlan_vdev_mgr_tgt_if_rx_defs.h
22  *
23  * This header file provides definitions to data structures for
24  * corresponding vdev mgmt operation
25  */
26 
27 #ifndef __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__
28 #define __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__
29 
30 #include <qdf_timer.h>
31 #include <qdf_atomic.h>
32 #include <qdf_util.h>
33 #include <wlan_cmn.h>
34 #ifdef FEATURE_RUNTIME_PM
35 #include <wlan_pmo_common_public_struct.h>
36 #endif
37 
38 /**
39  * enum wlan_vdev_mgr_tgt_if_rsp_bit - response status bit
40  * @START_RESPONSE_BIT: vdev start response bit
41  * @RESTART_RESPONSE_BIT: vdev restart response bit
42  * @STOP_RESPONSE_BIT: vdev stop response bit
43  * @DELETE_RESPONSE_BIT:  vdev delete response bit
44  * @PEER_DELETE_ALL_RESPONSE_BIT: vdev peer delete all response bit
45  * @RSO_STOP_RESPONSE_BIT: RSO stop response bit
46  * @RESPONSE_BIT_MAX: Max enumeration
47  */
48 enum wlan_vdev_mgr_tgt_if_rsp_bit {
49 	START_RESPONSE_BIT = 0,
50 	RESTART_RESPONSE_BIT = 1,
51 	STOP_RESPONSE_BIT = 2,
52 	DELETE_RESPONSE_BIT = 3,
53 	PEER_DELETE_ALL_RESPONSE_BIT = 4,
54 	RSO_STOP_RESPONSE_BIT = 5,
55 	RESPONSE_BIT_MAX,
56 };
57 
58 /**
59  * string_from_rsp_bit() - Convert response bit to string
60  * @bit: response bit as in wlan_vdev_mgr_tgt_if_rsp_bit
61  *
62  * Please note to add new string in the array at index equal to
63  * its enum value in wlan_vdev_mgr_tgt_if_rsp_bit.
64  */
65 static inline char *string_from_rsp_bit(enum wlan_vdev_mgr_tgt_if_rsp_bit bit)
66 {
67 	static const char *strings[] = { "START",
68 					"RESTART",
69 					"STOP",
70 					"DELETE",
71 					"PEER DELETE ALL",
72 					"RSO STOP",
73 					"RESPONE MAX"};
74 	return (char *)strings[bit];
75 }
76 
77 #ifdef FEATURE_RUNTIME_PM
78 /* Add extra PMO_RESUME_TIMEOUT for runtime PM resume timeout */
79 #define START_RESPONSE_TIMER           (6000 + PMO_RESUME_TIMEOUT)
80 #define STOP_RESPONSE_TIMER            (4000 + PMO_RESUME_TIMEOUT)
81 #define DELETE_RESPONSE_TIMER          (4000 + PMO_RESUME_TIMEOUT)
82 #define PEER_DELETE_ALL_RESPONSE_TIMER (6000 + PMO_RESUME_TIMEOUT)
83 #define RSO_STOP_RESPONSE_TIMER        (6000 + PMO_RESUME_TIMEOUT)
84 #elif defined(QCA_LOWMEM_CONFIG) || defined(QCA_512M_CONFIG) || \
85 defined(QCA_WIFI_QCA5018)
86 #define START_RESPONSE_TIMER           15000
87 #define STOP_RESPONSE_TIMER            15000
88 #define DELETE_RESPONSE_TIMER          15000
89 #define PEER_DELETE_ALL_RESPONSE_TIMER 15000
90 #define RSO_STOP_RESPONSE_TIMER        15000
91 #else
92 #define START_RESPONSE_TIMER           8000
93 #define STOP_RESPONSE_TIMER            6000
94 #define DELETE_RESPONSE_TIMER          4000
95 #define PEER_DELETE_ALL_RESPONSE_TIMER 6000
96 #define RSO_STOP_RESPONSE_TIMER        6000
97 #endif
98 
99 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
100 #define WLAN_SET_MAC_ADDR_TIMEOUT      START_RESPONSE_TIMER
101 #endif
102 
103 /**
104  * struct vdev_response_timer - vdev mgmt response ops timer
105  * @psoc: Object manager psoc
106  * @rsp_timer: VDEV MLME mgmt response timer
107  * @rsp_status: variable to check response status
108  * @expire_time: time to expire timer
109  * @timer_status: status of timer
110  * @rsp_timer_inuse: Status bit to inform whether the rsp timer is inuse
111  * @vdev_id: vdev object id
112  * @peer_type_bitmap: Peer type bitmap
113  */
114 struct vdev_response_timer {
115 	struct wlan_objmgr_psoc *psoc;
116 	qdf_timer_t rsp_timer;
117 	unsigned long rsp_status;
118 	uint32_t expire_time;
119 	QDF_STATUS timer_status;
120 	qdf_atomic_t rsp_timer_inuse;
121 	uint8_t vdev_id;
122 	uint32_t peer_type_bitmap;
123 };
124 
125 /**
126  * struct vdev_start_response - start response structure
127  * @vdev_id: vdev id
128  * @requestor_id: requester id
129  * @status: status of start request
130  * @resp_type: response of event type START/RESTART
131  * @chain_mask: chain mask
132  * @smps_mode: smps mode
133  * @mac_id: mac id
134  * @cfgd_tx_streams: configured tx streams
135  * @cfgd_rx_streams: configured rx streams
136  * @max_allowed_tx_power: max tx power allowed
137  */
138 struct vdev_start_response {
139 	uint8_t vdev_id;
140 	uint32_t requestor_id;
141 	uint32_t status;
142 	uint32_t resp_type;
143 	uint32_t chain_mask;
144 	uint32_t smps_mode;
145 	uint32_t mac_id;
146 	uint32_t cfgd_tx_streams;
147 	uint32_t cfgd_rx_streams;
148 	uint32_t max_allowed_tx_power;
149 };
150 
151 /**
152  * struct vdev_stop_response - stop response structure
153  * @vdev_id: vdev id
154  */
155 struct vdev_stop_response {
156 	uint8_t vdev_id;
157 };
158 
159 /**
160  * struct vdev_delete_response - delete response structure
161  * @vdev_id: vdev id
162  */
163 struct vdev_delete_response {
164 	uint8_t vdev_id;
165 };
166 
167 /**
168  * struct peer_delete_all_response - peer delete all response structure
169  * @vdev_id: vdev id
170  * @status: FW status for vdev delete all peer request
171  * @peer_type_bitmap: bitmap of peer type to delete from enum wlan_peer_type
172  */
173 struct peer_delete_all_response {
174 	uint8_t vdev_id;
175 	uint8_t status;
176 	uint32_t peer_type_bitmap;
177 };
178 
179 /*
180  * struct multi_vdev_restart_resp - multi-vdev restart response structure
181  * @pdev_id: pdev id
182  * @status: FW status for multi vdev restart request
183  * @vdev_id_bmap: Bitmap of vdev_ids
184  * @timestamp: Time stamp corresponding to the start of event processing
185  *
186  * NB: not using kernel-doc format since the kernel-doc script doesn't
187  *     handle the qdf_bitmap() macro
188  */
189 struct multi_vdev_restart_resp {
190 	uint8_t pdev_id;
191 	uint8_t status;
192 	qdf_bitmap(vdev_id_bmap, WLAN_UMAC_PSOC_MAX_VDEVS);
193 	uint64_t timestamp;
194 };
195 
196 #ifdef WLAN_FEATURE_11BE_MLO
197 /**
198  * struct vdev_sta_quiet_event - mlo sta quiet offload structure
199  * @mld_mac: AP mld mac address
200  * @link_mac: AP link mac address
201  * @link_id: Link id associated with AP
202  * @quiet_status: WMI_QUIET_EVENT_FLAG: quiet start or stop
203  */
204 struct vdev_sta_quiet_event {
205 	struct qdf_mac_addr mld_mac;
206 	struct qdf_mac_addr link_mac;
207 	uint8_t link_id;
208 	bool quiet_status;
209 };
210 #endif
211 #endif /* __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__ */
212