xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h (revision 17183c4759d35d62dc4d2b470a724940345ae906)
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_tx_defs.h
22  *
23  * This file provides definitions to data structures required for vdev Tx ops
24  */
25 
26 #ifndef __WLAN_VDEV_MGR_TX_OPS_DEFS_H__
27 #define __WLAN_VDEV_MGR_TX_OPS_DEFS_H__
28 
29 #include <qdf_nbuf.h>
30 #ifdef WLAN_FEATURE_11BE_MLO
31 #include <wlan_mlo_mgr_public_structs.h>
32 #endif
33 #include <wlan_mlme_dbg.h>
34 
35 /* slot time long */
36 #define WLAN_MLME_VDEV_SLOT_TIME_LONG   0x1
37 /* slot time short */
38 #define WLAN_MLME_VDEV_SLOT_TIME_SHORT  0x2
39 
40 #define WLAN_MU_SNIF_MAX_AIDS 4
41 
42 /**
43  * enum mlme_dev_setparam - type of set params pdev/vdev
44  * @MLME_PDEV_SETPARAM: pdev param
45  * @MLME_VDEV_SETPARAM: vdev param
46  */
47 enum mlme_dev_setparam {
48 	MLME_PDEV_SETPARAM = 0,
49 	MLME_VDEV_SETPARAM,
50 };
51 
52 #ifdef WLAN_BCN_RATECODE_ENABLE
53 /**
54  * enum mlme_bcn_tx_rate_code - beacon tx rate code
55  * @MLME_BCN_TX_RATE_CODE_1_M:
56  * @MLME_BCN_TX_RATE_CODE_2_M:
57  * @MLME_BCN_TX_RATE_CODE_5_5_M:
58  * @MLME_BCN_TX_RATE_CODE_6_M:
59  * @MLME_BCN_TX_RATE_CODE_9_M:
60  * @MLME_BCN_TX_RATE_CODE_11M:
61  * @MLME_BCN_TX_RATE_CODE_12_M:
62  * @MLME_BCN_TX_RATE_CODE_18_M:
63  * @MLME_BCN_TX_RATE_CODE_24_M:
64  * @MLME_BCN_TX_RATE_CODE_36_M:
65  * @MLME_BCN_TX_RATE_CODE_48_M:
66  * @MLME_BCN_TX_RATE_CODE_54_M:
67  */
68 enum mlme_bcn_tx_rate_code {
69 	MLME_BCN_TX_RATE_CODE_1_M = 0x83,
70 	MLME_BCN_TX_RATE_CODE_2_M = 0x82,
71 	MLME_BCN_TX_RATE_CODE_5_5_M = 0x81,
72 	MLME_BCN_TX_RATE_CODE_6_M = 0x03,
73 	MLME_BCN_TX_RATE_CODE_9_M = 0x07,
74 	MLME_BCN_TX_RATE_CODE_11M = 0x80,
75 	MLME_BCN_TX_RATE_CODE_12_M = 0x02,
76 	MLME_BCN_TX_RATE_CODE_18_M = 0x06,
77 	MLME_BCN_TX_RATE_CODE_24_M = 0x01,
78 	MLME_BCN_TX_RATE_CODE_36_M = 0x05,
79 	MLME_BCN_TX_RATE_CODE_48_M = 0x00,
80 	MLME_BCN_TX_RATE_CODE_54_M = 0x04,
81 };
82 #else
83 enum mlme_bcn_tx_rate_code {
84 	MLME_BCN_TX_RATE_CODE_1_M = 0x43,
85 	MLME_BCN_TX_RATE_CODE_2_M = 0x42,
86 	MLME_BCN_TX_RATE_CODE_5_5_M = 0x41,
87 	MLME_BCN_TX_RATE_CODE_6_M = 0x03,
88 	MLME_BCN_TX_RATE_CODE_9_M = 0x07,
89 	MLME_BCN_TX_RATE_CODE_11M = 0x40,
90 	MLME_BCN_TX_RATE_CODE_12_M = 0x02,
91 	MLME_BCN_TX_RATE_CODE_18_M = 0x06,
92 	MLME_BCN_TX_RATE_CODE_24_M = 0x01,
93 	MLME_BCN_TX_RATE_CODE_36_M = 0x05,
94 	MLME_BCN_TX_RATE_CODE_48_M = 0x00,
95 	MLME_BCN_TX_RATE_CODE_54_M = 0x04,
96 };
97 #endif
98 
99 /**
100  * enum wlan_mlme_host_sta_ps_param_uapsd - STA UPASD params
101  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN:
102  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN:
103  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN:
104  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN:
105  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN:
106  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN:
107  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN:
108  * @WLAN_MLME_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN:
109  */
110 enum wlan_mlme_host_sta_ps_param_uapsd {
111 	WLAN_MLME_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
112 	WLAN_MLME_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN  = (1 << 1),
113 	WLAN_MLME_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
114 	WLAN_MLME_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN  = (1 << 3),
115 	WLAN_MLME_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
116 	WLAN_MLME_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN  = (1 << 5),
117 	WLAN_MLME_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
118 	WLAN_MLME_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN  = (1 << 7),
119 };
120 
121 /**
122  * enum wlan_mlme_host_vdev_start_status - vdev start status code
123  * @WLAN_MLME_HOST_VDEV_START_OK:
124  * @WLAN_MLME_HOST_VDEV_START_CHAN_INVALID:
125  * @WLAN_MLME_HOST_VDEV_START_CHAN_BLOCKED:
126  * @WLAN_MLME_HOST_VDEV_START_CHAN_DFS_VIOLATION:
127  * @WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_REGDOMAIN:
128  * @WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_BAND:
129  * @WLAN_MLME_HOST_VDEV_START_TIMEOUT:
130  * @WLAN_MLME_HOST_VDEV_START_TX_VAP_CFG_INVALID:
131  * @WLAN_MLME_HOST_VDEV_START_MAX_REASON: Max enumeration
132  */
133 enum wlan_mlme_host_vdev_start_status {
134 	WLAN_MLME_HOST_VDEV_START_OK = 0,
135 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID,
136 	WLAN_MLME_HOST_VDEV_START_CHAN_BLOCKED,
137 	WLAN_MLME_HOST_VDEV_START_CHAN_DFS_VIOLATION,
138 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_REGDOMAIN,
139 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_BAND,
140 	WLAN_MLME_HOST_VDEV_START_TIMEOUT,
141 	WLAN_MLME_HOST_VDEV_START_TX_VAP_CFG_INVALID,
142 	/* Add new response status code from here */
143 	WLAN_MLME_HOST_VDEV_START_MAX_REASON,
144 };
145 
146 /**
147  * string_from_start_rsp_status() - Convert start response status to string
148  * @start_rsp: start response status
149  *
150  * Please note to add new string in the array at index equal to
151  * its enum value in wlan_mlme_host_vdev_start_status.
152  */
153 static inline char *string_from_start_rsp_status(
154 			enum wlan_mlme_host_vdev_start_status start_rsp)
155 {
156 	static const char *strings[] = { "START_OK",
157 					"CHAN_INVALID",
158 					"CHAN_BLOCKED",
159 					"CHAN_DFS_VIOLATION",
160 					"CHAN_INVALID_REGDOMAIN",
161 					"CHAN_INVALID_BAND",
162 					"START_RESPONSE_TIMEOUT",
163 					"TX_VAP_CONFIG_INVALID",
164 					"START_RESPONSE_UNKNOWN"};
165 
166 	if (start_rsp >= WLAN_MLME_HOST_VDEV_START_MAX_REASON)
167 		start_rsp = WLAN_MLME_HOST_VDEV_START_MAX_REASON;
168 
169 	return (char *)strings[start_rsp];
170 }
171 
172 /**
173  * enum wlan_mlme_host_start_event_param - start/restart resp event
174  * @WLAN_MLME_HOST_VDEV_START_RESP_EVENT: Start response
175  * @WLAN_MLME_HOST_VDEV_RESTART_RESP_EVENT: Restart response
176  */
177 enum wlan_mlme_host_start_event_param {
178 	WLAN_MLME_HOST_VDEV_START_RESP_EVENT = 0,
179 	WLAN_MLME_HOST_VDEV_RESTART_RESP_EVENT,
180 };
181 
182 /**
183  * enum wlan_mlme_custom_aggr_type: custom aggregate type
184  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation
185  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation
186  * @WLAN_MLME_CUSTOM_AGGR_TYPE_MAX: Max type
187  */
188 enum wlan_mlme_custom_aggr_type {
189 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU = 0,
190 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU = 1,
191 	WLAN_MLME_CUSTOM_AGGR_TYPE_MAX,
192 };
193 
194 /**
195  * struct sta_ps_params - sta ps cmd parameter
196  * @vdev_id: vdev id
197  * @param_id: sta ps parameter
198  * @value: sta ps parameter value
199  */
200 struct sta_ps_params {
201 	uint32_t vdev_id;
202 	uint32_t param_id;
203 	uint32_t value;
204 };
205 
206 /**
207  * struct rnr_bss_tbtt_info_param: Reported Vdev info
208  * @bss_mac: Mac address
209  * @beacon_intval: Beacon interval of reported AP
210  * @opclass: Channel Opclass
211  * @chan_idx: Channel number
212  * @next_qtime_tbtt_high: Tbtt higher 32bit
213  * @next_qtime_tbtt_low: Tbtt lower 32bit
214  */
215 struct rnr_bss_tbtt_info_param {
216 	uint8_t bss_mac[QDF_MAC_ADDR_SIZE];
217 	uint32_t beacon_intval;
218 	uint32_t opclass;
219 	uint32_t chan_idx;
220 	uint32_t next_qtime_tbtt_high;
221 	uint32_t next_qtime_tbtt_low;
222 };
223 
224 /**
225  * struct rnr_tbtt_multisoc_sync_param - Params to
226  * sync tbtt with non self SoCs timers
227  * @pdev_id: Host pdev_id
228  * @rnr_vap_count: Count of Vap to be included in WMI cmd
229  * @cmd_type: Set/Get tbtt sync info
230  * @rnr_bss_tbtt: Reported AP Vap info
231  */
232 struct rnr_tbtt_multisoc_sync_param {
233 	uint32_t pdev_id;
234 	uint8_t rnr_vap_count;
235 	uint8_t cmd_type;
236 	struct rnr_bss_tbtt_info_param *rnr_bss_tbtt;
237 };
238 
239 /**
240  * struct tbttoffset_params - Tbttoffset event params
241  * @vdev_id: Virtual AP device identifier
242  * @tbttoffset : Tbttoffset for the virtual AP device
243  * @vdev_tbtt_qtime_lo: Tbtt qtime low value
244  * @vdev_tbtt_qtime_hi: Tbtt qtime high value
245  */
246 struct tbttoffset_params {
247 	uint32_t vdev_id;
248 	uint32_t tbttoffset;
249 	uint32_t vdev_tbtt_qtime_lo;
250 	uint32_t vdev_tbtt_qtime_hi;
251 };
252 
253 /* Follow bitmap for sending the CSA switch count event */
254 #define WLAN_CSA_EVENT_BMAP_VALID_MASK 0X80000000
255 /* Send only when the switch count becomes zero, added for backward
256  * compatibility same can also be achieved by setting bitmap to 0X80000001.
257  */
258 #define WLAN_CSA_EVENT_BMAP_SWITCH_COUNT_ZERO    0
259 /* Send CSA switch count event for every update to switch count */
260 #define WLAN_CSA_EVENT_BMAP_ALL                  0XFFFFFFFF
261 
262 #ifdef WLAN_FEATURE_11BE_MLO
263 /**
264  * struct ml_bcn_partner_info - Partner link beacon information
265  * @vdev_id: Vdev id
266  * @hw_link_id: Unique hw link id across SoCs
267  * @beacon_interval: Beacon interval
268  * @csa_switch_count_offset: CSA switch count offset in beacon frame
269  * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
270  * @per_sta_profile_offset: Pointer to per-STA profile info
271  * @quiet_ie_offset: Quiet IE offset
272  * @is_other_ie_present: Set true if other IEs are present in per-STA profile.
273  *                       If the flag is set to false, FW will remove per-STA
274  *                       profile IE when Quiet count reaches to 0.
275  */
276 struct ml_bcn_partner_info {
277 	uint32_t vdev_id;
278 	uint32_t hw_link_id;
279 	uint32_t beacon_interval;
280 	uint32_t csa_switch_count_offset;
281 	uint32_t ext_csa_switch_count_offset;
282 	uint32_t per_sta_profile_offset;
283 	uint32_t quiet_ie_offset;
284 	uint32_t is_other_ie_present;
285 };
286 
287 /**
288  * struct mlo_bcn_templ_partner_links - ML partner links
289  * @num_links: Number of links
290  * @partner_info: Partner link info
291  */
292 struct mlo_bcn_templ_partner_links {
293 	uint8_t num_links;
294 	struct ml_bcn_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS];
295 };
296 
297 /**
298  * struct mlo_bcn_tmpl_ml_info - Impacted link critical update information
299  * @hw_link_id: Unique hw link id across SoCs
300  * CU vdev map for the Critical update category-1 (Inclusion of CU IES)
301  * @cu_vdev_map_cat1_lo: bits 31:0 to represent vdev ids 0 to 31
302  * @cu_vdev_map_cat1_hi: bits 63:32 to represent vdev ids 32 to 63
303  * CU vdev map for the Critical update category-2 (modification of CU IES)
304  * @cu_vdev_map_cat2_lo: bits 31:0 to represent vdev ids 0 to 31
305  * @cu_vdev_map_cat2_hi: bits 63:32 to represent vdev ids 32 to 63
306  */
307 struct mlo_bcn_tmpl_ml_info {
308 	uint32_t hw_link_id;
309 	uint32_t cu_vdev_map_cat1_lo;
310 	uint32_t cu_vdev_map_cat1_hi;
311 	uint32_t cu_vdev_map_cat2_lo;
312 	uint32_t cu_vdev_map_cat2_hi;
313 };
314 #endif
315 
316 /**
317  * struct beacon_tmpl_params - beacon template cmd parameter
318  * @vdev_id: vdev id
319  * @tim_ie_offset: tim ie offset
320  * @mbssid_ie_offset: mbssid ie offset
321  * @tmpl_len: beacon template length
322  * @tmpl_len_aligned: beacon template alignment
323  * @csa_switch_count_offset: CSA switch count offset in beacon frame
324  * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
325  * @esp_ie_offset: ESP IE offset in beacon frame
326  * @mu_edca_ie_offset: Mu EDCA IE offset in beacon frame
327  * @ema_params: The 4 octets in this field respectively indicate
328  *     ema_beacon_profile_periodicity, ema_beacon_tmpl_idx,
329  *     ema_first_tmpl and ema_last_tmpl in the order of low
330  *     to high
331  * @csa_event_bitmap: Specify when to send the CSA switch count status from FW
332  *     to host. Example: if CSA switch count event is needed to be sent when the
333  *     switch count is 0, 1, 4, and 5, set the bitmap to (0X80000033)
334  * @enable_bigtk: enable bigtk or not
335  * @frm: beacon template parameter
336  * @mlo_partner: Partner link information
337  * @cu_ml_info: Impacted link critical update information
338  */
339 struct beacon_tmpl_params {
340 	uint8_t vdev_id;
341 	uint32_t tim_ie_offset;
342 	uint32_t mbssid_ie_offset;
343 	uint32_t tmpl_len;
344 	uint32_t tmpl_len_aligned;
345 	uint32_t csa_switch_count_offset;
346 	uint32_t ext_csa_switch_count_offset;
347 	uint32_t esp_ie_offset;
348 	uint32_t mu_edca_ie_offset;
349 	uint32_t ema_params;
350 	uint32_t csa_event_bitmap;
351 	bool enable_bigtk;
352 	uint8_t *frm;
353 #ifdef WLAN_FEATURE_11BE_MLO
354 	struct mlo_bcn_templ_partner_links mlo_partner;
355 	struct mlo_bcn_tmpl_ml_info cu_ml_info;
356 #endif
357 };
358 
359 /**
360  * struct beacon_params - beacon cmd parameter
361  * @vdev_id: vdev id
362  * @beacon_interval: Beacon interval
363  * @wbuf: beacon buffer
364  * @frame_ctrl: frame control field
365  * @bcn_txant: beacon antenna
366  * @is_dtim_count_zero: is it dtim beacon
367  * @is_bitctl_reqd: is Bit control required
368  * @is_high_latency: Is this high latency target
369  */
370 struct beacon_params {
371 	uint8_t vdev_id;
372 	uint16_t beacon_interval;
373 	qdf_nbuf_t wbuf;
374 	uint16_t frame_ctrl;
375 	uint32_t bcn_txant;
376 	bool is_dtim_count_zero;
377 	bool is_bitctl_reqd;
378 	bool is_high_latency;
379 };
380 
381 /* struct fils_discovery_tmpl_params - FILS Discovery template cmd parameter
382  * @vdev_id: vdev ID
383  * @tmpl_len: FILS Discovery template length
384  * @tmpl_aligned: FILS Discovery template alignment
385  * @frm: FILS Discovery template parameter
386  */
387 struct fils_discovery_tmpl_params {
388 	uint8_t vdev_id;
389 	uint32_t tmpl_len;
390 	uint32_t tmpl_len_aligned;
391 	uint8_t *frm;
392 };
393 
394 /**
395  * struct mlme_channel_param - Channel parameters with all
396  *			info required by target.
397  * @chan_id: channel id
398  * @pwr: channel power
399  * @mhz: channel frequency
400  * @half_rate: is half rate
401  * @quarter_rate: is quarter rate
402  * @dfs_set: is dfs channel
403  * @dfs_set_cfreq2: is secondary freq dfs channel
404  * @is_chan_passive: is this passive channel
405  * @allow_ht: HT allowed in chan
406  * @allow_vht: VHT allowed on chan
407  * @set_agile: is agile mode
408  * @is_stadfs_en: STA DFS enabled
409  * @phy_mode: phymode (vht80 or ht40 or ...)
410  * @cfreq1: centre frequency on primary
411  * @cfreq2: centre frequency on secondary
412  * @maxpower: max power for channel
413  * @minpower: min power for channel
414  * @maxregpower: Max regulatory power
415  * @antennamax: Max antenna
416  * @reg_class_id: Regulatory class id.
417  * @puncture_bitmap: 11be static puncture bitmap
418  */
419 struct mlme_channel_param {
420 	uint8_t chan_id;
421 	uint8_t pwr;
422 	uint32_t mhz;
423 	uint32_t half_rate:1,
424 		quarter_rate:1,
425 		dfs_set:1,
426 		dfs_set_cfreq2:1,
427 		is_chan_passive:1,
428 		allow_ht:1,
429 		allow_vht:1,
430 		set_agile:1,
431 		is_stadfs_en:1;
432 	enum wlan_phymode phy_mode;
433 	uint32_t cfreq1;
434 	uint32_t cfreq2;
435 	int8_t   maxpower;
436 	int8_t   minpower;
437 	int8_t   maxregpower;
438 	uint8_t  antennamax;
439 	uint8_t  reg_class_id;
440 #ifdef WLAN_FEATURE_11BE
441 	uint16_t puncture_bitmap;
442 #endif
443 };
444 
445 /**
446  * struct vdev_mlme_mvr_param - Multiple vdev restart params
447  * @phymode: phymode information
448  * @preferred_tx_streams: preferred tx streams for VAP
449  * @preferred_rx_streams: preferred rx streams for VAP
450  */
451 struct vdev_mlme_mvr_param {
452 	uint32_t phymode;
453 	uint32_t preferred_tx_streams;
454 	uint32_t preferred_rx_streams;
455 };
456 
457 /**
458  * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter
459  * @pdev_id: Pdev identifier
460  * @requestor_id: Unique id identifying the module
461  * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC
462  * @cac_duration_ms: CAC duration on the given channel
463  * @num_vdevs: No. of vdevs that need to be restarted
464  * @ch_param: Pointer to channel_param
465  * @vdev_ids: Pointer to array of vdev_ids
466  * @mvr_param: Pointer to array of multi vdev restart param
467  * @max_vdevs: Maximum vdev count of this pdev
468  * @mvr_bmap_enabled: flag indicating mvr-bitmap support
469  */
470 struct multiple_vdev_restart_params {
471 	uint32_t pdev_id;
472 	uint32_t requestor_id;
473 	uint32_t disable_hw_ack;
474 	uint32_t cac_duration_ms;
475 	uint32_t num_vdevs;
476 	struct mlme_channel_param ch_param;
477 	uint32_t *vdev_ids;
478 	struct vdev_mlme_mvr_param *mvr_param;
479 	uint32_t max_vdevs;
480 	uint8_t mvr_bmap_enabled;
481 };
482 
483 /**
484  * struct multiple_vdev_set_param - Multiple vdev set param command parameter
485  * @pdev_id: Pdev identifier
486  * @param_id: parameter id
487  * @param_value: parameter value
488  * @num_vdevs: number of vdevs
489  * @vdev_ids: Pointer to array of vdev_ids
490  */
491 struct multiple_vdev_set_param {
492 	uint32_t pdev_id;
493 	uint32_t param_id;
494 	uint32_t param_value;
495 	uint32_t num_vdevs;
496 	uint32_t vdev_ids[WLAN_UMAC_PDEV_MAX_VDEVS];
497 };
498 
499 /**
500  * struct peer_flush_params - peer flush cmd parameter
501  * @peer_tid_bitmap: peer tid bitmap
502  * @vdev_id: vdev id
503  * @peer_mac: peer mac address
504  */
505 struct peer_flush_params {
506 	uint32_t peer_tid_bitmap;
507 	uint8_t vdev_id;
508 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
509 };
510 
511 /**
512  * struct peer_delete_cmd_params - peer delete cmd parameter
513  * @vdev_id: vdev id
514  * @hw_link_id_bitmap: logical link id bitmap for peers
515  * not getting created
516  */
517 struct peer_delete_cmd_params {
518 	uint8_t vdev_id;
519 	uint32_t hw_link_id_bitmap;
520 };
521 
522 /* Default FILS DISCOVERY/probe response sent in period of 20TU */
523 #define DEFAULT_FILS_DISCOVERY_PERIOD 20
524 #define DEFAULT_PROBE_RESP_PERIOD 20
525 
526 /**
527  * struct config_fils_params - FILS config params
528  * @vdev_id:  vdev id
529  * @fd_period:  0 - Disabled, non-zero - Period in ms (mili seconds)
530  * @send_prb_rsp_frame: send broadcast prb resp frame
531  */
532 struct config_fils_params {
533 	uint8_t vdev_id;
534 	uint32_t fd_period;
535 	uint32_t send_prb_rsp_frame: 1;
536 };
537 
538 /**
539  * struct config_ratemask_params - ratemask config parameters
540  * @vdev_id: vdev id
541  * @type: Type
542  * @lower32: Lower 32 bits in the 1st 64-bit value
543  * @higher32: Higher 32 bits in the 1st 64-bit value
544  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
545  * @higher32_2: Higher 32 bits in the 2nd 64-bit value
546  */
547 struct config_ratemask_params {
548 	uint8_t vdev_id;
549 	uint8_t type;
550 	uint32_t lower32;
551 	uint32_t higher32;
552 	uint32_t lower32_2;
553 	uint32_t higher32_2;
554 };
555 
556 /**
557  * struct set_custom_aggr_size_params - custom aggr size params
558  * @vdev_id : vdev id
559  * @tx_aggr_size : TX aggr size
560  * @rx_aggr_size : RX aggr size
561  * @ac:
562  * @aggr_type:
563  * @tx_aggr_size_disable:
564  * @rx_aggr_size_disable:
565  * @tx_ac_enable:
566  * @aggr_ba_enable:
567  * @reserved: spare bits
568  */
569 struct set_custom_aggr_size_params {
570 	uint32_t  vdev_id;
571 	uint32_t tx_aggr_size;
572 	uint32_t rx_aggr_size;
573 	uint32_t ac:2,
574 		 aggr_type:1,
575 		 tx_aggr_size_disable:1,
576 		 rx_aggr_size_disable:1,
577 		 tx_ac_enable:1,
578 		 aggr_ba_enable:1,
579 		 reserved:25;
580 };
581 
582 /**
583  * struct sifs_trigger_param - sifs_trigger cmd parameter
584  * @vdev_id: vdev id
585  * @param_value: parameter value
586  */
587 struct sifs_trigger_param {
588 	uint32_t vdev_id;
589 	uint32_t param_value;
590 };
591 
592 /**
593  * struct set_neighbour_rx_params - Neighbour RX params
594  * @vdev_id: vdev id
595  * @idx: index of param
596  * @action: action
597  * @type: Type of param
598  */
599 struct set_neighbour_rx_params {
600 	uint8_t vdev_id;
601 	uint32_t idx;
602 	uint32_t action;
603 	uint32_t type;
604 };
605 
606 /**
607  * struct set_tx_peer_filter - Set tx peer filter
608  * @vdev_id: vdev id
609  * @idx: index of param
610  * @action: action
611  */
612 struct set_tx_peer_filter {
613 	uint8_t vdev_id;
614 	uint32_t idx;
615 	uint32_t action;
616 };
617 
618 /**
619  * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter
620  * @vdev_id: vdev id
621  * @bssid_addr: BSSID address
622  * @client_addr: client address
623  * @chan_num: channel number
624  * @action:NAC_RSSI action,
625  */
626 struct vdev_scan_nac_rssi_params {
627 	uint32_t vdev_id;
628 	uint8_t bssid_addr[QDF_MAC_ADDR_SIZE];
629 	uint8_t client_addr[QDF_MAC_ADDR_SIZE];
630 	uint32_t chan_num;
631 	uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */
632 };
633 
634 #ifdef WLAN_FEATURE_11BE_MLO
635 /**
636  * struct mlo_vdev_start_flags - MLO start flags
637  * @mlo_enabled: indicate is MLO enabled
638  * @mlo_assoc_link: indicate is the link used to initialize
639  *                  the association of mlo connection
640  * @mlo_mcast_vdev: MLO cast vdev
641  * @emlsr_support: indicate non AP MLD STA supports eMLSR mode
642  * @mlo_link_add: Dynamic link addition
643  * @rsvd: reserved bits
644  */
645 struct mlo_vdev_start_flags {
646 	uint32_t mlo_enabled:1,
647 		 mlo_assoc_link:1,
648 		 mlo_mcast_vdev:1,
649 		 emlsr_support:1,
650 		 mlo_link_add:1,
651 		 rsvd:27;
652 };
653 
654 /**
655  * struct ml_vdev_start_partner_info - partner link info
656  * @vdev_id: vdev id
657  * @hw_mld_link_id: unique hw link id across SoCs
658  * @mac_addr: Partner mac address
659  */
660 struct ml_vdev_start_partner_info {
661 	uint32_t vdev_id;
662 	uint32_t hw_mld_link_id;
663 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
664 };
665 
666 /**
667  * struct mlo_vdev_start_partner_links - ML partner links
668  * @num_links: Number of links
669  * @partner_info: Partner link info
670  */
671 struct mlo_vdev_start_partner_links {
672 	uint8_t num_links;
673 #ifdef WLAN_MLO_MULTI_CHIP
674 	struct ml_vdev_start_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS + WLAN_UMAC_MLO_MAX_BRIDGE_VDEVS];
675 #else
676 	struct ml_vdev_start_partner_info partner_info[WLAN_UMAC_MLO_MAX_VDEVS];
677 #endif
678 };
679 #endif
680 /**
681  * struct vdev_start_params - vdev start cmd parameter
682  * @vdev_id: vdev id
683  * @beacon_interval: beacon interval
684  * @dtim_period: dtim period
685  * @is_restart: flag to check if it is vdev
686  * @disable_hw_ack: to update disable hw ack flag
687  * @hidden_ssid: hidden ssid
688  * @pmf_enabled: pmf enabled
689  * @ssid: ssid MAC
690  * @num_noa_descriptors: number of noa descriptors
691  * @preferred_tx_streams: preferred tx streams
692  * @preferred_rx_streams: preferred rx streams
693  * @cac_duration_ms: cac duration in milliseconds
694  * @regdomain: Regulatory domain
695  * @he_ops: HE ops
696  * @eht_ops: EHT ops
697  * @channel: Channel params required by target.
698  * @bcn_tx_rate_code: Beacon tx rate code.
699  * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev
700  * @mbssid_flags: MBSSID flags to FW
701  * @vdevid_trans: Tx VDEV ID
702  * @mlo_flags: Flags for multi-link operation
703  * @mlo_partner: Partner links for multi-link operation
704  * @mbssid_multi_group_flag: Flag to identify multi group mbssid support
705  * @mbssid_multi_group_id: Group id of current vdev
706  */
707 struct vdev_start_params {
708 	uint8_t vdev_id;
709 	uint32_t beacon_interval;
710 	uint32_t dtim_period;
711 	bool is_restart;
712 	uint32_t disable_hw_ack;
713 	bool hidden_ssid;
714 	bool pmf_enabled;
715 	struct wlan_ssid ssid;
716 	uint32_t num_noa_descriptors;
717 	uint32_t preferred_rx_streams;
718 	uint32_t preferred_tx_streams;
719 	uint32_t cac_duration_ms;
720 	uint32_t regdomain;
721 	uint32_t he_ops;
722 #ifdef WLAN_FEATURE_11BE
723 	uint32_t eht_ops;
724 #endif
725 	struct mlme_channel_param channel;
726 	enum mlme_bcn_tx_rate_code bcn_tx_rate_code;
727 	bool ldpc_rx_enabled;
728 	uint32_t mbssid_flags;
729 	uint8_t vdevid_trans;
730 #ifdef WLAN_FEATURE_11BE_MLO
731 	struct mlo_vdev_start_flags mlo_flags;
732 	struct mlo_vdev_start_partner_links mlo_partner;
733 #endif
734 	uint8_t mbssid_multi_group_flag;
735 	uint32_t mbssid_multi_group_id;
736 };
737 
738 /**
739  * struct vdev_set_params - vdev set cmd parameter
740  * @vdev_id: vdev id
741  * @param_id: parameter id
742  * @param_value: parameter value
743  */
744 struct vdev_set_params {
745 	uint32_t vdev_id;
746 	uint32_t param_id;
747 	uint32_t param_value;
748 };
749 
750 /**
751  * struct dev_set_param - vdev/pdev set param info
752  * @param_id: parameter id
753  * @param_value: parameter value
754  */
755 struct dev_set_param {
756 	uint32_t param_id;
757 	uint32_t param_value;
758 };
759 
760 /**
761  * struct set_multiple_pdev_vdev_param
762  * @param_type: enum of type mlme_dev_setparam
763  * @is_host_pdev_id: to indicate @dev_id holds host pdev id in case of pdev set
764  * param, need conversion to target pdev id before sending to fw.
765  * @dev_id: unique dev_id identifying the VDEV/PDEV
766  * @n_params: Number of parambers to set
767  * @params: pointer to dev_set_param structure
768  */
769 struct set_multiple_pdev_vdev_param {
770 	enum mlme_dev_setparam param_type;
771 	uint8_t is_host_pdev_id;
772 	uint8_t dev_id;
773 	uint8_t n_params;
774 	struct dev_set_param *params;
775 };
776 
777 /**
778  * struct set_rx_mac_filter - Set rx mac filter command parameters
779  * @vdev_id: Vdev id
780  * @mac: mac addr
781  * @freq: frequency
782  * @set: set or clear
783  */
784 struct set_rx_mac_filter {
785 	uint32_t vdev_id;
786 	uint8_t mac[QDF_MAC_ADDR_SIZE];
787 	uint32_t freq;
788 	bool set;
789 };
790 
791 static inline
792 QDF_STATUS mlme_check_index_setparam(struct dev_set_param *param,
793 				     uint32_t paramid, uint32_t paramvalue,
794 				     uint8_t index, uint8_t n_params)
795 {
796 	if (index >= n_params) {
797 		mlme_err("Index:%d OOB to fill param", index);
798 		return QDF_STATUS_E_FAILURE;
799 	}
800 	param[index].param_id = paramid;
801 	param[index].param_value = paramvalue;
802 	return QDF_STATUS_SUCCESS;
803 }
804 
805 /**
806  * struct vdev_set_mu_snif_param - vdev set mu sniffer cmd parameter
807  * @vdev_id: vdev id
808  * @mode: mu snif mode
809  * @num_user: max number of user
810  * @num_aid: number of set sta aid
811  * @aid: sta aids
812  */
813 
814 struct vdev_set_mu_snif_param {
815 	uint32_t vdev_id;
816 	uint32_t mode;
817 	uint32_t num_user;
818 	uint32_t num_aid;
819 	uint32_t aid[WLAN_MU_SNIF_MAX_AIDS];
820 };
821 
822 /**
823  * struct vdev_create_params - vdev create cmd parameter
824  * @vdev_id: interface id
825  * @vdev_stats_id_valid: flag to indicate valid stats id
826  * @vdev_stats_id: stats_id for stats collection
827  * @type: interface type
828  * @subtype: interface subtype
829  * @nss_2g: NSS for 2G
830  * @nss_5g: NSS for 5G
831  * @pdev_id: pdev id on pdev for this vdev
832  * @mbssid_flags: MBSS IE flags indicating vdev type
833  * @vdevid_trans: id of transmitting vdev for MBSS IE
834  * @special_vdev_mode: indicates special vdev mode
835  * @mlo_mac: Multilink Operation MAC address
836  */
837 struct vdev_create_params {
838 	uint8_t vdev_id;
839 	bool vdev_stats_id_valid;
840 	uint8_t vdev_stats_id;
841 	uint32_t type;
842 	uint32_t subtype;
843 	uint8_t nss_2g;
844 	uint8_t nss_5g;
845 	uint32_t pdev_id;
846 	uint32_t mbssid_flags;
847 	uint8_t vdevid_trans;
848 	bool special_vdev_mode;
849 #ifdef WLAN_FEATURE_11BE_MLO
850 	uint8_t mlo_mac[QDF_MAC_ADDR_SIZE];
851 #endif
852 };
853 
854 /**
855  * struct vdev_delete_params - vdev delete cmd parameter
856  * @vdev_id: vdev id
857  */
858 struct vdev_delete_params {
859 	uint8_t vdev_id;
860 };
861 
862 /**
863  * struct vdev_stop_params - vdev stop cmd parameter
864  * @vdev_id: vdev id
865  */
866 struct vdev_stop_params {
867 	uint8_t vdev_id;
868 };
869 
870 /**
871  * struct vdev_up_params - vdev up cmd parameter
872  * @vdev_id: vdev id
873  * @assoc_id: association id
874  * @profile_idx: profile index of the connected non-trans ap (mbssid case).
875  *		0  means invalid.
876  * @profile_num: the total profile numbers of non-trans aps (mbssid case).
877  *		0 means non-MBSS AP.
878  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
879  */
880 struct vdev_up_params {
881 	uint8_t vdev_id;
882 	uint16_t assoc_id;
883 	uint32_t profile_idx;
884 	uint32_t profile_num;
885 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
886 };
887 
888 /**
889  * struct vdev_down_params - vdev down cmd parameter
890  * @vdev_id: vdev id
891  */
892 struct vdev_down_params {
893 	uint8_t vdev_id;
894 };
895 
896 /**
897  * struct peer_delete_all_params - peer delete all request parameter
898  * @vdev_id: vdev id
899  * @peer_type_bitmap: Bitmap of type with bits corresponding to value from
900  * enum wlan_peer_type
901  */
902 struct peer_delete_all_params {
903 	uint8_t vdev_id;
904 	uint32_t peer_type_bitmap;
905 };
906 
907 #define AC_MAX 4
908 #define WMI_MUEDCA_PARAM_MASK 0xff
909 /**
910  * struct muedca_params - MU-EDCA parameters
911  * @pdev_id: pdev id
912  * @muedca_ecwmin: CWmin in exponential form
913  * @muedca_ecwmax: CWmax in exponential form
914  * @muedca_aifsn:  AIFSN parameter
915  * @muedca_acm:    ACM parameter
916  * @muedca_timer:  MU EDCA timer value
917  */
918 struct muedca_params {
919 	uint32_t pdev_id;
920 	uint8_t muedca_ecwmin[AC_MAX];      /* CWmin in exponential form */
921 	uint8_t muedca_ecwmax[AC_MAX];      /* CWmax in exponential form */
922 	uint8_t muedca_aifsn[AC_MAX];       /* AIFSN parameter */
923 	uint8_t muedca_acm[AC_MAX];         /* ACM parameter */
924 	uint8_t muedca_timer[AC_MAX];       /* MU EDCA timer value */
925 };
926 
927 /* Total 10 BSSIDs can be packed in a single measurement request buffer */
928 #define RTT_MAX_BSSIDS_TO_SCAN  10
929 
930 /**
931  * struct rtt_bssid_info - Store the parsed macaddr and BW from the measurement
932  *                         request buffer.
933  * @macaddr: Destination macaddr to scan
934  * @bw: packet bandwidth
935  */
936 struct rtt_bssid_info {
937 	uint8_t macaddr[QDF_MAC_ADDR_SIZE];
938 	uint8_t bw;
939 };
940 
941 /**
942  * struct rtt_channel_info - Store the parsed channel info from LOWI measurement
943  *                           request buffer.
944  * @freq: Channel frequency
945  * @cfreq1: Center frequency1
946  * @cfreq2: Center frequency2
947  * @phymode: Phymode
948  * @num_bssids: Number of bssids present in the measurement request buffer
949  * @bssid_info: Array to store BW and macaddr present in the measurement request
950  *              buffer.
951  */
952 struct rtt_channel_info {
953 	uint16_t freq;
954 	uint16_t cfreq1;
955 	uint16_t cfreq2;
956 	uint16_t phymode;
957 	uint16_t num_bssids;
958 	struct rtt_bssid_info bssid_info[RTT_MAX_BSSIDS_TO_SCAN];
959 };
960 
961 /**
962  * struct sr_prohibit_param - SR prohibit command parameter
963  *
964  * @vdev_id: vdev id
965  * @sr_he_siga_val15_allowed: HE_SIG_A_VAL15_ALLOWED is enabled/disabled
966  */
967 struct sr_prohibit_param {
968 	uint8_t vdev_id;
969 	bool sr_he_siga_val15_allowed;
970 };
971 #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */
972