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