xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_sta_param.h (revision 8ddef7dd9a290d4a9b1efd5d3efacf51d78a1a0d)
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  */
208 struct wmi_unified_pmk_cache {
209 	uint8_t             vdev_id;
210 	uint32_t            pmk_len;
211 	uint8_t             pmk[WMI_UNIFIED_MAX_PMK_LEN];
212 	uint32_t            pmkid_len;
213 	uint8_t             pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
214 	wmi_host_mac_addr   bssid;
215 	struct mac_ssid     ssid;
216 	uint32_t            cache_id;
217 	uint32_t            cat_flag;
218 	uint32_t            action_flag;
219 };
220 
221 #define WMI_QOS_NUM_AC_MAX 4
222 
223 /**
224  * struct aggr_add_ts_param - ADDTS parameters
225  * @staIdx: station index
226  * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
227  * @tspec: tspec value
228  * @status: CDF status
229  * @sessionId: session id
230  * @vdev_id: vdev id
231  */
232 struct aggr_add_ts_param {
233 	uint16_t staIdx;
234 	uint16_t tspecIdx;
235 	struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
236 	QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
237 	uint8_t sessionId;
238 	uint8_t vdev_id;
239 };
240 
241 #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
242 /**
243  * struct periodic_tx_pattern - periodic tx pattern
244  * @mac_address: MAC Address for the adapter
245  * @ucPtrnId: Pattern ID
246  * @ucPtrnSize: Pattern size
247  * @usPtrnIntervalMs: in ms
248  * @ucPattern: Pattern buffer
249  */
250 struct periodic_tx_pattern {
251 	struct qdf_mac_addr mac_address;
252 	uint8_t ucPtrnId;
253 	uint16_t ucPtrnSize;
254 	uint32_t usPtrnIntervalMs;
255 	uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
256 };
257 
258 /**
259  * struct flashing_req_params - led flashing parameter
260  * @reqId: request id
261  * @pattern_id: pattern identifier. 0: disconnected 1: connected
262  * @led_x0: led flashing parameter0
263  * @led_x1: led flashing parameter1
264  */
265 struct flashing_req_params {
266 	uint32_t req_id;
267 	uint32_t pattern_id;
268 	uint32_t led_x0;
269 	uint32_t led_x1;
270 };
271 
272 #define MAX_NUM_CHAN 128
273 
274 /**
275  * struct wmi_pcl_chan_weights - Params to get the valid weighed list
276  * @pcl_list: Preferred channel list already sorted in the order of preference
277  * @pcl_len: Length of the PCL
278  * @saved_chan_list: Valid channel list updated as part of
279  * WMA_UPDATE_CHAN_LIST_REQ
280  * @saved_num_chan: Length of the valid channel list
281  * @weighed_valid_list: Weights of the valid channel list. This will have one
282  * to one mapping with valid_chan_list. FW expects channel order and size to be
283  * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
284  * @weight_list: Weights assigned by policy manager
285  */
286 struct wmi_pcl_chan_weights {
287 	uint8_t pcl_list[MAX_NUM_CHAN];
288 	uint32_t pcl_len;
289 	uint8_t saved_chan_list[MAX_NUM_CHAN];
290 	uint32_t saved_num_chan;
291 	uint8_t weighed_valid_list[MAX_NUM_CHAN];
292 	uint8_t weight_list[MAX_NUM_CHAN];
293 };
294 
295 /**
296  * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
297  * @vdev_id: vdev id
298  * @is_enabled: Adaptive dwell time is enabled/disabled
299  * @dwelltime_mode: global default adaptive dwell mode
300  * @lpf_weight: weight to calculate the average low pass
301  * filter for channel congestion
302  * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
303  * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
304  *
305  */
306 struct wmi_adaptive_dwelltime_params {
307 	uint32_t vdev_id;
308 	bool is_enabled;
309 	enum scan_dwelltime_adaptive_mode dwelltime_mode;
310 	uint8_t lpf_weight;
311 	uint8_t passive_mon_intval;
312 	uint8_t wifi_act_threshold;
313 };
314 
315 #define WMI_SCAN_CLIENT_MAX        7
316 
317 /**
318  * struct wmi_dbs_scan_sel_params - DBS scan selection params
319  * @num_clients: Number of scan clients dutycycle
320  * @pdev_id: pdev_id for identifying the MAC
321  * @module_id: scan client module id
322  * @num_dbs_scans: number of DBS scans
323  * @num_non_dbs_scans: number of non-DBS scans
324  */
325 struct wmi_dbs_scan_sel_params {
326 	uint32_t num_clients;
327 	uint32_t pdev_id;
328 	uint32_t module_id[WMI_SCAN_CLIENT_MAX];
329 	uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
330 	uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
331 };
332 
333 /**
334  * struct set_arp_stats - set/reset arp stats
335  * @vdev_id: session id
336  * @flag: enable/disable stats
337  * @pkt_type: type of packet(1 - arp)
338  * @ip_addr: subnet ipv4 address in case of encrypted packets
339  * @pkt_type_bitmap: pkt bitmap
340  * @tcp_src_port: tcp src port for pkt tracking
341  * @tcp_dst_port: tcp dst port for pkt tracking
342  * @icmp_ipv4: target ipv4 address to track ping packets
343  * @reserved: reserved
344  */
345 struct set_arp_stats {
346 	uint32_t vdev_id;
347 	uint8_t flag;
348 	uint8_t pkt_type;
349 	uint32_t ip_addr;
350 	uint32_t pkt_type_bitmap;
351 	uint32_t tcp_src_port;
352 	uint32_t tcp_dst_port;
353 	uint32_t icmp_ipv4;
354 	uint32_t reserved;
355 };
356 
357 /**
358  * struct get_arp_stats - get arp stats from firmware
359  * @pkt_type: packet type(1 - ARP)
360  * @vdev_id: session id
361  */
362 struct get_arp_stats {
363 	uint8_t pkt_type;
364 	uint32_t vdev_id;
365 };
366 
367 #endif /* _WMI_UNIFIED_STA_PARAM_H_ */
368