xref: /wlan-dirver/qca-wifi-host-cmn/target_if/init_deinit/inc/service_ready_param.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2017-2021 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  * DOC: service_ready_param.h
20  *
21  * Public structures to access (ext)service ready data
22  */
23 #ifndef _SERVICE_READY_PARAM_H_
24 #define _SERVICE_READY_PARAM_H_
25 
26 #include "qdf_types.h"
27 #ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
28 #include "wmi_unified_param.h"
29 #endif
30 
31 
32 /**
33  * struct wlan_psoc_hal_reg_capability - hal reg table in psoc
34  * @eeprom_rd: regdomain value specified in EEPROM
35  * @eeprom_rd_ext: regdomain
36  * @regcap1: CAP1 capabilities bit map
37  * @regcap2: REGDMN EEPROM CAP
38  * @wireless_modes: REGDMN MODE
39  * @low_2ghz_chan: lower 2.4GHz channels
40  * @high_2ghz_chan: higher 2.4 GHz channels
41  * @low_5ghz_chan: lower 5 GHz channels
42  * @high_5ghz_chan: higher 5 GHz channels
43  */
44 struct wlan_psoc_hal_reg_capability {
45 	uint32_t eeprom_rd;
46 	uint32_t eeprom_rd_ext;
47 	uint32_t regcap1;
48 	uint32_t regcap2;
49 	uint32_t wireless_modes;
50 	uint32_t low_2ghz_chan;
51 	uint32_t high_2ghz_chan;
52 	uint32_t low_5ghz_chan;
53 	uint32_t high_5ghz_chan;
54 };
55 
56 /**
57  * struct wlan_psoc_target_capability_info - target capabilities in psoc
58  * @phy_capability: PHY capabilities
59  * @max_frag_entry: Maximum frag entries
60  * @num_rf_chains: Number of RF chains supported
61  * @ht_cap_info: HT cap info
62  * @vht_cap_info: VHT cap info
63  * @vht_supp_mcs: VHT Supported MCS
64  * @hw_min_tx_power: HW minimum tx power
65  * @hw_max_tx_power: HW maximum tx power
66  * @sys_cap_info: sys capability info
67  * @min_pkt_size_enable: Enterprise mode short pkt enable
68  * @max_bcn_ie_size: Max beacon and probe rsp IE offload size
69  * @max_num_scan_channels: Max scan channels
70  * @max_supported_macs: max supported MCS
71  * @wmi_fw_sub_feat_caps: FW sub feature capabilities
72  * @txrx_chainmask: TXRX chain mask
73  * @default_dbs_hw_mode_index: DBS hw mode index
74  * @num_msdu_desc: number of msdu desc
75  * @fw_version: FW build version
76  * @fw_version_1: Second dword of FW version (Valid for non-tlv FW)
77  */
78 struct wlan_psoc_target_capability_info {
79 	uint32_t phy_capability;
80 	uint32_t max_frag_entry;
81 	uint32_t num_rf_chains;
82 	uint32_t ht_cap_info;
83 	uint32_t vht_cap_info;
84 	uint32_t vht_supp_mcs;
85 	uint32_t hw_min_tx_power;
86 	uint32_t hw_max_tx_power;
87 	uint32_t sys_cap_info;
88 	uint32_t min_pkt_size_enable;
89 	uint32_t max_bcn_ie_size;
90 	uint32_t max_num_scan_channels;
91 	uint32_t max_supported_macs;
92 	uint32_t wmi_fw_sub_feat_caps;
93 	uint32_t txrx_chainmask;
94 	uint32_t default_dbs_hw_mode_index;
95 	uint32_t num_msdu_desc;
96 	uint32_t fw_version;
97 	uint32_t fw_version_1;
98 };
99 
100 /**
101  * struct wlan_psoc_host_ppe_threshold - PPE threshold
102  * @numss_m1: NSS - 1
103  * @ru_bit_mask: RU bit mask indicating the supported RU's
104  * @ppet16_ppet8_ru3_ru0: ppet8 and ppet16 for max num ss
105  */
106 struct wlan_psoc_host_ppe_threshold {
107 	uint32_t numss_m1;
108 	uint32_t ru_bit_mask;
109 	uint32_t ppet16_ppet8_ru3_ru0[PSOC_HOST_MAX_NUM_SS];
110 };
111 
112 /**
113  * struct wlan_psoc_host_hal_reg_cap_ext - extended regulatory capabilities
114  * recvd in EXT service
115  * @wireless_modes: REGDMN MODE
116  * @low_2ghz_chan: lower 2.4GHz channels
117  * @high_2ghz_chan: higher 2.4 GHz channels
118  * @low_5ghz_chan: lower 5 GHz channels
119  * @high_5ghz_chan: higher 5 GHz channels
120  */
121 struct wlan_psoc_host_hal_reg_cap_ext {
122 	uint64_t wireless_modes;
123 	uint32_t low_2ghz_chan;
124 	uint32_t high_2ghz_chan;
125 	uint32_t low_5ghz_chan;
126 	uint32_t high_5ghz_chan;
127 };
128 
129 /**
130  * struct wlan_psoc_host_mac_phy_caps - Phy caps recvd in EXT service
131  *  @hw_mode_id: identify a particular set of HW characteristics,
132  *        as specified by the subsequent fields. WMI_MAC_PHY_CAPABILITIES
133  *        element must be mapped to its parent WMI_HW_MODE_CAPABILITIES
134  *        element using hw_mode_id. No particular ordering of
135  *        WMI_MAC_PHY_CAPABILITIES elements should be
136  *        assumed, though in practice the elements may always be ordered
137  *        by hw_mode_id.
138  * @pdev_id: pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1
139  * @phy_id: Starts with 0
140  * @phy_idx: Index to mac phy caps structure for the given hw_mode_id and phy_id
141  * @hw_mode_config_type: holds the enum wmi_hw_mode_config_type
142  * @bitmap of supported modulations
143  * @supported_bands: supported bands, enum WLAN_BAND_CAPABILITY
144  * @ampdu_density: ampdu density 0 for no restriction, 1 for 1/4 us,
145  *        2 for 1/2 us, 3 for 1 us,4 for 2 us, 5 for 4 us,
146  *        6 for 8 us,7 for 16 us
147  * @max_bw_supported_2G: max bw supported 2G, enum wmi_channel_width
148  * @ht_cap_info_2G: WMI HT Capability, WMI_HT_CAP defines
149  * @vht_cap_info_2G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
150  * @vht_supp_mcs_2G: VHT Supported MCS Set field Rx/Tx same
151  *        The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
152  *        follows
153  *         - 0 indicates support for VHT-MCS 0-7 for n spatial streams
154  *         - 1 indicates support for VHT-MCS 0-8 for n spatial streams
155  *         - 2 indicates support for VHT-MCS 0-9 for n spatial streams
156  *         - 3 indicates that n spatial streams is not supported
157  * @he_cap_info_2G[]: HE capability info field of 802.11ax, WMI_HE_CAP defines
158  * @he_supp_mcs_2G: HE Supported MCS Set field Rx/Tx same
159  * @tx_chain_mask_2G: Valid Transmit chain mask
160  * @rx_chain_mask_2G: Valid Receive chain mask
161  * @max_bw_supported_5G: max bw supported 5G, enum wmi_channel_width
162  * @ht_cap_info_5G: WMI HT Capability, WMI_HT_CAP defines
163  * @vht_cap_info_5G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
164  * @vht_supp_mcs_5G: VHT Supported MCS Set field Rx/Tx same
165  *        The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
166  *        follows
167  *        - 0 indicates support for VHT-MCS 0-7 for n spatial streams
168  *        - 1 indicates support for VHT-MCS 0-8 for n spatial streams
169  *        - 2 indicates support for VHT-MCS 0-9 for n spatial streams
170  *        - 3 indicates that n spatial streams is not supported
171  * @he_cap_info_5G[]: HE capability info field of 802.11ax, WMI_HE_CAP defines
172  * @he_supp_mcs_5G: HE Supported MCS Set field Rx/Tx same
173  * @tx_chain_mask_5G: Valid Transmit chain mask
174  * @rx_chain_mask_5G: Valid Receive chain mask
175  * @he_cap_phy_info_2G: 2G HE capability phy field
176  * @he_cap_phy_info_5G: 5G HE capability phy field
177  * @he_cap_info_internal: HE PHY internal feature capability
178  * @he_ppet2G: 2G HE PPET info
179  * @he_ppet5G: 5G HE PPET info
180  * @chainmask_table_id: chain mask table id
181  * @lmac_id: hw mac id
182  * @reg_cap_ext: extended regulatory capabilities
183  * @tgt_pdev_id: target pdev id assigned and used by firmware
184  * @nss_ratio_enabled: This flag is set if nss ratio is received from FW as part
185  *                     of service ready ext event.
186  * @nss_ratio: nss ratio is used to calculate the NSS value for 160MHz.
187  * @hw_link_id: Unique link id across SoCs used to identify link in Multi-SoC ML
188  */
189 struct wlan_psoc_host_mac_phy_caps {
190 	uint32_t hw_mode_id;
191 	uint32_t pdev_id;
192 	uint32_t phy_id;
193 	uint8_t phy_idx;
194 	int hw_mode_config_type;
195 	uint32_t supports_11b:1,
196 		 supports_11g:1,
197 		 supports_11a:1,
198 		 supports_11n:1,
199 		 supports_11ac:1,
200 		 supports_11ax:1,
201 #ifdef WLAN_FEATURE_11BE
202 		 supports_11be:1,
203 #endif
204 		 reserved:25;
205 	uint32_t supported_bands;
206 	uint32_t ampdu_density;
207 	uint32_t max_bw_supported_2G;
208 	uint32_t ht_cap_info_2G;
209 	uint32_t vht_cap_info_2G;
210 	uint32_t vht_supp_mcs_2G;
211 	uint32_t he_cap_info_2G[PSOC_HOST_MAX_MAC_SIZE];
212 	uint32_t he_supp_mcs_2G;
213 	uint32_t tx_chain_mask_2G;
214 	uint32_t rx_chain_mask_2G;
215 	uint32_t max_bw_supported_5G;
216 	uint32_t ht_cap_info_5G;
217 	uint32_t vht_cap_info_5G;
218 	uint32_t vht_supp_mcs_5G;
219 	uint32_t he_cap_info_5G[PSOC_HOST_MAX_MAC_SIZE];
220 	uint32_t he_supp_mcs_5G;
221 	uint32_t tx_chain_mask_5G;
222 	uint32_t rx_chain_mask_5G;
223 	uint32_t he_cap_phy_info_2G[PSOC_HOST_MAX_PHY_SIZE];
224 	uint32_t he_cap_phy_info_5G[PSOC_HOST_MAX_PHY_SIZE];
225 	uint32_t he_cap_info_internal;
226 	struct wlan_psoc_host_ppe_threshold he_ppet2G;
227 	struct wlan_psoc_host_ppe_threshold he_ppet5G;
228 	uint32_t chainmask_table_id;
229 	uint32_t lmac_id;
230 	struct wlan_psoc_host_hal_reg_cap_ext reg_cap_ext;
231 	uint32_t tgt_pdev_id;
232 	bool nss_ratio_enabled;
233 	uint8_t nss_ratio_info;
234 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
235 	uint16_t hw_link_id;
236 #endif
237 };
238 
239 /**
240  * struct wlan_psoc_host_hw_mode_caps - HW mode capabilities in EXT event
241  * @hw_mode_id: identify a particular set of HW characteristics,
242  *              as specified by the subsequent fields
243  * @phy_id_map: BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on
244  * @hw_mode_config_type: HW mode config type
245  */
246 struct wlan_psoc_host_hw_mode_caps {
247 	uint32_t hw_mode_id;
248 	uint32_t phy_id_map;
249 	uint32_t hw_mode_config_type;
250 };
251 
252 /*
253  * struct wlan_psoc_host_mac_phy_caps_ext2 - Phy caps received in EXT2 service
254  * @hw_mode_id: HW mode id
255  * @pdev_id: Pdev id
256  * @phy_id: Phy id
257  * @wireless_modes_ext: Extended wireless modes
258  * @eht_cap_info_2G[]: EHT capability info field of 802.11ax, WMI_HE_CAP defines
259  * @eht_supp_mcs_2G: EHT Supported MCS Set field Rx/Tx same
260  * @eht_cap_info_5G[]: EHT capability info field of 802.11ax, WMI_HE_CAP defines
261  * @eht_supp_mcs_5G: EHT Supported MCS Set field Rx/Tx same
262  * @eht_cap_phy_info_2G: 2G EHT capability phy field
263  * @eht_cap_phy_info_5G: 5G EHT capability phy field
264  * @eht_cap_info_internal: EHT PHY internal feature capability
265  */
266 struct wlan_psoc_host_mac_phy_caps_ext2 {
267 	uint32_t hw_mode_id;
268 	uint32_t pdev_id;
269 	uint32_t phy_id;
270 	uint64_t wireless_modes_ext;
271 #ifdef WLAN_FEATURE_11BE
272 	uint32_t eht_cap_info_2G[PSOC_HOST_MAX_EHT_MAC_SIZE];
273 	uint32_t eht_supp_mcs_2G;
274 	uint32_t eht_cap_info_5G[PSOC_HOST_MAX_EHT_MAC_SIZE];
275 	uint32_t eht_supp_mcs_5G;
276 	uint32_t eht_cap_phy_info_2G[PSOC_HOST_MAX_EHT_PHY_SIZE];
277 	uint32_t eht_cap_phy_info_5G[PSOC_HOST_MAX_EHT_PHY_SIZE];
278 	uint32_t eht_cap_info_internal;
279 #endif
280 };
281 
282 /*
283  * struct wlan_psoc_host_scan_radio_caps - scan radio capabilities
284  * @phy_id: phy id
285  * @scan_radio_supported: indicates scan radio support
286  * @dfs_en: indicates DFS needs to be enabled/disabled for scan radio vap
287  */
288 struct wlan_psoc_host_scan_radio_caps {
289 	uint32_t phy_id;
290 	bool scan_radio_supported;
291 	bool dfs_en;
292 };
293 
294 /**
295  * struct wlan_psoc_host_dbr_ring_caps - Direct buffer rx module ring
296  *                                       capability maintained by PSOC
297  * @pdev_id: Pdev id of the pdev
298  * @mod_id: Module id
299  * @ring_elems_min: Minimum number of pointers in the ring
300  * @min_buf_size: Minimum size of each buffer entry in the ring
301  * @min_buf_align: Minimum alignment of the addresses in the ring
302  */
303 struct wlan_psoc_host_dbr_ring_caps {
304 	uint32_t pdev_id;
305 	uint32_t mod_id;
306 	uint32_t ring_elems_min;
307 	uint32_t min_buf_size;
308 	uint32_t min_buf_align;
309 };
310 
311 /**
312  * struct wlan_psoc_host_spectral_scaling_params - Spectral scaling params
313  * @pdev_id: Pdev id of the pdev
314  * @formula_id: Formula id
315  * @low_level_offset: Low level offset
316  * @high_level_offset: High level offset
317  * @rssi_thr: RSSI threshold
318  * @default_agc_max_gain: Default agc max gain
319  */
320 struct wlan_psoc_host_spectral_scaling_params {
321 	uint32_t pdev_id;
322 	uint32_t formula_id;
323 	uint32_t low_level_offset;
324 	uint32_t high_level_offset;
325 	uint32_t rssi_thr;
326 	uint32_t default_agc_max_gain;
327 };
328 
329 /**
330  * struct wlan_psoc_host_chainmask_capabilities - chain mask capabilities list
331  * @supports_chan_width_20: channel width 20 support for this chain mask.
332  * @supports_chan_width_40: channel width 40 support for this chain mask.
333  * @supports_chan_width_80: channel width 80 support for this chain mask.
334  * @supports_chan_width_160: channel width 160 support for this chain mask.
335  * @supports_chan_width_80P80: channel width 80P80 support for this chain mask.
336  * @supports_aSpectral: Agile Spectral support for this chain mask.
337  * @supports_aSpectral_160: Agile Spectral support in 160 MHz.
338  * @supports_aDFS_160: Agile DFS support in 160 MHz for this chain mask.
339  * @chain_mask_2G: 2G support for this chain mask.
340  * @chain_mask_5G: 5G support for this chain mask.
341  * @chain_mask_tx: Tx support for this chain mask.
342  * @chain_mask_rx: Rx support for this chain mask.
343  * @supports_aDFS: Agile DFS support for this chain mask.
344  * @chainmask: chain mask value.
345  */
346 struct wlan_psoc_host_chainmask_capabilities {
347 	uint32_t supports_chan_width_20:1,
348 		 supports_chan_width_40:1,
349 		 supports_chan_width_80:1,
350 		 supports_chan_width_160:1,
351 		 supports_chan_width_80P80:1,
352 #ifdef WLAN_FEATURE_11BE
353 		 supports_chan_width_320:1,
354 #endif
355 		 supports_aSpectral:1,
356 		 supports_aSpectral_160:1,
357 		 supports_aDFS_160:1,
358 		 reserved:19,
359 		 chain_mask_2G:1,
360 		 chain_mask_5G:1,
361 		 chain_mask_tx:1,
362 		 chain_mask_rx:1,
363 		 supports_aDFS:1;
364 	uint32_t chainmask;
365 };
366 
367 /**
368  * struct wlan_psoc_host_chainmask_table - chain mask table
369  * @table_id: tableid.
370  * @num_valid_chainmasks: num valid chainmasks.
371  * @cap_list: pointer to wlan_psoc_host_chainmask_capabilities list.
372  */
373 struct wlan_psoc_host_chainmask_table {
374 	uint32_t table_id;
375 	uint32_t num_valid_chainmasks;
376 	struct wlan_psoc_host_chainmask_capabilities *cap_list;
377 };
378 
379 /**
380  * struct wlan_psoc_host_service_ext_param - EXT service base params in event
381  * @default_conc_scan_config_bits: Default concurrenct scan config
382  * @default_fw_config_bits: Default HW config bits
383  * @wlan_psoc_host_ppe_threshold ppet: Host PPE threshold struct
384  * @he_cap_info: HE capabality info
385  * @mpdu_density: units are microseconds
386  * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program
387  *                        Value 0 means FW hasn't given any limit to host.
388  * @fw_build_vers_ext: Extended FW build version info.
389  *                        bits 27:0 rsvd
390  *                        bits 31:28 CRM sub ID
391  * @num_hw_modes: Number of HW modes in event
392  * @num_phy: Number of Phy mode.
393  * @num_chainmask_tables: Number of chain mask tables.
394  * @num_dbr_ring_caps: Number of direct buf rx ring capabilities
395  * @max_bssid_indicator: Maximum number of VAPs in MBSS IE
396  * @num_bin_scaling_params: Number of Spectral bin scaling parameters
397  * @chainmask_table: Available chain mask tables.
398  * @sar_version: SAR version info
399  */
400 struct wlan_psoc_host_service_ext_param {
401 	uint32_t default_conc_scan_config_bits;
402 	uint32_t default_fw_config_bits;
403 	struct wlan_psoc_host_ppe_threshold ppet;
404 	uint32_t he_cap_info;
405 	uint32_t mpdu_density;
406 	uint32_t max_bssid_rx_filters;
407 	uint32_t fw_build_vers_ext;
408 	uint32_t num_hw_modes;
409 	uint32_t num_phy;
410 	uint32_t num_chainmask_tables;
411 	uint32_t num_dbr_ring_caps;
412 	uint32_t max_bssid_indicator;
413 	uint32_t num_bin_scaling_params;
414 	struct wlan_psoc_host_chainmask_table
415 		chainmask_table[PSOC_MAX_CHAINMASK_TABLES];
416 	uint32_t sar_version;
417 };
418 
419 /**
420  * struct wlan_psoc_host_service_ext2_param - EXT service base params in event
421  * reg_db_version_major: REG DB version major number
422  * reg_db_version_minor: REG DB version minor number
423  * bdf_reg_db_version_major: BDF REG DB version major number
424  * bdf_reg_db_version_minor: BDF REG DB version minor number
425  * @num_dbr_ring_caps: Number of direct buf rx ring capabilities
426  * @chwidth_num_peer_caps: Peer limit for peer_chan_width_switch WMI cmd
427  * @max_ndp_sessions: Max number of ndp session fw supports
428  * @preamble_puncture_bw_cap: Preamble Puncturing Tx support
429  * @num_scan_radio_caps: Number of scan radio capabilities
430  * @max_users_dl_ofdma: Max number of users per-PPDU for Downlink OFDMA
431  * @max_users_ul_ofdma: Max number of users per-PPDU for Uplink OFDMA
432  * @max_users_dl_mumimo: Max number of users per-PPDU for Downlink MU-MIMO
433  * @max_users_ul_mumimo: Max number of users per-PPDU for Uplink MU-MIMO
434  * @twt_ack_support_cap: TWT ack capability support
435  * @target_cap_flags: Rx peer metadata version number used by target
436  */
437 struct wlan_psoc_host_service_ext2_param {
438 	uint8_t reg_db_version_major;
439 	uint8_t reg_db_version_minor;
440 	uint8_t bdf_reg_db_version_major;
441 	uint8_t bdf_reg_db_version_minor;
442 	uint32_t num_dbr_ring_caps;
443 	uint32_t chwidth_num_peer_caps;
444 	uint32_t max_ndp_sessions;
445 	uint32_t preamble_puncture_bw_cap;
446 	uint8_t num_scan_radio_caps;
447 	uint16_t max_users_dl_ofdma;
448 	uint16_t max_users_ul_ofdma;
449 	uint16_t max_users_dl_mumimo;
450 	uint16_t max_users_ul_mumimo;
451 	uint32_t twt_ack_support_cap:1;
452 	uint32_t target_cap_flags;
453 };
454 
455 #endif /* _SERVICE_READY_PARAM_H_*/
456