1 /* 2 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: This target interface shall be used 22 * to communicate with target using WMI. 23 */ 24 #ifndef _WLAN_TARGET_IF_H_ 25 #define _WLAN_TARGET_IF_H_ 26 27 #include "qdf_types.h" 28 #include "qdf_util.h" 29 #include "wlan_objmgr_psoc_obj.h" 30 #include "wmi_unified_api.h" 31 #include "wmi_unified_priv.h" 32 #include "wmi_unified_param.h" 33 #include <target_type.h> 34 35 #define TGT_WMI_PDEV_ID_SOC 0 /* WMI SOC ID */ 36 37 /* ASCII "TGT\0" */ 38 #define TGT_MAGIC 0x54575400 39 40 #define target_if_fatal(params...) \ 41 QDF_TRACE_FATAL(QDF_MODULE_ID_TARGET_IF, params) 42 #define target_if_err(params...) \ 43 QDF_TRACE_ERROR(QDF_MODULE_ID_TARGET_IF, params) 44 #define target_if_warn(params...) \ 45 QDF_TRACE_WARN(QDF_MODULE_ID_TARGET_IF, params) 46 #define target_if_info(params...) \ 47 QDF_TRACE_INFO(QDF_MODULE_ID_TARGET_IF, params) 48 #define target_if_debug(params...) \ 49 QDF_TRACE_DEBUG(QDF_MODULE_ID_TARGET_IF, params) 50 #define TARGET_IF_ENTER() \ 51 QDF_TRACE_ENTER(QDF_MODULE_ID_TARGET_IF, "enter") 52 #define TARGET_IF_EXIT() \ 53 QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit") 54 #define target_if_err_rl(params...) \ 55 QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params) 56 57 58 #define targetif_nofl_fatal(params...) \ 59 QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 60 #define targetif_nofl_err(params...) \ 61 QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 62 #define targetif_nofl_warn(params...) \ 63 QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 64 #define targetif_nofl_info(params...) \ 65 QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 66 #define targetif_nofl_debug(params...) \ 67 QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 68 69 #ifdef SERIALIZE_WMI_RX_EXECUTION_CTX 70 #define WMI_RX_EXECUTION_CTX WMI_RX_SERIALIZER_CTX 71 #else 72 #define WMI_RX_EXECUTION_CTX WMI_RX_UMAC_CTX 73 #endif /* SERIALIZE_WMI_RX_EXECUTION_CTX */ 74 75 typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)( 76 void *scn_handle); 77 78 typedef struct wlan_objmgr_pdev *(*get_pdev_handle_callback)( 79 void *scn_handle); 80 81 typedef int (*wmi_legacy_service_ready_callback)(uint32_t event_id, 82 void *handle, 83 uint8_t *event_data, 84 uint32_t length); 85 86 /* Enum for ext and ext2 processing status */ 87 enum wmi_init_status { 88 wmi_init_success, 89 wmi_init_ext_processing_failed, 90 wmi_init_ext2_processing_failed, 91 }; 92 93 /** 94 * struct target_if_ctx - target_interface context 95 * @magic: magic for target if ctx 96 * @get_psoc_hdl_cb: function pointer to get psoc 97 * @get_pdev_hdl_cb: function pointer to get pdev 98 * @lock: spin lock for protecting the ctx 99 */ 100 struct target_if_ctx { 101 uint32_t magic; 102 get_psoc_handle_callback get_psoc_hdl_cb; 103 get_pdev_handle_callback get_pdev_hdl_cb; 104 wmi_legacy_service_ready_callback service_ready_cb; 105 qdf_spinlock_t lock; 106 }; 107 108 struct target_psoc_info; 109 /** 110 * struct host_fw_ver - holds host fw version 111 * @host_ver: Host version 112 * @target_ver: Target version ID 113 * @target_rev: Target revision ID 114 * @wlan_ver: FW SW version 115 * @wlan_ver_1: FW SW version second dword 116 * @abi_ver: ABI version 117 */ 118 struct host_fw_ver { 119 uint32_t host_ver; 120 uint32_t target_ver; 121 uint32_t target_rev; 122 uint32_t wlan_ver; 123 uint32_t wlan_ver_1; 124 uint32_t abi_ver; 125 }; 126 127 struct common_dbglog_handle; 128 struct common_accelerator_handle; 129 130 /** 131 * struct comp_hdls - Non-umac/lower layer components handles, it is a sub 132 * structure of target psoc information 133 * @hif_hdl: HIF handle 134 * @htc_hdl: HTC handle 135 * @wmi_hdl: WMI handle 136 * @accelerator_hdl: NSS offload/IPA handle 137 * @dbglog_hdl: Debug log handle 138 */ 139 struct comp_hdls { 140 struct hif_opaque_softc *hif_hdl; 141 HTC_HANDLE htc_hdl; 142 struct wmi_unified *wmi_hdl; 143 struct common_accelerator_handle *accelerator_hdl; 144 struct common_dbglog_handle *dbglog_hdl; 145 }; 146 147 /** 148 * struct target_supported_modes - List of HW modes supported by target. 149 * 150 * @num_modes: Number of modes supported 151 * @hw_mode_ids: List of HW mode ids 152 * @phy_bit_map: List of Phy bit maps 153 */ 154 struct target_supported_modes { 155 uint8_t num_modes; 156 uint32_t hw_mode_ids[WMI_HOST_HW_MODE_MAX]; 157 uint32_t phy_bit_map[WMI_HOST_HW_MODE_MAX]; 158 }; 159 160 /** 161 * struct target_version_info - Target version information 162 * 163 * @reg_db_version_major: REG DB version major 164 * @reg_db_version_minor: REG DB version minor 165 * @bdf_reg_db_version_major: BDF REG DB version major 166 * @bdf_reg_db_version_minor: BDF REG DB version minor 167 */ 168 struct target_version_info { 169 uint8_t reg_db_version_major; 170 uint8_t reg_db_version_minor; 171 uint8_t bdf_reg_db_version_major; 172 uint8_t bdf_reg_db_version_minor; 173 }; 174 175 /** 176 * struct tgt_info - FW or lower layer related info(required by target_if), 177 * it is a sub structure of taarget psoc information 178 * @version: Host FW version struct 179 * @wlan_res_cfg: target_resource_config info 180 * @wlan_ext_res_cfg: wmi_host_ext_resource_config info 181 * @wmi_service_ready: is service ready received 182 * @wmi_ready: is ready event received 183 * @total_mac_phy_cnt: num of mac phys 184 * @num_radios: number of radios 185 * @wmi_service_status: wmi service status success or failed 186 * @wlan_init_status: Target init status 187 * @target_type: Target type 188 * @max_descs: Max descriptors 189 * @preferred_hw_mode: preferred hw mode 190 * @wmi_timeout: wait timeout for target events 191 * @event: qdf_event for target events 192 * @service_bitmap: WMI service bitmap 193 * @target_cap: target capabilities 194 * @service_ext2_param: service ready ext2 event params 195 * @service_ext_param: ext service params 196 * @mac_phy_cap: phy caps array 197 * @mac_phy_caps_ext2: mac phy caps ext2 params 198 * @dbr_ring_cap: dbr_ring capability info 199 * @reg_cap: regulatory caps array 200 * @scaling_params: Spectral bin scaling parameters 201 * @num_mem_chunks: number of mem chunks allocated 202 * @hw_mode_caps: HW mode caps of preferred mode 203 * @mem_chunks: allocated memory blocks for FW 204 * @scan_radio_caps: scan radio capabilities 205 * @device_mode: Global Device mode 206 * @sbs_lower_band_end_freq: sbs lower band end frequency 207 * @health_mon_params: health monitor params 208 */ 209 struct tgt_info { 210 struct host_fw_ver version; 211 target_resource_config wlan_res_cfg; 212 wmi_host_ext_resource_config wlan_ext_res_cfg; 213 bool wmi_service_ready; 214 bool wmi_ready; 215 uint8_t total_mac_phy_cnt; 216 uint8_t num_radios; 217 enum wmi_init_status wmi_service_status; 218 uint32_t wlan_init_status; 219 uint32_t target_type; 220 uint32_t max_descs; 221 uint32_t preferred_hw_mode; 222 uint32_t wmi_timeout; 223 qdf_event_t event; 224 uint32_t service_bitmap[PSOC_SERVICE_BM_SIZE]; 225 struct wlan_psoc_target_capability_info target_caps; 226 struct wlan_psoc_host_service_ext_param service_ext_param; 227 struct wlan_psoc_host_service_ext2_param service_ext2_param; 228 struct wlan_psoc_host_mac_phy_caps 229 mac_phy_cap[PSOC_MAX_MAC_PHY_CAP]; 230 struct wlan_psoc_host_mac_phy_caps_ext2 231 mac_phy_caps_ext2[PSOC_MAX_MAC_PHY_CAP]; 232 struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap; 233 struct wlan_psoc_host_spectral_scaling_params *scaling_params; 234 uint32_t num_mem_chunks; 235 struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS]; 236 struct wlan_psoc_host_hw_mode_caps hw_mode_cap; 237 struct target_supported_modes hw_modes; 238 uint8_t pdev_id_to_phy_id_map[WLAN_UMAC_MAX_PDEVS]; 239 bool is_pdevid_to_phyid_map; 240 struct wlan_psoc_host_scan_radio_caps *scan_radio_caps; 241 uint32_t device_mode; 242 uint32_t sbs_lower_band_end_freq; 243 #ifdef HEALTH_MON_SUPPORT 244 struct wmi_health_mon_params health_mon_param; 245 #endif /* HEALTH_MON_SUPPORT */ 246 }; 247 248 /** 249 * struct target_ops - Holds feature specific function pointers, which would be 250 * invoked as part of service ready or ext service ready 251 * @ext_resource_config_enable: Ext resource config 252 * @peer_config: Peer config enable 253 * @mesh_support_enable: Mesh support enable 254 * @smart_antenna_enable: Smart antenna enable 255 * @atf_config_enable: ATF config enable 256 * @btcoex_config_enable: BTCOEX config enable 257 * @lteu_ext_support_enable: LTE-U Ext config enable 258 * @set_init_cmd_dev_based_params: Sets Init command params 259 * @alloc_pdevs: Allocates PDEVs 260 * @update_pdev_tgt_info: Updates PDEV target info 261 * @mem_mgr_alloc_chunk: Allocates memory through MEM manager 262 * @mem_mgr_free_chunks: Free memory chunks through MEM manager 263 * @print_svc_ready_ex_param: Print service ready ext params 264 * @add_11ax_modes: Adds 11ax modes to reg cap 265 * @set_default_tgt_config: Sets target config with default values 266 * @sw_version_check: Checks the SW version 267 * @smart_log_enable: Enable Smart Logs feature 268 * @cfr_support_enable: CFR support enable 269 * @set_pktlog_checksum: Set the pktlog checksum from FW ready event to pl_dev 270 * @csa_switch_count_status: CSA event handler 271 * @mlo_setup_done_event: MLO setup sequence complete event handler 272 */ 273 struct target_ops { 274 QDF_STATUS (*ext_resource_config_enable) 275 (struct wlan_objmgr_psoc *psoc, 276 struct target_psoc_info *tgt_info, uint8_t *event); 277 void (*peer_config) 278 (struct wlan_objmgr_psoc *psoc, 279 struct target_psoc_info *tgt_info, uint8_t *event); 280 void (*mesh_support_enable) 281 (struct wlan_objmgr_psoc *psoc, 282 struct target_psoc_info *tgt_info, uint8_t *event); 283 void (*smart_antenna_enable) 284 (struct wlan_objmgr_psoc *psoc, 285 struct target_psoc_info *tgt_info, uint8_t *event); 286 void (*atf_config_enable) 287 (struct wlan_objmgr_psoc *psoc, 288 struct target_psoc_info *tgt_info, uint8_t *event); 289 void (*btcoex_config_enable) 290 (struct wlan_objmgr_psoc *psoc, 291 struct target_psoc_info *tgt_info, uint8_t *event); 292 void (*lteu_ext_support_enable) 293 (struct wlan_objmgr_psoc *psoc, 294 struct target_psoc_info *tgt_info, uint8_t *event); 295 void (*set_init_cmd_dev_based_params) 296 (struct wlan_objmgr_psoc *psoc, 297 struct target_psoc_info *tgt_info); 298 QDF_STATUS (*alloc_pdevs) 299 (struct wlan_objmgr_psoc *psoc, 300 struct target_psoc_info *tgt_info); 301 QDF_STATUS (*update_pdev_tgt_info) 302 (struct wlan_objmgr_psoc *psoc, 303 struct target_psoc_info *tgt_info); 304 uint32_t (*mem_mgr_alloc_chunk)(struct wlan_objmgr_psoc *psoc, 305 struct target_psoc_info *tgt_info, 306 u_int32_t req_id, u_int32_t idx, u_int32_t num_units, 307 u_int32_t unit_len, u_int32_t num_unit_info); 308 QDF_STATUS (*mem_mgr_free_chunks)(struct wlan_objmgr_psoc *psoc, 309 struct target_psoc_info *tgt_hdl); 310 void (*print_svc_ready_ex_param)( 311 struct wlan_objmgr_psoc *psoc, 312 struct target_psoc_info *tgt_info); 313 void (*add_11ax_modes)( 314 struct wlan_objmgr_psoc *psoc, 315 struct target_psoc_info *tgt_info); 316 void (*set_default_tgt_config)( 317 struct wlan_objmgr_psoc *psoc, 318 struct target_psoc_info *tgt_info); 319 QDF_STATUS (*sw_version_check)( 320 struct wlan_objmgr_psoc *psoc, 321 struct target_psoc_info *tgt_hdl, 322 uint8_t *evt_buf); 323 void (*eapol_minrate_enable) 324 (struct wlan_objmgr_psoc *psoc, 325 struct target_psoc_info *tgt_info, uint8_t *event); 326 void (*cfr_support_enable) 327 (struct wlan_objmgr_psoc *psoc, 328 struct target_psoc_info *tgt_info, uint8_t *event); 329 void (*set_pktlog_checksum) 330 (struct wlan_objmgr_pdev *pdev, uint32_t checksum); 331 int (*csa_switch_count_status)( 332 struct wlan_objmgr_psoc *psoc, 333 struct pdev_csa_switch_count_status csa_status); 334 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 335 bool (*mlo_capable)(struct wlan_objmgr_psoc *psoc); 336 void (*mlo_setup_done_event)(struct wlan_objmgr_psoc *psoc); 337 #endif 338 }; 339 340 341 342 /** 343 * struct target_psoc_info - target psoc information 344 * @hdls: component handles (htc/htt/wmi) sub structure 345 * @info: target related info sub structure 346 * @feature_ptr: stores legacy pointer or few driver specific structures 347 * @tif_ops: holds driver specific function pointers 348 */ 349 struct target_psoc_info { 350 struct comp_hdls hdls; 351 struct tgt_info info; 352 void *feature_ptr; 353 struct target_ops *tif_ops; 354 }; 355 356 /** 357 * struct target_pdev_info - target pdev information 358 * @wmi_handle: WMI handle 359 * @accelerator_hdl: NSS offload/IPA handles 360 * @pdev_idx: pdev id (of FW) 361 * @phy_idx: phy id (of FW) 362 * @hw_link_id: Unique link id across SoC required in multi-soc ML 363 * @feature_ptr: stores legacy pointer or few driver specific structures 364 */ 365 struct target_pdev_info { 366 struct wmi_unified *wmi_handle; 367 struct common_accelerator_handle *accelerator_hdl; 368 int32_t pdev_idx; 369 int32_t phy_idx; 370 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 371 uint16_t hw_link_id; 372 #endif 373 void *feature_ptr; 374 }; 375 376 /** 377 * struct target_mu_caps - max number of users per-PPDU for OFDMA/MU-MIMO 378 * @ofdma_dl: max users for Downlink OFDMA transmissions 379 * @ofdma_ul: max users for Uplink OFDMA transmissions 380 * @mumimo_dl: max users for Downlink MU-MIMO transmissions 381 * @mumimo_ul: max users for Uplink MU-MIMO transmissions 382 */ 383 struct target_mu_caps { 384 uint16_t ofdma_dl; 385 uint16_t ofdma_ul; 386 uint16_t mumimo_dl; 387 uint16_t mumimo_ul; 388 }; 389 390 391 /** 392 * target_if_init() - target_if Initialization 393 * @get_wmi_handle: function pointer to get wmi handle 394 * 395 * 396 * Return: QDF_STATUS 397 */ 398 QDF_STATUS target_if_init(get_psoc_handle_callback psoc_hdl_cb); 399 400 /** 401 * target_if_deinit() - Close target_if 402 * @scn_handle: scn handle 403 * 404 * Return: QDF_STATUS_SUCCESS - in case of success 405 */ 406 QDF_STATUS target_if_deinit(void); 407 408 /** 409 * target_if_store_pdev_target_if_ctx() - stores objmgr pdev in target if ctx 410 * @pdev_hdl_cb: function pointer to get objmgr pdev 411 * 412 * Return: QDF_STATUS_SUCCESS - in case of success 413 */ 414 QDF_STATUS target_if_store_pdev_target_if_ctx( 415 get_pdev_handle_callback pdev_hdl_cb); 416 417 /** 418 * wlan_get_tgt_if_ctx() -Get target if ctx 419 * 420 * Return: target if ctx 421 */ 422 struct target_if_ctx *target_if_get_ctx(void); 423 424 /** 425 * target_if_get_psoc_from_scn_hdl() - get psoc from scn handle 426 * @scn_handle: scn handle 427 * 428 * This API is generally used while processing wmi event. 429 * In wmi event SCN handle will be passed by wmi hence 430 * using this API we can get psoc from scn handle. 431 * 432 * Return: index for matching scn handle 433 */ 434 struct wlan_objmgr_psoc *target_if_get_psoc_from_scn_hdl(void *scn_handle); 435 436 /** 437 * target_if_get_pdev_from_scn_hdl() - get pdev from scn handle 438 * @scn_handle: scn handle 439 * 440 * This API is generally used while processing wmi event. 441 * In wmi event SCN handle will be passed by wmi hence 442 * using this API we can get pdev from scn handle. 443 * 444 * Return: pdev for matching scn handle 445 */ 446 struct wlan_objmgr_pdev *target_if_get_pdev_from_scn_hdl(void *scn_handle); 447 448 /** target_if_register_tx_ops() - register tx_ops 449 * @tx_ops: tx_ops structure 450 * 451 * This function is to be used by components to populate 452 * the OL function pointers (tx_ops) required by the component 453 * for UMAC-LMAC interaction, with the appropriate handler 454 * 455 * Return: QDF STATUS 456 */ 457 QDF_STATUS target_if_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); 458 459 /** 460 * target_if_get_psoc_legacy_service_ready_cb() - get psoc from scn handle 461 * 462 * This API is generally used while processing wmi event. 463 * In wmi event SCN handle will be passed by wmi hence 464 * using this API we can get psoc from scn handle. 465 * 466 * Return: wmi_legacy_service_ready_callback 467 */ 468 wmi_legacy_service_ready_callback 469 target_if_get_psoc_legacy_service_ready_cb(void); 470 471 /** 472 * target_if_register_legacy_service_ready_cb() - get legacy 473 * service ready handler from scn handle 474 * 475 * @service_ready_cb: function pointer to service ready callback 476 * 477 * Return: QDF Status 478 */ 479 QDF_STATUS target_if_register_legacy_service_ready_cb( 480 wmi_legacy_service_ready_callback service_ready_cb); 481 482 /** 483 * target_if_alloc_pdev_tgt_info() - alloc pdev tgt info 484 * @pdev: pointer to pdev 485 * 486 * API to allocate memory for target_pdev_info 487 * 488 * Return: SUCCESS on successful memory allocation or Failure 489 */ 490 QDF_STATUS target_if_alloc_pdev_tgt_info(struct wlan_objmgr_pdev *pdev); 491 492 /** 493 * target_if_free_pdev_tgt_info() - free pdev tgt info 494 * @pdev: pointer to pdev 495 * 496 * API to free allocated memory for target_pdev_info 497 * 498 * Return: SUCCESS on successful memory deallocation or Failure 499 */ 500 QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev); 501 502 /** 503 * target_if_alloc_psoc_tgt_info() - alloc psoc tgt info 504 * @psoc: pointer to psoc 505 * 506 * API to allocate memory for target_psoc_info 507 * 508 * Return: SUCCESS on successful memory allocation or Failure 509 */ 510 QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc); 511 512 /** 513 * target_if_free_psoc_tgt_info() - free psoc tgt info 514 * @psoc: pointer to psoc 515 * 516 * API to free allocated memory for target_psoc_info 517 * 518 * Return: SUCCESS on successful memory deallocation or Failure 519 */ 520 QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc); 521 522 /** 523 * target_is_tgt_type_ar900b() - Check if the target type is AR900B 524 * @target_type: target type to be checked. 525 * 526 * Return: true if the target_type is AR900B, else false. 527 */ 528 bool target_is_tgt_type_ar900b(uint32_t target_type); 529 530 /** 531 * target_is_tgt_type_qca9984() - Check if the target type is QCA9984 532 * @target_type: target type to be checked. 533 * 534 * Return: true if the target_type is QCA9984, else false. 535 */ 536 bool target_is_tgt_type_qca9984(uint32_t target_type); 537 538 /** 539 * target_is_tgt_type_qca9888() - Check if the target type is QCA9888 540 * @target_type: target type to be checked. 541 * 542 * Return: true if the target_type is QCA9888, else false. 543 */ 544 bool target_is_tgt_type_qca9888(uint32_t target_type); 545 546 /** 547 * target_is_tgt_type_adrastea() - Check if the target type is QCS40X 548 * @target_type: target type to be checked. 549 * 550 * Return: true if the target_type is QCS40X, else false. 551 */ 552 bool target_is_tgt_type_adrastea(uint32_t target_type); 553 554 /** 555 * target_is_tgt_type_qcn9000() - Check if the target type is QCN9000 (pine) 556 * @target_type: target type to be checked. 557 * 558 * Return: true if the target_type is QCN9000, else false. 559 */ 560 bool target_is_tgt_type_qcn9000(uint32_t target_type); 561 562 /** 563 * target_is_tgt_type_qcn6122() - Check if the target type is QCN6122 (Spruce) 564 * @target_type: target type to be checked. 565 * 566 * Return: true if the target_type is QCN6122, else false. 567 */ 568 bool target_is_tgt_type_qcn6122(uint32_t target_type); 569 570 /** 571 * target_is_tgt_type_qcn7605() - Check if the target type is QCN7605 572 * @target_type: target type to be checked. 573 * 574 * Return: true if the target_type is QCN7605, else false. 575 */ 576 bool target_is_tgt_type_qcn7605(uint32_t target_type); 577 578 /** 579 * target_psoc_set_wlan_init_status() - set info wlan_init_status 580 * @psoc_info: pointer to structure target_psoc_info 581 * @wlan_init_status: FW init status 582 * 583 * API to set wlan_init_status 584 * 585 * Return: void 586 */ 587 static inline void target_psoc_set_wlan_init_status 588 (struct target_psoc_info *psoc_info, uint32_t wlan_init_status) 589 { 590 if (!psoc_info) 591 return; 592 593 psoc_info->info.wlan_init_status = wlan_init_status; 594 } 595 596 /** 597 * target_psoc_get_wlan_init_status() - get info wlan_init_status 598 * @psoc_info: pointer to structure target_psoc_info 599 * 600 * API to get wlan_init_status 601 * 602 * Return: uint32_t 603 */ 604 static inline uint32_t target_psoc_get_wlan_init_status 605 (struct target_psoc_info *psoc_info) 606 { 607 if (!psoc_info) 608 return (uint32_t)-1; 609 610 return psoc_info->info.wlan_init_status; 611 } 612 613 /** 614 * target_psoc_set_target_type() - set info target_type 615 * @psoc_info: pointer to structure target_psoc_info 616 * @target_type: Target type 617 * 618 * API to set target_type 619 * 620 * Return: void 621 */ 622 static inline void target_psoc_set_target_type 623 (struct target_psoc_info *psoc_info, uint32_t target_type) 624 { 625 if (!psoc_info) 626 return; 627 628 psoc_info->info.target_type = target_type; 629 } 630 631 /** 632 * target_psoc_get_target_type() - get info target_type 633 * @psoc_info: pointer to structure target_psoc_info 634 * 635 * API to get target_type 636 * 637 * Return: unit32_t 638 */ 639 static inline uint32_t target_psoc_get_target_type 640 (struct target_psoc_info *psoc_info) 641 { 642 if (!psoc_info) 643 return (uint32_t)-1; 644 645 return psoc_info->info.target_type; 646 } 647 648 /** 649 * target_psoc_set_max_descs() - set info max_descs 650 * @psoc_info: pointer to structure target_psoc_info 651 * @max_descs: Max descriptors 652 * 653 * API to set max_descs 654 * 655 * Return: void 656 */ 657 static inline void target_psoc_set_max_descs 658 (struct target_psoc_info *psoc_info, uint32_t max_descs) 659 { 660 if (!psoc_info) 661 return; 662 663 psoc_info->info.max_descs = max_descs; 664 } 665 666 /** 667 * target_psoc_get_max_descs() - get info max_descs 668 * @psoc_info: pointer to structure target_psoc_info 669 * 670 * API to get max_descs 671 * 672 * Return: unint32_t 673 */ 674 static inline uint32_t target_psoc_get_max_descs 675 (struct target_psoc_info *psoc_info) 676 { 677 if (!psoc_info) 678 return (uint32_t)-1; 679 680 return psoc_info->info.max_descs; 681 } 682 683 /** 684 * target_psoc_set_wmi_service_ready() - set info wmi_service_ready 685 * @psoc_info: pointer to structure target_psoc_info 686 * @wmi_service_ready: service ready flag 687 * 688 * API to set wmi_service_ready 689 * 690 * Return: void 691 */ 692 static inline void target_psoc_set_wmi_service_ready 693 (struct target_psoc_info *psoc_info, bool wmi_service_ready) 694 { 695 if (!psoc_info) 696 return; 697 698 psoc_info->info.wmi_service_ready = wmi_service_ready; 699 } 700 701 /** 702 * target_psoc_get_wmi_service_ready() - get info wmi_service_ready 703 * @psoc_info: pointer to structure target_psoc_info 704 * 705 * API to get wmi_service_ready 706 * 707 * Return: bool 708 */ 709 static inline bool target_psoc_get_wmi_service_ready 710 (struct target_psoc_info *psoc_info) 711 { 712 return psoc_info->info.wmi_service_ready; 713 } 714 715 /** 716 * target_psoc_set_wmi_ready() - set info wmi_ready 717 * @psoc_info: pointer to structure target_psoc_info 718 * @wmi_ready: Ready event flag 719 * 720 * API to set wmi_ready 721 * 722 * Return: void 723 */ 724 static inline void target_psoc_set_wmi_ready 725 (struct target_psoc_info *psoc_info, bool wmi_ready) 726 { 727 if (!psoc_info) 728 return; 729 730 psoc_info->info.wmi_ready = wmi_ready; 731 } 732 733 /** 734 * target_psoc_get_wmi_ready() - get info wmi_ready 735 * @psoc_info: pointer to structure target_psoc_info 736 * 737 * API to get wmi_ready 738 * 739 * Return: bool 740 */ 741 static inline bool target_psoc_get_wmi_ready 742 (struct target_psoc_info *psoc_info) 743 { 744 return psoc_info->info.wmi_ready; 745 } 746 747 /** 748 * target_psoc_set_preferred_hw_mode() - set preferred_hw_mode 749 * @psoc_info: pointer to structure target_psoc_info 750 * @preferred_hw_mode: Preferred HW mode 751 * 752 * API to set preferred_hw_mode 753 * 754 * Return: void 755 */ 756 static inline void target_psoc_set_preferred_hw_mode( 757 struct target_psoc_info *psoc_info, uint32_t preferred_hw_mode) 758 { 759 if (!psoc_info) 760 return; 761 762 psoc_info->info.preferred_hw_mode = preferred_hw_mode; 763 } 764 765 /** 766 * target_psoc_get_preferred_hw_mode() - get preferred_hw_mode 767 * @psoc_info: pointer to structure target_psoc_info 768 * 769 * API to get preferred_hw_mode 770 * 771 * Return: unint32_t 772 */ 773 static inline uint32_t target_psoc_get_preferred_hw_mode 774 (struct target_psoc_info *psoc_info) 775 { 776 if (!psoc_info) 777 return WMI_HOST_HW_MODE_MAX; 778 779 return psoc_info->info.preferred_hw_mode; 780 } 781 782 /** 783 * target_psoc_get_supported_hw_modes() - get supported_hw_mode in target 784 * @psoc_info: pointer to structure target_psoc_info 785 * 786 * API to get list of supported HW modes 787 * 788 * Return: pointer to target_supported_modes 789 */ 790 static inline struct target_supported_modes *target_psoc_get_supported_hw_modes 791 (struct target_psoc_info *psoc_info) 792 { 793 if (!psoc_info) 794 return NULL; 795 796 return &psoc_info->info.hw_modes; 797 } 798 799 /** 800 * target_psoc_set_wmi_timeout() - set wmi_timeout 801 * @psoc_info: pointer to structure target_psoc_info 802 * @wmi_timeout: WMI timeout value in sec 803 * 804 * API to set wmi_timeout 805 * 806 * Return: void 807 */ 808 static inline void target_psoc_set_wmi_timeout 809 (struct target_psoc_info *psoc_info, uint32_t wmi_timeout) 810 { 811 if (!psoc_info) 812 return; 813 814 psoc_info->info.wmi_timeout = wmi_timeout; 815 } 816 817 /** 818 * target_psoc_get_wmi_timeout() - get wmi_timeout 819 * @psoc_info: pointer to structure target_psoc_info 820 * 821 * API to get wmi_timeout 822 * 823 * Return: unint32_t 824 */ 825 static inline uint32_t target_psoc_get_wmi_timeout 826 (struct target_psoc_info *psoc_info) 827 { 828 if (!psoc_info) 829 return (uint32_t)-1; 830 831 return psoc_info->info.wmi_timeout; 832 } 833 834 /** 835 * target_psoc_set_total_mac_phy_cnt() - set total_mac_phy 836 * @psoc_info: pointer to structure target_psoc_infoa 837 * @total_mac_phy_cnt: Total MAC PHY cnt 838 * 839 * API to set total_mac_phy 840 * 841 * Return: void 842 */ 843 static inline void target_psoc_set_total_mac_phy_cnt 844 (struct target_psoc_info *psoc_info, uint8_t total_mac_phy_cnt) 845 { 846 if (!psoc_info) 847 return; 848 849 psoc_info->info.total_mac_phy_cnt = total_mac_phy_cnt; 850 } 851 852 /** 853 * target_psoc_get_total_mac_phy_cnt() - get total_mac_phy 854 * @psoc_info: pointer to structure target_psoc_info 855 * 856 * API to get total_mac_phy 857 * 858 * Return: unint8_t 859 */ 860 static inline uint8_t target_psoc_get_total_mac_phy_cnt( 861 struct target_psoc_info *psoc_info) 862 { 863 if (!psoc_info) 864 return 0; 865 866 return psoc_info->info.total_mac_phy_cnt; 867 } 868 869 /** 870 * target_psoc_set_num_radios() - set num of radios 871 * @psoc_info: pointer to structure target_psoc_info 872 * @num_radios: Number of radios 873 * 874 * API to set number of radios 875 * 876 * Return: number of radios 877 */ 878 static inline void target_psoc_set_num_radios( 879 struct target_psoc_info *psoc_info, uint8_t num_radios) 880 { 881 if (!psoc_info) 882 return; 883 884 psoc_info->info.num_radios = num_radios; 885 } 886 887 /** 888 * target_psoc_set_pdev_id_to_phy_id_map() - set pdev to phy id mapping 889 * @psoc_info: pointer to structure target_psoc_info 890 * @pdev_id: pdev id 891 * @phy_id: phy_id 892 * 893 * API to set pdev id to phy id mapping 894 * 895 * Return: void 896 */ 897 static inline void target_psoc_set_pdev_id_to_phy_id_map( 898 struct target_psoc_info *psoc_info, 899 uint8_t *phy_id_map) 900 { 901 if (!psoc_info) 902 return; 903 904 psoc_info->info.is_pdevid_to_phyid_map = true; 905 qdf_mem_copy(psoc_info->info.pdev_id_to_phy_id_map, phy_id_map, 906 PSOC_MAX_PHY_REG_CAP); 907 } 908 909 /** 910 * target_psoc_get_num_radios() - get number of radios 911 * @psoc_info: pointer to structure target_psoc_info 912 * 913 * API to get number_of_radios 914 * 915 * Return: number of radios 916 */ 917 static inline uint8_t target_psoc_get_num_radios 918 (struct target_psoc_info *psoc_info) 919 { 920 if (!psoc_info) 921 return 0; 922 923 return psoc_info->info.num_radios; 924 } 925 926 /** 927 * target_psoc_get_num_radios_for_mode() - get number of radios for a hw-mode 928 * @psoc_info: pointer to structure target_psoc_info 929 * 930 * API to get number_of_radios for a HW mode 931 * 932 * Return: number of radios 933 */ 934 935 static inline uint8_t target_psoc_get_num_radios_for_mode 936 (struct target_psoc_info *psoc_info, uint8_t mode) 937 { 938 uint8_t mac_phy_count; 939 uint8_t num_radios = 0; 940 struct tgt_info *info = &psoc_info->info; 941 942 if (!psoc_info) 943 return 0; 944 945 for (mac_phy_count = 0; 946 mac_phy_count < target_psoc_get_total_mac_phy_cnt(psoc_info); 947 mac_phy_count++) { 948 num_radios += 949 (info->mac_phy_cap[mac_phy_count].hw_mode_id == mode); 950 } 951 952 return num_radios; 953 } 954 955 /** 956 * target_psoc_set_service_bitmap() - set service_bitmap 957 * @psoc_info: pointer to structure target_psoc_info 958 * @service_bitmap: FW service bitmap 959 * 960 * API to set service_bitmap 961 * 962 * Return: void 963 */ 964 static inline void target_psoc_set_service_bitmap 965 (struct target_psoc_info *psoc_info, uint32_t *service_bitmap) 966 { 967 qdf_mem_copy(psoc_info->info.service_bitmap, service_bitmap, 968 sizeof(psoc_info->info.service_bitmap)); 969 } 970 971 /** 972 * target_psoc_get_service_bitmap() - get service_bitmap 973 * @psoc_info: pointer to structure target_psoc_info 974 * 975 * API to get service_bitmap 976 * 977 * Return: unint32_t 978 */ 979 static inline uint32_t *target_psoc_get_service_bitmap 980 (struct target_psoc_info *psoc_info) 981 { 982 return psoc_info->info.service_bitmap; 983 } 984 985 /** 986 * target_psoc_set_num_mem_chunks - set num_mem_chunks 987 * @psoc_info: pointer to structure target_psoc_info 988 & @num_mem_chunks: Num Memory chunks allocated for FW 989 * 990 * API to set num_mem_chunks 991 * 992 * Return: void 993 */ 994 static inline void target_psoc_set_num_mem_chunks( 995 struct target_psoc_info *psoc_info, uint32_t num_mem_chunks) 996 { 997 if (!psoc_info) 998 return; 999 psoc_info->info.num_mem_chunks = num_mem_chunks; 1000 } 1001 1002 /** 1003 * target_psoc_get_num_mem_chunks() - get num_mem_chunks 1004 * @psoc_info: pointer to structure target_psoc_info 1005 * 1006 * API to get total_mac_phy 1007 * 1008 * Return: unint8_t 1009 */ 1010 static inline uint32_t target_psoc_get_num_mem_chunks 1011 (struct target_psoc_info *psoc_info) 1012 { 1013 if (!psoc_info) 1014 return (uint32_t)-1; 1015 1016 return psoc_info->info.num_mem_chunks; 1017 } 1018 /** 1019 * target_psoc_set_hif_hdl - set hif_hdl 1020 * @psoc_info: pointer to structure target_psoc_info 1021 * @hif_hdl: HIF handle 1022 * 1023 * API to set hif_hdl 1024 * 1025 * Return: void 1026 */ 1027 static inline void target_psoc_set_hif_hdl 1028 (struct target_psoc_info *psoc_info, 1029 struct hif_opaque_softc *hif_hdl) 1030 { 1031 if (!psoc_info) 1032 return; 1033 1034 psoc_info->hdls.hif_hdl = hif_hdl; 1035 } 1036 1037 /** 1038 * target_psoc_get_hif_hdl() - get hif_hdl 1039 * @psoc_info: pointer to structure target_psoc_info 1040 * 1041 * API to get hif_hdl 1042 * 1043 * Return: hif_hdl 1044 */ 1045 static inline struct hif_opaque_softc *target_psoc_get_hif_hdl 1046 (struct target_psoc_info *psoc_info) 1047 { 1048 if (!psoc_info) 1049 return NULL; 1050 1051 return psoc_info->hdls.hif_hdl; 1052 } 1053 1054 /** 1055 * target_psoc_set_hif_hdl - set htc_hdl 1056 * @psoc_info: pointer to structure target_psoc_info 1057 * @htc_hdl: HTC handle 1058 * 1059 * API to set htc_hdl 1060 * 1061 * Return: void 1062 */ 1063 static inline void target_psoc_set_htc_hdl( 1064 struct target_psoc_info *psoc_info, 1065 HTC_HANDLE htc_hdl) 1066 { 1067 if (!psoc_info) 1068 return; 1069 1070 psoc_info->hdls.htc_hdl = htc_hdl; 1071 } 1072 1073 /** 1074 * target_psoc_get_htc_hdl() - get htc_hdl 1075 * @psoc_info: pointer to structure target_psoc_info 1076 * 1077 * API to get htc_hdl 1078 * 1079 * Return: htc_hdl 1080 */ 1081 static inline HTC_HANDLE target_psoc_get_htc_hdl 1082 (struct target_psoc_info *psoc_info) 1083 { 1084 if (!psoc_info) 1085 return NULL; 1086 1087 return psoc_info->hdls.htc_hdl; 1088 } 1089 /** 1090 * target_psoc_set_wmi_hdl - set wmi_hdl 1091 * @psoc_info: pointer to structure target_psoc_info 1092 * @wmi_hdl: WMI handle 1093 * 1094 * API to set wmi_hdl 1095 * 1096 * Return: void 1097 */ 1098 static inline void target_psoc_set_wmi_hdl 1099 (struct target_psoc_info *psoc_info, 1100 struct wmi_unified *wmi_hdl) 1101 { 1102 if (!psoc_info) 1103 return; 1104 1105 psoc_info->hdls.wmi_hdl = wmi_hdl; 1106 } 1107 1108 /** 1109 * target_psoc_get_wmi_hdl() - get wmi_hdl 1110 * @psoc_info: pointer to structure target_psoc_info 1111 * 1112 * API to get wmi_hdl 1113 * 1114 * Return: wmi_hdl 1115 */ 1116 static inline struct wmi_unified *target_psoc_get_wmi_hdl 1117 (struct target_psoc_info *psoc_info) 1118 { 1119 if (!psoc_info) 1120 return NULL; 1121 1122 return psoc_info->hdls.wmi_hdl; 1123 } 1124 1125 /** 1126 * target_psoc_set_accelerator_hdl - set accelerator_hdl 1127 * @psoc_info: pointer to structure target_psoc_info 1128 * @accelerator_hdl: Accelator handle 1129 * 1130 * API to set accelerator_hdl 1131 * 1132 * Return: void 1133 */ 1134 static inline void target_psoc_set_accelerator_hdl 1135 (struct target_psoc_info *psoc_info, 1136 struct common_accelerator_handle *accelerator_hdl) 1137 { 1138 if (!psoc_info) 1139 return; 1140 1141 psoc_info->hdls.accelerator_hdl = accelerator_hdl; 1142 } 1143 1144 /** 1145 * target_psoc_get_accelerator_hdl() - get accelerator_hdl 1146 * @psoc_info: pointer to structure target_psoc_info 1147 * 1148 * API to get accelerator_hdl 1149 * 1150 * Return: accelerator_hdl 1151 */ 1152 static inline 1153 struct common_accelerator_handle *target_psoc_get_accelerator_hdl 1154 (struct target_psoc_info *psoc_info) 1155 { 1156 if (!psoc_info) 1157 return NULL; 1158 1159 return psoc_info->hdls.accelerator_hdl; 1160 } 1161 1162 /** 1163 * target_psoc_set_feature_ptr - set feature_ptr 1164 * @psoc_info: pointer to structure target_psoc_info 1165 * @feature_ptr: set feature pointer 1166 * 1167 * API to set feature_ptr 1168 * 1169 * Return: void 1170 */ 1171 static inline void target_psoc_set_feature_ptr 1172 (struct target_psoc_info *psoc_info, void *feature_ptr) 1173 { 1174 if (!psoc_info) 1175 return; 1176 1177 psoc_info->feature_ptr = feature_ptr; 1178 } 1179 1180 /** 1181 * target_psoc_get_feature_ptr() - get feature_ptr 1182 * @psoc_info: pointer to structure target_psoc_info 1183 * 1184 * API to get feature_ptr 1185 * 1186 * Return: feature_ptr 1187 */ 1188 static inline void *target_psoc_get_feature_ptr 1189 (struct target_psoc_info *psoc_info) 1190 { 1191 if (!psoc_info) 1192 return NULL; 1193 1194 return psoc_info->feature_ptr; 1195 } 1196 1197 /** 1198 * target_psoc_get_version()- get host_fw_ver version 1199 * @psoc_info: pointer to structure target_psoc_info 1200 * 1201 * API to get host_fw_ver version 1202 * 1203 * Return: void 1204 */ 1205 static inline struct host_fw_ver *target_psoc_get_version 1206 (struct target_psoc_info *psoc_info) 1207 { 1208 return &psoc_info->info.version; 1209 } 1210 1211 /** 1212 * target_psoc_get_target_ver()- get target version 1213 * @psoc_info: pointer to structure target_psoc_info 1214 * 1215 * API to get target version 1216 * 1217 * Return: target version 1218 */ 1219 static inline uint32_t target_psoc_get_target_ver 1220 (struct target_psoc_info *psoc_info) 1221 { 1222 return psoc_info->info.version.target_ver; 1223 } 1224 1225 /** 1226 * target_psoc_set_target_ver()- set target version 1227 * @psoc_info: pointer to structure target_psoc_info 1228 * @target_ver: Target version 1229 * 1230 * API to set target version 1231 * 1232 * Return: void 1233 */ 1234 static inline void target_psoc_set_target_ver 1235 (struct target_psoc_info *psoc_info, uint32_t target_ver) 1236 { 1237 if (!psoc_info) 1238 return; 1239 1240 psoc_info->info.version.target_ver = target_ver; 1241 } 1242 1243 /** 1244 * target_psoc_set_target_rev()- set target revision 1245 * @psoc_info: pointer to structure target_psoc_info 1246 * @target_rev: Target revision 1247 * 1248 * API to get target version 1249 * 1250 * Return: void 1251 */ 1252 static inline void target_psoc_set_target_rev 1253 (struct target_psoc_info *psoc_info, uint32_t target_rev) 1254 { 1255 if (!psoc_info) 1256 return; 1257 1258 psoc_info->info.version.target_rev = target_rev; 1259 } 1260 1261 /** 1262 * target_psoc_get_target_rev()- get target revision 1263 * @psoc_info: pointer to structure target_psoc_info 1264 * 1265 * API to get target revision 1266 * 1267 * Return: target revision 1268 */ 1269 static inline uint32_t target_psoc_get_target_rev 1270 (struct target_psoc_info *psoc_info) 1271 { 1272 return psoc_info->info.version.target_rev; 1273 } 1274 1275 /** 1276 * target_psoc_set_dbglog_hdl - set dbglog_hdl 1277 * @psoc_info: pointer to structure target_psoc_info 1278 * @dbglog_hdl: dbglog handle 1279 * 1280 * API to set dbglog_hdl 1281 * 1282 * Return: void 1283 */ 1284 static inline void target_psoc_set_dbglog_hdl 1285 (struct target_psoc_info *psoc_info, 1286 struct common_dbglog_handle *dbglog_hdl) 1287 { 1288 if (!psoc_info) 1289 return; 1290 1291 psoc_info->hdls.dbglog_hdl = dbglog_hdl; 1292 } 1293 1294 /** 1295 * target_psoc_get_dbglog_hdl() - get dbglog_hdl 1296 * @psoc_info: pointer to structure target_psoc_info 1297 * 1298 * API to get dbglog_hdl 1299 * 1300 * Return: dbglog_hdl 1301 */ 1302 static inline struct common_dbglog_handle *target_psoc_get_dbglog_hdl 1303 (struct target_psoc_info *psoc_info) 1304 { 1305 if (!psoc_info) 1306 return NULL; 1307 1308 return psoc_info->hdls.dbglog_hdl; 1309 } 1310 1311 /** 1312 * target_psoc_get_wlan_res_cfg() - get wlan_res_cfg 1313 * @psoc_info: pointer to structure target_psoc_info 1314 * 1315 * API to get wlan_res_cfg 1316 * 1317 * Return: structure pointer to host_fw_ver 1318 */ 1319 static inline target_resource_config *target_psoc_get_wlan_res_cfg 1320 (struct target_psoc_info *psoc_info) 1321 { 1322 if (!psoc_info) 1323 return NULL; 1324 1325 return &psoc_info->info.wlan_res_cfg; 1326 } 1327 1328 /** 1329 * target_psoc_get_wlan_ext_res_cfg() - get wlan_ext_res_cfg 1330 * @psoc_info: pointer to structure target_psoc_info 1331 * 1332 * API to get wlan_ext_res_cfg 1333 * 1334 * Return: structure pointer to wmi_host_ext_resource_config 1335 */ 1336 static inline wmi_host_ext_resource_config *target_psoc_get_wlan_ext_res_cfg 1337 (struct target_psoc_info *psoc_info) 1338 { 1339 if (!psoc_info) 1340 return NULL; 1341 1342 return &psoc_info->info.wlan_ext_res_cfg; 1343 } 1344 1345 /** 1346 * target_psoc_get_event_queue() - get event_queue 1347 * @psoc_info: pointer to structure target_psoc_info 1348 * 1349 * API to get event_queue 1350 * 1351 * Return: structure pointer to qdf_wait_queue_head_t 1352 */ 1353 static inline qdf_event_t *target_psoc_get_event 1354 (struct target_psoc_info *psoc_info) 1355 { 1356 if (!psoc_info) 1357 return NULL; 1358 1359 return &psoc_info->info.event; 1360 } 1361 1362 /** 1363 * target_psoc_get_target_caps() - get target_caps 1364 * @psoc_info: pointer to structure target_psoc_info 1365 * 1366 * API to get target_caps 1367 * 1368 * Return: structure pointer to wlan_psoc_target_capability_info 1369 */ 1370 static inline struct wlan_psoc_target_capability_info 1371 *target_psoc_get_target_caps(struct target_psoc_info *psoc_info) 1372 { 1373 if (!psoc_info) 1374 return NULL; 1375 1376 return &psoc_info->info.target_caps; 1377 } 1378 1379 /** 1380 * target_psoc_get_service_ext_param() - get service_ext_param 1381 * @psoc_info: pointer to structure target_psoc_info 1382 * 1383 * API to get service_ext_param 1384 * 1385 * Return: structure pointer to wlan_psoc_host_service_ext_param 1386 */ 1387 static inline struct wlan_psoc_host_service_ext_param 1388 *target_psoc_get_service_ext_param 1389 (struct target_psoc_info *psoc_info) 1390 { 1391 if (!psoc_info) 1392 return NULL; 1393 1394 return &psoc_info->info.service_ext_param; 1395 } 1396 1397 /** 1398 * target_psoc_get_num_dbr_ring_caps() - get no of dbr_ring_caps 1399 * @psoc_info: pointer to structure target_psoc_info 1400 * 1401 * API to get num_dbr_ring_caps 1402 * 1403 * Return: no of dbr_ring_caps 1404 */ 1405 static inline uint32_t target_psoc_get_num_dbr_ring_caps 1406 (struct target_psoc_info *psoc_info) 1407 { 1408 if (!psoc_info) 1409 return 0; 1410 1411 if (psoc_info->info.service_ext_param.num_dbr_ring_caps) 1412 return psoc_info->info.service_ext_param.num_dbr_ring_caps; 1413 1414 return psoc_info->info.service_ext2_param.num_dbr_ring_caps; 1415 } 1416 1417 /** 1418 * target_psoc_get_num_scan_radio_caps() - get no of scan_radio_caps 1419 * @psoc_info: pointer to structure target_psoc_info 1420 * 1421 * API to get num_scan_radio_caps 1422 * 1423 * Return: no of scan_radio_caps 1424 */ 1425 static inline uint32_t target_psoc_get_num_scan_radio_caps 1426 (struct target_psoc_info *psoc_info) 1427 { 1428 if (!psoc_info) 1429 return 0; 1430 1431 return psoc_info->info.service_ext2_param.num_scan_radio_caps; 1432 } 1433 1434 /** 1435 * target_psoc_get_mac_phy_cap_for_mode() - get mac_phy_cap for a hw-mode 1436 * @psoc_info: pointer to structure target_psoc_info 1437 * 1438 * API to get mac_phy_cap for a specified hw-mode 1439 * 1440 * Return: structure pointer to wlan_psoc_host_mac_phy_caps 1441 */ 1442 1443 static inline struct wlan_psoc_host_mac_phy_caps 1444 *target_psoc_get_mac_phy_cap_for_mode 1445 (struct target_psoc_info *psoc_info, uint8_t mode) 1446 { 1447 uint8_t mac_phy_idx; 1448 struct tgt_info *info = &psoc_info->info; 1449 1450 if (!psoc_info) 1451 return NULL; 1452 1453 for (mac_phy_idx = 0; 1454 mac_phy_idx < PSOC_MAX_MAC_PHY_CAP; 1455 mac_phy_idx++) 1456 if (info->mac_phy_cap[mac_phy_idx].hw_mode_id == mode) 1457 break; 1458 1459 if (mac_phy_idx == PSOC_MAX_MAC_PHY_CAP) 1460 return NULL; 1461 1462 return &info->mac_phy_cap[mac_phy_idx]; 1463 } 1464 1465 /** 1466 * target_psoc_get_mac_phy_cap_ext2_for_mode() - get mac_phy_caps_ext2 1467 * for a hw-mode 1468 * @psoc_info: pointer to structure target_psoc_info 1469 * @mode: hw mode 1470 * 1471 * API to get mac_phy_cap for a specified hw-mode 1472 * 1473 * Return: structure pointer to wlan_psoc_host_mac_phy_caps_ext2 1474 */ 1475 1476 static inline struct wlan_psoc_host_mac_phy_caps_ext2 1477 *target_psoc_get_mac_phy_cap_ext2_for_mode 1478 (struct target_psoc_info *psoc_info, uint8_t mode) 1479 { 1480 uint8_t mac_phy_idx; 1481 struct tgt_info *info = &psoc_info->info; 1482 1483 if (!psoc_info) 1484 return NULL; 1485 1486 for (mac_phy_idx = 0; 1487 mac_phy_idx < PSOC_MAX_MAC_PHY_CAP; 1488 mac_phy_idx++) 1489 if (info->mac_phy_caps_ext2[mac_phy_idx].hw_mode_id == mode) 1490 break; 1491 1492 if (mac_phy_idx == PSOC_MAX_MAC_PHY_CAP) 1493 return NULL; 1494 1495 return &info->mac_phy_caps_ext2[mac_phy_idx]; 1496 } 1497 1498 /** 1499 * target_psoc_get_mac_phy_cap() - get mac_phy_cap 1500 * @psoc_info: pointer to structure target_psoc_info 1501 * 1502 * API to get mac_phy_cap 1503 * 1504 * Return: structure pointer to wlan_psoc_host_mac_phy_caps 1505 */ 1506 static inline struct wlan_psoc_host_mac_phy_caps *target_psoc_get_mac_phy_cap 1507 (struct target_psoc_info *psoc_info) 1508 { 1509 uint32_t preferred_hw_mode; 1510 struct wlan_psoc_host_mac_phy_caps *mac_phy_cap; 1511 1512 if (!psoc_info) 1513 return NULL; 1514 1515 preferred_hw_mode = 1516 target_psoc_get_preferred_hw_mode(psoc_info); 1517 1518 if (preferred_hw_mode < WMI_HOST_HW_MODE_MAX) { 1519 mac_phy_cap = 1520 target_psoc_get_mac_phy_cap_for_mode 1521 (psoc_info, preferred_hw_mode); 1522 } else { 1523 mac_phy_cap = psoc_info->info.mac_phy_cap; 1524 } 1525 1526 return mac_phy_cap; 1527 } 1528 1529 /** 1530 * target_psoc_get_mac_phy_cap_ext2() - get mac_phy_caps_ext2 1531 * @psoc_info: pointer to structure target_psoc_info 1532 * 1533 * API to get mac_phy_caps_ext2 1534 * 1535 * Return: structure pointer to wlan_psoc_host_mac_phy_caps 1536 */ 1537 static inline struct wlan_psoc_host_mac_phy_caps_ext2 1538 *target_psoc_get_mac_phy_cap_ext2 1539 (struct target_psoc_info *psoc_info) 1540 { 1541 uint32_t preferred_hw_mode; 1542 struct wlan_psoc_host_mac_phy_caps_ext2 *mac_phy_caps_ext2; 1543 1544 if (!psoc_info) 1545 return NULL; 1546 1547 preferred_hw_mode = 1548 target_psoc_get_preferred_hw_mode(psoc_info); 1549 1550 if (preferred_hw_mode < WMI_HOST_HW_MODE_MAX) { 1551 mac_phy_caps_ext2 = 1552 target_psoc_get_mac_phy_cap_ext2_for_mode 1553 (psoc_info, preferred_hw_mode); 1554 } else { 1555 mac_phy_caps_ext2 = psoc_info->info.mac_phy_caps_ext2; 1556 } 1557 1558 return mac_phy_caps_ext2; 1559 } 1560 1561 /** 1562 * target_psoc_get_dbr_ring_caps() - get dbr_ring_cap 1563 * @psoc_info: pointer to structure target_psoc_info 1564 * 1565 * API to get dbr_ring_cap 1566 * 1567 * Return: structure pointer to wlan_psoc_host_dbr_ring_caps 1568 */ 1569 static inline struct wlan_psoc_host_dbr_ring_caps 1570 *target_psoc_get_dbr_ring_caps(struct target_psoc_info *psoc_info) 1571 { 1572 if (!psoc_info) 1573 return NULL; 1574 1575 return psoc_info->info.dbr_ring_cap; 1576 } 1577 1578 /** 1579 * target_psoc_get_scan_radio_caps() - get scan_radio_cap 1580 * @psoc_info: pointer to structure target_psoc_info 1581 * 1582 * API to get scan_radio_cap 1583 * 1584 * Return: structure pointer to wlan_psoc_host_scan_radio_caps 1585 */ 1586 static inline struct wlan_psoc_host_scan_radio_caps 1587 *target_psoc_get_scan_radio_caps(struct target_psoc_info *psoc_info) 1588 { 1589 if (!psoc_info) 1590 return NULL; 1591 1592 return psoc_info->info.scan_radio_caps; 1593 } 1594 1595 /** 1596 * target_psoc_get_spectral_scaling_params() - get Spectral scaling params 1597 * @psoc_info: pointer to structure target_psoc_info 1598 * 1599 * API to get Spectral scaling params 1600 * 1601 * Return: structure pointer to wlan_psoc_host_spectral_scaling_params 1602 */ 1603 static inline struct wlan_psoc_host_spectral_scaling_params 1604 *target_psoc_get_spectral_scaling_params( 1605 struct target_psoc_info *psoc_info) 1606 { 1607 if (!psoc_info) 1608 return NULL; 1609 1610 return psoc_info->info.scaling_params; 1611 } 1612 1613 /** 1614 * target_psoc_get_mem_chunks() - get mem_chunks 1615 * @psoc_info: pointer to structure target_psoc_info 1616 * 1617 * API to get mem_chunks 1618 * 1619 * Return: structure pointer to wmi_host_mem_chunk 1620 */ 1621 static inline struct wmi_host_mem_chunk *target_psoc_get_mem_chunks 1622 (struct target_psoc_info *psoc_info) 1623 { 1624 if (!psoc_info) 1625 return NULL; 1626 1627 return psoc_info->info.mem_chunks; 1628 } 1629 1630 /** 1631 * target_psoc_get_tif_ops() - get tif_ops 1632 * @psoc_info: pointer to structure target_psoc_info 1633 * 1634 * API to get tif_ops 1635 * 1636 * Return: structure pointer to target_ops 1637 */ 1638 static inline struct target_ops *target_psoc_get_tif_ops 1639 (struct target_psoc_info *psoc_info) 1640 { 1641 if (!psoc_info) 1642 return NULL; 1643 1644 return psoc_info->tif_ops; 1645 } 1646 1647 /** 1648 * target_pdev_set_feature_ptr - set feature_ptr 1649 * @pdev_info: pointer to structure target_pdev_info 1650 * @feature_ptr: Feature pointer 1651 * 1652 * API to set feature_ptr 1653 * 1654 * Return: void 1655 */ 1656 static inline void target_pdev_set_feature_ptr 1657 (struct target_pdev_info *pdev_info, void *feature_ptr) 1658 { 1659 if (!pdev_info) 1660 return; 1661 1662 pdev_info->feature_ptr = feature_ptr; 1663 } 1664 1665 /** 1666 * target_pdev_get_feature_ptr() - get feature_ptr 1667 * @pdev_info: pointer to structure target_pdev_info 1668 * 1669 * API to get feature_ptr 1670 * 1671 * Return: feature_ptr 1672 */ 1673 static inline void *target_pdev_get_feature_ptr 1674 (struct target_pdev_info *pdev_info) 1675 { 1676 if (!pdev_info) 1677 return NULL; 1678 1679 return pdev_info->feature_ptr; 1680 } 1681 1682 /** 1683 * target_pdev_set_wmi_handle - set wmi_handle 1684 * @pdev_info: pointer to structure target_pdev_info 1685 * @wmi_handle: WMI handle 1686 * 1687 * API to set wmi_handle 1688 * 1689 * Return: void 1690 */ 1691 static inline void target_pdev_set_wmi_handle 1692 (struct target_pdev_info *pdev_info, 1693 struct wmi_unified *wmi_handle) 1694 { 1695 if (!pdev_info) 1696 return; 1697 1698 pdev_info->wmi_handle = wmi_handle; 1699 } 1700 1701 /** 1702 * target_pdev_get_wmi_handle - get wmi_handle 1703 * @pdev_info: pointer to structure target_dev_info 1704 * 1705 * API to get wmi_handle 1706 * 1707 * Return: wmi_handle 1708 */ 1709 static inline struct wmi_unified *target_pdev_get_wmi_handle 1710 (struct target_pdev_info *pdev_info) 1711 { 1712 if (!pdev_info) 1713 return NULL; 1714 1715 return pdev_info->wmi_handle; 1716 } 1717 1718 /** 1719 * target_pdev_set_accelerator_hdl - set accelerator_hdl 1720 * @pdev_info: pointer to structure target_pdev_info 1721 * @accelerator_hdl: Accelator handle 1722 * 1723 * API to set accelerator_hdl 1724 * 1725 * Return: void 1726 */ 1727 static inline void target_pdev_set_accelerator_hdl 1728 (struct target_pdev_info *pdev_info, 1729 struct common_accelerator_handle *accelerator_hdl) 1730 { 1731 if (!pdev_info) 1732 return; 1733 1734 pdev_info->accelerator_hdl = accelerator_hdl; 1735 } 1736 1737 /** 1738 * target_pdev_get_accelerator_hdl - get accelerator_hdl 1739 * @pdev_info: pointer to structure target_dev_info 1740 * 1741 * API to get accelerator_hdl 1742 * 1743 * Return: accelerator_hdl 1744 */ 1745 static inline struct common_accelerator_handle * 1746 target_pdev_get_accelerator_hdl(struct target_pdev_info *pdev_info) 1747 { 1748 if (!pdev_info) 1749 return NULL; 1750 1751 return pdev_info->accelerator_hdl; 1752 } 1753 1754 /** 1755 * target_pdev_set_pdev_idx - set pdev_idx 1756 * @pdev_info: pointer to structure target_pdev_info 1757 * @pdev_idx: PDEV id of FW 1758 * 1759 * API to set pdev_idx 1760 * 1761 * Return: void 1762 */ 1763 static inline void target_pdev_set_pdev_idx 1764 (struct target_pdev_info *pdev_info, int32_t pdev_idx) 1765 { 1766 if (!pdev_info) 1767 return; 1768 1769 pdev_info->pdev_idx = pdev_idx; 1770 } 1771 1772 /** 1773 * target_pdev_get_pdev_idx - get pdev_idx 1774 * @pdev_info: pointer to structure target_dev_info 1775 * 1776 * API to get pdev_idx 1777 * 1778 * Return: int32_t 1779 */ 1780 static inline int32_t target_pdev_get_pdev_idx 1781 (struct target_pdev_info *pdev_info) 1782 { 1783 if (!pdev_info) 1784 return -EINVAL; 1785 1786 return pdev_info->pdev_idx; 1787 } 1788 1789 /** 1790 * target_pdev_set_phy_idx - set phy_idx 1791 * @pdev_info: pointer to structure target_pdev_info 1792 * @phy_idx: phy ID of FW 1793 * 1794 * API to set phy_idx 1795 * 1796 * Return: void 1797 */ 1798 static inline void target_pdev_set_phy_idx 1799 (struct target_pdev_info *pdev_info, int32_t phy_idx) 1800 { 1801 if (!pdev_info) 1802 return; 1803 1804 pdev_info->phy_idx = phy_idx; 1805 } 1806 1807 /** 1808 * target_pdev_get_phy_idx - get phy_idx 1809 * @pdev_info: pointer to structure target_dev_info 1810 * 1811 * API to get phy_idx 1812 * 1813 * Return: int32_t 1814 */ 1815 static inline int32_t target_pdev_get_phy_idx 1816 (struct target_pdev_info *pdev_info) 1817 { 1818 if (!pdev_info) 1819 return -EINVAL; 1820 1821 return pdev_info->phy_idx; 1822 } 1823 1824 /** 1825 * GET_WMI_HDL_FROM_PSOC - get wmi handle from psoc 1826 * @psoc: psoc object 1827 * 1828 * API to get wmi_handle from psoc 1829 * 1830 * Return: wmi_handle on success 1831 * if tgt handle is not initialized, it returns NULL 1832 */ 1833 static inline struct wmi_unified *GET_WMI_HDL_FROM_PSOC( 1834 struct wlan_objmgr_psoc *psoc) 1835 { 1836 struct target_psoc_info *tgt_if_handle; 1837 1838 if (psoc) { 1839 tgt_if_handle = psoc->tgt_if_handle; 1840 1841 if (tgt_if_handle) 1842 return target_psoc_get_wmi_hdl(tgt_if_handle); 1843 else 1844 return NULL; 1845 } 1846 1847 return NULL; 1848 } 1849 1850 /** 1851 * GET_WMI_HDL_FROM_PDEV - get wmi handle from pdev 1852 * @pdev: pdev object 1853 * 1854 * API to get wmi_handle from pdev 1855 * 1856 * Return: wmi_handle on success 1857 * if tgt handle is not initialized, it returns NULL 1858 */ 1859 static inline struct wmi_unified *GET_WMI_HDL_FROM_PDEV( 1860 struct wlan_objmgr_pdev *pdev) 1861 { 1862 struct target_pdev_info *tgt_if_handle; 1863 1864 if (pdev) { 1865 tgt_if_handle = pdev->tgt_if_handle; 1866 1867 if (tgt_if_handle) 1868 return target_pdev_get_wmi_handle(tgt_if_handle); 1869 else 1870 return NULL; 1871 } 1872 1873 return NULL; 1874 } 1875 1876 /** 1877 * get_wmi_unified_hdl_from_psoc - get wmi handle from psoc 1878 * @psoc: psoc object 1879 * 1880 * API to get wmi_handle from psoc 1881 * 1882 * Return: wmi_handle on success 1883 * if tgt handle is not initialized, it returns NULL 1884 */ 1885 static inline wmi_unified_t 1886 get_wmi_unified_hdl_from_psoc(struct wlan_objmgr_psoc *psoc) 1887 { 1888 return (wmi_unified_t)GET_WMI_HDL_FROM_PSOC(psoc); 1889 } 1890 1891 /** 1892 * get_wmi_unified_hdl_from_pdev - get wmi handle from pdev 1893 * @pdev: pdev object 1894 * 1895 * API to get wmi_handle from pdev 1896 * 1897 * Return: wmi_handle on success 1898 * if tgt handle is not initialized, it returns NULL 1899 */ 1900 static inline wmi_unified_t 1901 get_wmi_unified_hdl_from_pdev(struct wlan_objmgr_pdev *pdev) 1902 { 1903 return (wmi_unified_t)GET_WMI_HDL_FROM_PDEV(pdev); 1904 } 1905 1906 /** 1907 * target_if_ext_res_cfg_enable - Enable ext resource config 1908 * @psoc: psoc object 1909 * @tgt_hdl: target_psoc_info pointer 1910 * @evt_buf: Event buffer received from FW 1911 * 1912 * API to enable Ext resource config 1913 * 1914 * Return: none 1915 */ 1916 static inline void target_if_ext_res_cfg_enable(struct wlan_objmgr_psoc *psoc, 1917 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1918 { 1919 if ((tgt_hdl->tif_ops) && 1920 (tgt_hdl->tif_ops->ext_resource_config_enable)) 1921 tgt_hdl->tif_ops->ext_resource_config_enable(psoc, 1922 tgt_hdl, evt_buf); 1923 } 1924 1925 /** 1926 * target_if_peer_cfg_enable - Enable peer config 1927 * @psoc: psoc object 1928 * @tgt_hdl: target_psoc_info pointer 1929 * @evt_buf: Event buffer received from FW 1930 * 1931 * API to enable peer config 1932 * 1933 * Return: none 1934 */ 1935 static inline void target_if_peer_cfg_enable(struct wlan_objmgr_psoc *psoc, 1936 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1937 { 1938 if ((tgt_hdl->tif_ops) && 1939 (tgt_hdl->tif_ops->peer_config)) 1940 tgt_hdl->tif_ops->peer_config(psoc, tgt_hdl, evt_buf); 1941 } 1942 1943 /** 1944 * target_if_mesh_support_enable - Enable MESH mode support 1945 * @psoc: psoc object 1946 * @tgt_hdl: target_psoc_info pointer 1947 * @evt_buf: Event buffer received from FW 1948 * 1949 * API to enable Mesh mode 1950 * 1951 * Return: none 1952 */ 1953 static inline void target_if_mesh_support_enable(struct wlan_objmgr_psoc *psoc, 1954 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1955 { 1956 if ((tgt_hdl->tif_ops) && 1957 (tgt_hdl->tif_ops->mesh_support_enable)) 1958 tgt_hdl->tif_ops->mesh_support_enable(psoc, tgt_hdl, evt_buf); 1959 } 1960 1961 /** 1962 * target_if_eapol_minrate_enable - Enable EAPOL Minrate in Tunnel Mode 1963 * @psoc: psoc object 1964 * @tgt_hdl: target_psoc_info pointer 1965 * @evt_buf: Event buffer received from FW 1966 * 1967 * API to enable eapol minrate 1968 * 1969 * Return: none 1970 */ 1971 static inline void target_if_eapol_minrate_enable(struct wlan_objmgr_psoc *psoc, 1972 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1973 { 1974 if ((tgt_hdl->tif_ops) && 1975 (tgt_hdl->tif_ops->eapol_minrate_enable)) 1976 tgt_hdl->tif_ops->eapol_minrate_enable(psoc, tgt_hdl, evt_buf); 1977 } 1978 1979 /** 1980 * target_if_smart_antenna_enable - Enable Smart antenna module 1981 * @psoc: psoc object 1982 * @tgt_hdl: target_psoc_info pointer 1983 * @evt_buf: Event buffer received from FW 1984 * 1985 * API to enable Smart antenna 1986 * 1987 * Return: none 1988 */ 1989 static inline void target_if_smart_antenna_enable(struct wlan_objmgr_psoc *psoc, 1990 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1991 { 1992 if ((tgt_hdl->tif_ops) && 1993 (tgt_hdl->tif_ops->smart_antenna_enable)) 1994 tgt_hdl->tif_ops->smart_antenna_enable(psoc, tgt_hdl, evt_buf); 1995 } 1996 1997 /** 1998 * target_if_cfr_support_enable - Enable cfr support 1999 * @psoc: psoc object 2000 * @tgt_hdl: target_psoc_info pointer 2001 * @evt_buf: Event buffer received from FW 2002 * 2003 * API to enable cfr support 2004 * 2005 * Return: none 2006 */ 2007 static inline void target_if_cfr_support_enable(struct wlan_objmgr_psoc *psoc, 2008 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 2009 { 2010 if ((tgt_hdl->tif_ops) && 2011 (tgt_hdl->tif_ops->cfr_support_enable)) 2012 tgt_hdl->tif_ops->cfr_support_enable(psoc, tgt_hdl, evt_buf); 2013 } 2014 2015 /** 2016 * target_if_set_pktlog_checksum - Set pktlog checksum 2017 * @pdev: pdev object 2018 * @tgt_hdl: target_psoc_info pointer 2019 * @checksum: checksum received from FW 2020 * 2021 * API to set pktlog checksum 2022 * 2023 * Return: none 2024 */ 2025 static inline void target_if_set_pktlog_checksum(struct wlan_objmgr_pdev *pdev, 2026 struct target_psoc_info *tgt_hdl, uint32_t checksum) 2027 { 2028 if ((tgt_hdl->tif_ops) && 2029 (tgt_hdl->tif_ops->set_pktlog_checksum)) 2030 tgt_hdl->tif_ops->set_pktlog_checksum(pdev, checksum); 2031 } 2032 2033 /** 2034 * target_if_atf_cfg_enable - Enable ATF config 2035 * @psoc: psoc object 2036 * @tgt_hdl: target_psoc_info pointer 2037 * @evt_buf: Event buffer received from FW 2038 * 2039 * API to enable ATF config 2040 * 2041 * Return: none 2042 */ 2043 static inline void target_if_atf_cfg_enable(struct wlan_objmgr_psoc *psoc, 2044 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 2045 { 2046 if ((tgt_hdl->tif_ops) && 2047 (tgt_hdl->tif_ops->atf_config_enable)) 2048 tgt_hdl->tif_ops->atf_config_enable(psoc, tgt_hdl, evt_buf); 2049 } 2050 2051 /** 2052 * target_if_btcoex_cfg_enable - Enable BT coex config 2053 * @psoc: psoc object 2054 * @tgt_hdl: target_psoc_info pointer 2055 * @evt_buf: Event buffer received from FW 2056 * 2057 * API to enable BT coex config 2058 * 2059 * Return: none 2060 */ 2061 static inline void target_if_btcoex_cfg_enable(struct wlan_objmgr_psoc *psoc, 2062 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 2063 { 2064 if ((tgt_hdl->tif_ops) && 2065 (tgt_hdl->tif_ops->btcoex_config_enable)) 2066 tgt_hdl->tif_ops->btcoex_config_enable(psoc, tgt_hdl, evt_buf); 2067 } 2068 2069 /** 2070 * target_if_lteu_cfg_enable - Enable LTEU config 2071 * @psoc: psoc object 2072 * @tgt_hdl: target_psoc_info pointer 2073 * @evt_buf: Event buffer received from FW 2074 * 2075 * API to enable LTEU coex config 2076 * 2077 * Return: none 2078 */ 2079 static inline void target_if_lteu_cfg_enable(struct wlan_objmgr_psoc *psoc, 2080 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 2081 { 2082 if ((tgt_hdl->tif_ops) && 2083 (tgt_hdl->tif_ops->lteu_ext_support_enable)) 2084 tgt_hdl->tif_ops->lteu_ext_support_enable(psoc, tgt_hdl, 2085 evt_buf); 2086 } 2087 2088 /** 2089 * target_if_set_init_cmd_dev_param - Set init command params 2090 * @psoc: psoc object 2091 * @tgt_hdl: target_psoc_info pointer 2092 * 2093 * API to set init command param based on config 2094 * 2095 * Return: none 2096 */ 2097 static inline void target_if_set_init_cmd_dev_param( 2098 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 2099 { 2100 if ((tgt_hdl->tif_ops) && 2101 (tgt_hdl->tif_ops->set_init_cmd_dev_based_params)) { 2102 tgt_hdl->tif_ops->set_init_cmd_dev_based_params(psoc, 2103 tgt_hdl); 2104 } 2105 } 2106 2107 /** 2108 * target_if_alloc_pdevs - Allocate PDEVs 2109 * @psoc: psoc object 2110 * @tgt_hdl: target_psoc_info pointer 2111 * 2112 * API allocates PDEVs based on ext service ready param 2113 * 2114 * Return: SUCCESS on pdev allocation or PDEV allocation is not needed 2115 * FAILURE, if allocation fails 2116 */ 2117 static inline QDF_STATUS target_if_alloc_pdevs(struct wlan_objmgr_psoc *psoc, 2118 struct target_psoc_info *tgt_hdl) 2119 { 2120 QDF_STATUS ret_val; 2121 2122 if ((tgt_hdl->tif_ops) && 2123 (tgt_hdl->tif_ops->alloc_pdevs)) 2124 ret_val = tgt_hdl->tif_ops->alloc_pdevs(psoc, tgt_hdl); 2125 else 2126 ret_val = QDF_STATUS_SUCCESS; 2127 2128 return ret_val; 2129 } 2130 2131 /** 2132 * target_if_update_pdev_tgt_info - Update PDEVs info 2133 * @psoc: psoc object 2134 * @tgt_hdl: target_psoc_info pointer 2135 * 2136 * API updates PDEVs info based on config 2137 * 2138 * Return: SUCCESS on pdev updation or PDEV updation is not needed 2139 * FAILURE, if updation fails 2140 */ 2141 static inline QDF_STATUS target_if_update_pdev_tgt_info( 2142 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 2143 { 2144 QDF_STATUS ret_val; 2145 2146 if ((tgt_hdl->tif_ops) && 2147 (tgt_hdl->tif_ops->update_pdev_tgt_info)) 2148 ret_val = tgt_hdl->tif_ops->update_pdev_tgt_info(psoc, 2149 tgt_hdl); 2150 else 2151 ret_val = QDF_STATUS_SUCCESS; 2152 2153 return ret_val; 2154 } 2155 2156 /** 2157 * target_if_print_service_ready_ext_param - Print Service ready ext param 2158 * @psoc: psoc object 2159 * @tgt_hdl: target_psoc_info pointer 2160 * 2161 * API to print service ready ext param 2162 * 2163 * Return: none 2164 */ 2165 static inline void target_if_print_service_ready_ext_param( 2166 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 2167 { 2168 if ((tgt_hdl->tif_ops) && 2169 (tgt_hdl->tif_ops->print_svc_ready_ex_param)) { 2170 tgt_hdl->tif_ops->print_svc_ready_ex_param(psoc, 2171 tgt_hdl); 2172 } 2173 } 2174 2175 /** 2176 * target_if_add_11ax_modes - Add 11ax modes explicitly 2177 * @psoc: psoc object 2178 * @tgt_hdl: target_psoc_info pointer 2179 * 2180 * API to adds 11ax modes 2181 * 2182 * Return: none 2183 */ 2184 #ifdef QCA_HOST_ADD_11AX_MODE_WAR 2185 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc, 2186 struct target_psoc_info *tgt_hdl) 2187 { 2188 if ((tgt_hdl->tif_ops) && 2189 (tgt_hdl->tif_ops->add_11ax_modes)) { 2190 tgt_hdl->tif_ops->add_11ax_modes(psoc, tgt_hdl); 2191 } 2192 } 2193 #else 2194 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc, 2195 struct target_psoc_info *tgt_hdl) 2196 { 2197 } 2198 #endif 2199 2200 /** 2201 * target_if_csa_switch_count_status - Calls a function to process CSA event 2202 * @psoc: psoc object 2203 * @tgt_hdl: target_psoc_info pointer 2204 * @csa_status: CSA switch count status event param 2205 * 2206 * Return: 0 on success, -1 on failure 2207 */ 2208 static inline int target_if_csa_switch_count_status( 2209 struct wlan_objmgr_psoc *psoc, 2210 struct target_psoc_info *tgt_hdl, 2211 struct pdev_csa_switch_count_status csa_status) 2212 { 2213 if (tgt_hdl->tif_ops && tgt_hdl->tif_ops->csa_switch_count_status) 2214 return tgt_hdl->tif_ops->csa_switch_count_status( 2215 psoc, csa_status); 2216 2217 return -1; 2218 } 2219 2220 /** 2221 * target_if_set_default_config - Set default config in init command 2222 * @psoc: psoc object 2223 * @tgt_hdl: target_psoc_info pointer 2224 * 2225 * API to set default config in init command 2226 * 2227 * Return: none 2228 */ 2229 static inline void target_if_set_default_config(struct wlan_objmgr_psoc *psoc, 2230 struct target_psoc_info *tgt_hdl) 2231 { 2232 if ((tgt_hdl->tif_ops) && 2233 (tgt_hdl->tif_ops->set_default_tgt_config)) { 2234 tgt_hdl->tif_ops->set_default_tgt_config(psoc, tgt_hdl); 2235 } 2236 } 2237 2238 /** 2239 * target_if_sw_version_check - SW version check 2240 * @psoc: psoc object 2241 * @tgt_hdl: target_psoc_info pointer 2242 * @evt_buf: Event buffer received from FW 2243 * 2244 * API checks the SW version 2245 * 2246 * Return: SUCCESS on version matches or version check is not needed 2247 * FAILURE, if check fails 2248 */ 2249 static inline QDF_STATUS target_if_sw_version_check( 2250 struct wlan_objmgr_psoc *psoc, 2251 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 2252 { 2253 QDF_STATUS ret_val; 2254 2255 if ((tgt_hdl->tif_ops) && 2256 (tgt_hdl->tif_ops->sw_version_check)) 2257 ret_val = tgt_hdl->tif_ops->sw_version_check(psoc, tgt_hdl, 2258 evt_buf); 2259 else 2260 ret_val = QDF_STATUS_SUCCESS; 2261 2262 return ret_val; 2263 } 2264 2265 /** 2266 * target_if_get_phy_capability - get phy capability 2267 * @target_psoc_info: pointer to structure target_psoc_info 2268 * 2269 * API to get phy capability from the target caps 2270 * 2271 * Return: int32_t 2272 */ 2273 static inline int32_t target_if_get_phy_capability 2274 (struct target_psoc_info *target_psoc_info) 2275 { 2276 if (!target_psoc_info) 2277 return -EINVAL; 2278 2279 return target_psoc_info->info.target_caps.phy_capability; 2280 } 2281 2282 /** 2283 * target_if_set_phy_capability - set phy capability 2284 * @target_psoc_info: pointer to structure target_psoc_info 2285 * @phy_capab: PHY capabilities 2286 * 2287 * API to set phy capability in the target caps 2288 * 2289 * Return: None 2290 */ 2291 static inline void target_if_set_phy_capability 2292 (struct target_psoc_info *target_psoc_info, int phy_capability) 2293 { 2294 if (!target_psoc_info) 2295 return; 2296 2297 target_psoc_info->info.target_caps.phy_capability = phy_capability; 2298 } 2299 2300 /** 2301 * target_if_set_max_frag_entry - set Maximum frag entries 2302 * @target_psoc_info: pointer to structure target_psoc_info 2303 * @max_frag_entry: Maximum frag entries 2304 * 2305 * API to set Maximum frag entries from the target caps 2306 * 2307 * Return: None 2308 */ 2309 static inline void target_if_set_max_frag_entry 2310 (struct target_psoc_info *target_psoc_info, int max_frag_entry) 2311 { 2312 if (!target_psoc_info) 2313 return; 2314 2315 target_psoc_info->info.target_caps.max_frag_entry = max_frag_entry; 2316 } 2317 2318 /** 2319 * target_if_get_max_frag_entry - get Maximum frag entries 2320 * @target_psoc_info: pointer to structure target_psoc_info 2321 * 2322 * API to get Maximum frag entries from the target caps 2323 * 2324 * Return: int32_t 2325 */ 2326 static inline int32_t target_if_get_max_frag_entry 2327 (struct target_psoc_info *target_psoc_info) 2328 { 2329 if (!target_psoc_info) 2330 return -EINVAL; 2331 2332 return target_psoc_info->info.target_caps.max_frag_entry; 2333 } 2334 2335 /** 2336 * target_if_get_ht_cap_info - get ht capabilities info 2337 * @target_psoc_info: pointer to structure target_psoc_info 2338 * 2339 * API to get ht capabilities info from the target caps 2340 * 2341 * Return: int32_t 2342 */ 2343 static inline int32_t target_if_get_ht_cap_info 2344 (struct target_psoc_info *target_psoc_info) 2345 { 2346 if (!target_psoc_info) 2347 return -EINVAL; 2348 2349 return target_psoc_info->info.target_caps.ht_cap_info; 2350 } 2351 2352 /** 2353 * target_if_get_vht_cap_info - get vht capabilities info 2354 * @target_psoc_info: pointer to structure target_psoc_info 2355 * 2356 * API to get vht capabilities info from the target caps 2357 * 2358 * Return: int32_t 2359 */ 2360 static inline int32_t target_if_get_vht_cap_info 2361 (struct target_psoc_info *target_psoc_info) 2362 { 2363 if (!target_psoc_info) 2364 return -EINVAL; 2365 2366 return target_psoc_info->info.target_caps.vht_cap_info; 2367 } 2368 2369 /** 2370 * target_if_get_num_rf_chains - get Number of RF chains supported 2371 * @target_psoc_info: pointer to structure target_psoc_info 2372 * 2373 * API to get Number of RF chains supported from the target caps 2374 * 2375 * Return: int32_t 2376 */ 2377 static inline int32_t target_if_get_num_rf_chains 2378 (struct target_psoc_info *target_psoc_info) 2379 { 2380 if (!target_psoc_info) 2381 return -EINVAL; 2382 2383 return target_psoc_info->info.target_caps.num_rf_chains; 2384 } 2385 2386 /** 2387 * target_if_get_fw_version - get firmware version 2388 * @target_psoc_info: pointer to structure target_psoc_info 2389 * 2390 * API to get firmware version from the target caps 2391 * 2392 * Return: int32_t 2393 */ 2394 static inline int32_t target_if_get_fw_version 2395 (struct target_psoc_info *target_psoc_info) 2396 { 2397 if (!target_psoc_info) 2398 return 0; 2399 2400 return target_psoc_info->info.target_caps.fw_version; 2401 } 2402 2403 /** 2404 * target_if_get_wmi_fw_sub_feat_caps - FW sub feature capabilities 2405 * @target_psoc_info: pointer to structure target_psoc_info 2406 * 2407 * API to get FW sub feature capabilities from the target caps 2408 * 2409 * Return: int32_t 2410 */ 2411 static inline int32_t target_if_get_wmi_fw_sub_feat_caps 2412 (struct target_psoc_info *target_psoc_info) 2413 { 2414 if (!target_psoc_info) 2415 return -EINVAL; 2416 2417 return target_psoc_info->info.target_caps.wmi_fw_sub_feat_caps; 2418 } 2419 2420 /** 2421 * target_if_get_conc_scan_config_bits - Default concurrenct scan config 2422 * @tgt_hdl: pointer to structure target_psoc_info 2423 * 2424 * API to get Default concurrenct scan config from the target caps 2425 * 2426 * Return: int32_t 2427 */ 2428 static inline int32_t target_if_get_conc_scan_config_bits 2429 (struct target_psoc_info *tgt_hdl) 2430 { 2431 if (!tgt_hdl) 2432 return -EINVAL; 2433 2434 return tgt_hdl->info.service_ext_param.default_conc_scan_config_bits; 2435 } 2436 2437 /** 2438 * target_if_get_fw_config_bits - Default HW config bits 2439 * @tgt_hdl: pointer to structure target_psoc_info 2440 * 2441 * API to get Default HW config bits from the target caps 2442 * 2443 * Return: int32_t 2444 */ 2445 static inline int32_t target_if_get_fw_config_bits 2446 (struct target_psoc_info *tgt_hdl) 2447 { 2448 if (!tgt_hdl) 2449 return -EINVAL; 2450 2451 return tgt_hdl->info.service_ext_param.default_fw_config_bits; 2452 } 2453 2454 /** 2455 * target_psoc_get_num_hw_modes - get number of dbs hardware modes 2456 * @tgt_hdl: pointer to structure target_psoc_info 2457 * 2458 * API to get Number of Dual Band Simultaneous (DBS) hardware modes 2459 * 2460 * Return: int32_t 2461 */ 2462 static inline int32_t target_psoc_get_num_hw_modes 2463 (struct target_psoc_info *tgt_hdl) 2464 { 2465 if (!tgt_hdl) 2466 return -EINVAL; 2467 2468 return tgt_hdl->info.service_ext_param.num_hw_modes; 2469 } 2470 2471 #ifdef WLAN_SUPPORT_TWT 2472 #ifdef WLAN_TWT_AP_PDEV_COUNT_NUM_PHY 2473 static inline void target_if_set_twt_ap_pdev_count 2474 (struct tgt_info *info, struct target_psoc_info *tgt_hdl) 2475 { 2476 if (!tgt_hdl) 2477 return; 2478 2479 info->wlan_res_cfg.twt_ap_pdev_count = 2480 info->service_ext_param.num_phy; 2481 } 2482 #else 2483 #ifdef WLAN_TWT_2G_PHYB_WAR 2484 static inline void target_if_set_twt_ap_pdev_count 2485 (struct tgt_info *info, struct target_psoc_info *tgt_hdl) 2486 { 2487 uint32_t mode; 2488 uint8_t num_radios; 2489 2490 if (!tgt_hdl) 2491 return; 2492 2493 mode = target_psoc_get_preferred_hw_mode(tgt_hdl); 2494 num_radios = target_psoc_get_num_radios(tgt_hdl); 2495 if (mode == WMI_HOST_HW_MODE_2G_PHYB && num_radios == 1) 2496 num_radios += 1; 2497 2498 info->wlan_res_cfg.twt_ap_pdev_count = num_radios; 2499 } 2500 #else 2501 static inline void target_if_set_twt_ap_pdev_count 2502 (struct tgt_info *info, struct target_psoc_info *tgt_hdl) 2503 { 2504 if (!tgt_hdl) 2505 return; 2506 2507 info->wlan_res_cfg.twt_ap_pdev_count = 2508 target_psoc_get_num_radios(tgt_hdl); 2509 } 2510 #endif /* WLAN_TWT_2G_PHYB_WAR */ 2511 #endif /* WLAN_TWT_AP_PDEV_COUNT_NUM_PHY */ 2512 #else 2513 static inline void target_if_set_twt_ap_pdev_count 2514 (struct tgt_info *info, struct target_psoc_info *tgt_hdl) 2515 { 2516 } 2517 #endif /* WLAN_SUPPORT_TWT */ 2518 2519 /** 2520 * target_psoc_get_version_info() - Get version info from tgt info 2521 * @psoc_info: pointer to structure target_psoc_info 2522 * @reg_major: reg db version major 2523 * @reg_minor: reg db version minor 2524 * @bdf_major: bdf reg db version major 2525 * @bdf_minor: bdf reg db version minor 2526 * 2527 * API to get target version information. 2528 * 2529 * Return: void 2530 */ 2531 static inline void target_psoc_get_version_info( 2532 struct target_psoc_info *psoc_info, 2533 uint8_t *reg_major, uint8_t *reg_minor, 2534 uint8_t *bdf_major, uint8_t *bdf_minor) 2535 { 2536 if (!psoc_info) 2537 return; 2538 2539 *reg_major = psoc_info->info.service_ext2_param.reg_db_version_major; 2540 *reg_minor = psoc_info->info.service_ext2_param.reg_db_version_minor; 2541 *bdf_major = 2542 psoc_info->info.service_ext2_param.bdf_reg_db_version_major; 2543 *bdf_minor = 2544 psoc_info->info.service_ext2_param.bdf_reg_db_version_minor; 2545 } 2546 2547 /** 2548 * target_psoc_get_chan_width_switch_num_peers() - Get peer limit 2549 * @psoc_info: pointer to structure target_psoc_info 2550 * 2551 * API to get the number of peers supported per WMI command with the ID 2552 * WMI_PEER_CHAN_WIDTH_SWITCH_CMDID. 2553 * 2554 * Return: maximum peers allowed in a single WMI command with the given ID. 2555 */ 2556 static inline uint32_t target_psoc_get_chan_width_switch_num_peers( 2557 struct target_psoc_info *psoc_info) 2558 { 2559 if (!psoc_info) 2560 return 0; 2561 2562 return psoc_info->info.service_ext2_param.chwidth_num_peer_caps; 2563 } 2564 2565 /** 2566 * target_if_is_scan_radio_supported() - API to check scan radio 2567 * support for the given radio 2568 * @pdev: pointer to pdev 2569 * @is_scan_radio_supported: pointer to scan radio support flag 2570 * 2571 * API to check scan radio support for the given radio 2572 * 2573 * Return: QDF_STATUS 2574 */ 2575 QDF_STATUS 2576 target_pdev_is_scan_radio_supported(struct wlan_objmgr_pdev *pdev, 2577 bool *is_scan_radio_supported); 2578 2579 /** 2580 * target_pdev_scan_radio_is_dfs_enabled() - API to check 2581 * whether DFS needs to be enabled/disabled for scan radio. 2582 * @pdev: pointer to pdev 2583 * @is_dfs_en: Pointer to DFS enable flag 2584 * 2585 * API to check whether DFS needs to be enabled/disabled for 2586 * scan radio. This API should be used only for a scan radio 2587 * pdev. 2588 * 2589 * Return: QDF_STATUS 2590 */ 2591 QDF_STATUS 2592 target_pdev_scan_radio_is_dfs_enabled(struct wlan_objmgr_pdev *pdev, 2593 bool *is_dfs_en); 2594 2595 /** 2596 * target_psoc_get_preamble_puncture_cap() - Get Preamble Puncturing capability 2597 * @psoc_info: pointer to structure target_psoc_info 2598 * 2599 * API to get the target capability for Preamble Punctured Tx 2600 * 2601 * Return: target capability for Preamble Punctured Tx. 2602 */ 2603 static inline uint32_t target_psoc_get_preamble_puncture_cap( 2604 struct target_psoc_info *psoc_info) 2605 { 2606 if (!psoc_info) 2607 return 0; 2608 2609 return psoc_info->info.service_ext2_param.preamble_puncture_bw_cap; 2610 } 2611 2612 /** 2613 * target_psoc_get_mu_max_users() - Get max users for MU transmissions 2614 * @psoc_info: pointer to structure target_psoc_info 2615 * @mu_caps: pointer to structure for max OFDMA/MU-MIMO users per-PPDU 2616 * 2617 * API to get the max number of users per-PPDU supported for Uplink/Downlink 2618 * MU transmissions. 2619 * 2620 * Return: void 2621 */ 2622 static inline void target_psoc_get_mu_max_users( 2623 struct target_psoc_info *psoc_info, 2624 struct target_mu_caps *mu_caps) 2625 { 2626 struct wlan_psoc_host_service_ext2_param *service_ext2_param; 2627 2628 if (!psoc_info || !mu_caps) 2629 return; 2630 2631 service_ext2_param = &psoc_info->info.service_ext2_param; 2632 2633 mu_caps->ofdma_dl = service_ext2_param->max_users_dl_ofdma; 2634 mu_caps->ofdma_ul = service_ext2_param->max_users_ul_ofdma; 2635 mu_caps->mumimo_dl = service_ext2_param->max_users_dl_mumimo; 2636 mu_caps->mumimo_ul = service_ext2_param->max_users_ul_mumimo; 2637 } 2638 2639 /** 2640 * target_psoc_set_device_mode() - set global device_mode 2641 * @psoc_info: pointer to structure target_psoc_info 2642 * @device_mode: device mode mission monitor/ftm etc 2643 * 2644 * API to set global device mode 2645 * 2646 * Return: void 2647 */ 2648 static inline void target_psoc_set_device_mode 2649 (struct target_psoc_info *psoc_info, uint32_t device_mode) 2650 { 2651 if (!psoc_info) 2652 return; 2653 2654 psoc_info->info.device_mode = device_mode; 2655 } 2656 2657 /** 2658 * target_psoc_get_device_mode() - get info device_mode 2659 * @psoc_info: pointer to structure target_psoc_info 2660 * 2661 * API to get device_mode 2662 * 2663 * Return: enum QDF_GLOBAL_MODE 2664 */ 2665 static inline enum QDF_GLOBAL_MODE target_psoc_get_device_mode 2666 (struct target_psoc_info *psoc_info) 2667 { 2668 if (!psoc_info) 2669 return QDF_GLOBAL_MAX_MODE; 2670 2671 return psoc_info->info.device_mode; 2672 } 2673 2674 /** 2675 * target_if_set_reg_cc_ext_supp() - Set reg_cc_ext_supp capability 2676 * in WMI_INIT_CMD based on host capability of reg_cc_ext_event. 2677 * 2678 * @tgt_hdl: Pointer to struct target_psoc_info. 2679 * @psoc: Pointer to struct wlan_objmgr_psoc. 2680 * 2681 */ 2682 void target_if_set_reg_cc_ext_supp(struct target_psoc_info *tgt_hdl, 2683 struct wlan_objmgr_psoc *psoc); 2684 2685 /** 2686 * target_psoc_set_sbs_lower_band_end() - Set lower band end sbs frequency 2687 * 2688 * @psoc_info: Pointer to struct target_psoc_info. 2689 * @val: sbs lower band end cap value 2690 * 2691 * Return: None 2692 * 2693 */ 2694 static inline 2695 void target_psoc_set_sbs_lower_band_end(struct target_psoc_info *psoc_info, 2696 uint32_t val) 2697 { 2698 if (!psoc_info) 2699 return; 2700 2701 psoc_info->info.sbs_lower_band_end_freq = val; 2702 } 2703 2704 /** 2705 * target_psoc_set_twt_ack_cap() - Set twt ack capability 2706 * 2707 * @psoc_info: Pointer to struct target_psoc_info. 2708 * @val: twt ack cap value 2709 * 2710 * Return: None 2711 * 2712 */ 2713 static inline 2714 void target_psoc_set_twt_ack_cap(struct target_psoc_info *psoc_info, bool val) 2715 { 2716 if (!psoc_info) 2717 return; 2718 2719 psoc_info->info.service_ext2_param.twt_ack_support_cap = val; 2720 } 2721 2722 /** 2723 * target_psoc_get_twt_ack_cap() - Get twt ack capability 2724 * 2725 * @psoc_info: Pointer to struct target_psoc_info. 2726 * @val: twt ack cap value 2727 * 2728 * Return: None 2729 * 2730 */ 2731 static inline 2732 void target_psoc_get_twt_ack_cap(struct target_psoc_info *psoc_info, bool *val) 2733 { 2734 if (!psoc_info) 2735 return; 2736 2737 *val = psoc_info->info.service_ext2_param.twt_ack_support_cap; 2738 } 2739 2740 /** 2741 * target_psoc_target_cap_flags() - flags containing information about target 2742 * capabilities 2743 * @psoc_info: pointer to structure target_psoc_info 2744 * 2745 * API to get flags containing information about target capabilities 2746 * 2747 * Return: no of target_cap_flags 2748 */ 2749 static inline uint32_t target_psoc_get_target_cap_flags 2750 (struct target_psoc_info *psoc_info) 2751 { 2752 if (!psoc_info) 2753 return 0; 2754 2755 return psoc_info->info.service_ext2_param.target_cap_flags; 2756 } 2757 2758 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 2759 /** 2760 * target_pdev_get_hw_link_id - get hw_link_id 2761 * @pdev: pointer to structure target_pdev_info 2762 * 2763 * API to get hw_link_id 2764 * 2765 * Return: uint16_t 2766 */ 2767 #define PDEV_INVALID_HW_LINK_ID 0xFFFF 2768 uint16_t target_if_pdev_get_hw_link_id 2769 (struct wlan_objmgr_pdev *pdev); 2770 2771 /** 2772 * target_pdev_set_hw_link_id - set hw_link_id 2773 * @pdev: pointer to structure target_pdev_info 2774 * @hw_link_id: unique hw link id of pdev across psoc 2775 * 2776 * API to set hw_link_id 2777 * 2778 * Return: void 2779 */ 2780 void target_pdev_set_hw_link_id 2781 (struct wlan_objmgr_pdev *pdev, uint16_t hw_link_id); 2782 2783 /** 2784 * target_if_mlo_setup_req - API to trigger MLO setup sequence 2785 * @pdev: Array of pointers to pdev object that are part of ML group 2786 * @num_pdevs: Number of pdevs in above array 2787 * @grp_id: ML Group ID 2788 * 2789 * Return: QDF_STATUS codes 2790 */ 2791 QDF_STATUS target_if_mlo_setup_req(struct wlan_objmgr_pdev **pdev, 2792 uint8_t num_pdevs, uint8_t grp_id); 2793 2794 /** 2795 * target_if_mlo_ready - API to send MLO ready 2796 * @pdev: Array of pointers to pdev object that are part of ML group 2797 * @num_pdevs: Number of pdevs in above array 2798 * 2799 * Return: QDF_STATUS codes 2800 */ 2801 QDF_STATUS target_if_mlo_ready(struct wlan_objmgr_pdev **pdev, 2802 uint8_t num_pdevs); 2803 2804 /** 2805 * target_if_mlo_teardown_req - API to trigger MLO teardown sequence 2806 * @pdev: Array of pointers to pdev object that are part of ML group 2807 * @num_pdevs: Number of pdevs in above array 2808 * @reason: Reason for triggering teardown 2809 * 2810 * Return: QDF_STATUS codes 2811 */ 2812 QDF_STATUS target_if_mlo_teardown_req(struct wlan_objmgr_pdev **pdev, 2813 uint8_t num_pdevs, uint32_t reason); 2814 #endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/ 2815 2816 /** 2817 * target_if_is_platform_eht_capable(): 2818 * API to check if the platform is EHT capable 2819 * @pdev: pdev object 2820 * 2821 * Return: True if platform is 11BE capable; else False 2822 */ 2823 bool target_if_is_platform_eht_capable(struct wlan_objmgr_psoc *psoc, 2824 uint8_t pdev_id); 2825 #ifdef REO_SHARED_QREF_TABLE_EN 2826 static inline void target_if_set_reo_shared_qref_feature(struct wlan_objmgr_psoc *psoc, 2827 struct tgt_info *info) 2828 { 2829 struct target_psoc_info *tgt_hdl; 2830 2831 tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); 2832 if (!tgt_hdl) { 2833 target_if_err("target_psoc_info is null"); 2834 info->wlan_res_cfg.reo_qdesc_shared_addr_table_enabled = false; 2835 return; 2836 } 2837 2838 if (target_psoc_get_target_type(tgt_hdl) == TARGET_TYPE_QCN9224) 2839 info->wlan_res_cfg.reo_qdesc_shared_addr_table_enabled = true; 2840 else 2841 info->wlan_res_cfg.reo_qdesc_shared_addr_table_enabled = false; 2842 2843 } 2844 2845 #else 2846 static inline void target_if_set_reo_shared_qref_feature(struct wlan_objmgr_psoc *psoc, 2847 struct tgt_info *info) 2848 { 2849 info->wlan_res_cfg.reo_qdesc_shared_addr_table_enabled = false; 2850 } 2851 #endif 2852 2853 #endif 2854