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