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