xref: /wlan-dirver/qca-wifi-host-cmn/target_if/init_deinit/inc/service_ready_param.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
1 /*
2  * Copyright (c) 2017-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  * 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 	uint32_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  * @hw_mode_config_type: holds the enum wmi_hw_mode_config_type
141  * @bitmap of supported modulations
142  * @supported_bands: supported bands, enum WLAN_BAND_CAPABILITY
143  * @ampdu_density: ampdu density 0 for no restriction, 1 for 1/4 us,
144  *        2 for 1/2 us, 3 for 1 us,4 for 2 us, 5 for 4 us,
145  *        6 for 8 us,7 for 16 us
146  * @max_bw_supported_2G: max bw supported 2G, enum wmi_channel_width
147  * @ht_cap_info_2G: WMI HT Capability, WMI_HT_CAP defines
148  * @vht_cap_info_2G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
149  * @vht_supp_mcs_2G: VHT Supported MCS Set field Rx/Tx same
150  *        The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
151  *        follows
152  *         - 0 indicates support for VHT-MCS 0-7 for n spatial streams
153  *         - 1 indicates support for VHT-MCS 0-8 for n spatial streams
154  *         - 2 indicates support for VHT-MCS 0-9 for n spatial streams
155  *         - 3 indicates that n spatial streams is not supported
156  * @he_cap_info_2G[]: HE capability info field of 802.11ax, WMI_HE_CAP defines
157  * @he_supp_mcs_2G: HE Supported MCS Set field Rx/Tx same
158  * @tx_chain_mask_2G: Valid Transmit chain mask
159  * @rx_chain_mask_2G: Valid Receive chain mask
160  * @max_bw_supported_5G: max bw supported 5G, enum wmi_channel_width
161  * @ht_cap_info_5G: WMI HT Capability, WMI_HT_CAP defines
162  * @vht_cap_info_5G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
163  * @vht_supp_mcs_5G: VHT Supported MCS Set field Rx/Tx same
164  *        The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
165  *        follows
166  *        - 0 indicates support for VHT-MCS 0-7 for n spatial streams
167  *        - 1 indicates support for VHT-MCS 0-8 for n spatial streams
168  *        - 2 indicates support for VHT-MCS 0-9 for n spatial streams
169  *        - 3 indicates that n spatial streams is not supported
170  * @he_cap_info_5G[]: HE capability info field of 802.11ax, WMI_HE_CAP defines
171  * @he_supp_mcs_5G: HE Supported MCS Set field Rx/Tx same
172  * @tx_chain_mask_5G: Valid Transmit chain mask
173  * @rx_chain_mask_5G: Valid Receive chain mask
174  * @he_cap_phy_info_2G: 2G HE capability phy field
175  * @he_cap_phy_info_5G: 5G HE capability phy field
176  * @he_cap_info_internal: HE PHY internal feature capability
177  * @he_ppet2G: 2G HE PPET info
178  * @he_ppet5G: 5G HE PPET info
179  * @chainmask_table_id: chain mask table id
180  * @lmac_id: hw mac id
181  * @reg_cap_ext: extended regulatory capabilities
182  */
183 struct wlan_psoc_host_mac_phy_caps {
184 	uint32_t hw_mode_id;
185 	uint32_t pdev_id;
186 	uint32_t phy_id;
187 	int hw_mode_config_type;
188 	uint32_t supports_11b:1,
189 		 supports_11g:1,
190 		 supports_11a:1,
191 		 supports_11n:1,
192 		 supports_11ac:1,
193 		 supports_11ax:1;
194 	uint32_t supported_bands;
195 	uint32_t ampdu_density;
196 	uint32_t max_bw_supported_2G;
197 	uint32_t ht_cap_info_2G;
198 	uint32_t vht_cap_info_2G;
199 	uint32_t vht_supp_mcs_2G;
200 	uint32_t he_cap_info_2G[PSOC_HOST_MAX_MAC_SIZE];
201 	uint32_t he_supp_mcs_2G;
202 	uint32_t tx_chain_mask_2G;
203 	uint32_t rx_chain_mask_2G;
204 	uint32_t max_bw_supported_5G;
205 	uint32_t ht_cap_info_5G;
206 	uint32_t vht_cap_info_5G;
207 	uint32_t vht_supp_mcs_5G;
208 	uint32_t he_cap_info_5G[PSOC_HOST_MAX_MAC_SIZE];
209 	uint32_t he_supp_mcs_5G;
210 	uint32_t tx_chain_mask_5G;
211 	uint32_t rx_chain_mask_5G;
212 	uint32_t he_cap_phy_info_2G[PSOC_HOST_MAX_PHY_SIZE];
213 	uint32_t he_cap_phy_info_5G[PSOC_HOST_MAX_PHY_SIZE];
214 	uint32_t he_cap_info_internal;
215 	struct wlan_psoc_host_ppe_threshold he_ppet2G;
216 	struct wlan_psoc_host_ppe_threshold he_ppet5G;
217 	uint32_t chainmask_table_id;
218 	uint32_t lmac_id;
219 	struct wlan_psoc_host_hal_reg_cap_ext reg_cap_ext;
220 };
221 
222 /**
223  * struct wlan_psoc_host_hw_mode_caps - HW mode capabilities in EXT event
224  * @hw_mode_id: identify a particular set of HW characteristics,
225  *              as specified by the subsequent fields
226  * @phy_id_map: BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on
227  * @hw_mode_config_type: HW mode config type
228  */
229 struct wlan_psoc_host_hw_mode_caps {
230 	uint32_t hw_mode_id;
231 	uint32_t phy_id_map;
232 	uint32_t hw_mode_config_type;
233 };
234 
235 /**
236  * struct wlan_psoc_host_dbr_ring_caps - Direct buffer rx module ring
237  *                                       capability maintained by PSOC
238  * @pdev_id: Pdev id of the pdev
239  * @mod_id: Module id
240  * @ring_elems_min: Minimum number of pointers in the ring
241  * @min_buf_size: Minimum size of each buffer entry in the ring
242  * @min_buf_align: Minimum alignment of the addresses in the ring
243  */
244 struct wlan_psoc_host_dbr_ring_caps {
245 	uint32_t pdev_id;
246 	uint32_t mod_id;
247 	uint32_t ring_elems_min;
248 	uint32_t min_buf_size;
249 	uint32_t min_buf_align;
250 };
251 
252 /**
253  * struct wlan_psoc_host_spectral_scaling_params - Spectral scaling params
254  * @pdev_id: Pdev id of the pdev
255  * @formula_id: Formula id
256  * @low_level_offset: Low level offset
257  * @high_level_offset: High level offset
258  * @rssi_thr: RSSI threshold
259  * @default_agc_max_gain: Default agc max gain
260  */
261 struct wlan_psoc_host_spectral_scaling_params {
262 	uint32_t pdev_id;
263 	uint32_t formula_id;
264 	uint32_t low_level_offset;
265 	uint32_t high_level_offset;
266 	uint32_t rssi_thr;
267 	uint32_t default_agc_max_gain;
268 };
269 
270 /**
271  * struct wlan_psoc_host_chainmask_capabilities - chain mask capabilities list
272  * @supports_chan_width_20: channel width 20 support for this chain mask.
273  * @supports_chan_width_40: channel width 40 support for this chain mask.
274  * @supports_chan_width_80: channel width 80 support for this chain mask.
275  * @supports_chan_width_160: channel width 160 support for this chain mask.
276  * @supports_chan_width_80P80: channel width 80P80 support for this chain mask.
277  * @chain_mask_2G: 2G support for this chain mask.
278  * @chain_mask_5G: 5G support for this chain mask.
279  * @chain_mask_tx: Tx support for this chain mask.
280  * @chain_mask_rx: Rx support for this chain mask.
281  * @supports_aDFS: Agile DFS support for this chain mask.
282  * @chainmask: chain mask value.
283  */
284 struct wlan_psoc_host_chainmask_capabilities {
285 	uint32_t supports_chan_width_20:1,
286 		 supports_chan_width_40:1,
287 		 supports_chan_width_80:1,
288 		 supports_chan_width_160:1,
289 		 supports_chan_width_80P80:1,
290 		 reserved:22,
291 		 chain_mask_2G:1,
292 		 chain_mask_5G:1,
293 		 chain_mask_tx:1,
294 		 chain_mask_rx:1,
295 		 supports_aDFS:1;
296 	uint32_t chainmask;
297 };
298 
299 /**
300  * struct wlan_psoc_host_chainmask_table - chain mask table
301  * @table_id: tableid.
302  * @num_valid_chainmasks: num valid chainmasks.
303  * @cap_list: pointer to wlan_psoc_host_chainmask_capabilities list.
304  */
305 struct wlan_psoc_host_chainmask_table {
306 	uint32_t table_id;
307 	uint32_t num_valid_chainmasks;
308 	struct wlan_psoc_host_chainmask_capabilities *cap_list;
309 };
310 
311 /**
312  * struct wlan_psoc_host_service_ext_param - EXT service base params in event
313  * @default_conc_scan_config_bits: Default concurrenct scan config
314  * @default_fw_config_bits: Default HW config bits
315  * @wlan_psoc_host_ppe_threshold ppet: Host PPE threshold struct
316  * @he_cap_info: HE capabality info
317  * @mpdu_density: units are microseconds
318  * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program
319  *                        Value 0 means FW hasn't given any limit to host.
320  * @fw_build_vers_ext: Extended FW build version info.
321  *                        bits 27:0 rsvd
322  *                        bits 31:28 CRM sub ID
323  * @num_hw_modes: Number of HW modes in event
324  * @num_phy: Number of Phy mode.
325  * @num_chainmask_tables: Number of chain mask tables.
326  * @num_dbr_ring_caps: Number of direct buf rx ring capabilities
327  * @max_bssid_indicator: Maximum number of VAPs in MBSS IE
328  * @num_bin_scaling_params: Number of Spectral bin scaling parameters
329  * @chainmask_table: Available chain mask tables.
330  * @sar_version: SAR version info
331  */
332 struct wlan_psoc_host_service_ext_param {
333 	uint32_t default_conc_scan_config_bits;
334 	uint32_t default_fw_config_bits;
335 	struct wlan_psoc_host_ppe_threshold ppet;
336 	uint32_t he_cap_info;
337 	uint32_t mpdu_density;
338 	uint32_t max_bssid_rx_filters;
339 	uint32_t fw_build_vers_ext;
340 	uint32_t num_hw_modes;
341 	uint32_t num_phy;
342 	uint32_t num_chainmask_tables;
343 	uint32_t num_dbr_ring_caps;
344 	uint32_t max_bssid_indicator;
345 	uint32_t num_bin_scaling_params;
346 	struct wlan_psoc_host_chainmask_table
347 		chainmask_table[PSOC_MAX_CHAINMASK_TABLES];
348 	uint32_t sar_version;
349 };
350 
351 /**
352  * struct wlan_psoc_host_service_ext2_param - EXT service base params in event
353  * reg_db_version_major: REG DB version major number
354  * reg_db_version_minor: REG DB version minor number
355  * bdf_reg_db_version_major: BDF REG DB version major number
356  * bdf_reg_db_version_minor: BDF REG DB version minor number
357  * @num_dbr_ring_caps: Number of direct buf rx ring capabilities
358  */
359 struct wlan_psoc_host_service_ext2_param {
360 	uint8_t reg_db_version_major;
361 	uint8_t reg_db_version_minor;
362 	uint8_t bdf_reg_db_version_major;
363 	uint8_t bdf_reg_db_version_minor;
364 	uint32_t num_dbr_ring_caps;
365 };
366 
367 #endif /* _SERVICE_READY_PARAM_H_*/
368