1 /* 2 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: This target interface shall be used 21 * to communicate with target using WMI. 22 */ 23 #ifndef _WLAN_TARGET_IF_H_ 24 #define _WLAN_TARGET_IF_H_ 25 26 #include "qdf_types.h" 27 #include "qdf_util.h" 28 #include "wlan_objmgr_psoc_obj.h" 29 #include "wmi_unified_api.h" 30 #include "wmi_unified_priv.h" 31 #include "wmi_unified_param.h" 32 33 #define TGT_WMI_PDEV_ID_SOC 0 /* WMI SOC ID */ 34 35 /* ASCII "TGT\0" */ 36 #define TGT_MAGIC 0x54575400 37 38 #define target_if_fatal(params...) \ 39 QDF_TRACE_FATAL(QDF_MODULE_ID_TARGET_IF, params) 40 #define target_if_err(params...) \ 41 QDF_TRACE_ERROR(QDF_MODULE_ID_TARGET_IF, params) 42 #define target_if_warn(params...) \ 43 QDF_TRACE_WARN(QDF_MODULE_ID_TARGET_IF, params) 44 #define target_if_info(params...) \ 45 QDF_TRACE_INFO(QDF_MODULE_ID_TARGET_IF, params) 46 #define target_if_debug(params...) \ 47 QDF_TRACE_DEBUG(QDF_MODULE_ID_TARGET_IF, params) 48 #define TARGET_IF_ENTER() \ 49 QDF_TRACE_ENTER(QDF_MODULE_ID_TARGET_IF, "enter") 50 #define TARGET_IF_EXIT() \ 51 QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit") 52 #define target_if_err_rl(params...) \ 53 QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params) 54 55 56 #define targetif_nofl_fatal(params...) \ 57 QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 58 #define targetif_nofl_err(params...) \ 59 QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 60 #define targetif_nofl_warn(params...) \ 61 QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 62 #define targetif_nofl_info(params...) \ 63 QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 64 #define targetif_nofl_debug(params...) \ 65 QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TARGET_IF, params) 66 67 #ifdef CONFIG_MCL 68 #define TARGET_TYPE_AR900B 9 /* Beeliner */ 69 #define TARGET_TYPE_QCA9984 15 /* cascade */ 70 #define TARGET_TYPE_IPQ4019 16 /* dakota */ 71 #define TARGET_TYPE_QCA9888 17 /* besra */ 72 #define TARGET_TYPE_AR9888 7 /* Peregrine */ 73 #endif 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 /** 87 * struct target_if_ctx - target_interface context 88 * @magic: magic for target if ctx 89 * @get_psoc_hdl_cb: function pointer to get psoc 90 * @get_pdev_hdl_cb: function pointer to get pdev 91 * @lock: spin lock for protecting the ctx 92 */ 93 struct target_if_ctx { 94 uint32_t magic; 95 get_psoc_handle_callback get_psoc_hdl_cb; 96 get_pdev_handle_callback get_pdev_hdl_cb; 97 wmi_legacy_service_ready_callback service_ready_cb; 98 qdf_spinlock_t lock; 99 }; 100 101 struct target_psoc_info; 102 /** 103 * struct host_fw_ver - holds host fw version 104 * @host_ver: Host version 105 * @target_ver: Target version ID 106 * @target_rev: Target revision ID 107 * @wlan_ver: FW SW version 108 * @wlan_ver_1: FW SW version second dword 109 * @abi_ver: ABI version 110 */ 111 struct host_fw_ver { 112 uint32_t host_ver; 113 uint32_t target_ver; 114 uint32_t target_rev; 115 uint32_t wlan_ver; 116 uint32_t wlan_ver_1; 117 uint32_t abi_ver; 118 }; 119 120 struct common_dbglog_handle; 121 struct common_hif_handle; 122 struct common_htc_handle; 123 struct common_wmi_handle; 124 struct common_accelerator_handle; 125 126 /** 127 * struct comp_hdls - Non-umac/lower layer components handles, it is a sub 128 * structure of target psoc information 129 * @hif_hdl: HIF handle 130 * @htc_hdl: HTC handle 131 * @wmi_hdl: WMI handle 132 * @accelerator_hdl: NSS offload/IPA handle 133 * @dbglog_hdl: Debug log handle 134 */ 135 struct comp_hdls { 136 struct common_hif_handle *hif_hdl; 137 struct common_htc_handle *htc_hdl; 138 struct common_wmi_handle *wmi_hdl; 139 struct common_accelerator_handle *accelerator_hdl; 140 struct common_dbglog_handle *dbglog_hdl; 141 }; 142 143 /** 144 * struct target_supported_modes - List of HW modes supported by target. 145 * 146 * @num_modes: Number of modes supported 147 * @hw_mode_ids: List of HW mode ids 148 */ 149 struct target_supported_modes { 150 uint8_t num_modes; 151 uint32_t hw_mode_ids[WMI_HOST_HW_MODE_MAX]; 152 }; 153 154 /** 155 * struct tgt_info - FW or lower layer related info(required by target_if), 156 * it is a sub structure of taarget psoc information 157 * @version: Host FW version struct 158 * @wlan_res_cfg: target_resource_config info 159 * @wlan_ext_res_cfg: wmi_host_ext_resource_config info 160 * @wmi_service_ready: is service ready received 161 * @wmi_ready: is ready event received 162 * @total_mac_phy_cnt: num of mac phys 163 * @num_radios: number of radios 164 * @wlan_init_status: Target init status 165 * @target_type: Target type 166 * @max_descs: Max descriptors 167 * @preferred_hw_mode: preferred hw mode 168 * @wmi_timeout: wait timeout for target events 169 * @event: qdf_event for target events 170 * @service_bitmap: WMI service bitmap 171 * @target_cap: target capabilities 172 * @service_ext_param: ext service params 173 * @mac_phy_cap: phy caps array 174 * @reg_cap: regulatory caps array 175 * @scaling_params: Spectral bin scaling parameters 176 * @num_mem_chunks: number of mem chunks allocated 177 * @hw_mode_caps: HW mode caps of preferred mode 178 * @mem_chunks: allocated memory blocks for FW 179 */ 180 struct tgt_info { 181 struct host_fw_ver version; 182 target_resource_config wlan_res_cfg; 183 wmi_host_ext_resource_config wlan_ext_res_cfg; 184 bool wmi_service_ready; 185 bool wmi_ready; 186 uint8_t total_mac_phy_cnt; 187 uint8_t num_radios; 188 uint32_t wlan_init_status; 189 uint32_t target_type; 190 uint32_t max_descs; 191 uint32_t preferred_hw_mode; 192 uint32_t wmi_timeout; 193 qdf_event_t event; 194 uint32_t service_bitmap[PSOC_SERVICE_BM_SIZE]; 195 struct wlan_psoc_target_capability_info target_caps; 196 struct wlan_psoc_host_service_ext_param service_ext_param; 197 struct wlan_psoc_host_mac_phy_caps 198 mac_phy_cap[PSOC_MAX_MAC_PHY_CAP]; 199 struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap; 200 struct wlan_psoc_host_spectral_scaling_params *scaling_params; 201 uint32_t num_mem_chunks; 202 struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS]; 203 struct wlan_psoc_host_hw_mode_caps hw_mode_cap; 204 struct target_supported_modes hw_modes; 205 }; 206 207 /** 208 * struct target_ops - Holds feature specific function pointers, which would be 209 * invoked as part of service ready or ext service ready 210 * @ext_resource_config_enable: Ext resource config 211 * @peer_config: Peer config enable 212 * @mesh_support_enable: Mesh support enable 213 * @smart_antenna_enable: Smart antenna enable 214 * @atf_config_enable: ATF config enable 215 * @qwrap_config_enable: QWRAP config enable 216 * @btcoex_config_enable: BTCOEX config enable 217 * @lteu_ext_support_enable: LTE-U Ext config enable 218 * @set_init_cmd_dev_based_params: Sets Init command params 219 * @alloc_pdevs: Allocates PDEVs 220 * @update_pdev_tgt_info: Updates PDEV target info 221 * @mem_mgr_alloc_chunk: Allocates memory through MEM manager 222 * @mem_mgr_free_chunks: Free memory chunks through MEM manager 223 * @print_svc_ready_ex_param: Print service ready ext params 224 * @add_11ax_modes: Adds 11ax modes to reg cap 225 * @set_default_tgt_config: Sets target config with default values 226 * @sw_version_check: Checks the SW version 227 * @smart_log_enable: Enable Smart Logs feature 228 * @cfr_support_enable: CFR support enable 229 */ 230 struct target_ops { 231 QDF_STATUS (*ext_resource_config_enable) 232 (struct wlan_objmgr_psoc *psoc, 233 struct target_psoc_info *tgt_info, uint8_t *event); 234 void (*peer_config) 235 (struct wlan_objmgr_psoc *psoc, 236 struct target_psoc_info *tgt_info, uint8_t *event); 237 void (*mesh_support_enable) 238 (struct wlan_objmgr_psoc *psoc, 239 struct target_psoc_info *tgt_info, uint8_t *event); 240 void (*smart_antenna_enable) 241 (struct wlan_objmgr_psoc *psoc, 242 struct target_psoc_info *tgt_info, uint8_t *event); 243 void (*atf_config_enable) 244 (struct wlan_objmgr_psoc *psoc, 245 struct target_psoc_info *tgt_info, uint8_t *event); 246 void (*qwrap_config_enable) 247 (struct wlan_objmgr_psoc *psoc, 248 struct target_psoc_info *tgt_info, uint8_t *event); 249 void (*btcoex_config_enable) 250 (struct wlan_objmgr_psoc *psoc, 251 struct target_psoc_info *tgt_info, uint8_t *event); 252 void (*lteu_ext_support_enable) 253 (struct wlan_objmgr_psoc *psoc, 254 struct target_psoc_info *tgt_info, uint8_t *event); 255 void (*set_init_cmd_dev_based_params) 256 (struct wlan_objmgr_psoc *psoc, 257 struct target_psoc_info *tgt_info); 258 QDF_STATUS (*alloc_pdevs) 259 (struct wlan_objmgr_psoc *psoc, 260 struct target_psoc_info *tgt_info); 261 QDF_STATUS (*update_pdev_tgt_info) 262 (struct wlan_objmgr_psoc *psoc, 263 struct target_psoc_info *tgt_info); 264 uint32_t (*mem_mgr_alloc_chunk)(struct wlan_objmgr_psoc *psoc, 265 struct target_psoc_info *tgt_info, 266 u_int32_t req_id, u_int32_t idx, u_int32_t num_units, 267 u_int32_t unit_len, u_int32_t num_unit_info); 268 QDF_STATUS (*mem_mgr_free_chunks)(struct wlan_objmgr_psoc *psoc, 269 struct target_psoc_info *tgt_hdl); 270 void (*print_svc_ready_ex_param)( 271 struct wlan_objmgr_psoc *psoc, 272 struct target_psoc_info *tgt_info); 273 void (*add_11ax_modes)( 274 struct wlan_objmgr_psoc *psoc, 275 struct target_psoc_info *tgt_info); 276 void (*set_default_tgt_config)( 277 struct wlan_objmgr_psoc *psoc, 278 struct target_psoc_info *tgt_info); 279 QDF_STATUS (*sw_version_check)( 280 struct wlan_objmgr_psoc *psoc, 281 struct target_psoc_info *tgt_hdl, 282 uint8_t *evt_buf); 283 void (*eapol_minrate_enable) 284 (struct wlan_objmgr_psoc *psoc, 285 struct target_psoc_info *tgt_info, uint8_t *event); 286 void (*cfr_support_enable) 287 (struct wlan_objmgr_psoc *psoc, 288 struct target_psoc_info *tgt_info, uint8_t *event); 289 }; 290 291 292 293 /** 294 * struct target_psoc_info - target psoc information 295 * @hdls: component handles (htc/htt/wmi) sub structure 296 * @info: target related info sub structure 297 * @feature_ptr: stores legacy pointer or few driver specific structures 298 * @tif_ops: holds driver specific function pointers 299 */ 300 struct target_psoc_info { 301 struct comp_hdls hdls; 302 struct tgt_info info; 303 void *feature_ptr; 304 struct target_ops *tif_ops; 305 }; 306 307 /** 308 * struct target_pdev_info - target pdev information 309 * @wmi_handle: WMI handle 310 * @accelerator_hdl: NSS offload/IPA handles 311 * @pdev_idx: pdev id (of FW) 312 * @phy_idx: phy id (of FW) 313 * @feature_ptr: stores legacy pointer or few driver specific structures 314 */ 315 struct target_pdev_info { 316 struct common_wmi_handle *wmi_handle; 317 struct common_accelerator_handle *accelerator_hdl; 318 int32_t pdev_idx; 319 int32_t phy_idx; 320 void *feature_ptr; 321 }; 322 323 324 /** 325 * target_if_init() - target_if Initialization 326 * @get_wmi_handle: function pointer to get wmi handle 327 * 328 * 329 * Return: QDF_STATUS 330 */ 331 QDF_STATUS target_if_init(get_psoc_handle_callback psoc_hdl_cb); 332 333 /** 334 * target_if_deinit() - Close target_if 335 * @scn_handle: scn handle 336 * 337 * Return: QDF_STATUS_SUCCESS - in case of success 338 */ 339 QDF_STATUS target_if_deinit(void); 340 341 /** 342 * target_if_store_pdev_target_if_ctx() - stores objmgr pdev in target if ctx 343 * @pdev_hdl_cb: function pointer to get objmgr pdev 344 * 345 * Return: QDF_STATUS_SUCCESS - in case of success 346 */ 347 QDF_STATUS target_if_store_pdev_target_if_ctx( 348 get_pdev_handle_callback pdev_hdl_cb); 349 350 /** 351 * wlan_get_tgt_if_ctx() -Get target if ctx 352 * 353 * Return: target if ctx 354 */ 355 struct target_if_ctx *target_if_get_ctx(void); 356 357 /** 358 * target_if_get_psoc_from_scn_hdl() - get psoc from scn handle 359 * @scn_handle: scn handle 360 * 361 * This API is generally used while processing wmi event. 362 * In wmi event SCN handle will be passed by wmi hence 363 * using this API we can get psoc from scn handle. 364 * 365 * Return: index for matching scn handle 366 */ 367 struct wlan_objmgr_psoc *target_if_get_psoc_from_scn_hdl(void *scn_handle); 368 369 /** 370 * target_if_get_pdev_from_scn_hdl() - get pdev from scn handle 371 * @scn_handle: scn handle 372 * 373 * This API is generally used while processing wmi event. 374 * In wmi event SCN handle will be passed by wmi hence 375 * using this API we can get pdev from scn handle. 376 * 377 * Return: pdev for matching scn handle 378 */ 379 struct wlan_objmgr_pdev *target_if_get_pdev_from_scn_hdl(void *scn_handle); 380 381 /** target_if_register_tx_ops() - register tx_ops 382 * @tx_ops: tx_ops structure 383 * 384 * This function is to be used by components to populate 385 * the OL function pointers (tx_ops) required by the component 386 * for UMAC-LMAC interaction, with the appropriate handler 387 * 388 * Return: QDF STATUS 389 */ 390 QDF_STATUS target_if_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); 391 392 /** 393 * target_if_get_psoc_legacy_service_ready_cb() - get psoc from scn handle 394 * 395 * This API is generally used while processing wmi event. 396 * In wmi event SCN handle will be passed by wmi hence 397 * using this API we can get psoc from scn handle. 398 * 399 * Return: wmi_legacy_service_ready_callback 400 */ 401 wmi_legacy_service_ready_callback 402 target_if_get_psoc_legacy_service_ready_cb(void); 403 404 /** 405 * target_if_register_legacy_service_ready_cb() - get legacy 406 * service ready handler from scn handle 407 * 408 * @service_ready_cb: function pointer to service ready callback 409 * 410 * Return: QDF Status 411 */ 412 QDF_STATUS target_if_register_legacy_service_ready_cb( 413 wmi_legacy_service_ready_callback service_ready_cb); 414 415 /** 416 * target_if_alloc_pdev_tgt_info() - alloc pdev tgt info 417 * @pdev: pointer to pdev 418 * 419 * API to allocate memory for target_pdev_info 420 * 421 * Return: SUCCESS on successful memory allocation or Failure 422 */ 423 QDF_STATUS target_if_alloc_pdev_tgt_info(struct wlan_objmgr_pdev *pdev); 424 425 /** 426 * target_if_free_pdev_tgt_info() - free pdev tgt info 427 * @pdev: pointer to pdev 428 * 429 * API to free allocated memory for target_pdev_info 430 * 431 * Return: SUCCESS on successful memory deallocation or Failure 432 */ 433 QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev); 434 435 /** 436 * target_if_alloc_psoc_tgt_info() - alloc psoc tgt info 437 * @psoc: pointer to psoc 438 * 439 * API to allocate memory for target_psoc_info 440 * 441 * Return: SUCCESS on successful memory allocation or Failure 442 */ 443 QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc); 444 445 /** 446 * target_if_free_psoc_tgt_info() - free psoc tgt info 447 * @psoc: pointer to psoc 448 * 449 * API to free allocated memory for target_psoc_info 450 * 451 * Return: SUCCESS on successful memory deallocation or Failure 452 */ 453 QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc); 454 455 /** 456 * target_is_tgt_type_ar900b() - Check if the target type is AR900B 457 * @target_type: target type to be checked. 458 * 459 * Return: true if the target_type is AR900B, else false. 460 */ 461 bool target_is_tgt_type_ar900b(uint32_t target_type); 462 463 /** 464 * target_is_tgt_type_ipq4019() - Check if the target type is IPQ4019 465 * @target_type: target type to be checked. 466 * 467 * Return: true if the target_type is IPQ4019, else false. 468 */ 469 bool target_is_tgt_type_ipq4019(uint32_t target_type); 470 471 /** 472 * target_is_tgt_type_qca9984() - Check if the target type is QCA9984 473 * @target_type: target type to be checked. 474 * 475 * Return: true if the target_type is QCA9984, else false. 476 */ 477 bool target_is_tgt_type_qca9984(uint32_t target_type); 478 479 /** 480 * target_is_tgt_type_qca9888() - Check if the target type is QCA9888 481 * @target_type: target type to be checked. 482 * 483 * Return: true if the target_type is QCA9888, else false. 484 */ 485 bool target_is_tgt_type_qca9888(uint32_t target_type); 486 487 488 /** 489 * target_psoc_set_wlan_init_status() - set info wlan_init_status 490 * @psoc_info: pointer to structure target_psoc_info 491 * @wlan_init_status: FW init status 492 * 493 * API to set wlan_init_status 494 * 495 * Return: void 496 */ 497 static inline void target_psoc_set_wlan_init_status 498 (struct target_psoc_info *psoc_info, uint32_t wlan_init_status) 499 { 500 if (psoc_info == NULL) 501 return; 502 503 psoc_info->info.wlan_init_status = wlan_init_status; 504 } 505 506 /** 507 * target_psoc_get_wlan_init_status() - get info wlan_init_status 508 * @psoc_info: pointer to structure target_psoc_info 509 * 510 * API to get wlan_init_status 511 * 512 * Return: uint32_t 513 */ 514 static inline uint32_t target_psoc_get_wlan_init_status 515 (struct target_psoc_info *psoc_info) 516 { 517 if (psoc_info == NULL) 518 return (uint32_t)-1; 519 520 return psoc_info->info.wlan_init_status; 521 } 522 523 /** 524 * target_psoc_set_target_type() - set info target_type 525 * @psoc_info: pointer to structure target_psoc_info 526 * @target_type: Target type 527 * 528 * API to set target_type 529 * 530 * Return: void 531 */ 532 static inline void target_psoc_set_target_type 533 (struct target_psoc_info *psoc_info, uint32_t target_type) 534 { 535 if (psoc_info == NULL) 536 return; 537 538 psoc_info->info.target_type = target_type; 539 } 540 541 /** 542 * target_psoc_get_target_type() - get info target_type 543 * @psoc_info: pointer to structure target_psoc_info 544 * 545 * API to get target_type 546 * 547 * Return: unit32_t 548 */ 549 static inline uint32_t target_psoc_get_target_type 550 (struct target_psoc_info *psoc_info) 551 { 552 if (psoc_info == NULL) 553 return (uint32_t)-1; 554 555 return psoc_info->info.target_type; 556 } 557 558 /** 559 * target_psoc_set_max_descs() - set info max_descs 560 * @psoc_info: pointer to structure target_psoc_info 561 * @max_descs: Max descriptors 562 * 563 * API to set max_descs 564 * 565 * Return: void 566 */ 567 static inline void target_psoc_set_max_descs 568 (struct target_psoc_info *psoc_info, uint32_t max_descs) 569 { 570 if (psoc_info == NULL) 571 return; 572 573 psoc_info->info.max_descs = max_descs; 574 } 575 576 /** 577 * target_psoc_get_max_descs() - get info max_descs 578 * @psoc_info: pointer to structure target_psoc_info 579 * 580 * API to get max_descs 581 * 582 * Return: unint32_t 583 */ 584 static inline uint32_t target_psoc_get_max_descs 585 (struct target_psoc_info *psoc_info) 586 { 587 if (psoc_info == NULL) 588 return (uint32_t)-1; 589 590 return psoc_info->info.max_descs; 591 } 592 593 /** 594 * target_psoc_set_wmi_service_ready() - set info wmi_service_ready 595 * @psoc_info: pointer to structure target_psoc_info 596 * @wmi_service_ready: service ready flag 597 * 598 * API to set wmi_service_ready 599 * 600 * Return: void 601 */ 602 static inline void target_psoc_set_wmi_service_ready 603 (struct target_psoc_info *psoc_info, bool wmi_service_ready) 604 { 605 if (psoc_info == NULL) 606 return; 607 608 psoc_info->info.wmi_service_ready = wmi_service_ready; 609 } 610 611 /** 612 * target_psoc_get_wmi_service_ready() - get info wmi_service_ready 613 * @psoc_info: pointer to structure target_psoc_info 614 * 615 * API to get wmi_service_ready 616 * 617 * Return: bool 618 */ 619 static inline bool target_psoc_get_wmi_service_ready 620 (struct target_psoc_info *psoc_info) 621 { 622 return psoc_info->info.wmi_service_ready; 623 } 624 625 /** 626 * target_psoc_set_wmi_ready() - set info wmi_ready 627 * @psoc_info: pointer to structure target_psoc_info 628 * @wmi_ready: Ready event flag 629 * 630 * API to set wmi_ready 631 * 632 * Return: void 633 */ 634 static inline void target_psoc_set_wmi_ready 635 (struct target_psoc_info *psoc_info, bool wmi_ready) 636 { 637 if (psoc_info == NULL) 638 return; 639 640 psoc_info->info.wmi_ready = wmi_ready; 641 } 642 643 /** 644 * target_psoc_get_wmi_ready() - get info wmi_ready 645 * @psoc_info: pointer to structure target_psoc_info 646 * 647 * API to get wmi_ready 648 * 649 * Return: bool 650 */ 651 static inline bool target_psoc_get_wmi_ready 652 (struct target_psoc_info *psoc_info) 653 { 654 return psoc_info->info.wmi_ready; 655 } 656 657 /** 658 * target_psoc_set_preferred_hw_mode() - set preferred_hw_mode 659 * @psoc_info: pointer to structure target_psoc_info 660 * @preferred_hw_mode: Preferred HW mode 661 * 662 * API to set preferred_hw_mode 663 * 664 * Return: void 665 */ 666 static inline void target_psoc_set_preferred_hw_mode( 667 struct target_psoc_info *psoc_info, uint32_t preferred_hw_mode) 668 { 669 if (psoc_info == NULL) 670 return; 671 672 psoc_info->info.preferred_hw_mode = preferred_hw_mode; 673 } 674 675 /** 676 * target_psoc_get_preferred_hw_mode() - get preferred_hw_mode 677 * @psoc_info: pointer to structure target_psoc_info 678 * 679 * API to get preferred_hw_mode 680 * 681 * Return: unint32_t 682 */ 683 static inline uint32_t target_psoc_get_preferred_hw_mode 684 (struct target_psoc_info *psoc_info) 685 { 686 if (psoc_info == NULL) 687 return WMI_HOST_HW_MODE_MAX; 688 689 return psoc_info->info.preferred_hw_mode; 690 } 691 692 /** 693 * target_psoc_get_supported_hw_modes() - get supported_hw_mode in target 694 * @psoc_info: pointer to structure target_psoc_info 695 * 696 * API to get list of supported HW modes 697 * 698 * Return: pointer to target_supported_modes 699 */ 700 static inline struct target_supported_modes *target_psoc_get_supported_hw_modes 701 (struct target_psoc_info *psoc_info) 702 { 703 if (!psoc_info) 704 return NULL; 705 706 return &psoc_info->info.hw_modes; 707 } 708 709 /** 710 * target_psoc_set_wmi_timeout() - set wmi_timeout 711 * @psoc_info: pointer to structure target_psoc_info 712 * @wmi_timeout: WMI timeout value in sec 713 * 714 * API to set wmi_timeout 715 * 716 * Return: void 717 */ 718 static inline void target_psoc_set_wmi_timeout 719 (struct target_psoc_info *psoc_info, uint32_t wmi_timeout) 720 { 721 if (psoc_info == NULL) 722 return; 723 724 psoc_info->info.wmi_timeout = wmi_timeout; 725 } 726 727 /** 728 * target_psoc_get_wmi_timeout() - get wmi_timeout 729 * @psoc_info: pointer to structure target_psoc_info 730 * 731 * API to get wmi_timeout 732 * 733 * Return: unint32_t 734 */ 735 static inline uint32_t target_psoc_get_wmi_timeout 736 (struct target_psoc_info *psoc_info) 737 { 738 if (psoc_info == NULL) 739 return (uint32_t)-1; 740 741 return psoc_info->info.wmi_timeout; 742 } 743 744 /** 745 * target_psoc_set_total_mac_phy_cnt() - set total_mac_phy 746 * @psoc_info: pointer to structure target_psoc_infoa 747 * @total_mac_phy_cnt: Total MAC PHY cnt 748 * 749 * API to set total_mac_phy 750 * 751 * Return: void 752 */ 753 static inline void target_psoc_set_total_mac_phy_cnt 754 (struct target_psoc_info *psoc_info, uint8_t total_mac_phy_cnt) 755 { 756 if (psoc_info == NULL) 757 return; 758 759 psoc_info->info.total_mac_phy_cnt = total_mac_phy_cnt; 760 } 761 762 /** 763 * target_psoc_get_total_mac_phy_cnt() - get total_mac_phy 764 * @psoc_info: pointer to structure target_psoc_info 765 * 766 * API to get total_mac_phy 767 * 768 * Return: unint8_t 769 */ 770 static inline uint8_t target_psoc_get_total_mac_phy_cnt( 771 struct target_psoc_info *psoc_info) 772 { 773 if (psoc_info == NULL) 774 return 0; 775 776 return psoc_info->info.total_mac_phy_cnt; 777 } 778 779 /** 780 * target_psoc_set_num_radios() - set num of radios 781 * @psoc_info: pointer to structure target_psoc_info 782 * @num_radios: Number of radios 783 * 784 * API to set number of radios 785 * 786 * Return: number of radios 787 */ 788 static inline void target_psoc_set_num_radios( 789 struct target_psoc_info *psoc_info, uint8_t num_radios) 790 { 791 if (psoc_info == NULL) 792 return; 793 794 psoc_info->info.num_radios = num_radios; 795 } 796 797 /** 798 * target_psoc_get_num_radios() - get number of radios 799 * @psoc_info: pointer to structure target_psoc_info 800 * 801 * API to get number_of_radios 802 * 803 * Return: number of radios 804 */ 805 static inline uint8_t target_psoc_get_num_radios 806 (struct target_psoc_info *psoc_info) 807 { 808 if (psoc_info == NULL) 809 return 0; 810 811 return psoc_info->info.num_radios; 812 } 813 814 /** 815 * target_psoc_set_service_bitmap() - set service_bitmap 816 * @psoc_info: pointer to structure target_psoc_info 817 * @service_bitmap: FW service bitmap 818 * 819 * API to set service_bitmap 820 * 821 * Return: void 822 */ 823 static inline void target_psoc_set_service_bitmap 824 (struct target_psoc_info *psoc_info, uint32_t *service_bitmap) 825 { 826 qdf_mem_copy(psoc_info->info.service_bitmap, service_bitmap, 827 sizeof(psoc_info->info.service_bitmap)); 828 } 829 830 /** 831 * target_psoc_get_service_bitmap() - get service_bitmap 832 * @psoc_info: pointer to structure target_psoc_info 833 * 834 * API to get service_bitmap 835 * 836 * Return: unint32_t 837 */ 838 static inline uint32_t *target_psoc_get_service_bitmap 839 (struct target_psoc_info *psoc_info) 840 { 841 return psoc_info->info.service_bitmap; 842 } 843 844 /** 845 * target_psoc_set_num_mem_chunks - set num_mem_chunks 846 * @psoc_info: pointer to structure target_psoc_info 847 & @num_mem_chunks: Num Memory chunks allocated for FW 848 * 849 * API to set num_mem_chunks 850 * 851 * Return: void 852 */ 853 static inline void target_psoc_set_num_mem_chunks( 854 struct target_psoc_info *psoc_info, uint32_t num_mem_chunks) 855 { 856 if (psoc_info == NULL) 857 return; 858 psoc_info->info.num_mem_chunks = num_mem_chunks; 859 } 860 861 /** 862 * target_psoc_get_num_mem_chunks() - get num_mem_chunks 863 * @psoc_info: pointer to structure target_psoc_info 864 * 865 * API to get total_mac_phy 866 * 867 * Return: unint8_t 868 */ 869 static inline uint32_t target_psoc_get_num_mem_chunks 870 (struct target_psoc_info *psoc_info) 871 { 872 if (psoc_info == NULL) 873 return (uint32_t)-1; 874 875 return psoc_info->info.num_mem_chunks; 876 } 877 /** 878 * target_psoc_set_hif_hdl - set hif_hdl 879 * @psoc_info: pointer to structure target_psoc_info 880 * @hif_hdl: HIF handle 881 * 882 * API to set hif_hdl 883 * 884 * Return: void 885 */ 886 static inline void target_psoc_set_hif_hdl 887 (struct target_psoc_info *psoc_info, 888 struct common_hif_handle *hif_hdl) 889 { 890 if (psoc_info == NULL) 891 return; 892 893 psoc_info->hdls.hif_hdl = hif_hdl; 894 } 895 896 /** 897 * target_psoc_get_hif_hdl() - get hif_hdl 898 * @psoc_info: pointer to structure target_psoc_info 899 * 900 * API to get hif_hdl 901 * 902 * Return: hif_hdl 903 */ 904 static inline struct common_hif_handle *target_psoc_get_hif_hdl 905 (struct target_psoc_info *psoc_info) 906 { 907 if (psoc_info == NULL) 908 return NULL; 909 910 return psoc_info->hdls.hif_hdl; 911 } 912 913 /** 914 * target_psoc_set_hif_hdl - set htc_hdl 915 * @psoc_info: pointer to structure target_psoc_info 916 * @htc_hdl: HTC handle 917 * 918 * API to set htc_hdl 919 * 920 * Return: void 921 */ 922 static inline void target_psoc_set_htc_hdl 923 (struct target_psoc_info *psoc_info, 924 struct common_htc_handle *htc_hdl) 925 { 926 if (psoc_info == NULL) 927 return; 928 929 psoc_info->hdls.htc_hdl = htc_hdl; 930 } 931 932 /** 933 * target_psoc_get_htc_hdl() - get htc_hdl 934 * @psoc_info: pointer to structure target_psoc_info 935 * 936 * API to get htc_hdl 937 * 938 * Return: htc_hdl 939 */ 940 static inline struct common_htc_handle *target_psoc_get_htc_hdl 941 (struct target_psoc_info *psoc_info) 942 { 943 if (psoc_info == NULL) 944 return NULL; 945 946 return psoc_info->hdls.htc_hdl; 947 } 948 /** 949 * target_psoc_set_wmi_hdl - set wmi_hdl 950 * @psoc_info: pointer to structure target_psoc_info 951 * @wmi_hdl: WMI handle 952 * 953 * API to set wmi_hdl 954 * 955 * Return: void 956 */ 957 static inline void target_psoc_set_wmi_hdl 958 (struct target_psoc_info *psoc_info, 959 struct common_wmi_handle *wmi_hdl) 960 { 961 if (psoc_info == NULL) 962 return; 963 964 psoc_info->hdls.wmi_hdl = wmi_hdl; 965 } 966 967 /** 968 * target_psoc_get_wmi_hdl() - get wmi_hdl 969 * @psoc_info: pointer to structure target_psoc_info 970 * 971 * API to get wmi_hdl 972 * 973 * Return: wmi_hdl 974 */ 975 static inline struct common_wmi_handle *target_psoc_get_wmi_hdl 976 (struct target_psoc_info *psoc_info) 977 { 978 if (psoc_info == NULL) 979 return NULL; 980 981 return psoc_info->hdls.wmi_hdl; 982 } 983 984 /** 985 * target_psoc_set_accelerator_hdl - set accelerator_hdl 986 * @psoc_info: pointer to structure target_psoc_info 987 * @accelerator_hdl: Accelator handle 988 * 989 * API to set accelerator_hdl 990 * 991 * Return: void 992 */ 993 static inline void target_psoc_set_accelerator_hdl 994 (struct target_psoc_info *psoc_info, 995 struct common_accelerator_handle *accelerator_hdl) 996 { 997 if (psoc_info == NULL) 998 return; 999 1000 psoc_info->hdls.accelerator_hdl = accelerator_hdl; 1001 } 1002 1003 /** 1004 * target_psoc_get_accelerator_hdl() - get accelerator_hdl 1005 * @psoc_info: pointer to structure target_psoc_info 1006 * 1007 * API to get accelerator_hdl 1008 * 1009 * Return: accelerator_hdl 1010 */ 1011 static inline 1012 struct common_accelerator_handle *target_psoc_get_accelerator_hdl 1013 (struct target_psoc_info *psoc_info) 1014 { 1015 if (psoc_info == NULL) 1016 return NULL; 1017 1018 return psoc_info->hdls.accelerator_hdl; 1019 } 1020 1021 /** 1022 * target_psoc_set_feature_ptr - set feature_ptr 1023 * @psoc_info: pointer to structure target_psoc_info 1024 * @feature_ptr: set feature pointer 1025 * 1026 * API to set feature_ptr 1027 * 1028 * Return: void 1029 */ 1030 static inline void target_psoc_set_feature_ptr 1031 (struct target_psoc_info *psoc_info, void *feature_ptr) 1032 { 1033 if (psoc_info == NULL) 1034 return; 1035 1036 psoc_info->feature_ptr = feature_ptr; 1037 } 1038 1039 /** 1040 * target_psoc_get_feature_ptr() - get feature_ptr 1041 * @psoc_info: pointer to structure target_psoc_info 1042 * 1043 * API to get feature_ptr 1044 * 1045 * Return: feature_ptr 1046 */ 1047 static inline void *target_psoc_get_feature_ptr 1048 (struct target_psoc_info *psoc_info) 1049 { 1050 if (psoc_info == NULL) 1051 return NULL; 1052 1053 return psoc_info->feature_ptr; 1054 } 1055 1056 /** 1057 * target_psoc_get_version()- get host_fw_ver version 1058 * @psoc_info: pointer to structure target_psoc_info 1059 * 1060 * API to get host_fw_ver version 1061 * 1062 * Return: void 1063 */ 1064 static inline struct host_fw_ver *target_psoc_get_version 1065 (struct target_psoc_info *psoc_info) 1066 { 1067 return &psoc_info->info.version; 1068 } 1069 1070 /** 1071 * target_psoc_get_target_ver()- get target version 1072 * @psoc_info: pointer to structure target_psoc_info 1073 * 1074 * API to get target version 1075 * 1076 * Return: target version 1077 */ 1078 static inline uint32_t target_psoc_get_target_ver 1079 (struct target_psoc_info *psoc_info) 1080 { 1081 return psoc_info->info.version.target_ver; 1082 } 1083 1084 /** 1085 * target_psoc_set_target_ver()- set target version 1086 * @psoc_info: pointer to structure target_psoc_info 1087 * @target_ver: Target version 1088 * 1089 * API to set target version 1090 * 1091 * Return: void 1092 */ 1093 static inline void target_psoc_set_target_ver 1094 (struct target_psoc_info *psoc_info, uint32_t target_ver) 1095 { 1096 if (psoc_info == NULL) 1097 return; 1098 1099 psoc_info->info.version.target_ver = target_ver; 1100 } 1101 1102 /** 1103 * target_psoc_set_target_rev()- set target revision 1104 * @psoc_info: pointer to structure target_psoc_info 1105 * @target_rev: Target revision 1106 * 1107 * API to get target version 1108 * 1109 * Return: void 1110 */ 1111 static inline void target_psoc_set_target_rev 1112 (struct target_psoc_info *psoc_info, uint32_t target_rev) 1113 { 1114 if (psoc_info == NULL) 1115 return; 1116 1117 psoc_info->info.version.target_rev = target_rev; 1118 } 1119 1120 /** 1121 * target_psoc_get_target_rev()- get target revision 1122 * @psoc_info: pointer to structure target_psoc_info 1123 * 1124 * API to get target revision 1125 * 1126 * Return: target revision 1127 */ 1128 static inline uint32_t target_psoc_get_target_rev 1129 (struct target_psoc_info *psoc_info) 1130 { 1131 return psoc_info->info.version.target_rev; 1132 } 1133 1134 /** 1135 * target_psoc_set_dbglog_hdl - set dbglog_hdl 1136 * @psoc_info: pointer to structure target_psoc_info 1137 * @dbglog_hdl: dbglog handle 1138 * 1139 * API to set dbglog_hdl 1140 * 1141 * Return: void 1142 */ 1143 static inline void target_psoc_set_dbglog_hdl 1144 (struct target_psoc_info *psoc_info, 1145 struct common_dbglog_handle *dbglog_hdl) 1146 { 1147 if (psoc_info == NULL) 1148 return; 1149 1150 psoc_info->hdls.dbglog_hdl = dbglog_hdl; 1151 } 1152 1153 /** 1154 * target_psoc_get_dbglog_hdl() - get dbglog_hdl 1155 * @psoc_info: pointer to structure target_psoc_info 1156 * 1157 * API to get dbglog_hdl 1158 * 1159 * Return: dbglog_hdl 1160 */ 1161 static inline struct common_dbglog_handle *target_psoc_get_dbglog_hdl 1162 (struct target_psoc_info *psoc_info) 1163 { 1164 if (psoc_info == NULL) 1165 return NULL; 1166 1167 return psoc_info->hdls.dbglog_hdl; 1168 } 1169 1170 /** 1171 * target_psoc_get_wlan_res_cfg() - get wlan_res_cfg 1172 * @psoc_info: pointer to structure target_psoc_info 1173 * 1174 * API to get wlan_res_cfg 1175 * 1176 * Return: structure pointer to host_fw_ver 1177 */ 1178 static inline target_resource_config *target_psoc_get_wlan_res_cfg 1179 (struct target_psoc_info *psoc_info) 1180 { 1181 if (psoc_info == NULL) 1182 return NULL; 1183 1184 return &psoc_info->info.wlan_res_cfg; 1185 } 1186 1187 /** 1188 * target_psoc_get_wlan_ext_res_cfg() - get wlan_ext_res_cfg 1189 * @psoc_info: pointer to structure target_psoc_info 1190 * 1191 * API to get wlan_ext_res_cfg 1192 * 1193 * Return: structure pointer to wmi_host_ext_resource_config 1194 */ 1195 static inline wmi_host_ext_resource_config *target_psoc_get_wlan_ext_res_cfg 1196 (struct target_psoc_info *psoc_info) 1197 { 1198 if (psoc_info == NULL) 1199 return NULL; 1200 1201 return &psoc_info->info.wlan_ext_res_cfg; 1202 } 1203 1204 /** 1205 * target_psoc_get_event_queue() - get event_queue 1206 * @psoc_info: pointer to structure target_psoc_info 1207 * 1208 * API to get event_queue 1209 * 1210 * Return: structure pointer to qdf_wait_queue_head_t 1211 */ 1212 static inline qdf_event_t *target_psoc_get_event 1213 (struct target_psoc_info *psoc_info) 1214 { 1215 if (psoc_info == NULL) 1216 return NULL; 1217 1218 return &psoc_info->info.event; 1219 } 1220 1221 /** 1222 * target_psoc_get_target_caps() - get target_caps 1223 * @psoc_info: pointer to structure target_psoc_info 1224 * 1225 * API to get target_caps 1226 * 1227 * Return: structure pointer to wlan_psoc_target_capability_info 1228 */ 1229 static inline struct wlan_psoc_target_capability_info 1230 *target_psoc_get_target_caps(struct target_psoc_info *psoc_info) 1231 { 1232 if (psoc_info == NULL) 1233 return NULL; 1234 1235 return &psoc_info->info.target_caps; 1236 } 1237 1238 /** 1239 * target_psoc_get_service_ext_param() - get service_ext_param 1240 * @psoc_info: pointer to structure target_psoc_info 1241 * 1242 * API to get service_ext_param 1243 * 1244 * Return: structure pointer to wlan_psoc_host_service_ext_param 1245 */ 1246 static inline struct wlan_psoc_host_service_ext_param 1247 *target_psoc_get_service_ext_param 1248 (struct target_psoc_info *psoc_info) 1249 { 1250 if (psoc_info == NULL) 1251 return NULL; 1252 1253 return &psoc_info->info.service_ext_param; 1254 } 1255 1256 1257 /** 1258 * target_psoc_get_mac_phy_cap() - get mac_phy_cap 1259 * @psoc_info: pointer to structure target_psoc_info 1260 * 1261 * API to get mac_phy_cap 1262 * 1263 * Return: structure pointer to wlan_psoc_host_mac_phy_caps 1264 */ 1265 static inline struct wlan_psoc_host_mac_phy_caps *target_psoc_get_mac_phy_cap 1266 (struct target_psoc_info *psoc_info) 1267 { 1268 if (psoc_info == NULL) 1269 return NULL; 1270 1271 return psoc_info->info.mac_phy_cap; 1272 } 1273 1274 /** 1275 * target_psoc_get_dbr_ring_caps() - get dbr_ring_cap 1276 * @psoc_info: pointer to structure target_psoc_info 1277 * 1278 * API to get dbr_ring_cap 1279 * 1280 * Return: structure pointer to wlan_psoc_host_dbr_ring_caps 1281 */ 1282 static inline struct wlan_psoc_host_dbr_ring_caps 1283 *target_psoc_get_dbr_ring_caps(struct target_psoc_info *psoc_info) 1284 { 1285 if (psoc_info == NULL) 1286 return NULL; 1287 1288 return psoc_info->info.dbr_ring_cap; 1289 } 1290 1291 /** 1292 * target_psoc_get_spectral_scaling_params() - get Spectral scaling params 1293 * @psoc_info: pointer to structure target_psoc_info 1294 * 1295 * API to get Spectral scaling params 1296 * 1297 * Return: structure pointer to wlan_psoc_host_spectral_scaling_params 1298 */ 1299 static inline struct wlan_psoc_host_spectral_scaling_params 1300 *target_psoc_get_spectral_scaling_params( 1301 struct target_psoc_info *psoc_info) 1302 { 1303 if (!psoc_info) 1304 return NULL; 1305 1306 return psoc_info->info.scaling_params; 1307 } 1308 1309 /** 1310 * target_psoc_get_mem_chunks() - get mem_chunks 1311 * @psoc_info: pointer to structure target_psoc_info 1312 * 1313 * API to get mem_chunks 1314 * 1315 * Return: structure pointer to wmi_host_mem_chunk 1316 */ 1317 static inline struct wmi_host_mem_chunk *target_psoc_get_mem_chunks 1318 (struct target_psoc_info *psoc_info) 1319 { 1320 if (psoc_info == NULL) 1321 return NULL; 1322 1323 return psoc_info->info.mem_chunks; 1324 } 1325 1326 /** 1327 * target_psoc_get_tif_ops() - get tif_ops 1328 * @psoc_info: pointer to structure target_psoc_info 1329 * 1330 * API to get tif_ops 1331 * 1332 * Return: structure pointer to target_ops 1333 */ 1334 static inline struct target_ops *target_psoc_get_tif_ops 1335 (struct target_psoc_info *psoc_info) 1336 { 1337 if (psoc_info == NULL) 1338 return NULL; 1339 1340 return psoc_info->tif_ops; 1341 } 1342 1343 /** 1344 * target_pdev_set_feature_ptr - set feature_ptr 1345 * @pdev_info: pointer to structure target_pdev_info 1346 * @feature_ptr: Feature pointer 1347 * 1348 * API to set feature_ptr 1349 * 1350 * Return: void 1351 */ 1352 static inline void target_pdev_set_feature_ptr 1353 (struct target_pdev_info *pdev_info, void *feature_ptr) 1354 { 1355 if (pdev_info == NULL) 1356 return; 1357 1358 pdev_info->feature_ptr = feature_ptr; 1359 } 1360 1361 /** 1362 * target_pdev_get_feature_ptr() - get feature_ptr 1363 * @pdev_info: pointer to structure target_pdev_info 1364 * 1365 * API to get feature_ptr 1366 * 1367 * Return: feature_ptr 1368 */ 1369 static inline void *target_pdev_get_feature_ptr 1370 (struct target_pdev_info *pdev_info) 1371 { 1372 if (pdev_info == NULL) 1373 return NULL; 1374 1375 return pdev_info->feature_ptr; 1376 } 1377 1378 /** 1379 * target_pdev_set_wmi_handle - set wmi_handle 1380 * @pdev_info: pointer to structure target_pdev_info 1381 * @wmi_handle: WMI handle 1382 * 1383 * API to set wmi_handle 1384 * 1385 * Return: void 1386 */ 1387 static inline void target_pdev_set_wmi_handle 1388 (struct target_pdev_info *pdev_info, 1389 struct common_wmi_handle *wmi_handle) 1390 { 1391 if (pdev_info == NULL) 1392 return; 1393 1394 pdev_info->wmi_handle = wmi_handle; 1395 } 1396 1397 /** 1398 * target_pdev_get_wmi_handle - get wmi_handle 1399 * @pdev_info: pointer to structure target_dev_info 1400 * 1401 * API to get wmi_handle 1402 * 1403 * Return: wmi_handle 1404 */ 1405 static inline struct common_wmi_handle *target_pdev_get_wmi_handle 1406 (struct target_pdev_info *pdev_info) 1407 { 1408 if (pdev_info == NULL) 1409 return NULL; 1410 1411 return pdev_info->wmi_handle; 1412 } 1413 1414 /** 1415 * target_pdev_set_accelerator_hdl - set accelerator_hdl 1416 * @pdev_info: pointer to structure target_pdev_info 1417 * @accelerator_hdl: Accelator handle 1418 * 1419 * API to set accelerator_hdl 1420 * 1421 * Return: void 1422 */ 1423 static inline void target_pdev_set_accelerator_hdl 1424 (struct target_pdev_info *pdev_info, 1425 struct common_accelerator_handle *accelerator_hdl) 1426 { 1427 if (pdev_info == NULL) 1428 return; 1429 1430 pdev_info->accelerator_hdl = accelerator_hdl; 1431 } 1432 1433 /** 1434 * target_pdev_get_accelerator_hdl - get accelerator_hdl 1435 * @pdev_info: pointer to structure target_dev_info 1436 * 1437 * API to get accelerator_hdl 1438 * 1439 * Return: accelerator_hdl 1440 */ 1441 static inline struct common_accelerator_handle * 1442 target_pdev_get_accelerator_hdl(struct target_pdev_info *pdev_info) 1443 { 1444 if (pdev_info == NULL) 1445 return NULL; 1446 1447 return pdev_info->accelerator_hdl; 1448 } 1449 1450 /** 1451 * target_pdev_set_pdev_idx - set pdev_idx 1452 * @pdev_info: pointer to structure target_pdev_info 1453 * @pdev_idx: PDEV id of FW 1454 * 1455 * API to set pdev_idx 1456 * 1457 * Return: void 1458 */ 1459 static inline void target_pdev_set_pdev_idx 1460 (struct target_pdev_info *pdev_info, int32_t pdev_idx) 1461 { 1462 if (pdev_info == NULL) 1463 return; 1464 1465 pdev_info->pdev_idx = pdev_idx; 1466 } 1467 1468 /** 1469 * target_pdev_get_pdev_idx - get pdev_idx 1470 * @pdev_info: pointer to structure target_dev_info 1471 * 1472 * API to get pdev_idx 1473 * 1474 * Return: int32_t 1475 */ 1476 static inline int32_t target_pdev_get_pdev_idx 1477 (struct target_pdev_info *pdev_info) 1478 { 1479 if (pdev_info == NULL) 1480 return -EINVAL; 1481 1482 return pdev_info->pdev_idx; 1483 } 1484 1485 /** 1486 * target_pdev_set_phy_idx - set phy_idx 1487 * @pdev_info: pointer to structure target_pdev_info 1488 * @phy_idx: phy ID of FW 1489 * 1490 * API to set phy_idx 1491 * 1492 * Return: void 1493 */ 1494 static inline void target_pdev_set_phy_idx 1495 (struct target_pdev_info *pdev_info, int32_t phy_idx) 1496 { 1497 if (pdev_info == NULL) 1498 return; 1499 1500 pdev_info->phy_idx = phy_idx; 1501 } 1502 1503 /** 1504 * target_pdev_get_phy_idx - get phy_idx 1505 * @pdev_info: pointer to structure target_dev_info 1506 * 1507 * API to get phy_idx 1508 * 1509 * Return: int32_t 1510 */ 1511 static inline int32_t target_pdev_get_phy_idx 1512 (struct target_pdev_info *pdev_info) 1513 { 1514 if (pdev_info == NULL) 1515 return -EINVAL; 1516 1517 return pdev_info->phy_idx; 1518 } 1519 1520 /** 1521 * GET_WMI_HDL_FROM_PSOC - get wmi handle from psoc 1522 * @psoc: psoc object 1523 * 1524 * API to get wmi_handle from psoc 1525 * 1526 * Return: wmi_handle on success 1527 * if tgt handle is not initialized, it returns NULL 1528 */ 1529 static inline struct common_wmi_handle *GET_WMI_HDL_FROM_PSOC( 1530 struct wlan_objmgr_psoc *psoc) 1531 { 1532 void *tgt_if_handle; 1533 1534 if (psoc) { 1535 tgt_if_handle = psoc->tgt_if_handle; 1536 1537 if (tgt_if_handle) 1538 return (target_psoc_get_wmi_hdl( 1539 (struct target_psoc_info *)tgt_if_handle)); 1540 else 1541 return NULL; 1542 } 1543 1544 return NULL; 1545 } 1546 1547 /** 1548 * GET_WMI_HDL_FROM_PDEV - get wmi handle from pdev 1549 * @pdev: pdev object 1550 * 1551 * API to get wmi_handle from pdev 1552 * 1553 * Return: wmi_handle on success 1554 * if tgt handle is not initialized, it returns NULL 1555 */ 1556 static inline struct common_wmi_handle *GET_WMI_HDL_FROM_PDEV( 1557 struct wlan_objmgr_pdev *pdev) 1558 { 1559 void *tgt_if_handle; 1560 1561 if (pdev) { 1562 tgt_if_handle = pdev->tgt_if_handle; 1563 1564 if (tgt_if_handle) 1565 return target_pdev_get_wmi_handle(tgt_if_handle); 1566 else 1567 return NULL; 1568 } 1569 1570 return NULL; 1571 } 1572 1573 /** 1574 * get_wmi_unified_hdl_from_psoc - get wmi handle from psoc 1575 * @psoc: psoc object 1576 * 1577 * API to get wmi_handle from psoc 1578 * 1579 * Return: wmi_handle on success 1580 * if tgt handle is not initialized, it returns NULL 1581 */ 1582 static inline wmi_unified_t 1583 get_wmi_unified_hdl_from_psoc(struct wlan_objmgr_psoc *psoc) 1584 { 1585 return (wmi_unified_t)GET_WMI_HDL_FROM_PSOC(psoc); 1586 } 1587 1588 /** 1589 * get_wmi_unified_hdl_from_pdev - get wmi handle from pdev 1590 * @pdev: pdev object 1591 * 1592 * API to get wmi_handle from pdev 1593 * 1594 * Return: wmi_handle on success 1595 * if tgt handle is not initialized, it returns NULL 1596 */ 1597 static inline wmi_unified_t 1598 get_wmi_unified_hdl_from_pdev(struct wlan_objmgr_pdev *pdev) 1599 { 1600 return (wmi_unified_t)GET_WMI_HDL_FROM_PDEV(pdev); 1601 } 1602 1603 /** 1604 * target_if_ext_res_cfg_enable - Enable ext resource config 1605 * @psoc: psoc object 1606 * @tgt_hdl: target_psoc_info pointer 1607 * @evt_buf: Event buffer received from FW 1608 * 1609 * API to enable Ext resource config 1610 * 1611 * Return: none 1612 */ 1613 static inline void target_if_ext_res_cfg_enable(struct wlan_objmgr_psoc *psoc, 1614 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1615 { 1616 if ((tgt_hdl->tif_ops) && 1617 (tgt_hdl->tif_ops->ext_resource_config_enable)) 1618 tgt_hdl->tif_ops->ext_resource_config_enable(psoc, 1619 tgt_hdl, evt_buf); 1620 } 1621 1622 /** 1623 * target_if_peer_cfg_enable - Enable peer config 1624 * @psoc: psoc object 1625 * @tgt_hdl: target_psoc_info pointer 1626 * @evt_buf: Event buffer received from FW 1627 * 1628 * API to enable peer config 1629 * 1630 * Return: none 1631 */ 1632 static inline void target_if_peer_cfg_enable(struct wlan_objmgr_psoc *psoc, 1633 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1634 { 1635 if ((tgt_hdl->tif_ops) && 1636 (tgt_hdl->tif_ops->peer_config)) 1637 tgt_hdl->tif_ops->peer_config(psoc, tgt_hdl, evt_buf); 1638 } 1639 1640 /** 1641 * target_if_mesh_support_enable - Enable MESH mode support 1642 * @psoc: psoc object 1643 * @tgt_hdl: target_psoc_info pointer 1644 * @evt_buf: Event buffer received from FW 1645 * 1646 * API to enable Mesh mode 1647 * 1648 * Return: none 1649 */ 1650 static inline void target_if_mesh_support_enable(struct wlan_objmgr_psoc *psoc, 1651 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1652 { 1653 if ((tgt_hdl->tif_ops) && 1654 (tgt_hdl->tif_ops->mesh_support_enable)) 1655 tgt_hdl->tif_ops->mesh_support_enable(psoc, tgt_hdl, evt_buf); 1656 } 1657 1658 /** 1659 * target_if_eapol_minrate_enable - Enable EAPOL Minrate in Tunnel Mode 1660 * @psoc: psoc object 1661 * @tgt_hdl: target_psoc_info pointer 1662 * @evt_buf: Event buffer received from FW 1663 * 1664 * API to enable eapol minrate 1665 * 1666 * Return: none 1667 */ 1668 static inline void target_if_eapol_minrate_enable(struct wlan_objmgr_psoc *psoc, 1669 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1670 { 1671 if ((tgt_hdl->tif_ops) && 1672 (tgt_hdl->tif_ops->eapol_minrate_enable)) 1673 tgt_hdl->tif_ops->eapol_minrate_enable(psoc, tgt_hdl, evt_buf); 1674 } 1675 1676 /** 1677 * target_if_smart_antenna_enable - Enable Smart antenna module 1678 * @psoc: psoc object 1679 * @tgt_hdl: target_psoc_info pointer 1680 * @evt_buf: Event buffer received from FW 1681 * 1682 * API to enable Smart antenna 1683 * 1684 * Return: none 1685 */ 1686 static inline void target_if_smart_antenna_enable(struct wlan_objmgr_psoc *psoc, 1687 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1688 { 1689 if ((tgt_hdl->tif_ops) && 1690 (tgt_hdl->tif_ops->smart_antenna_enable)) 1691 tgt_hdl->tif_ops->smart_antenna_enable(psoc, tgt_hdl, evt_buf); 1692 } 1693 1694 /** 1695 * target_if_cfr_support_enable - Enable cfr support 1696 * @psoc: psoc object 1697 * @tgt_hdl: target_psoc_info pointer 1698 * @evt_buf: Event buffer received from FW 1699 * 1700 * API to enable cfr support 1701 * 1702 * Return: none 1703 */ 1704 static inline void target_if_cfr_support_enable(struct wlan_objmgr_psoc *psoc, 1705 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1706 { 1707 if ((tgt_hdl->tif_ops) && 1708 (tgt_hdl->tif_ops->cfr_support_enable)) 1709 tgt_hdl->tif_ops->cfr_support_enable(psoc, tgt_hdl, evt_buf); 1710 } 1711 1712 /** 1713 * target_if_atf_cfg_enable - Enable ATF config 1714 * @psoc: psoc object 1715 * @tgt_hdl: target_psoc_info pointer 1716 * @evt_buf: Event buffer received from FW 1717 * 1718 * API to enable ATF config 1719 * 1720 * Return: none 1721 */ 1722 static inline void target_if_atf_cfg_enable(struct wlan_objmgr_psoc *psoc, 1723 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1724 { 1725 if ((tgt_hdl->tif_ops) && 1726 (tgt_hdl->tif_ops->atf_config_enable)) 1727 tgt_hdl->tif_ops->atf_config_enable(psoc, tgt_hdl, evt_buf); 1728 } 1729 1730 /** 1731 * target_if_qwrap_cfg_enable - Enable QWRAP config 1732 * @psoc: psoc object 1733 * @tgt_hdl: target_psoc_info pointer 1734 * @evt_buf: Event buffer received from FW 1735 * 1736 * API to enable QWRAP config 1737 * 1738 * Return: none 1739 */ 1740 static inline void target_if_qwrap_cfg_enable(struct wlan_objmgr_psoc *psoc, 1741 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1742 { 1743 if ((tgt_hdl->tif_ops) && 1744 (tgt_hdl->tif_ops->qwrap_config_enable)) 1745 tgt_hdl->tif_ops->qwrap_config_enable(psoc, tgt_hdl, evt_buf); 1746 } 1747 1748 /** 1749 * target_if_btcoex_cfg_enable - Enable BT coex config 1750 * @psoc: psoc object 1751 * @tgt_hdl: target_psoc_info pointer 1752 * @evt_buf: Event buffer received from FW 1753 * 1754 * API to enable BT coex config 1755 * 1756 * Return: none 1757 */ 1758 static inline void target_if_btcoex_cfg_enable(struct wlan_objmgr_psoc *psoc, 1759 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1760 { 1761 if ((tgt_hdl->tif_ops) && 1762 (tgt_hdl->tif_ops->btcoex_config_enable)) 1763 tgt_hdl->tif_ops->btcoex_config_enable(psoc, tgt_hdl, evt_buf); 1764 } 1765 1766 /** 1767 * target_if_lteu_cfg_enable - Enable LTEU config 1768 * @psoc: psoc object 1769 * @tgt_hdl: target_psoc_info pointer 1770 * @evt_buf: Event buffer received from FW 1771 * 1772 * API to enable LTEU coex config 1773 * 1774 * Return: none 1775 */ 1776 static inline void target_if_lteu_cfg_enable(struct wlan_objmgr_psoc *psoc, 1777 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1778 { 1779 if ((tgt_hdl->tif_ops) && 1780 (tgt_hdl->tif_ops->lteu_ext_support_enable)) 1781 tgt_hdl->tif_ops->lteu_ext_support_enable(psoc, tgt_hdl, 1782 evt_buf); 1783 } 1784 1785 /** 1786 * target_if_set_init_cmd_dev_param - Set init command params 1787 * @psoc: psoc object 1788 * @tgt_hdl: target_psoc_info pointer 1789 * 1790 * API to set init command param based on config 1791 * 1792 * Return: none 1793 */ 1794 static inline void target_if_set_init_cmd_dev_param( 1795 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 1796 { 1797 if ((tgt_hdl->tif_ops) && 1798 (tgt_hdl->tif_ops->set_init_cmd_dev_based_params)) { 1799 tgt_hdl->tif_ops->set_init_cmd_dev_based_params(psoc, 1800 tgt_hdl); 1801 } 1802 } 1803 1804 /** 1805 * target_if_alloc_pdevs - Allocate PDEVs 1806 * @psoc: psoc object 1807 * @tgt_hdl: target_psoc_info pointer 1808 * 1809 * API allocates PDEVs based on ext service ready param 1810 * 1811 * Return: SUCCESS on pdev allocation or PDEV allocation is not needed 1812 * FAILURE, if allocation fails 1813 */ 1814 static inline QDF_STATUS target_if_alloc_pdevs(struct wlan_objmgr_psoc *psoc, 1815 struct target_psoc_info *tgt_hdl) 1816 { 1817 QDF_STATUS ret_val; 1818 1819 if ((tgt_hdl->tif_ops) && 1820 (tgt_hdl->tif_ops->alloc_pdevs)) 1821 ret_val = tgt_hdl->tif_ops->alloc_pdevs(psoc, tgt_hdl); 1822 else 1823 ret_val = QDF_STATUS_SUCCESS; 1824 1825 return ret_val; 1826 } 1827 1828 /** 1829 * target_if_update_pdev_tgt_info - Update PDEVs info 1830 * @psoc: psoc object 1831 * @tgt_hdl: target_psoc_info pointer 1832 * 1833 * API updates PDEVs info based on config 1834 * 1835 * Return: SUCCESS on pdev updation or PDEV updation is not needed 1836 * FAILURE, if updation fails 1837 */ 1838 static inline QDF_STATUS target_if_update_pdev_tgt_info( 1839 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 1840 { 1841 QDF_STATUS ret_val; 1842 1843 if ((tgt_hdl->tif_ops) && 1844 (tgt_hdl->tif_ops->update_pdev_tgt_info)) 1845 ret_val = tgt_hdl->tif_ops->update_pdev_tgt_info(psoc, 1846 tgt_hdl); 1847 else 1848 ret_val = QDF_STATUS_SUCCESS; 1849 1850 return ret_val; 1851 } 1852 1853 /** 1854 * target_if_print_service_ready_ext_param - Print Service ready ext param 1855 * @psoc: psoc object 1856 * @tgt_hdl: target_psoc_info pointer 1857 * 1858 * API to print service ready ext param 1859 * 1860 * Return: none 1861 */ 1862 static inline void target_if_print_service_ready_ext_param( 1863 struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) 1864 { 1865 if ((tgt_hdl->tif_ops) && 1866 (tgt_hdl->tif_ops->print_svc_ready_ex_param)) { 1867 tgt_hdl->tif_ops->print_svc_ready_ex_param(psoc, 1868 tgt_hdl); 1869 } 1870 } 1871 1872 /** 1873 * target_if_add_11ax_modes - Add 11ax modes explicitly 1874 * @psoc: psoc object 1875 * @tgt_hdl: target_psoc_info pointer 1876 * 1877 * API to adds 11ax modes 1878 * 1879 * Return: none 1880 */ 1881 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc, 1882 struct target_psoc_info *tgt_hdl) 1883 { 1884 if ((tgt_hdl->tif_ops) && 1885 (tgt_hdl->tif_ops->add_11ax_modes)) { 1886 tgt_hdl->tif_ops->add_11ax_modes(psoc, tgt_hdl); 1887 } 1888 } 1889 1890 /** 1891 * target_if_set_default_config - Set default config in init command 1892 * @psoc: psoc object 1893 * @tgt_hdl: target_psoc_info pointer 1894 * 1895 * API to set default config in init command 1896 * 1897 * Return: none 1898 */ 1899 static inline void target_if_set_default_config(struct wlan_objmgr_psoc *psoc, 1900 struct target_psoc_info *tgt_hdl) 1901 { 1902 if ((tgt_hdl->tif_ops) && 1903 (tgt_hdl->tif_ops->set_default_tgt_config)) { 1904 tgt_hdl->tif_ops->set_default_tgt_config(psoc, tgt_hdl); 1905 } 1906 } 1907 1908 /** 1909 * target_if_sw_version_check - SW version check 1910 * @psoc: psoc object 1911 * @tgt_hdl: target_psoc_info pointer 1912 * @evt_buf: Event buffer received from FW 1913 * 1914 * API checks the SW version 1915 * 1916 * Return: SUCCESS on version matches or version check is not needed 1917 * FAILURE, if check fails 1918 */ 1919 static inline QDF_STATUS target_if_sw_version_check( 1920 struct wlan_objmgr_psoc *psoc, 1921 struct target_psoc_info *tgt_hdl, uint8_t *evt_buf) 1922 { 1923 QDF_STATUS ret_val; 1924 1925 if ((tgt_hdl->tif_ops) && 1926 (tgt_hdl->tif_ops->sw_version_check)) 1927 ret_val = tgt_hdl->tif_ops->sw_version_check(psoc, tgt_hdl, 1928 evt_buf); 1929 else 1930 ret_val = QDF_STATUS_SUCCESS; 1931 1932 return ret_val; 1933 } 1934 1935 /** 1936 * target_if_get_phy_capability - get phy capability 1937 * @target_psoc_info: pointer to structure target_psoc_info 1938 * 1939 * API to get phy capability from the target caps 1940 * 1941 * Return: int32_t 1942 */ 1943 static inline int32_t target_if_get_phy_capability 1944 (struct target_psoc_info *target_psoc_info) 1945 { 1946 if (target_psoc_info == NULL) 1947 return -EINVAL; 1948 1949 return target_psoc_info->info.target_caps.phy_capability; 1950 } 1951 1952 /** 1953 * target_if_set_phy_capability - set phy capability 1954 * @target_psoc_info: pointer to structure target_psoc_info 1955 * @phy_capab: PHY capabilities 1956 * 1957 * API to set phy capability in the target caps 1958 * 1959 * Return: None 1960 */ 1961 static inline void target_if_set_phy_capability 1962 (struct target_psoc_info *target_psoc_info, int phy_capability) 1963 { 1964 if (target_psoc_info == NULL) 1965 return; 1966 1967 target_psoc_info->info.target_caps.phy_capability = phy_capability; 1968 } 1969 1970 /** 1971 * target_if_set_max_frag_entry - set Maximum frag entries 1972 * @target_psoc_info: pointer to structure target_psoc_info 1973 * @max_frag_entry: Maximum frag entries 1974 * 1975 * API to set Maximum frag entries from the target caps 1976 * 1977 * Return: None 1978 */ 1979 static inline void target_if_set_max_frag_entry 1980 (struct target_psoc_info *target_psoc_info, int max_frag_entry) 1981 { 1982 if (target_psoc_info == NULL) 1983 return; 1984 1985 target_psoc_info->info.target_caps.max_frag_entry = max_frag_entry; 1986 } 1987 1988 /** 1989 * target_if_get_max_frag_entry - get Maximum frag entries 1990 * @target_psoc_info: pointer to structure target_psoc_info 1991 * 1992 * API to get Maximum frag entries from the target caps 1993 * 1994 * Return: int32_t 1995 */ 1996 static inline int32_t target_if_get_max_frag_entry 1997 (struct target_psoc_info *target_psoc_info) 1998 { 1999 if (target_psoc_info == NULL) 2000 return -EINVAL; 2001 2002 return target_psoc_info->info.target_caps.max_frag_entry; 2003 } 2004 2005 /** 2006 * target_if_get_ht_cap_info - get ht capabilities info 2007 * @target_psoc_info: pointer to structure target_psoc_info 2008 * 2009 * API to get ht capabilities info from the target caps 2010 * 2011 * Return: int32_t 2012 */ 2013 static inline int32_t target_if_get_ht_cap_info 2014 (struct target_psoc_info *target_psoc_info) 2015 { 2016 if (target_psoc_info == NULL) 2017 return -EINVAL; 2018 2019 return target_psoc_info->info.target_caps.ht_cap_info; 2020 } 2021 2022 /** 2023 * target_if_get_vht_cap_info - get vht capabilities info 2024 * @target_psoc_info: pointer to structure target_psoc_info 2025 * 2026 * API to get vht capabilities info from the target caps 2027 * 2028 * Return: int32_t 2029 */ 2030 static inline int32_t target_if_get_vht_cap_info 2031 (struct target_psoc_info *target_psoc_info) 2032 { 2033 if (target_psoc_info == NULL) 2034 return -EINVAL; 2035 2036 return target_psoc_info->info.target_caps.vht_cap_info; 2037 } 2038 2039 /** 2040 * target_if_get_num_rf_chains - get Number of RF chains supported 2041 * @target_psoc_info: pointer to structure target_psoc_info 2042 * 2043 * API to get Number of RF chains supported from the target caps 2044 * 2045 * Return: int32_t 2046 */ 2047 static inline int32_t target_if_get_num_rf_chains 2048 (struct target_psoc_info *target_psoc_info) 2049 { 2050 if (target_psoc_info == NULL) 2051 return -EINVAL; 2052 2053 return target_psoc_info->info.target_caps.num_rf_chains; 2054 } 2055 2056 /** 2057 * target_if_get_fw_version - get firmware version 2058 * @target_psoc_info: pointer to structure target_psoc_info 2059 * 2060 * API to get firmware version from the target caps 2061 * 2062 * Return: int32_t 2063 */ 2064 static inline int32_t target_if_get_fw_version 2065 (struct target_psoc_info *target_psoc_info) 2066 { 2067 if (target_psoc_info == NULL) 2068 return 0; 2069 2070 return target_psoc_info->info.target_caps.fw_version; 2071 } 2072 2073 /** 2074 * target_if_get_wmi_fw_sub_feat_caps - FW sub feature capabilities 2075 * @target_psoc_info: pointer to structure target_psoc_info 2076 * 2077 * API to get FW sub feature capabilities from the target caps 2078 * 2079 * Return: int32_t 2080 */ 2081 static inline int32_t target_if_get_wmi_fw_sub_feat_caps 2082 (struct target_psoc_info *target_psoc_info) 2083 { 2084 if (target_psoc_info == NULL) 2085 return -EINVAL; 2086 2087 return target_psoc_info->info.target_caps.wmi_fw_sub_feat_caps; 2088 } 2089 2090 /** 2091 * target_if_get_conc_scan_config_bits - Default concurrenct scan config 2092 * @tgt_hdl: pointer to structure target_psoc_info 2093 * 2094 * API to get Default concurrenct scan config from the target caps 2095 * 2096 * Return: int32_t 2097 */ 2098 static inline int32_t target_if_get_conc_scan_config_bits 2099 (struct target_psoc_info *tgt_hdl) 2100 { 2101 if (tgt_hdl == NULL) 2102 return -EINVAL; 2103 2104 return tgt_hdl->info.service_ext_param.default_conc_scan_config_bits; 2105 } 2106 2107 /** 2108 * target_if_get_fw_config_bits - Default HW config bits 2109 * @tgt_hdl: pointer to structure target_psoc_info 2110 * 2111 * API to get Default HW config bits from the target caps 2112 * 2113 * Return: int32_t 2114 */ 2115 static inline int32_t target_if_get_fw_config_bits 2116 (struct target_psoc_info *tgt_hdl) 2117 { 2118 if (tgt_hdl == NULL) 2119 return -EINVAL; 2120 2121 return tgt_hdl->info.service_ext_param.default_fw_config_bits; 2122 } 2123 2124 /** 2125 * target_psoc_get_num_hw_modes - get number of dbs hardware modes 2126 * @tgt_hdl: pointer to structure target_psoc_info 2127 * 2128 * API to get Number of Dual Band Simultaneous (DBS) hardware modes 2129 * 2130 * Return: int32_t 2131 */ 2132 static inline int32_t target_psoc_get_num_hw_modes 2133 (struct target_psoc_info *tgt_hdl) 2134 { 2135 if (tgt_hdl == NULL) 2136 return -EINVAL; 2137 2138 return tgt_hdl->info.service_ext_param.num_hw_modes; 2139 } 2140 #endif 2141 2142