xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h (revision 45a38684b07295822dc8eba39e293408f203eec8)
1 /*
2  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: wlan_vdev_mgr_tgt_if_tx_defs.h
21  *
22  * This file provides definitions to data structures required for vdev Tx ops
23  */
24 
25 #ifndef __WLAN_VDEV_MGR_TX_OPS_DEFS_H__
26 #define __WLAN_VDEV_MGR_TX_OPS_DEFS_H__
27 
28 #include <qdf_nbuf.h>
29 
30 /** slot time long */
31 #define WLAN_MLME_VDEV_SLOT_TIME_LONG   0x1
32 /** slot time short */
33 #define WLAN_MLME_VDEV_SLOT_TIME_SHORT  0x2
34 
35 /**
36  * enum MLME_bcn_tx_rate_code - beacon tx rate code
37  */
38 enum mlme_bcn_tx_rate_code {
39 	MLME_BCN_TX_RATE_CODE_1_M = 0x43,
40 	MLME_BCN_TX_RATE_CODE_2_M = 0x42,
41 	MLME_BCN_TX_RATE_CODE_5_5_M = 0x41,
42 	MLME_BCN_TX_RATE_CODE_6_M = 0x03,
43 	MLME_BCN_TX_RATE_CODE_9_M = 0x07,
44 	MLME_BCN_TX_RATE_CODE_11M = 0x40,
45 	MLME_BCN_TX_RATE_CODE_12_M = 0x02,
46 	MLME_BCN_TX_RATE_CODE_18_M = 0x06,
47 	MLME_BCN_TX_RATE_CODE_24_M = 0x01,
48 	MLME_BCN_TX_RATE_CODE_36_M = 0x05,
49 	MLME_BCN_TX_RATE_CODE_48_M = 0x00,
50 	MLME_BCN_TX_RATE_CODE_54_M = 0x04,
51 };
52 
53 /**
54  * enum wlan_mlme_host_sta_ps_param_uapsd - STA UPASD params
55  */
56 enum wlan_mlme_host_sta_ps_param_uapsd {
57 	WLAN_MLME_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
58 	WLAN_MLME_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN  = (1 << 1),
59 	WLAN_MLME_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
60 	WLAN_MLME_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN  = (1 << 3),
61 	WLAN_MLME_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
62 	WLAN_MLME_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN  = (1 << 5),
63 	WLAN_MLME_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
64 	WLAN_MLME_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN  = (1 << 7),
65 };
66 
67 /**
68  * enum wlan_mlme_host_vdev_start_status - vdev start status code
69  */
70 enum wlan_mlme_host_vdev_start_status {
71 	WLAN_MLME_HOST_VDEV_START_OK = 0,
72 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID,
73 	WLAN_MLME_HOST_VDEV_START_CHAN_BLOCKED,
74 	WLAN_MLME_HOST_VDEV_START_CHAN_DFS_VIOLATION,
75 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_REGDOMAIN,
76 	WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_BAND,
77 	WLAN_MLME_HOST_VDEV_START_TIMEOUT,
78 	/* Add new response status code from here */
79 	WLAN_MLME_HOST_VDEV_START_MAX_REASON,
80 };
81 
82 /**
83  * string_from_start_rsp_status() - Convert start response status to string
84  * @start_rsp - start response status
85  *
86  * Please note to add new string in the array at index equal to
87  * its enum value in wlan_mlme_host_vdev_start_status.
88  */
89 static inline char *string_from_start_rsp_status(
90 			enum wlan_mlme_host_vdev_start_status start_rsp)
91 {
92 	static const char *strings[] = { "START_OK",
93 					"CHAN_INVALID",
94 					"CHAN_BLOCKED",
95 					"CHAN_DFS_VIOLATION",
96 					"CHAN_INVALID_REGDOMAIN",
97 					"CHAN_INVALID_BAND",
98 					"START_RESPONSE_TIMEOUT",
99 					"START_RESPONSE_UNKNOWN"};
100 
101 	if (start_rsp >= WLAN_MLME_HOST_VDEV_START_MAX_REASON)
102 		start_rsp = WLAN_MLME_HOST_VDEV_START_MAX_REASON;
103 
104 	return (char *)strings[start_rsp];
105 }
106 
107 /**
108  * enum wlan_mlme_host_start_event_param - start/restart resp event
109  */
110 enum wlan_mlme_host_start_event_param {
111 	WLAN_MLME_HOST_VDEV_START_RESP_EVENT = 0,
112 	WLAN_MLME_HOST_VDEV_RESTART_RESP_EVENT,
113 };
114 
115 /**
116  * enum wlan_mlme_custom_aggr_type: custon aggregate type
117  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation
118  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation
119  * @WLAN_MLME_CUSTOM_AGGR_TYPE_MAX: Max type
120  */
121 enum wlan_mlme_custom_aggr_type {
122 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU = 0,
123 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU = 1,
124 	WLAN_MLME_CUSTOM_AGGR_TYPE_MAX,
125 };
126 
127 /**
128  * struct sta_ps_params - sta ps cmd parameter
129  * @vdev_id: vdev id
130  * @param_id: sta ps parameter
131  * @value: sta ps parameter value
132  */
133 struct sta_ps_params {
134 	uint32_t vdev_id;
135 	uint32_t param_id;
136 	uint32_t value;
137 };
138 
139 /**
140  * struct rnr_bss_tbtt_info_param: Reported Vdev info
141  * @bss_mac: Mac address
142  * @beacon_intval: Beacon interval of reported AP
143  * @opclass: Channel Opclass
144  * @chan_idx: Channel number
145  * @next_qtime_tbtt_high: Tbtt higher 32bit
146  * @next_qtime_tbtt_low: Tbtt lower 32bit
147  */
148 struct rnr_bss_tbtt_info_param {
149 	uint8_t bss_mac[QDF_MAC_ADDR_SIZE];
150 	uint32_t beacon_intval;
151 	uint32_t opclass;
152 	uint32_t chan_idx;
153 	uint32_t next_qtime_tbtt_high;
154 	uint32_t next_qtime_tbtt_low;
155 };
156 
157 /**
158  * struct rnr_tbtt_multisoc_sync_param - Params to
159  * sync tbtt with non self SoCs timers
160  * @pdev_id: Host pdev_id
161  * @rnr_vap_count: Count of Vap to be included in WMI cmd
162  * @cmd_type: Set/Get tbtt sync info
163  * @rnr_bss_tbtt: Reported AP Vap info
164  */
165 struct rnr_tbtt_multisoc_sync_param {
166 	uint32_t pdev_id;
167 	uint8_t rnr_vap_count;
168 	uint8_t cmd_type;
169 	struct rnr_bss_tbtt_info_param *rnr_bss_tbtt;
170 };
171 
172 /**
173  * struct tbttoffset_params - Tbttoffset event params
174  * @vdev_id: Virtual AP device identifier
175  * @tbttoffset : Tbttoffset for the virtual AP device
176  * @vdev_tbtt_qtime_lo: Tbtt qtime low value
177  * @vdev_tbtt_qtime_hi: Tbtt qtime high value
178  */
179 struct tbttoffset_params {
180 	uint32_t vdev_id;
181 	uint32_t tbttoffset;
182 	uint32_t vdev_tbtt_qtime_lo;
183 	uint32_t vdev_tbtt_qtime_hi;
184 };
185 
186 /**
187  * struct beacon_tmpl_params - beacon template cmd parameter
188  * @vdev_id: vdev id
189  * @tim_ie_offset: tim ie offset
190  * @mbssid_ie_offset: mbssid ie offset
191  * @tmpl_len: beacon template length
192  * @tmpl_len_aligned: beacon template alignment
193  * @csa_switch_count_offset: CSA swith count offset in beacon frame
194  * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
195  * @esp_ie_offset: ESP IE offset in beacon frame
196  * @mu_edca_ie_offset: Mu EDCA IE offset in beacon frame
197  * @ema_params: The 4 octets in this field respectively indicate
198  *     ema_beacon_profile_periodicity, ema_beacon_tmpl_idx,
199  *     ema_first_tmpl and ema_last_tmpl in the order of low
200  *     to high
201  * @enable_bigtk: enable bigtk or not
202  * @frm: beacon template parameter
203  */
204 struct beacon_tmpl_params {
205 	uint8_t vdev_id;
206 	uint32_t tim_ie_offset;
207 	uint32_t mbssid_ie_offset;
208 	uint32_t tmpl_len;
209 	uint32_t tmpl_len_aligned;
210 	uint32_t csa_switch_count_offset;
211 	uint32_t ext_csa_switch_count_offset;
212 	uint32_t esp_ie_offset;
213 	uint32_t mu_edca_ie_offset;
214 	uint32_t ema_params;
215 	bool enable_bigtk;
216 	uint8_t *frm;
217 };
218 
219 /**
220  * struct beacon_params - beacon cmd parameter
221  * @vdev_id: vdev id
222  * @beacon_interval: Beacon interval
223  * @wbuf: beacon buffer
224  * @frame_ctrl: frame control field
225  * @bcn_txant: beacon antenna
226  * @is_dtim_count_zero: is it dtim beacon
227  * @is_bitctl_reqd: is Bit control required
228  * @is_high_latency: Is this high latency target
229  */
230 struct beacon_params {
231 	uint8_t vdev_id;
232 	uint16_t beacon_interval;
233 	qdf_nbuf_t wbuf;
234 	uint16_t frame_ctrl;
235 	uint32_t bcn_txant;
236 	bool is_dtim_count_zero;
237 	bool is_bitctl_reqd;
238 	bool is_high_latency;
239 };
240 
241 /* struct fils_discovery_tmpl_params - FILS Discovery template cmd parameter
242  * @vdev_id: vdev ID
243  * @tmpl_len: FILS Discovery template length
244  * @tmpl_aligned: FILS Discovery template alignment
245  * @frm: FILS Discovery template parameter
246  */
247 struct fils_discovery_tmpl_params {
248 	uint8_t vdev_id;
249 	uint32_t tmpl_len;
250 	uint32_t tmpl_len_aligned;
251 	uint8_t *frm;
252 };
253 
254 /**
255  * struct mlme_channel_param - Channel parameters with all
256  *			info required by target.
257  * @chan_id: channel id
258  * @pwr: channel power
259  * @mhz: channel frequency
260  * @half_rate: is half rate
261  * @quarter_rate: is quarter rate
262  * @dfs_set: is dfs channel
263  * @dfs_set_cfreq2: is secondary freq dfs channel
264  * @is_chan_passive: is this passive channel
265  * @allow_ht: HT allowed in chan
266  * @allow_vht: VHT allowed on chan
267  * @set_agile: is agile mode
268  * @phy_mode: phymode (vht80 or ht40 or ...)
269  * @cfreq1: centre frequency on primary
270  * @cfreq2: centre frequency on secondary
271  * @maxpower: max power for channel
272  * @minpower: min power for channel
273  * @maxreqpower: Max regulatory power
274  * @antennamac: Max antenna
275  * @reg_class_id: Regulatory class id.
276  */
277 struct mlme_channel_param {
278 	uint8_t chan_id;
279 	uint8_t pwr;
280 	uint32_t mhz;
281 	uint32_t half_rate:1,
282 		quarter_rate:1,
283 		dfs_set:1,
284 		dfs_set_cfreq2:1,
285 		is_chan_passive:1,
286 		allow_ht:1,
287 		allow_vht:1,
288 		set_agile:1;
289 	enum wlan_phymode phy_mode;
290 	uint32_t cfreq1;
291 	uint32_t cfreq2;
292 	int8_t   maxpower;
293 	int8_t   minpower;
294 	int8_t   maxregpower;
295 	uint8_t  antennamax;
296 	uint8_t  reg_class_id;
297 };
298 
299 /**
300  * struct vdev_mlme_mvr_param - Multiple vdev restart params
301  * @phymode: phymode information
302  */
303 struct vdev_mlme_mvr_param {
304 	uint32_t phymode;
305 };
306 
307 /**
308  * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter
309  * @pdev_id: Pdev identifier
310  * @requestor_id: Unique id identifying the module
311  * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC
312  * @cac_duration_ms: CAC duration on the given channel
313  * @num_vdevs: No. of vdevs that need to be restarted
314  * @ch_param: Pointer to channel_param
315  * @vdev_ids: Pointer to array of vdev_ids
316  * @mvr_param: array holding multi vdev restart param
317  */
318 struct multiple_vdev_restart_params {
319 	uint32_t pdev_id;
320 	uint32_t requestor_id;
321 	uint32_t disable_hw_ack;
322 	uint32_t cac_duration_ms;
323 	uint32_t num_vdevs;
324 	struct mlme_channel_param ch_param;
325 	uint32_t vdev_ids[WLAN_UMAC_PDEV_MAX_VDEVS];
326 	struct vdev_mlme_mvr_param mvr_param[WLAN_UMAC_PDEV_MAX_VDEVS];
327 };
328 
329 /**
330  * struct peer_flush_params - peer flush cmd parameter
331  * @peer_tid_bitmap: peer tid bitmap
332  * @vdev_id: vdev id
333  * @peer_mac: peer mac address
334  */
335 struct peer_flush_params {
336 	uint32_t peer_tid_bitmap;
337 	uint8_t vdev_id;
338 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
339 };
340 
341 /* Default FILS DISCOVERY/probe response sent in period of 20TU */
342 #define DEFAULT_FILS_DISCOVERY_PERIOD 20
343 #define DEFAULT_PROBE_RESP_PERIOD 20
344 
345 /**
346  * struct config_fils_params - FILS config params
347  * @vdev_id:  vdev id
348  * @fd_period:  0 - Disabled, non-zero - Period in ms (mili seconds)
349  * @send_prb_rsp_frame: send broadcast prb resp frame
350  */
351 struct config_fils_params {
352 	uint8_t vdev_id;
353 	uint32_t fd_period;
354 	uint32_t send_prb_rsp_frame: 1;
355 };
356 
357 /**
358  * struct config_ratemask_params - ratemask config parameters
359  * @vdev_id: vdev id
360  * @type: Type
361  * @lower32: Lower 32 bits in the 1st 64-bit value
362  * @higher32: Higher 32 bits in the 1st 64-bit value
363  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
364  */
365 struct config_ratemask_params {
366 	uint8_t vdev_id;
367 	uint8_t type;
368 	uint32_t lower32;
369 	uint32_t higher32;
370 	uint32_t lower32_2;
371 };
372 
373 /**
374  * struct set_custom_aggr_size_params - custom aggr size params
375  * @vdev_id : vdev id
376  * @tx_aggr_size : TX aggr size
377  * @rx_aggr_size : RX aggr size
378  * @enable_bitmap: Bitmap for aggr size check
379  */
380 struct set_custom_aggr_size_params {
381 	uint32_t  vdev_id;
382 	uint32_t tx_aggr_size;
383 	uint32_t rx_aggr_size;
384 	uint32_t ac:2,
385 		 aggr_type:1,
386 		 tx_aggr_size_disable:1,
387 		 rx_aggr_size_disable:1,
388 		 tx_ac_enable:1,
389 		 reserved:26;
390 };
391 
392 /**
393  * struct sifs_trigger_param - sifs_trigger cmd parameter
394  * @vdev_id: vdev id
395  * @param_value: parameter value
396  */
397 struct sifs_trigger_param {
398 	uint32_t vdev_id;
399 	uint32_t param_value;
400 };
401 
402 /**
403  * struct set_neighbour_rx_params - Neighbour RX params
404  * @vdev_id: vdev id
405  * @idx: index of param
406  * @action: action
407  * @type: Type of param
408  */
409 struct set_neighbour_rx_params {
410 	uint8_t vdev_id;
411 	uint32_t idx;
412 	uint32_t action;
413 	uint32_t type;
414 };
415 
416 /**
417  * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter
418  * @vdev_id: vdev id
419  * @bssid_addr: BSSID address
420  * @client_addr: client address
421  * @chan_num: channel number
422  * @action:NAC_RSSI action,
423  */
424 struct vdev_scan_nac_rssi_params {
425 	uint32_t vdev_id;
426 	uint8_t bssid_addr[QDF_MAC_ADDR_SIZE];
427 	uint8_t client_addr[QDF_MAC_ADDR_SIZE];
428 	uint32_t chan_num;
429 	uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */
430 };
431 
432 /**
433  * struct vdev_start_params - vdev start cmd parameter
434  * @vdev_id: vdev id
435  * @beacon_interval: beacon interval
436  * @dtim_period: dtim period
437  * @is_restart: flag to check if it is vdev
438  * @disable_hw_ack: to update disable hw ack flag
439  * @hidden_ssid: hidden ssid
440  * @pmf_enabled: pmf enabled
441  * @ssid: ssid MAC
442  * @num_noa_descriptors: number of noa descriptors
443  * @preferred_tx_streams: preferred tx streams
444  * @preferred_rx_streams: preferred rx streams
445  * @cac_duration_ms: cac duration in milliseconds
446  * @regdomain: Regulatory domain
447  * @he_ops: HE ops
448  * @channel_param: Channel params required by target.
449  * @bcn_tx_rate_code: Beacon tx rate code.
450  * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev
451  */
452 struct vdev_start_params {
453 	uint8_t vdev_id;
454 	uint32_t beacon_interval;
455 	uint32_t dtim_period;
456 	bool is_restart;
457 	uint32_t disable_hw_ack;
458 	bool hidden_ssid;
459 	bool pmf_enabled;
460 	struct wlan_ssid ssid;
461 	uint32_t num_noa_descriptors;
462 	uint32_t preferred_rx_streams;
463 	uint32_t preferred_tx_streams;
464 	uint32_t cac_duration_ms;
465 	uint32_t regdomain;
466 	uint32_t he_ops;
467 	struct mlme_channel_param channel;
468 	enum mlme_bcn_tx_rate_code bcn_tx_rate_code;
469 	bool ldpc_rx_enabled;
470 };
471 
472 /**
473  * struct vdev_set_params - vdev set cmd parameter
474  * @vdev_id: vdev id
475  * @param_id: parameter id
476  * @param_value: parameter value
477  */
478 struct vdev_set_params {
479 	uint32_t vdev_id;
480 	uint32_t param_id;
481 	uint32_t param_value;
482 };
483 
484 /**
485  * struct vdev_create_params - vdev create cmd parameter
486  * @vdev_id: interface id
487  * @type: interface type
488  * @subtype: interface subtype
489  * @nss_2g: NSS for 2G
490  * @nss_5g: NSS for 5G
491  * @pdev_id: pdev id on pdev for this vdev
492  * @mbssid_flags: MBSS IE flags indicating vdev type
493  * @vdevid_trans: id of transmitting vdev for MBSS IE
494  * @special_vdev_mode: indicates special vdev mode
495  */
496 struct vdev_create_params {
497 	uint8_t vdev_id;
498 	uint32_t type;
499 	uint32_t subtype;
500 	uint8_t nss_2g;
501 	uint8_t nss_5g;
502 	uint32_t pdev_id;
503 	uint32_t mbssid_flags;
504 	uint8_t vdevid_trans;
505 	bool special_vdev_mode;
506 };
507 
508 /**
509  * struct vdev_delete_params - vdev delete cmd parameter
510  * @vdev_id: vdev id
511  */
512 struct vdev_delete_params {
513 	uint8_t vdev_id;
514 };
515 
516 /**
517  * struct vdev_stop_params - vdev stop cmd parameter
518  * @vdev_id: vdev id
519  */
520 struct vdev_stop_params {
521 	uint8_t vdev_id;
522 };
523 
524 /**
525  * struct vdev_up_params - vdev up cmd parameter
526  * @vdev_id: vdev id
527  * @assoc_id: association id
528  * @profile_idx: profile index of the connected non-trans ap (mbssid case).
529  *		0  means invalid.
530  * @profile_num: the total profile numbers of non-trans aps (mbssid case).
531  *		0 means non-MBSS AP.
532  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
533  */
534 struct vdev_up_params {
535 	uint8_t vdev_id;
536 	uint16_t assoc_id;
537 	uint32_t profile_idx;
538 	uint32_t profile_num;
539 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
540 };
541 
542 /**
543  * struct vdev_down_params - vdev down cmd parameter
544  * @vdev_id: vdev id
545  */
546 struct vdev_down_params {
547 	uint8_t vdev_id;
548 };
549 
550 /**
551  * struct peer_delete_all_params - peer delete all request parameter
552  * @vdev_id: vdev id
553  */
554 struct peer_delete_all_params {
555 	uint8_t vdev_id;
556 };
557 
558 #define AC_MAX 4
559 #define WMI_MUEDCA_PARAM_MASK 0xff
560 /**
561  * struct muedca_params - MU-EDCA parameters
562  * @muedca_ecwmin: CWmin in exponential form
563  * @muedca_ecwmax: CWmax in exponential form
564  * @muedca_aifsn:  AIFSN parameter
565  * @muedca_acm:    ACM parameter
566  * @muedca_timer:  MU EDCA timer value
567  */
568 struct muedca_params {
569 	uint32_t pdev_id;
570 	uint8_t muedca_ecwmin[AC_MAX];      /* CWmin in exponential form */
571 	uint8_t muedca_ecwmax[AC_MAX];      /* CWmax in exponential form */
572 	uint8_t muedca_aifsn[AC_MAX];       /* AIFSN parameter */
573 	uint8_t muedca_acm[AC_MAX];         /* ACM parameter */
574 	uint8_t muedca_timer[AC_MAX];       /* MU EDCA timer value */
575 };
576 
577 #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */
578