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