xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h (revision 16020acc91a7f0dc87b8db85d6b2b5ab335d0fa9)
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  * @UPDATE_MAC_ADDR_RESPONSE_BIT: MAC address update response bit
47  * @RESPONSE_BIT_MAX: Max enumeration
48  */
49 enum wlan_vdev_mgr_tgt_if_rsp_bit {
50 	START_RESPONSE_BIT = 0,
51 	RESTART_RESPONSE_BIT = 1,
52 	STOP_RESPONSE_BIT = 2,
53 	DELETE_RESPONSE_BIT = 3,
54 	PEER_DELETE_ALL_RESPONSE_BIT = 4,
55 	RSO_STOP_RESPONSE_BIT = 5,
56 	UPDATE_MAC_ADDR_RESPONSE_BIT = 6,
57 	RESPONSE_BIT_MAX,
58 };
59 
60 /**
61  * string_from_rsp_bit() - Convert response bit to string
62  * @bit: response bit as in wlan_vdev_mgr_tgt_if_rsp_bit
63  *
64  * Please note to add new string in the array at index equal to
65  * its enum value in wlan_vdev_mgr_tgt_if_rsp_bit.
66  */
67 static inline char *string_from_rsp_bit(enum wlan_vdev_mgr_tgt_if_rsp_bit bit)
68 {
69 	static const char *strings[] = { "START",
70 					"RESTART",
71 					"STOP",
72 					"DELETE",
73 					"PEER DELETE ALL",
74 					"RSO STOP",
75 					"UPDATE_MAC_ADDR",
76 					"RESPONE MAX"};
77 	return (char *)strings[bit];
78 }
79 
80 #ifdef FEATURE_RUNTIME_PM
81 /* Add extra PMO_RESUME_TIMEOUT for runtime PM resume timeout */
82 #define START_RESPONSE_TIMER           (6000 + PMO_RESUME_TIMEOUT)
83 #define STOP_RESPONSE_TIMER            (4000 + PMO_RESUME_TIMEOUT)
84 #define DELETE_RESPONSE_TIMER          (4000 + PMO_RESUME_TIMEOUT)
85 #define PEER_DELETE_ALL_RESPONSE_TIMER (6000 + PMO_RESUME_TIMEOUT)
86 #define RSO_STOP_RESPONSE_TIMER        (6000 + PMO_RESUME_TIMEOUT)
87 #elif defined(QCA_LOWMEM_CONFIG) || defined(QCA_512M_CONFIG) || \
88 defined(QCA_WIFI_QCA5018)
89 #define START_RESPONSE_TIMER           15000
90 #define STOP_RESPONSE_TIMER            15000
91 #define DELETE_RESPONSE_TIMER          15000
92 #define PEER_DELETE_ALL_RESPONSE_TIMER 15000
93 #define RSO_STOP_RESPONSE_TIMER        15000
94 #else
95 #define START_RESPONSE_TIMER           8000
96 #define STOP_RESPONSE_TIMER            6000
97 #define DELETE_RESPONSE_TIMER          4000
98 #define PEER_DELETE_ALL_RESPONSE_TIMER 6000
99 #define RSO_STOP_RESPONSE_TIMER        6000
100 #endif
101 
102 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
103 #define WLAN_SET_MAC_ADDR_TIMEOUT      START_RESPONSE_TIMER
104 #endif
105 
106 /**
107  * struct vdev_response_timer - vdev mgmt response ops timer
108  * @psoc: Object manager psoc
109  * @rsp_timer: VDEV MLME mgmt response timer
110  * @rsp_status: variable to check response status
111  * @expire_time: time to expire timer
112  * @timer_status: status of timer
113  * @rsp_timer_inuse: Status bit to inform whether the rsp timer is inuse
114  * @vdev_id: vdev object id
115  * @peer_type_bitmap: Peer type bitmap
116  */
117 struct vdev_response_timer {
118 	struct wlan_objmgr_psoc *psoc;
119 	qdf_timer_t rsp_timer;
120 	unsigned long rsp_status;
121 	uint32_t expire_time;
122 	QDF_STATUS timer_status;
123 	qdf_atomic_t rsp_timer_inuse;
124 	uint8_t vdev_id;
125 	uint32_t peer_type_bitmap;
126 };
127 
128 /**
129  * struct vdev_start_response - start response structure
130  * @vdev_id: vdev id
131  * @requestor_id: requester id
132  * @status: status of start request
133  * @resp_type: response of event type START/RESTART
134  * @chain_mask: chain mask
135  * @smps_mode: smps mode
136  * @mac_id: mac id
137  * @cfgd_tx_streams: configured tx streams
138  * @cfgd_rx_streams: configured rx streams
139  * @max_allowed_tx_power: max tx power allowed
140  */
141 struct vdev_start_response {
142 	uint8_t vdev_id;
143 	uint32_t requestor_id;
144 	uint32_t status;
145 	uint32_t resp_type;
146 	uint32_t chain_mask;
147 	uint32_t smps_mode;
148 	uint32_t mac_id;
149 	uint32_t cfgd_tx_streams;
150 	uint32_t cfgd_rx_streams;
151 	uint32_t max_allowed_tx_power;
152 };
153 
154 /**
155  * struct vdev_stop_response - stop response structure
156  * @vdev_id: vdev id
157  */
158 struct vdev_stop_response {
159 	uint8_t vdev_id;
160 };
161 
162 /**
163  * struct vdev_delete_response - delete response structure
164  * @vdev_id: vdev id
165  */
166 struct vdev_delete_response {
167 	uint8_t vdev_id;
168 };
169 
170 /**
171  * struct peer_delete_all_response - peer delete all response structure
172  * @vdev_id: vdev id
173  * @status: FW status for vdev delete all peer request
174  * @peer_type_bitmap: bitmap of peer type to delete from enum wlan_peer_type
175  */
176 struct peer_delete_all_response {
177 	uint8_t vdev_id;
178 	uint8_t status;
179 	uint32_t peer_type_bitmap;
180 };
181 
182 /**
183  * struct multi_vdev_restart_resp - multi-vdev restart response structure
184  * @pdev_id: pdev id
185  * @status: FW status for multi vdev restart request
186  * @vdev_id_bmap: Bitmap of vdev_ids
187  * @timestamp: Time stamp corresponding to the start of event processing
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