xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_sta_param.h (revision 27d564647e9b50e713c60b0d7e5ea2a9b0a3ae74)
1 /*
2  * Copyright (c) 2013-2018 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_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_params {
36 	uint8_t vdev_id;
37 	uint32_t method;
38 	uint32_t timeperiod;
39 	uint8_t *hostv4addr;
40 	uint8_t *destv4addr;
41 	uint8_t *destmac;
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 /**
103  * struct nan_req_params - NAN request params
104  * @request_data_len: request data length
105  * @request_data: request data
106  */
107 struct nan_req_params {
108 	uint16_t request_data_len;
109 	uint8_t request_data[];
110 };
111 
112 #ifndef CONVERGED_TDLS_ENABLE
113 /**
114  * struct tdls_chan_switch_params - channel switch parameter structure
115  * @vdev_id: vdev ID
116  * @peer_mac_addr: Peer mac address
117  * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
118  * @tdls_off_ch: Target Off Channel
119  * @oper_class: Operating class for target channel
120  * @is_responder: Responder or initiator
121  */
122 struct tdls_channel_switch_params {
123 	uint32_t    vdev_id;
124 	uint8_t     peer_mac_addr[IEEE80211_ADDR_LEN];
125 	uint16_t    tdls_off_ch_bw_offset;
126 	uint8_t     tdls_off_ch;
127 	uint8_t     tdls_sw_mode;
128 	uint8_t     oper_class;
129 	uint8_t     is_responder;
130 };
131 #endif
132 
133 #define WMI_TDLS_MAX_SUPP_CHANNELS       128
134 #define WMI_TDLS_MAX_SUPP_OPER_CLASSES   32
135 #define WMI_2_4_GHZ_MAX_FREQ  3000
136 
137 /**
138  * struct tdls_update_ch_params - channel parameters
139  * @chanId: ID of the channel
140  * @pwr: power level
141  * @dfsSet: is dfs supported or not
142  * @half_rate: is the channel operating at 10MHz
143  * @quarter_rate: is the channel operating at 5MHz
144  */
145 struct tdls_update_ch_params {
146 	uint8_t chanId;
147 	uint8_t pwr;
148 	bool dfsSet;
149 	bool half_rate;
150 	bool quarter_rate;
151 };
152 
153 /**
154  * struct tdls_peer_cap_params - TDLS peer capablities parameters
155  * @isPeerResponder: is peer responder or not
156  * @peerUapsdQueue: peer uapsd queue
157  * @peerMaxSp: peer max SP value
158  * @peerBuffStaSupport: peer buffer sta supported or not
159  * @peerOffChanSupport: peer offchannel support
160  * @peerCurrOperClass: peer current operating class
161  * @selfCurrOperClass: self current operating class
162  * @peerChanLen: peer channel length
163  * @peerChan: peer channel list
164  * @peerOperClassLen: peer operating class length
165  * @peerOperClass: peer operating class
166  * @prefOffChanNum: peer offchannel number
167  * @prefOffChanBandwidth: peer offchannel bandwidth
168  * @opClassForPrefOffChan: operating class for offchannel
169  */
170 struct tdls_peer_cap_params {
171 	uint8_t isPeerResponder;
172 	uint8_t peerUapsdQueue;
173 	uint8_t peerMaxSp;
174 	uint8_t peerBuffStaSupport;
175 	uint8_t peerOffChanSupport;
176 	uint8_t peerCurrOperClass;
177 	uint8_t selfCurrOperClass;
178 	uint8_t peerChanLen;
179 	struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
180 	uint8_t peerOperClassLen;
181 	uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
182 	uint8_t prefOffChanNum;
183 	uint8_t prefOffChanBandwidth;
184 	uint8_t opClassForPrefOffChan;
185 };
186 
187 /**
188  * struct tdls_peer_state_params - TDLS peer state parameters
189  * @vdevId: vdev id
190  * @peerMacAddr: peer mac address
191  * @peerCap: peer capabality
192  */
193 struct tdls_peer_state_params {
194 	uint32_t vdevId;
195 	uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
196 	uint32_t peerState;
197 	struct tdls_peer_cap_params peerCap;
198 };
199 
200 /**
201  * struct vdev_ie_info_param - IE info
202  * @vdev_id - vdev for which the IE is being sent
203  * @ie_id - ID of the IE
204  * @length - length of the IE data
205  * @data - IE data
206  *
207  * This structure is used to store the IE information.
208  */
209 struct vdev_ie_info_param {
210 	uint32_t vdev_id;
211 	uint32_t ie_id;
212 	uint32_t length;
213 	uint32_t ie_source;
214 	uint32_t band;
215 	uint8_t *data;
216 };
217 
218 #define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
219 /**
220  * struct sar_limit_cmd_row - sar limits row
221  * @band_id: Optional param for frequency band
222  *           See %enum wmi_sar_band_id_flags for possible values
223  * @chain_id: Optional param for antenna chain id
224  * @mod_id: Optional param for modulation scheme
225  *          See %enum wmi_sar_mod_id_flags for possible values
226  * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
227  * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
228  *                   See WMI_SAR_*_VALID_MASK for possible values
229  */
230 struct sar_limit_cmd_row {
231 	uint32_t band_id;
232 	uint32_t chain_id;
233 	uint32_t mod_id;
234 	uint32_t limit_value;
235 	uint32_t validity_bitmap;
236 };
237 
238 /**
239  * struct sar_limit_cmd_params - sar limits params
240  * @sar_enable: flag to enable SAR
241  *              See %enum wmi_sar_feature_state_flags for possible values
242  * @num_limit_rows: number of items in sar_limits
243  * @commit_limits: indicates firmware to start apply new SAR values
244  * @sar_limit_row_list: pointer to array of sar limit rows
245  */
246 struct sar_limit_cmd_params {
247 	uint32_t sar_enable;
248 	uint32_t num_limit_rows;
249 	uint32_t commit_limits;
250 	struct sar_limit_cmd_row *sar_limit_row_list;
251 };
252 
253 /**
254  * struct sar_limit_event_row - sar limits row
255  * @band_id: Frequency band.
256  *           See %enum wmi_sar_band_id_flags for possible values
257  * @chain_id: Chain id
258  * @mod_id: Modulation scheme
259  *          See %enum wmi_sar_mod_id_flags for possible values
260  * @limit_value: Power limits in steps of 0.5 dbm that is currently active for
261  *     the given @band_id, @chain_id, and @mod_id
262  */
263 struct sar_limit_event_row {
264 	uint32_t band_id;
265 	uint32_t chain_id;
266 	uint32_t mod_id;
267 	uint32_t limit_value;
268 };
269 
270 /**
271  * struct sar_limit_event - sar limits params
272  * @sar_enable: Current status of SAR enablement.
273  *              See %enum wmi_sar_feature_state_flags for possible values
274  * @num_limit_rows: number of items in sar_limits
275  * @sar_limit_row: array of sar limit rows. Only @num_limit_rows
276  *                 should be considered valid.
277  */
278 struct sar_limit_event {
279 	uint32_t sar_enable;
280 	uint32_t num_limit_rows;
281 	struct sar_limit_event_row
282 			sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED];
283 };
284 
285 #define WMI_UNIFIED_MAX_PMKID_LEN   16
286 #define WMI_UNIFIED_MAX_PMK_LEN     64
287 
288 /**
289  * struct wmi_unified_pmk_cache - used to set del pmkid cache
290  * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
291  * @pmk_len: PMK len
292  *	for big-endian hosts, manual endian conversion will be needed to keep
293  *	the array values in their original order in spite of the automatic
294  *	byte-swap applied to WMI messages during download
295  * @pmk: PMK array
296  * @pmkid_len: PMK ID Len
297  * @pmkid: PMK ID Array
298  * @bssid: BSSID
299  * @ssid: SSID
300  * @cache_id: PMK Cache ID
301  * @cat_flag: whether (bssid) or (ssid,cache_id) is valid
302  * @action_flag: add/delete the entry
303  */
304 struct wmi_unified_pmk_cache {
305 	uint32_t            tlv_header;
306 	uint32_t            pmk_len;
307 	uint8_t             session_id;
308 	uint8_t             pmk[WMI_UNIFIED_MAX_PMK_LEN];
309 	uint32_t            pmkid_len;
310 	uint8_t             pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
311 	wmi_host_mac_addr   bssid;
312 	struct mac_ssid     ssid;
313 	uint32_t            cache_id;
314 	uint32_t            cat_flag;
315 	uint32_t            action_flag;
316 };
317 
318 #define WMI_QOS_NUM_AC_MAX 4
319 
320 /**
321  * struct aggr_add_ts_param - ADDTS parameters
322  * @staIdx: station index
323  * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
324  * @tspec: tspec value
325  * @status: CDF status
326  * @sessionId: session id
327  * @vdev_id: vdev id
328  */
329 struct aggr_add_ts_param {
330 	uint16_t staIdx;
331 	uint16_t tspecIdx;
332 	struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
333 	QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
334 	uint8_t sessionId;
335 	uint8_t vdev_id;
336 };
337 
338 #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
339 /**
340  * struct periodic_tx_pattern - periodic tx pattern
341  * @mac_address: MAC Address for the adapter
342  * @ucPtrnId: Pattern ID
343  * @ucPtrnSize: Pattern size
344  * @usPtrnIntervalMs: in ms
345  * @ucPattern: Pattern buffer
346  */
347 struct periodic_tx_pattern {
348 	struct qdf_mac_addr mac_address;
349 	uint8_t ucPtrnId;
350 	uint16_t ucPtrnSize;
351 	uint32_t usPtrnIntervalMs;
352 	uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
353 };
354 
355 /**
356  * struct flashing_req_params - led flashing parameter
357  * @reqId: request id
358  * @pattern_id: pattern identifier. 0: disconnected 1: connected
359  * @led_x0: led flashing parameter0
360  * @led_x1: led flashing parameter1
361  */
362 struct flashing_req_params {
363 	uint32_t req_id;
364 	uint32_t pattern_id;
365 	uint32_t led_x0;
366 	uint32_t led_x1;
367 };
368 
369 #define MAX_NUM_CHAN 128
370 
371 /**
372  * struct wmi_pcl_chan_weights - Params to get the valid weighed list
373  * @pcl_list: Preferred channel list already sorted in the order of preference
374  * @pcl_len: Length of the PCL
375  * @saved_chan_list: Valid channel list updated as part of
376  * WMA_UPDATE_CHAN_LIST_REQ
377  * @saved_num_chan: Length of the valid channel list
378  * @weighed_valid_list: Weights of the valid channel list. This will have one
379  * to one mapping with valid_chan_list. FW expects channel order and size to be
380  * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
381  * @weight_list: Weights assigned by policy manager
382  */
383 struct wmi_pcl_chan_weights {
384 	uint8_t pcl_list[MAX_NUM_CHAN];
385 	uint32_t pcl_len;
386 	uint8_t saved_chan_list[MAX_NUM_CHAN];
387 	uint32_t saved_num_chan;
388 	uint8_t weighed_valid_list[MAX_NUM_CHAN];
389 	uint8_t weight_list[MAX_NUM_CHAN];
390 };
391 
392 /**
393  * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
394  * @vdev_id: vdev id
395  * @is_enabled: Adaptive dwell time is enabled/disabled
396  * @dwelltime_mode: global default adaptive dwell mode
397  * @lpf_weight: weight to calculate the average low pass
398  * filter for channel congestion
399  * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
400  * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
401  *
402  */
403 struct wmi_adaptive_dwelltime_params {
404 	uint32_t vdev_id;
405 	bool is_enabled;
406 	enum scan_dwelltime_adaptive_mode dwelltime_mode;
407 	uint8_t lpf_weight;
408 	uint8_t passive_mon_intval;
409 	uint8_t wifi_act_threshold;
410 };
411 
412 #define WMI_SCAN_CLIENT_MAX        7
413 
414 /**
415  * struct wmi_dbs_scan_sel_params - DBS scan selection params
416  * @num_clients: Number of scan clients dutycycle
417  * @pdev_id: pdev_id for identifying the MAC
418  * @module_id: scan client module id
419  * @num_dbs_scans: number of DBS scans
420  * @num_non_dbs_scans: number of non-DBS scans
421  */
422 struct wmi_dbs_scan_sel_params {
423 	uint32_t num_clients;
424 	uint32_t pdev_id;
425 	uint32_t module_id[WMI_SCAN_CLIENT_MAX];
426 	uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
427 	uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
428 };
429 
430 /**
431  * struct set_arp_stats - set/reset arp stats
432  * @vdev_id: session id
433  * @flag: enable/disable stats
434  * @pkt_type: type of packet(1 - arp)
435  * @ip_addr: subnet ipv4 address in case of encrypted packets
436  * @pkt_type_bitmap: pkt bitmap
437  * @tcp_src_port: tcp src port for pkt tracking
438  * @tcp_dst_port: tcp dst port for pkt tracking
439  * @icmp_ipv4: target ipv4 address to track ping packets
440  * @reserved: reserved
441  */
442 struct set_arp_stats {
443 	uint32_t vdev_id;
444 	uint8_t flag;
445 	uint8_t pkt_type;
446 	uint32_t ip_addr;
447 	uint32_t pkt_type_bitmap;
448 	uint32_t tcp_src_port;
449 	uint32_t tcp_dst_port;
450 	uint32_t icmp_ipv4;
451 	uint32_t reserved;
452 };
453 
454 /**
455  * struct get_arp_stats - get arp stats from firmware
456  * @pkt_type: packet type(1 - ARP)
457  * @vdev_id: session id
458  */
459 struct get_arp_stats {
460 	uint8_t pkt_type;
461 	uint32_t vdev_id;
462 };
463 
464 #endif /* _WMI_UNIFIED_STA_PARAM_H_ */
465