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 * @tgt_pdev_id: target pdev id assigned and used by firmware 183 */ 184 struct wlan_psoc_host_mac_phy_caps { 185 uint32_t hw_mode_id; 186 uint32_t pdev_id; 187 uint32_t phy_id; 188 int hw_mode_config_type; 189 uint32_t supports_11b:1, 190 supports_11g:1, 191 supports_11a:1, 192 supports_11n:1, 193 supports_11ac:1, 194 supports_11ax:1; 195 uint32_t supported_bands; 196 uint32_t ampdu_density; 197 uint32_t max_bw_supported_2G; 198 uint32_t ht_cap_info_2G; 199 uint32_t vht_cap_info_2G; 200 uint32_t vht_supp_mcs_2G; 201 uint32_t he_cap_info_2G[PSOC_HOST_MAX_MAC_SIZE]; 202 uint32_t he_supp_mcs_2G; 203 uint32_t tx_chain_mask_2G; 204 uint32_t rx_chain_mask_2G; 205 uint32_t max_bw_supported_5G; 206 uint32_t ht_cap_info_5G; 207 uint32_t vht_cap_info_5G; 208 uint32_t vht_supp_mcs_5G; 209 uint32_t he_cap_info_5G[PSOC_HOST_MAX_MAC_SIZE]; 210 uint32_t he_supp_mcs_5G; 211 uint32_t tx_chain_mask_5G; 212 uint32_t rx_chain_mask_5G; 213 uint32_t he_cap_phy_info_2G[PSOC_HOST_MAX_PHY_SIZE]; 214 uint32_t he_cap_phy_info_5G[PSOC_HOST_MAX_PHY_SIZE]; 215 uint32_t he_cap_info_internal; 216 struct wlan_psoc_host_ppe_threshold he_ppet2G; 217 struct wlan_psoc_host_ppe_threshold he_ppet5G; 218 uint32_t chainmask_table_id; 219 uint32_t lmac_id; 220 struct wlan_psoc_host_hal_reg_cap_ext reg_cap_ext; 221 uint32_t tgt_pdev_id; 222 }; 223 224 /** 225 * struct wlan_psoc_host_hw_mode_caps - HW mode capabilities in EXT event 226 * @hw_mode_id: identify a particular set of HW characteristics, 227 * as specified by the subsequent fields 228 * @phy_id_map: BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on 229 * @hw_mode_config_type: HW mode config type 230 */ 231 struct wlan_psoc_host_hw_mode_caps { 232 uint32_t hw_mode_id; 233 uint32_t phy_id_map; 234 uint32_t hw_mode_config_type; 235 }; 236 237 /** 238 * struct wlan_psoc_host_dbr_ring_caps - Direct buffer rx module ring 239 * capability maintained by PSOC 240 * @pdev_id: Pdev id of the pdev 241 * @mod_id: Module id 242 * @ring_elems_min: Minimum number of pointers in the ring 243 * @min_buf_size: Minimum size of each buffer entry in the ring 244 * @min_buf_align: Minimum alignment of the addresses in the ring 245 */ 246 struct wlan_psoc_host_dbr_ring_caps { 247 uint32_t pdev_id; 248 uint32_t mod_id; 249 uint32_t ring_elems_min; 250 uint32_t min_buf_size; 251 uint32_t min_buf_align; 252 }; 253 254 /** 255 * struct wlan_psoc_host_spectral_scaling_params - Spectral scaling params 256 * @pdev_id: Pdev id of the pdev 257 * @formula_id: Formula id 258 * @low_level_offset: Low level offset 259 * @high_level_offset: High level offset 260 * @rssi_thr: RSSI threshold 261 * @default_agc_max_gain: Default agc max gain 262 */ 263 struct wlan_psoc_host_spectral_scaling_params { 264 uint32_t pdev_id; 265 uint32_t formula_id; 266 uint32_t low_level_offset; 267 uint32_t high_level_offset; 268 uint32_t rssi_thr; 269 uint32_t default_agc_max_gain; 270 }; 271 272 /** 273 * struct wlan_psoc_host_chainmask_capabilities - chain mask capabilities list 274 * @supports_chan_width_20: channel width 20 support for this chain mask. 275 * @supports_chan_width_40: channel width 40 support for this chain mask. 276 * @supports_chan_width_80: channel width 80 support for this chain mask. 277 * @supports_chan_width_160: channel width 160 support for this chain mask. 278 * @supports_chan_width_80P80: channel width 80P80 support for this chain mask. 279 * @supports_aSpectral: Agile Spectral support for this chain mask. 280 * @supports_aSpectral_160: Agile Spectral support in 160 MHz. 281 * @supports_aDFS_160: Agile DFS support in 160 MHz for this chain mask. 282 * @chain_mask_2G: 2G support for this chain mask. 283 * @chain_mask_5G: 5G support for this chain mask. 284 * @chain_mask_tx: Tx support for this chain mask. 285 * @chain_mask_rx: Rx support for this chain mask. 286 * @supports_aDFS: Agile DFS support for this chain mask. 287 * @chainmask: chain mask value. 288 */ 289 struct wlan_psoc_host_chainmask_capabilities { 290 uint32_t supports_chan_width_20:1, 291 supports_chan_width_40:1, 292 supports_chan_width_80:1, 293 supports_chan_width_160:1, 294 supports_chan_width_80P80:1, 295 supports_aSpectral:1, 296 supports_aSpectral_160:1, 297 supports_aDFS_160:1, 298 reserved:19, 299 chain_mask_2G:1, 300 chain_mask_5G:1, 301 chain_mask_tx:1, 302 chain_mask_rx:1, 303 supports_aDFS:1; 304 uint32_t chainmask; 305 }; 306 307 /** 308 * struct wlan_psoc_host_chainmask_table - chain mask table 309 * @table_id: tableid. 310 * @num_valid_chainmasks: num valid chainmasks. 311 * @cap_list: pointer to wlan_psoc_host_chainmask_capabilities list. 312 */ 313 struct wlan_psoc_host_chainmask_table { 314 uint32_t table_id; 315 uint32_t num_valid_chainmasks; 316 struct wlan_psoc_host_chainmask_capabilities *cap_list; 317 }; 318 319 /** 320 * struct wlan_psoc_host_service_ext_param - EXT service base params in event 321 * @default_conc_scan_config_bits: Default concurrenct scan config 322 * @default_fw_config_bits: Default HW config bits 323 * @wlan_psoc_host_ppe_threshold ppet: Host PPE threshold struct 324 * @he_cap_info: HE capabality info 325 * @mpdu_density: units are microseconds 326 * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program 327 * Value 0 means FW hasn't given any limit to host. 328 * @fw_build_vers_ext: Extended FW build version info. 329 * bits 27:0 rsvd 330 * bits 31:28 CRM sub ID 331 * @num_hw_modes: Number of HW modes in event 332 * @num_phy: Number of Phy mode. 333 * @num_chainmask_tables: Number of chain mask tables. 334 * @num_dbr_ring_caps: Number of direct buf rx ring capabilities 335 * @max_bssid_indicator: Maximum number of VAPs in MBSS IE 336 * @num_bin_scaling_params: Number of Spectral bin scaling parameters 337 * @chainmask_table: Available chain mask tables. 338 * @sar_version: SAR version info 339 */ 340 struct wlan_psoc_host_service_ext_param { 341 uint32_t default_conc_scan_config_bits; 342 uint32_t default_fw_config_bits; 343 struct wlan_psoc_host_ppe_threshold ppet; 344 uint32_t he_cap_info; 345 uint32_t mpdu_density; 346 uint32_t max_bssid_rx_filters; 347 uint32_t fw_build_vers_ext; 348 uint32_t num_hw_modes; 349 uint32_t num_phy; 350 uint32_t num_chainmask_tables; 351 uint32_t num_dbr_ring_caps; 352 uint32_t max_bssid_indicator; 353 uint32_t num_bin_scaling_params; 354 struct wlan_psoc_host_chainmask_table 355 chainmask_table[PSOC_MAX_CHAINMASK_TABLES]; 356 uint32_t sar_version; 357 }; 358 359 /** 360 * struct wlan_psoc_host_service_ext2_param - EXT service base params in event 361 * reg_db_version_major: REG DB version major number 362 * reg_db_version_minor: REG DB version minor number 363 * bdf_reg_db_version_major: BDF REG DB version major number 364 * bdf_reg_db_version_minor: BDF REG DB version minor number 365 * @num_dbr_ring_caps: Number of direct buf rx ring capabilities 366 */ 367 struct wlan_psoc_host_service_ext2_param { 368 uint8_t reg_db_version_major; 369 uint8_t reg_db_version_minor; 370 uint8_t bdf_reg_db_version_major; 371 uint8_t bdf_reg_db_version_minor; 372 uint32_t num_dbr_ring_caps; 373 }; 374 375 #endif /* _SERVICE_READY_PARAM_H_*/ 376