xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
1 /*
2  * Copyright (c) 2019 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 };
89 
90 /**
91  * enum wlan_mlme_host_start_event_param - start/restart resp event
92  */
93 enum wlan_mlme_host_start_event_param {
94 	WLAN_MLME_HOST_VDEV_START_RESP_EVENT = 0,
95 	WLAN_MLME_HOST_VDEV_RESTART_RESP_EVENT,
96 };
97 
98 /**
99  * enum wlan_mlme_custom_aggr_type: custon aggregate type
100  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation
101  * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation
102  * @WLAN_MLME_CUSTOM_AGGR_TYPE_MAX: Max type
103  */
104 enum wlan_mlme_custom_aggr_type {
105 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU = 0,
106 	WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU = 1,
107 	WLAN_MLME_CUSTOM_AGGR_TYPE_MAX,
108 };
109 
110 /**
111  * struct sta_ps_params - sta ps cmd parameter
112  * @vdev_id: vdev id
113  * @param_id: sta ps parameter
114  * @value: sta ps parameter value
115  */
116 struct sta_ps_params {
117 	uint32_t vdev_id;
118 	uint32_t param_id;
119 	uint32_t value;
120 };
121 
122 /**
123  * struct tbttoffset_params - Tbttoffset event params
124  * @vdev_id: Virtual AP device identifier
125  * @tbttoffset : Tbttoffset for the virtual AP device
126  */
127 struct tbttoffset_params {
128 	uint32_t vdev_id;
129 	uint32_t tbttoffset;
130 };
131 
132 /**
133  * struct beacon_tmpl_params - beacon template cmd parameter
134  * @vdev_id: vdev id
135  * @tim_ie_offset: tim ie offset
136  * @mbssid_ie_offset: mbssid ie offset
137  * @tmpl_len: beacon template length
138  * @tmpl_len_aligned: beacon template alignment
139  * @csa_switch_count_offset: CSA swith count offset in beacon frame
140  * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
141  * @esp_ie_offset: ESP IE offset in beacon frame
142  * @frm: beacon template parameter
143  */
144 struct beacon_tmpl_params {
145 	uint8_t vdev_id;
146 	uint32_t tim_ie_offset;
147 	uint32_t mbssid_ie_offset;
148 	uint32_t tmpl_len;
149 	uint32_t tmpl_len_aligned;
150 	uint32_t csa_switch_count_offset;
151 	uint32_t ext_csa_switch_count_offset;
152 	uint32_t esp_ie_offset;
153 	uint8_t *frm;
154 };
155 
156 /**
157  * struct beacon_params - beacon cmd parameter
158  * @vdev_id: vdev id
159  * @beacon_interval: Beacon interval
160  * @wbuf: beacon buffer
161  * @frame_ctrl: frame control field
162  * @bcn_txant: beacon antenna
163  * @is_dtim_count_zero: is it dtim beacon
164  * @is_bitctl_reqd: is Bit control required
165  * @is_high_latency: Is this high latency target
166  */
167 struct beacon_params {
168 	uint8_t vdev_id;
169 	uint16_t beacon_interval;
170 	qdf_nbuf_t wbuf;
171 	uint16_t frame_ctrl;
172 	uint32_t bcn_txant;
173 	bool is_dtim_count_zero;
174 	bool is_bitctl_reqd;
175 	bool is_high_latency;
176 };
177 
178 /* struct fils_discovery_tmpl_params - FILS Discovery template cmd parameter
179  * @vdev_id: vdev ID
180  * @tmpl_len: FILS Discovery template length
181  * @tmpl_aligned: FILS Discovery template alignment
182  * @frm: FILS Discovery template parameter
183  */
184 struct fils_discovery_tmpl_params {
185 	uint8_t vdev_id;
186 	uint32_t tmpl_len;
187 	uint32_t tmpl_len_aligned;
188 	uint8_t *frm;
189 };
190 
191 /**
192  * struct mlme_channel_param - Channel parameters with all
193  *			info required by target.
194  * @chan_id: channel id
195  * @pwr: channel power
196  * @mhz: channel frequency
197  * @half_rate: is half rate
198  * @quarter_rate: is quarter rate
199  * @dfs_set: is dfs channel
200  * @dfs_set_cfreq2: is secondary freq dfs channel
201  * @is_chan_passive: is this passive channel
202  * @allow_ht: HT allowed in chan
203  * @allow_vht: VHT allowed on chan
204  * @set_agile: is agile mode
205  * @phy_mode: phymode (vht80 or ht40 or ...)
206  * @cfreq1: centre frequency on primary
207  * @cfreq2: centre frequency on secondary
208  * @maxpower: max power for channel
209  * @minpower: min power for channel
210  * @maxreqpower: Max regulatory power
211  * @antennamac: Max antenna
212  * @reg_class_id: Regulatory class id.
213  */
214 struct mlme_channel_param {
215 	uint8_t chan_id;
216 	uint8_t pwr;
217 	uint32_t mhz;
218 	uint32_t half_rate:1,
219 		quarter_rate:1,
220 		dfs_set:1,
221 		dfs_set_cfreq2:1,
222 		is_chan_passive:1,
223 		allow_ht:1,
224 		allow_vht:1,
225 		set_agile:1;
226 	enum wlan_phymode phy_mode;
227 	uint32_t cfreq1;
228 	uint32_t cfreq2;
229 	int8_t   maxpower;
230 	int8_t   minpower;
231 	int8_t   maxregpower;
232 	uint8_t  antennamax;
233 	uint8_t  reg_class_id;
234 };
235 
236 /**
237  * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter
238  * @pdev_id: Pdev identifier
239  * @requestor_id: Unique id identifying the module
240  * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC
241  * @cac_duration_ms: CAC duration on the given channel
242  * @num_vdevs: No. of vdevs that need to be restarted
243  * @ch_param: Pointer to channel_param
244  * @vdev_ids: Pointer to array of vdev_ids
245  */
246 struct multiple_vdev_restart_params {
247 	uint32_t pdev_id;
248 	uint32_t requestor_id;
249 	uint32_t disable_hw_ack;
250 	uint32_t cac_duration_ms;
251 	uint32_t num_vdevs;
252 	struct mlme_channel_param ch_param;
253 	uint32_t vdev_ids[WLAN_UMAC_PDEV_MAX_VDEVS];
254 };
255 
256 /**
257  * struct peer_flush_params - peer flush cmd parameter
258  * @peer_tid_bitmap: peer tid bitmap
259  * @vdev_id: vdev id
260  * @peer_mac: peer mac address
261  */
262 struct peer_flush_params {
263 	uint32_t peer_tid_bitmap;
264 	uint8_t vdev_id;
265 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
266 };
267 
268 /**
269  * struct config_ratemask_params - ratemask config parameters
270  * @vdev_id: vdev id
271  * @type: Type
272  * @lower32: Lower 32 bits in the 1st 64-bit value
273  * @higher32: Higher 32 bits in the 1st 64-bit value
274  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
275  */
276 struct config_ratemask_params {
277 	uint8_t vdev_id;
278 	uint8_t type;
279 	uint32_t lower32;
280 	uint32_t higher32;
281 	uint32_t lower32_2;
282 };
283 
284 /**
285  * struct set_custom_aggr_size_params - custom aggr size params
286  * @vdev_id : vdev id
287  * @tx_aggr_size : TX aggr size
288  * @rx_aggr_size : RX aggr size
289  * @enable_bitmap: Bitmap for aggr size check
290  */
291 struct set_custom_aggr_size_params {
292 	uint32_t  vdev_id;
293 	uint32_t tx_aggr_size;
294 	uint32_t rx_aggr_size;
295 	uint32_t ac:2,
296 		 aggr_type:1,
297 		 tx_aggr_size_disable:1,
298 		 rx_aggr_size_disable:1,
299 		 tx_ac_enable:1,
300 		 reserved:26;
301 };
302 
303 /**
304  * struct sifs_trigger_param - sifs_trigger cmd parameter
305  * @vdev_id: vdev id
306  * @param_value: parameter value
307  */
308 struct sifs_trigger_param {
309 	uint32_t vdev_id;
310 	uint32_t param_value;
311 };
312 
313 /**
314  * struct set_neighbour_rx_params - Neighbour RX params
315  * @vdev_id: vdev id
316  * @idx: index of param
317  * @action: action
318  * @type: Type of param
319  */
320 struct set_neighbour_rx_params {
321 	uint8_t vdev_id;
322 	uint32_t idx;
323 	uint32_t action;
324 	uint32_t type;
325 };
326 
327 /**
328  * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter
329  * @vdev_id: vdev id
330  * @bssid_addr: BSSID address
331  * @client_addr: client address
332  * @chan_num: channel number
333  * @action:NAC_RSSI action,
334  */
335 struct vdev_scan_nac_rssi_params {
336 	uint32_t vdev_id;
337 	uint8_t bssid_addr[QDF_MAC_ADDR_SIZE];
338 	uint8_t client_addr[QDF_MAC_ADDR_SIZE];
339 	uint32_t chan_num;
340 	uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */
341 };
342 
343 /**
344  * struct vdev_start_params - vdev start cmd parameter
345  * @vdev_id: vdev id
346  * @beacon_interval: beacon interval
347  * @dtim_period: dtim period
348  * @is_restart: flag to check if it is vdev
349  * @disable_hw_ack: to update disable hw ack flag
350  * @hidden_ssid: hidden ssid
351  * @pmf_enabled: pmf enabled
352  * @ssid: ssid MAC
353  * @num_noa_descriptors: number of noa descriptors
354  * @preferred_tx_streams: preferred tx streams
355  * @preferred_rx_streams: preferred rx streams
356  * @cac_duration_ms: cac duration in milliseconds
357  * @regdomain: Regulatory domain
358  * @he_ops: HE ops
359  * @channel_param: Channel params required by target.
360  * @bcn_tx_rate_code: Beacon tx rate code.
361  * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev
362  */
363 struct vdev_start_params {
364 	uint8_t vdev_id;
365 	uint32_t beacon_interval;
366 	uint32_t dtim_period;
367 	bool is_restart;
368 	uint32_t disable_hw_ack;
369 	bool hidden_ssid;
370 	bool pmf_enabled;
371 	struct mlme_mac_ssid ssid;
372 	uint32_t num_noa_descriptors;
373 	uint32_t preferred_rx_streams;
374 	uint32_t preferred_tx_streams;
375 	uint32_t cac_duration_ms;
376 	uint32_t regdomain;
377 	uint32_t he_ops;
378 	struct mlme_channel_param channel;
379 	enum mlme_bcn_tx_rate_code bcn_tx_rate_code;
380 	bool ldpc_rx_enabled;
381 };
382 
383 /**
384  * struct vdev_set_params - vdev set cmd parameter
385  * @vdev_id: vdev id
386  * @param_id: parameter id
387  * @param_value: parameter value
388  */
389 struct vdev_set_params {
390 	uint32_t vdev_id;
391 	uint32_t param_id;
392 	uint32_t param_value;
393 };
394 
395 /**
396  * struct vdev_create_params - vdev create cmd parameter
397  * @vdev_id: interface id
398  * @type: interface type
399  * @subtype: interface subtype
400  * @nss_2g: NSS for 2G
401  * @nss_5g: NSS for 5G
402  * @pdev_id: pdev id on pdev for this vdev
403  * @mbssid_flags: MBSS IE flags indicating vdev type
404  * @vdevid_trans: id of transmitting vdev for MBSS IE
405  */
406 struct vdev_create_params {
407 	uint8_t vdev_id;
408 	uint32_t type;
409 	uint32_t subtype;
410 	uint8_t nss_2g;
411 	uint8_t nss_5g;
412 	uint32_t pdev_id;
413 	uint32_t mbssid_flags;
414 	uint8_t vdevid_trans;
415 };
416 
417 /**
418  * struct vdev_delete_params - vdev delete cmd parameter
419  * @vdev_id: vdev id
420  */
421 struct vdev_delete_params {
422 	uint8_t vdev_id;
423 };
424 
425 /**
426  * struct vdev_stop_params - vdev stop cmd parameter
427  * @vdev_id: vdev id
428  */
429 struct vdev_stop_params {
430 	uint8_t vdev_id;
431 };
432 
433 /**
434  * struct vdev_up_params - vdev up cmd parameter
435  * @vdev_id: vdev id
436  * @assoc_id: association id
437  * @profile_idx: profile index of the connected non-trans ap (mbssid case).
438  *		0  means invalid.
439  * @profile_num: the total profile numbers of non-trans aps (mbssid case).
440  *		0 means non-MBSS AP.
441  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
442  */
443 struct vdev_up_params {
444 	uint8_t vdev_id;
445 	uint16_t assoc_id;
446 	uint32_t profile_idx;
447 	uint32_t profile_num;
448 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
449 };
450 
451 /**
452  * struct vdev_down_params - vdev down cmd parameter
453  * @vdev_id: vdev id
454  */
455 struct vdev_down_params {
456 	uint8_t vdev_id;
457 };
458 
459 /**
460  * struct peer_delete_all_params - peer delete all request parameter
461  * @vdev_id: vdev id
462  */
463 struct peer_delete_all_params {
464 	uint8_t vdev_id;
465 };
466 
467 #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */
468