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