xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_sta_param.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 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  * This file contains the API definitions for the STA WMI APIs.
22  */
23 
24 #ifndef _WMI_UNIFIED_STA_PARAM_H_
25 #define _WMI_UNIFIED_STA_PARAM_H_
26 
27 /**
28  * struct sta_keep_alive_params - sta keep alive parameters
29  * @vdev_id: vdev id
30  * @method: keep alive method
31  * @timeperiod: time to keep alive
32  * @hostv4addr: host ipv4 address
33  * @destv4addr: destination ipv4 address
34  * @destmac: destination mac address
35  */
36 struct sta_keep_alive_params {
37 	uint8_t vdev_id;
38 	uint32_t method;
39 	uint32_t timeperiod;
40 	uint8_t hostv4addr[QDF_IPV4_ADDR_SIZE];
41 	uint8_t destv4addr[QDF_IPV4_ADDR_SIZE];
42 	uint8_t destmac[QDF_MAC_ADDR_SIZE];
43 };
44 
45 /**
46  * struct gtx_config_t - GTX config
47  * @gtx_rt_mask: for HT and VHT rate masks
48  * @gtx_usrcfg: host request for GTX mask
49  * @gtx_threshold: PER Threshold (default: 10%)
50  * @gtx_margin: PER margin (default: 2%)
51  * @gtx_tcpstep: TCP step (default: 1)
52  * @gtx_tpcMin: TCP min (default: 5)
53  * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
54  */
55 struct wmi_gtx_config {
56 	uint32_t gtx_rt_mask[2];
57 	uint32_t gtx_usrcfg;
58 	uint32_t gtx_threshold;
59 	uint32_t gtx_margin;
60 	uint32_t gtx_tpcstep;
61 	uint32_t gtx_tpcmin;
62 	uint32_t gtx_bwmask;
63 };
64 
65 /**
66  * struct wlm_latency_level_param - WLM parameters
67  * @wlm_latency_level: wlm latency level to set
68  *  0 - normal, 1 - moderate, 2 - low, 3 - ultralow
69  * @wlm_latency_flags: wlm latency flags to set
70  *  |31  12|  11  |  10  |9    8|7    6|5    4|3    2|  1  |  0  |
71  *  +------+------+------+------+------+------+------+-----+-----+
72  *  | RSVD | SSLP | CSLP | RSVD | Roam | RSVD | DWLT | DFS | SUP |
73  *  +------+-------------+-------------+-------------------------+
74  *  |  WAL |      PS     |     Roam    |         Scan            |
75  *
76  *  bit 0: Avoid scan request from HLOS if setting
77  *  bit 1: Skip DFS channel SCAN if setting
78  *  bit 2-3: Define policy of dwell time/duration for each foreign channel
79  *     (b2 b3)
80  *     (0  0 ): Default scan dwell time
81  *     (0  1 ): Reserve
82  *     (1  0 ): Shrink off channel dwell time
83  *     (1  1 ): Reserve
84  *  bit 4-5: Reserve for scan
85  *  bit 6-7: Define roaming policy
86  *     (b6 b7)
87  *     (0  0 ): Default roaming behavior, allow roaming in all scenarios
88  *     (0  1 ): Disallow all roaming
89  *     (1  0 ): Allow roaming when final bmissed
90  *     (1  1 ): Reserve
91  *  bit 8-9: Reserve for roaming
92  *  bit 10: Disable css power collapse if setting
93  *  bit 11: Disable sys sleep if setting
94  *  bit 12-31: Reserve for future useage
95  * @vdev_id: vdev id
96  * @force_reset: bit 0 used as force reset to override the latency level as
97  * default for all the wlm clients
98  * @client_id_bitmask: clients of WLM Arbiter
99  */
100 struct wlm_latency_level_param {
101 	uint16_t wlm_latency_level;
102 	uint32_t wlm_latency_flags;
103 	uint16_t vdev_id;
104 #ifdef MULTI_CLIENT_LL_SUPPORT
105 	uint32_t force_reset;
106 	uint32_t client_id_bitmask;
107 #endif
108 };
109 
110 #define WMI_2_4_GHZ_MAX_FREQ  3000
111 
112 /**
113  * struct vdev_ie_info_param - IE info
114  * @vdev_id - vdev for which the IE is being sent
115  * @ie_id - ID of the IE
116  * @length - length of the IE data
117  * @data - IE data
118  *
119  * This structure is used to store the IE information.
120  */
121 struct vdev_ie_info_param {
122 	uint32_t vdev_id;
123 	uint32_t ie_id;
124 	uint32_t length;
125 	uint32_t ie_source;
126 	uint32_t band;
127 	uint8_t *data;
128 };
129 
130 #define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
131 /**
132  * struct sar_limit_cmd_row - sar limits row
133  * @band_id: Optional param for frequency band
134  *           See %enum wmi_sar_band_id_flags for possible values
135  * @chain_id: Optional param for antenna chain id
136  * @mod_id: Optional param for modulation scheme
137  *          See %enum wmi_sar_mod_id_flags for possible values
138  * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
139  * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
140  *                   See WMI_SAR_*_VALID_MASK for possible values
141  */
142 struct sar_limit_cmd_row {
143 	uint32_t band_id;
144 	uint32_t chain_id;
145 	uint32_t mod_id;
146 	uint32_t limit_value;
147 	uint32_t validity_bitmap;
148 };
149 
150 /**
151  * struct sar_limit_cmd_params - sar limits params
152  * @sar_enable: flag to enable SAR
153  *              See %enum wmi_sar_feature_state_flags for possible values
154  * @num_limit_rows: number of items in sar_limits
155  * @commit_limits: indicates firmware to start apply new SAR values
156  * @sar_limit_row_list: pointer to array of sar limit rows
157  */
158 struct sar_limit_cmd_params {
159 	uint32_t sar_enable;
160 	uint32_t num_limit_rows;
161 	uint32_t commit_limits;
162 	struct sar_limit_cmd_row *sar_limit_row_list;
163 };
164 
165 /**
166  * struct sar_limit_event_row - sar limits row
167  * @band_id: Frequency band.
168  *           See %enum wmi_sar_band_id_flags for possible values
169  * @chain_id: Chain id
170  * @mod_id: Modulation scheme
171  *          See %enum wmi_sar_mod_id_flags for possible values
172  * @limit_value: Power limits in steps of 0.5 dbm that is currently active for
173  *     the given @band_id, @chain_id, and @mod_id
174  */
175 struct sar_limit_event_row {
176 	uint32_t band_id;
177 	uint32_t chain_id;
178 	uint32_t mod_id;
179 	uint32_t limit_value;
180 };
181 
182 /**
183  * struct sar_limit_event - sar limits params
184  * @sar_enable: Current status of SAR enablement.
185  *              See %enum wmi_sar_feature_state_flags for possible values
186  * @num_limit_rows: number of items in sar_limits
187  * @sar_limit_row: array of sar limit rows. Only @num_limit_rows
188  *                 should be considered valid.
189  */
190 struct sar_limit_event {
191 	uint32_t sar_enable;
192 	uint32_t num_limit_rows;
193 	struct sar_limit_event_row
194 			sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED];
195 };
196 
197 #define WMI_UNIFIED_MAX_PMKID_LEN   16
198 #define WMI_UNIFIED_MAX_PMK_LEN     64
199 
200 /**
201  * struct wmi_unified_pmk_cache - used to set del pmkid cache
202  * @vdev_id: ID of the vdev being configured
203  * @pmk_len: PMK len
204  *	for big-endian hosts, manual endian conversion will be needed to keep
205  *	the array values in their original order in spite of the automatic
206  *	byte-swap applied to WMI messages during download
207  * @pmk: PMK array
208  * @pmkid_len: PMK ID Len
209  * @pmkid: PMK ID Array
210  * @bssid: BSSID
211  * @ssid: SSID
212  * @cache_id: PMK Cache ID
213  * @cat_flag: whether (bssid) or (ssid,cache_id) is valid
214  * @action_flag: add/delete the entry
215  * @is_flush_all: FLAG to indicate PMKSA flush. True if PMKSA cache flush is
216  * needed.
217  */
218 struct wmi_unified_pmk_cache {
219 	uint8_t             vdev_id;
220 	uint32_t            pmk_len;
221 	uint8_t             pmk[WMI_UNIFIED_MAX_PMK_LEN];
222 	uint32_t            pmkid_len;
223 	uint8_t             pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
224 	wmi_host_mac_addr   bssid;
225 	struct wlan_ssid    ssid;
226 	uint32_t            cache_id;
227 	uint32_t            cat_flag;
228 	uint32_t            action_flag;
229 	bool                is_flush_all;
230 };
231 
232 #define WMI_QOS_NUM_AC_MAX 4
233 
234 /**
235  * struct aggr_add_ts_param - ADDTS parameters
236  * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
237  * @tspec: tspec value
238  * @status: CDF status
239  * @sessionId: session id
240  * @vdev_id: vdev id
241  */
242 struct aggr_add_ts_param {
243 	uint16_t tspecIdx;
244 	struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
245 	QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
246 	uint8_t sessionId;
247 	uint8_t vdev_id;
248 };
249 
250 #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
251 /**
252  * struct periodic_tx_pattern - periodic tx pattern
253  * @mac_address: MAC Address for the adapter
254  * @ucPtrnId: Pattern ID
255  * @ucPtrnSize: Pattern size
256  * @usPtrnIntervalMs: in ms
257  * @ucPattern: Pattern buffer
258  */
259 struct periodic_tx_pattern {
260 	struct qdf_mac_addr mac_address;
261 	uint8_t ucPtrnId;
262 	uint16_t ucPtrnSize;
263 	uint32_t usPtrnIntervalMs;
264 	uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
265 };
266 
267 /**
268  * struct flashing_req_params - led flashing parameter
269  * @reqId: request id
270  * @pattern_id: pattern identifier. 0: disconnected 1: connected
271  * @led_x0: led flashing parameter0
272  * @led_x1: led flashing parameter1
273  */
274 struct flashing_req_params {
275 	uint32_t req_id;
276 	uint32_t pattern_id;
277 	uint32_t led_x0;
278 	uint32_t led_x1;
279 };
280 
281 /**
282  * struct wmi_pcl_chan_weights - Params to get the valid weighed list
283  * @pcl_list: channel freq list sorted in preferred order
284  * @pcl_len: Length of the PCL
285  * @saved_chan_list: Valid channel freq list updated as part of
286  * WMA_UPDATE_CHAN_LIST_REQ
287  * @saved_num_chan: Length of the valid channel list
288  * @weighed_valid_list: Weights of the valid channel list. This will have one
289  * to one mapping with valid_chan_list. FW expects channel order and size to be
290  * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
291  * @weight_list: Weights assigned by policy manager
292  */
293 struct wmi_pcl_chan_weights {
294 	uint32_t pcl_list[NUM_CHANNELS];
295 	uint32_t pcl_len;
296 	uint32_t saved_chan_list[NUM_CHANNELS];
297 	uint32_t saved_num_chan;
298 	uint8_t weighed_valid_list[NUM_CHANNELS];
299 	uint8_t weight_list[NUM_CHANNELS];
300 };
301 
302 /**
303  * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
304  * @vdev_id: vdev id
305  * @is_enabled: Adaptive dwell time is enabled/disabled
306  * @dwelltime_mode: global default adaptive dwell mode
307  * @lpf_weight: weight to calculate the average low pass
308  * filter for channel congestion
309  * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
310  * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
311  *
312  */
313 struct wmi_adaptive_dwelltime_params {
314 	uint32_t vdev_id;
315 	bool is_enabled;
316 	enum scan_dwelltime_adaptive_mode dwelltime_mode;
317 	uint8_t lpf_weight;
318 	uint8_t passive_mon_intval;
319 	uint8_t wifi_act_threshold;
320 };
321 
322 #define WMI_SCAN_CLIENT_MAX        7
323 
324 /**
325  * struct wmi_dbs_scan_sel_params - DBS scan selection params
326  * @num_clients: Number of scan clients dutycycle
327  * @pdev_id: pdev_id for identifying the MAC
328  * @module_id: scan client module id
329  * @num_dbs_scans: number of DBS scans
330  * @num_non_dbs_scans: number of non-DBS scans
331  */
332 struct wmi_dbs_scan_sel_params {
333 	uint32_t num_clients;
334 	uint32_t pdev_id;
335 	uint32_t module_id[WMI_SCAN_CLIENT_MAX];
336 	uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
337 	uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
338 };
339 
340 /**
341  * struct set_arp_stats - set/reset arp stats
342  * @vdev_id: session id
343  * @flag: enable/disable stats
344  * @pkt_type: type of packet(1 - arp)
345  * @ip_addr: subnet ipv4 address in case of encrypted packets
346  * @pkt_type_bitmap: pkt bitmap
347  * @tcp_src_port: tcp src port for pkt tracking
348  * @tcp_dst_port: tcp dst port for pkt tracking
349  * @icmp_ipv4: target ipv4 address to track ping packets
350  * @reserved: reserved
351  */
352 struct set_arp_stats {
353 	uint32_t vdev_id;
354 	uint8_t flag;
355 	uint8_t pkt_type;
356 	uint32_t ip_addr;
357 	uint32_t pkt_type_bitmap;
358 	uint32_t tcp_src_port;
359 	uint32_t tcp_dst_port;
360 	uint32_t icmp_ipv4;
361 	uint32_t reserved;
362 };
363 
364 /**
365  * struct get_arp_stats - get arp stats from firmware
366  * @pkt_type: packet type(1 - ARP)
367  * @vdev_id: session id
368  */
369 struct get_arp_stats {
370 	uint8_t pkt_type;
371 	uint32_t vdev_id;
372 };
373 
374 #endif /* _WMI_UNIFIED_STA_PARAM_H_ */
375