1 /* 2 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef _QDF_IPA_H 18 #define _QDF_IPA_H 19 20 #ifdef IPA_OFFLOAD 21 22 #include <i_qdf_ipa.h> 23 24 /** 25 * enum qdf_ipa_wlan_event - QDF IPA events 26 * @QDF_IPA_CLIENT_CONNECT: Client Connects 27 * @QDF_IPA_CLIENT_DISCONNECT: Client Disconnects 28 * @QDF_IPA_AP_CONNECT: SoftAP is started 29 * @QDF_IPA_AP_DISCONNECT: SoftAP is stopped 30 * @QDF_IPA_STA_CONNECT: STA associates to AP 31 * @QDF_IPA_STA_DISCONNECT: STA dissociates from AP 32 * @QDF_IPA_CLIENT_CONNECT_EX: Peer associates/re-associates to softap 33 * @QDF_SWITCH_TO_SCC: WLAN interfaces in scc mode 34 * @QDF_SWITCH_TO_MCC: WLAN interfaces in mcc mode 35 * @QDF_WDI_ENABLE: WDI enable complete 36 * @QDF_WDI_DISABLE: WDI teardown 37 * @QDF_FWR_SSR_BEFORE_SHUTDOWN: WLAN FW recovery 38 * @QDF_IPA_WLAN_EVENT_MAX: Max value for the enum 39 */ 40 typedef enum { 41 QDF_IPA_CLIENT_CONNECT, 42 QDF_IPA_CLIENT_DISCONNECT, 43 QDF_IPA_AP_CONNECT, 44 QDF_IPA_AP_DISCONNECT, 45 QDF_IPA_STA_CONNECT, 46 QDF_IPA_STA_DISCONNECT, 47 QDF_IPA_CLIENT_CONNECT_EX, 48 QDF_SWITCH_TO_SCC, 49 QDF_SWITCH_TO_MCC, 50 QDF_WDI_ENABLE, 51 QDF_WDI_DISABLE, 52 QDF_FWR_SSR_BEFORE_SHUTDOWN, 53 QDF_IPA_WLAN_EVENT_MAX 54 } qdf_ipa_wlan_event; 55 56 /** 57 * qdf_ipa_wdi_meter_evt_type_t - type of event client callback is 58 * for AP+STA mode metering 59 * @IPA_GET_WDI_SAP_STATS: get IPA_stats betwen SAP and STA - 60 * use ipa_get_wdi_sap_stats structure 61 * @IPA_SET_WIFI_QUOTA: set quota limit on STA - 62 * use ipa_set_wifi_quota structure 63 */ 64 typedef __qdf_ipa_wdi_meter_evt_type_t qdf_ipa_wdi_meter_evt_type_t; 65 66 typedef __qdf_ipa_get_wdi_sap_stats_t qdf_ipa_get_wdi_sap_stats_t; 67 68 /** 69 * qdf_ipa_set_wifi_quota_t - structure used for 70 * IPA_SET_WIFI_QUOTA. 71 */ 72 typedef __qdf_ipa_set_wifi_quota_t qdf_ipa_set_wifi_quota_t; 73 74 /** 75 * qdf_ipa_connect_params_t - low-level client connect input parameters. Either 76 * client allocates the data and desc FIFO and specifies that in data+desc OR 77 * specifies sizes and pipe_mem pref and IPA does the allocation. 78 */ 79 typedef __qdf_ipa_connect_params_t qdf_ipa_connect_params_t; 80 81 /** 82 * qdf_ipa_tx_meta_t - meta-data for the TX packet 83 */ 84 typedef __qdf_ipa_tx_meta_t qdf_ipa_tx_meta_t; 85 86 /** 87 * __qdf_ipa_sps_params_t - SPS related output parameters resulting from 88 */ 89 typedef __qdf_ipa_sps_params_t qdf_ipa_sps_params_t; 90 91 /** 92 * qdf_ipa_tx_intf_t - interface tx properties 93 */ 94 typedef __qdf_ipa_tx_intf_t qdf_ipa_tx_intf_t; 95 96 /** 97 * qdf_ipa_rx_intf_t - interface rx properties 98 */ 99 typedef __qdf_ipa_rx_intf_t qdf_ipa_rx_intf_t; 100 101 /** 102 * qdf_ipa_ext_intf_t - interface ext properties 103 */ 104 typedef __qdf_ipa_ext_intf_t qdf_ipa_ext_intf_t; 105 106 /** 107 * qdf_ipa_sys_connect_params_t - information needed to setup an IPA end-point 108 * in system-BAM mode 109 */ 110 typedef __qdf_ipa_sys_connect_params_t qdf_ipa_sys_connect_params_t; 111 112 /** 113 * __qdf_pa_rm_event_t - IPA RM events 114 * 115 * Indicate the resource state change 116 */ 117 typedef __qdf_ipa_rm_event_t qdf_ipa_rm_event_t; 118 119 /** 120 * struct qdf_ipa_rm_register_params_t - information needed to 121 * register IPA RM client with IPA RM 122 */ 123 typedef __qdf_ipa_rm_register_params_t qdf_ipa_rm_register_params_t; 124 125 /** 126 * struct qdf_ipa_rm_create_params_t - information needed to initialize 127 * the resource 128 * 129 * IPA RM client is expected to perform non blocking operations only 130 * in request_resource and release_resource functions and 131 * release notification context as soon as possible. 132 */ 133 typedef __qdf_ipa_rm_create_params_t qdf_ipa_rm_create_params_t; 134 135 /** 136 * qdf_ipa_rm_perf_profile_t - information regarding IPA RM client performance 137 * profile 138 */ 139 typedef __qdf_ipa_rm_perf_profile_t qdf_ipa_rm_perf_profile_t; 140 141 /** 142 * qdf_ipa_tx_data_desc_t - information needed 143 * to send data packet to HW link: link to data descriptors 144 * priv: client specific private data 145 */ 146 typedef __qdf_ipa_tx_data_desc_t qdf_ipa_tx_data_desc_t; 147 148 /** 149 * qdf_ipa_rx_data_t - information needed 150 * to send to wlan driver on receiving data from ipa hw 151 */ 152 typedef __qdf_ipa_rx_data_t qdf_ipa_rx_data_t; 153 154 /** 155 * qdf_ipa_wdi_ul_params_t - WDI_RX configuration 156 */ 157 typedef __qdf_ipa_wdi_ul_params_t qdf_ipa_wdi_ul_params_t; 158 159 /** 160 * qdf_ipa_wdi_ul_params_smmu_t - WDI_RX configuration (with WLAN SMMU) 161 */ 162 typedef __qdf_ipa_wdi_ul_params_smmu_t qdf_ipa_wdi_ul_params_smmu_t; 163 164 /** 165 * qdf_ipa_wdi_dl_params_t - WDI_TX configuration 166 */ 167 typedef __qdf_ipa_wdi_dl_params_t qdf_ipa_wdi_dl_params_t; 168 169 /** 170 * qdf_ipa_wdi_dl_params_smmu_t - WDI_TX configuration (with WLAN SMMU) 171 */ 172 typedef __qdf_ipa_wdi_dl_params_smmu_t qdf_ipa_wdi_dl_params_smmu_t; 173 174 /** 175 * qdf_ipa_wdi_in_params_t - information provided by WDI client 176 */ 177 typedef __qdf_ipa_wdi_in_params_t qdf_ipa_wdi_in_params_t; 178 179 /** 180 * qdf_ipa_wdi_out_params_t - information provided to WDI client 181 */ 182 typedef __qdf_ipa_wdi_out_params_t qdf_ipa_wdi_out_params_t; 183 184 /** 185 * qdf_ipa_wdi_db_params_t - information provided to retrieve 186 * physical address of uC doorbell 187 */ 188 typedef __qdf_ipa_wdi_db_params_t qdf_ipa_wdi_db_params_t; 189 190 /** 191 * qdf_ipa_wdi_uc_ready_params_t - uC ready CB parameters 192 */ 193 typedef void (*qdf_ipa_uc_ready_cb)(void *priv); 194 typedef __qdf_ipa_wdi_uc_ready_params_t qdf_ipa_wdi_uc_ready_params_t; 195 196 /** 197 * qdf_ipa_wdi_buffer_info_t - address info of a WLAN allocated buffer 198 * 199 * IPA driver will create/release IOMMU mapping in IPA SMMU from iova->pa 200 */ 201 typedef __qdf_ipa_wdi_buffer_info_t qdf_ipa_wdi_buffer_info_t; 202 203 /** 204 * qdf_ipa_gsi_ep_config_t - IPA GSI endpoint configurations 205 */ 206 typedef __qdf_ipa_gsi_ep_config_t qdf_ipa_gsi_ep_config_t; 207 208 /** 209 * qdf_ipa_dp_evt_type_t - type of event client callback is 210 * invoked for on data path 211 * @IPA_RECEIVE: data is struct sk_buff 212 * @IPA_WRITE_DONE: data is struct sk_buff 213 */ 214 typedef __qdf_ipa_dp_evt_type_t qdf_ipa_dp_evt_type_t; 215 216 #ifdef WDI3_STATS_UPDATE 217 /** 218 * qdf_ipa_wdi_tx_info_t - WLAN embedded TX bytes information 219 * 220 * WLAN host fills this structure to update IPA driver about 221 * embedded TX information. 222 */ 223 typedef __qdf_ipa_wdi_tx_info_t qdf_ipa_wdi_tx_info_t; 224 225 /** 226 * qdf_ipa_wdi_bw_info_t - BW threshold levels to be monitored 227 * by IPA uC 228 */ 229 typedef __qdf_ipa_wdi_bw_info_t qdf_ipa_wdi_bw_info_t; 230 231 /** 232 * qdf_ipa_inform_wlan_bw_t - BW information given by IPA driver 233 * whenever uC detects threshold level reached 234 */ 235 typedef __qdf_ipa_inform_wlan_bw_t qdf_ipa_inform_wlan_bw_t; 236 #endif 237 238 typedef __qdf_ipa_hdr_add_t qdf_ipa_hdr_add_t; 239 typedef __qdf_ipa_hdr_del_t qdf_ipa_hdr_del_t; 240 typedef __qdf_ipa_ioc_add_hdr_t qdf_ipa_ioc_add_hdr_t; 241 typedef __qdf_ipa_ioc_del_hdr_t qdf_ipa_ioc_del_hdr_t; 242 typedef __qdf_ipa_ioc_get_hdr_t qdf_ipa_ioc_get_hdr_t; 243 typedef __qdf_ipa_ioc_copy_hdr_t qdf_ipa_ioc_copy_hdr_t; 244 typedef __qdf_ipa_ioc_add_hdr_proc_ctx_t qdf_ipa_ioc_add_hdr_proc_ctx_t; 245 typedef __qdf_ipa_ioc_del_hdr_proc_ctx_t qdf_ipa_ioc_del_hdr_proc_ctx_t; 246 typedef __qdf_ipa_msg_meta_t qdf_ipa_msg_meta_t; 247 typedef __qdf_ipa_client_type_t qdf_ipa_client_type_t; 248 typedef __qdf_ipa_hw_stats_wdi_info_data_t qdf_ipa_hw_stats_wdi_info_data_t; 249 typedef __qdf_ipa_rm_resource_name_t qdf_ipa_rm_resource_name_t; 250 typedef __qdf_ipa_wlan_event_t qdf_ipa_wlan_event_t; 251 typedef __qdf_ipa_wlan_msg_t qdf_ipa_wlan_msg_t; 252 typedef __qdf_ipa_wlan_msg_ex_t qdf_ipa_wlan_msg_ex_t; 253 typedef __qdf_ipa_ioc_tx_intf_prop_t qdf_ipa_ioc_tx_intf_prop_t; 254 typedef __qdf_ipa_ioc_rx_intf_prop_t qdf_ipa_ioc_rx_intf_prop_t; 255 typedef __qdf_ipa_wlan_hdr_attrib_val_t qdf_ipa_wlan_hdr_attrib_val_t; 256 typedef int (*qdf_ipa_msg_pull_fn)(void *buff, u32 len, u32 type); 257 typedef void (*qdf_ipa_ready_cb)(void *user_data); 258 259 #define QDF_IPA_SET_META_MSG_TYPE(meta, msg_type) \ 260 __QDF_IPA_SET_META_MSG_TYPE(meta, msg_type) 261 262 #define QDF_IPA_RM_RESOURCE_GRANTED __QDF_IPA_RM_RESOURCE_GRANTED 263 #define QDF_IPA_RM_RESOURCE_RELEASED __QDF_IPA_RM_RESOURCE_RELEASED 264 265 #define QDF_IPA_VOLTAGE_LEVEL __QDF_IPA_VOLTAGE_LEVEL 266 267 #define QDF_IPA_RM_RESOURCE_WLAN_PROD __QDF_IPA_RM_RESOURCE_WLAN_PROD 268 #define QDF_IPA_RM_RESOURCE_WLAN_CONS __QDF_IPA_RM_RESOURCE_WLAN_CONS 269 #define QDF_IPA_RM_RESOURCE_APPS_CONS __QDF_IPA_RM_RESOURCE_APPS_CONS 270 271 #define QDF_IPA_CLIENT_WLAN1_PROD __QDF_IPA_CLIENT_WLAN1_PROD 272 #define QDF_IPA_CLIENT_WLAN3_PROD __QDF_IPA_CLIENT_WLAN3_PROD 273 #define QDF_IPA_CLIENT_WLAN1_CONS __QDF_IPA_CLIENT_WLAN1_CONS 274 #define QDF_IPA_CLIENT_WLAN2_CONS __QDF_IPA_CLIENT_WLAN2_CONS 275 #define QDF_IPA_CLIENT_WLAN3_CONS __QDF_IPA_CLIENT_WLAN3_CONS 276 #define QDF_IPA_CLIENT_WLAN4_CONS __QDF_IPA_CLIENT_WLAN4_CONS 277 #define QDF_IPA_CLIENT_WLAN4_PROD __QDF_IPA_CLIENT_WLAN4_PROD 278 #ifdef FEATURE_IPA_PIPE_CHANGE_WDI1 279 #define QDF_IPA_CLIENT_WLAN_LEGACY_CONS QDF_IPA_CLIENT_WLAN3_CONS 280 #define QDF_IPA_CLIENT_WLAN_LEGACY_PROD QDF_IPA_CLIENT_WLAN3_PROD 281 #define QDF_IPA_CLIENT_MCC2_CONS QDF_IPA_CLIENT_WLAN4_CONS 282 #else 283 #define QDF_IPA_CLIENT_WLAN_LEGACY_CONS QDF_IPA_CLIENT_WLAN1_CONS 284 #define QDF_IPA_CLIENT_WLAN_LEGACY_PROD QDF_IPA_CLIENT_WLAN1_PROD 285 #define QDF_IPA_CLIENT_MCC2_CONS QDF_IPA_CLIENT_WLAN3_CONS 286 #endif 287 288 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)) && \ 289 (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) 290 #define QDF_IPA_CLIENT_WLAN_WDI2_CONS QDF_IPA_CLIENT_WLAN4_CONS 291 #define QDF_IPA_CLIENT_WLAN_WDI2_PROD QDF_IPA_CLIENT_WLAN4_PROD 292 #else 293 #define QDF_IPA_CLIENT_WLAN_WDI2_CONS QDF_IPA_CLIENT_WLAN1_CONS 294 #define QDF_IPA_CLIENT_WLAN_WDI2_PROD QDF_IPA_CLIENT_WLAN1_PROD 295 #endif 296 297 /* 298 * Resume / Suspend 299 */ 300 301 #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) 302 static inline int qdf_ipa_reset_endpoint(u32 clnt_hdl) 303 { 304 return __qdf_ipa_reset_endpoint(clnt_hdl); 305 } 306 307 /* 308 * Remove ep delay 309 */ 310 static inline int qdf_ipa_clear_endpoint_delay(u32 clnt_hdl) 311 { 312 return __qdf_ipa_clear_endpoint_delay(clnt_hdl); 313 } 314 315 /* 316 * Header removal / addition 317 */ 318 static inline int qdf_ipa_add_hdr(qdf_ipa_ioc_add_hdr_t *hdrs) 319 { 320 return __qdf_ipa_add_hdr(hdrs); 321 } 322 323 static inline int qdf_ipa_del_hdr(qdf_ipa_ioc_del_hdr_t *hdls) 324 { 325 return __qdf_ipa_del_hdr(hdls); 326 } 327 328 static inline int qdf_ipa_commit_hdr(void) 329 { 330 return __qdf_ipa_commit_hdr(); 331 } 332 333 static inline int qdf_ipa_get_hdr(qdf_ipa_ioc_get_hdr_t *lookup) 334 { 335 return __qdf_ipa_get_hdr(lookup); 336 } 337 338 static inline int qdf_ipa_put_hdr(u32 hdr_hdl) 339 { 340 return __qdf_ipa_put_hdr(hdr_hdl); 341 } 342 343 static inline int qdf_ipa_copy_hdr(qdf_ipa_ioc_copy_hdr_t *copy) 344 { 345 return __qdf_ipa_copy_hdr(copy); 346 } 347 348 static inline int qdf_ipa_register_pull_msg(qdf_ipa_msg_meta_t *meta, 349 qdf_ipa_msg_pull_fn callback) 350 { 351 return __qdf_ipa_register_pull_msg(meta, callback); 352 } 353 354 static inline int qdf_ipa_deregister_pull_msg(qdf_ipa_msg_meta_t *meta) 355 { 356 return __qdf_ipa_deregister_pull_msg(meta); 357 } 358 359 /* 360 * Interface 361 */ 362 static inline int qdf_ipa_register_intf(const char *name, 363 const qdf_ipa_tx_intf_t *tx, 364 const qdf_ipa_rx_intf_t *rx) 365 { 366 return __qdf_ipa_register_intf(name, tx, rx); 367 } 368 369 static inline int qdf_ipa_register_intf_ext(const char *name, 370 const qdf_ipa_tx_intf_t *tx, 371 const qdf_ipa_rx_intf_t *rx, 372 const qdf_ipa_ext_intf_t *ext) 373 { 374 return __qdf_ipa_register_intf_ext(name, tx, rx, ext); 375 } 376 377 static inline int qdf_ipa_deregister_intf(const char *name) 378 { 379 return __qdf_ipa_deregister_intf(name); 380 } 381 382 /* 383 * Data path 384 */ 385 static inline int qdf_ipa_tx_dp(qdf_ipa_client_type_t dst, struct sk_buff *skb, 386 qdf_ipa_tx_meta_t *metadata) 387 { 388 return __qdf_ipa_tx_dp(dst, skb, metadata); 389 } 390 391 /* 392 * To transfer multiple data packets 393 */ 394 static inline int qdf_ipa_tx_dp_mul( 395 qdf_ipa_client_type_t dst, 396 qdf_ipa_tx_data_desc_t *data_desc) 397 { 398 return __qdf_ipa_tx_dp_mul(dst, data_desc); 399 } 400 401 /* 402 * System pipes 403 */ 404 static inline u16 qdf_ipa_get_smem_restr_bytes(void) 405 { 406 return __qdf_ipa_get_smem_restr_bytes(); 407 } 408 409 static inline int qdf_ipa_connect_wdi_pipe(qdf_ipa_wdi_in_params_t *in, 410 qdf_ipa_wdi_out_params_t *out) 411 { 412 return __qdf_ipa_connect_wdi_pipe(in, out); 413 } 414 415 static inline int qdf_ipa_disconnect_wdi_pipe(u32 clnt_hdl) 416 { 417 return __qdf_ipa_disconnect_wdi_pipe(clnt_hdl); 418 } 419 420 static inline int qdf_ipa_enable_wdi_pipe(u32 clnt_hdl) 421 { 422 return __qdf_ipa_enable_wdi_pipe(clnt_hdl); 423 } 424 425 static inline int qdf_ipa_disable_wdi_pipe(u32 clnt_hdl) 426 { 427 return __qdf_ipa_disable_wdi_pipe(clnt_hdl); 428 } 429 430 static inline int qdf_ipa_resume_wdi_pipe(u32 clnt_hdl) 431 { 432 return __qdf_ipa_resume_wdi_pipe(clnt_hdl); 433 } 434 435 static inline int qdf_ipa_suspend_wdi_pipe(u32 clnt_hdl) 436 { 437 return __qdf_ipa_suspend_wdi_pipe(clnt_hdl); 438 } 439 440 static inline int qdf_ipa_uc_wdi_get_dbpa( 441 qdf_ipa_wdi_db_params_t *out) 442 { 443 return __qdf_ipa_uc_wdi_get_dbpa(out); 444 } 445 446 447 /* 448 * Resource manager 449 */ 450 static inline int qdf_ipa_rm_create_resource( 451 qdf_ipa_rm_create_params_t *create_params) 452 { 453 return __qdf_ipa_rm_create_resource(create_params); 454 } 455 456 static inline int qdf_ipa_rm_delete_resource( 457 qdf_ipa_rm_resource_name_t resource_name) 458 { 459 return __qdf_ipa_rm_delete_resource(resource_name); 460 } 461 462 static inline int qdf_ipa_rm_register(qdf_ipa_rm_resource_name_t resource_name, 463 qdf_ipa_rm_register_params_t *reg_params) 464 { 465 return __qdf_ipa_rm_register(resource_name, reg_params); 466 } 467 468 static inline int qdf_ipa_rm_set_perf_profile( 469 qdf_ipa_rm_resource_name_t resource_name, 470 qdf_ipa_rm_perf_profile_t *profile) 471 { 472 return __qdf_ipa_rm_set_perf_profile(resource_name, profile); 473 } 474 475 static inline int qdf_ipa_rm_deregister(qdf_ipa_rm_resource_name_t resource_name, 476 qdf_ipa_rm_register_params_t *reg_params) 477 { 478 return __qdf_ipa_rm_deregister(resource_name, reg_params); 479 } 480 481 static inline int qdf_ipa_rm_add_dependency( 482 qdf_ipa_rm_resource_name_t resource_name, 483 qdf_ipa_rm_resource_name_t depends_on_name) 484 { 485 return __qdf_ipa_rm_add_dependency(resource_name, depends_on_name); 486 } 487 488 static inline int qdf_ipa_rm_add_dependency_sync( 489 qdf_ipa_rm_resource_name_t resource_name, 490 qdf_ipa_rm_resource_name_t depends_on_name) 491 { 492 return __qdf_ipa_rm_add_dependency_sync(resource_name, depends_on_name); 493 } 494 495 static inline int qdf_ipa_rm_delete_dependency( 496 qdf_ipa_rm_resource_name_t resource_name, 497 qdf_ipa_rm_resource_name_t depends_on_name) 498 { 499 return __qdf_ipa_rm_delete_dependency(resource_name, depends_on_name); 500 } 501 502 static inline int qdf_ipa_rm_request_resource( 503 qdf_ipa_rm_resource_name_t resource_name) 504 { 505 return __qdf_ipa_rm_request_resource(resource_name); 506 } 507 508 static inline int qdf_ipa_rm_release_resource( 509 qdf_ipa_rm_resource_name_t resource_name) 510 { 511 return __qdf_ipa_rm_release_resource(resource_name); 512 } 513 514 static inline int qdf_ipa_rm_notify_completion(qdf_ipa_rm_event_t event, 515 qdf_ipa_rm_resource_name_t resource_name) 516 { 517 return __qdf_ipa_rm_notify_completion(event, resource_name); 518 } 519 520 static inline int qdf_ipa_rm_inactivity_timer_init( 521 qdf_ipa_rm_resource_name_t resource_name, 522 unsigned long msecs) 523 { 524 return __qdf_ipa_rm_inactivity_timer_init(resource_name, msecs); 525 } 526 527 static inline int qdf_ipa_rm_inactivity_timer_destroy( 528 qdf_ipa_rm_resource_name_t resource_name) 529 { 530 return __qdf_ipa_rm_inactivity_timer_destroy(resource_name); 531 } 532 533 static inline int qdf_ipa_rm_inactivity_timer_request_resource( 534 qdf_ipa_rm_resource_name_t resource_name) 535 { 536 return __qdf_ipa_rm_inactivity_timer_request_resource(resource_name); 537 } 538 539 static inline int qdf_ipa_rm_inactivity_timer_release_resource( 540 qdf_ipa_rm_resource_name_t resource_name) 541 { 542 return __qdf_ipa_rm_inactivity_timer_release_resource(resource_name); 543 } 544 545 /* 546 * Miscellaneous 547 */ 548 static inline void qdf_ipa_bam_reg_dump(void) 549 { 550 return __qdf_ipa_bam_reg_dump(); 551 } 552 553 static inline int qdf_ipa_get_ep_mapping(qdf_ipa_client_type_t client) 554 { 555 return __qdf_ipa_get_ep_mapping(client); 556 } 557 558 static inline void qdf_ipa_proxy_clk_vote(void) 559 { 560 return __qdf_ipa_proxy_clk_vote(); 561 } 562 563 static inline void qdf_ipa_proxy_clk_unvote(void) 564 { 565 return __qdf_ipa_proxy_clk_unvote(); 566 } 567 568 static inline bool qdf_ipa_is_client_handle_valid(u32 clnt_hdl) 569 { 570 return __qdf_ipa_is_client_handle_valid(clnt_hdl); 571 } 572 573 static inline qdf_ipa_client_type_t qdf_ipa_get_client_mapping(int pipe_idx) 574 { 575 return __qdf_ipa_get_client_mapping(pipe_idx); 576 } 577 578 static inline qdf_ipa_rm_resource_name_t qdf_ipa_get_rm_resource_from_ep( 579 int pipe_idx) 580 { 581 return __qdf_ipa_get_rm_resource_from_ep(pipe_idx); 582 } 583 584 static inline bool qdf_ipa_get_modem_cfg_emb_pipe_flt(void) 585 { 586 return __qdf_ipa_get_modem_cfg_emb_pipe_flt(); 587 } 588 589 static inline int qdf_ipa_create_wdi_mapping(u32 num_buffers, 590 __qdf_ipa_wdi_buffer_info_t *info) 591 { 592 return __qdf_ipa_create_wdi_mapping(num_buffers, info); 593 } 594 595 static inline int qdf_ipa_release_wdi_mapping(u32 num_buffers, 596 qdf_ipa_wdi_buffer_info_t *info) 597 { 598 return __qdf_ipa_release_wdi_mapping(num_buffers, info); 599 } 600 601 static inline int qdf_ipa_disable_apps_wan_cons_deaggr(uint32_t agg_size, 602 uint32_t agg_count) 603 { 604 return __qdf_ipa_disable_apps_wan_cons_deaggr(agg_size, agg_count); 605 } 606 607 static inline const qdf_ipa_gsi_ep_config_t *qdf_ipa_get_gsi_ep_info(qdf_ipa_client_type_t client) 608 { 609 return __qdf_ipa_get_gsi_ep_info(client); 610 } 611 612 static inline int qdf_ipa_stop_gsi_channel(u32 clnt_hdl) 613 { 614 return __qdf_ipa_stop_gsi_channel(clnt_hdl); 615 } 616 617 #endif 618 static inline void qdf_ipa_free_skb(qdf_ipa_rx_data_t *rx_in) 619 { 620 return __qdf_ipa_free_skb(rx_in); 621 } 622 623 static inline int qdf_ipa_uc_reg_rdyCB( 624 qdf_ipa_wdi_uc_ready_params_t *param) 625 { 626 return __qdf_ipa_uc_reg_rdyCB(param); 627 } 628 629 static inline int qdf_ipa_uc_dereg_rdyCB(void) 630 { 631 return __qdf_ipa_uc_dereg_rdyCB(); 632 } 633 634 static inline int qdf_ipa_get_wdi_stats(qdf_ipa_hw_stats_wdi_info_data_t *stats) 635 { 636 return __qdf_ipa_get_wdi_stats(stats); 637 } 638 639 static inline int qdf_ipa_register_ipa_ready_cb( 640 void (*qdf_ipa_ready_cb)(void *user_data), 641 void *user_data) 642 { 643 return __qdf_ipa_register_ipa_ready_cb(qdf_ipa_ready_cb, user_data); 644 } 645 646 static inline int qdf_ipa_setup_sys_pipe(qdf_ipa_sys_connect_params_t *sys_in, 647 u32 *clnt_hdl) 648 { 649 return __qdf_ipa_setup_sys_pipe(sys_in, clnt_hdl); 650 } 651 652 static inline int qdf_ipa_teardown_sys_pipe(u32 clnt_hdl) 653 { 654 return __qdf_ipa_teardown_sys_pipe(clnt_hdl); 655 } 656 657 /* 658 * Messaging 659 */ 660 static inline int qdf_ipa_send_msg(qdf_ipa_msg_meta_t *meta, void *buff, 661 ipa_msg_free_fn callback) 662 { 663 return __qdf_ipa_send_msg(meta, buff, callback); 664 } 665 666 static inline bool qdf_ipa_is_ready(void) 667 { 668 return __qdf_ipa_is_ready(); 669 } 670 671 #ifdef FEATURE_METERING 672 static inline int qdf_ipa_broadcast_wdi_quota_reach_ind(uint32_t index, 673 uint64_t quota_bytes) 674 { 675 return __qdf_ipa_broadcast_wdi_quota_reach_ind(index, quota_bytes); 676 } 677 #endif 678 679 #ifdef ENABLE_SMMU_S1_TRANSLATION 680 /** 681 * qdf_get_ipa_smmu_enabled() - to get IPA SMMU enable status 682 * 683 * Return: true when IPA SMMU enabled, otherwise false 684 */ 685 static inline bool qdf_get_ipa_smmu_enabled(void) 686 { 687 return __qdf_get_ipa_smmu_enabled(); 688 } 689 #endif 690 691 #ifdef IPA_LAN_RX_NAPI_SUPPORT 692 /** 693 * qdf_ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN 694 * RX DP 695 * 696 * Returns: true if enabled, false otherwise 697 */ 698 static inline bool qdf_ipa_get_lan_rx_napi(void) 699 { 700 return __qdf_ipa_get_lan_rx_napi(); 701 } 702 #else 703 static inline bool qdf_ipa_get_lan_rx_napi(void) 704 { 705 return false; 706 } 707 #endif /* IPA_LAN_RX_NAPI_SUPPORT */ 708 #endif /* IPA_OFFLOAD */ 709 #endif /* _QDF_IPA_H */ 710