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