diff --git a/drivers/platform/msm/ipa/Makefile b/drivers/platform/msm/ipa/Makefile index 5e9d92db20..510b118073 100644 --- a/drivers/platform/msm/ipa/Makefile +++ b/drivers/platform/msm/ipa/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only ipam-y += \ - ipa_api.o ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \ + ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \ ipa_v3/ipa.o \ ipa_v3/ipa_debugfs.o \ ipa_v3/ipa_hdr.o \ diff --git a/drivers/platform/msm/ipa/ipa_api.c b/drivers/platform/msm/ipa/ipa_api.c deleted file mode 100644 index 8d4ca32c39..0000000000 --- a/drivers/platform/msm/ipa/ipa_api.c +++ /dev/null @@ -1,2624 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - */ - -#include "ipa.h" -#include -#include -#include -#include -#include -#include -#include -#include "ipa_uc_offload.h" -#include -#include "ipa_api.h" -#include "ipa_i.h" - -/* - * The following for adding code (ie. for EMULATION) not found on x86. - */ -#if defined(CONFIG_IPA_EMULATION) -# include "ipa_emulation_stubs.h" -#endif - -#define DRV_NAME "ipa" - -#define IPA_API_DISPATCH_RETURN(api, p...) \ - do { \ - if (!ipa_api_ctrl) { \ - pr_err("%s:%d IPA HW is not supported\n", \ - __func__, __LINE__); \ - ret = -EPERM; \ - } \ - else { \ - if (ipa_api_ctrl->api) { \ - ret = ipa_api_ctrl->api(p); \ - } else { \ - WARN(1, \ - "%s not implemented for IPA ver %d\n", \ - __func__, ipa_api_hw_type); \ - ret = -EPERM; \ - } \ - } \ - } while (0) - -#define IPA_API_DISPATCH(api, p...) \ - do { \ - if (!ipa_api_ctrl) \ - pr_err("%s:%d IPA HW is not supported\n", \ - __func__, __LINE__); \ - else { \ - if (ipa_api_ctrl->api) { \ - ipa_api_ctrl->api(p); \ - } else { \ - WARN(1, \ - "%s not implemented for IPA ver %d\n",\ - __func__, ipa_api_hw_type); \ - } \ - } \ - } while (0) - -#define IPA_API_DISPATCH_RETURN_PTR(api, p...) \ - do { \ - if (!ipa_api_ctrl) { \ - pr_err("%s:%d IPA HW is not supported\n", \ - __func__, __LINE__); \ - ret = NULL; \ - } \ - else { \ - if (ipa_api_ctrl->api) { \ - ret = ipa_api_ctrl->api(p); \ - } else { \ - WARN(1, "%s not implemented for IPA ver %d\n",\ - __func__, ipa_api_hw_type); \ - ret = NULL; \ - } \ - } \ - } while (0) - -#define IPA_API_DISPATCH_RETURN_BOOL(api, p...) \ - do { \ - if (!ipa_api_ctrl) { \ - pr_err("%s:%d IPA HW is not supported\n", \ - __func__, __LINE__); \ - ret = false; \ - } \ - else { \ - if (ipa_api_ctrl->api) { \ - ret = ipa_api_ctrl->api(p); \ - } else { \ - WARN(1, "%s not implemented for IPA ver %d\n",\ - __func__, ipa_api_hw_type); \ - ret = false; \ - } \ - } \ - } while (0) - -#if defined(CONFIG_IPA_EMULATION) -static bool running_emulation = true; -#else -static bool running_emulation; -#endif - -static enum ipa_hw_type ipa_api_hw_type; -static struct ipa_api_controller *ipa_api_ctrl; - -const char *ipa_clients_strings[IPA_CLIENT_MAX] = { - __stringify(IPA_CLIENT_HSIC1_PROD), - __stringify(IPA_CLIENT_HSIC1_CONS), - __stringify(IPA_CLIENT_HSIC2_PROD), - __stringify(IPA_CLIENT_HSIC2_CONS), - __stringify(IPA_CLIENT_HSIC3_PROD), - __stringify(IPA_CLIENT_HSIC3_CONS), - __stringify(IPA_CLIENT_HSIC4_PROD), - __stringify(IPA_CLIENT_HSIC4_CONS), - __stringify(IPA_CLIENT_HSIC5_PROD), - __stringify(IPA_CLIENT_HSIC5_CONS), - __stringify(IPA_CLIENT_WLAN1_PROD), - __stringify(IPA_CLIENT_WLAN1_CONS), - __stringify(IPA_CLIENT_WLAN2_PROD), - __stringify(IPA_CLIENT_WLAN2_CONS), - __stringify(RESERVED_PROD_14), - __stringify(IPA_CLIENT_WLAN3_CONS), - __stringify(RESERVED_PROD_16), - __stringify(IPA_CLIENT_WLAN4_CONS), - __stringify(IPA_CLIENT_USB_PROD), - __stringify(IPA_CLIENT_USB_CONS), - __stringify(IPA_CLIENT_USB2_PROD), - __stringify(IPA_CLIENT_USB2_CONS), - __stringify(IPA_CLIENT_USB3_PROD), - __stringify(IPA_CLIENT_USB3_CONS), - __stringify(IPA_CLIENT_USB4_PROD), - __stringify(IPA_CLIENT_USB4_CONS), - __stringify(IPA_CLIENT_UC_USB_PROD), - __stringify(IPA_CLIENT_USB_DPL_CONS), - __stringify(IPA_CLIENT_A2_EMBEDDED_PROD), - __stringify(IPA_CLIENT_A2_EMBEDDED_CONS), - __stringify(IPA_CLIENT_A2_TETHERED_PROD), - __stringify(IPA_CLIENT_A2_TETHERED_CONS), - __stringify(IPA_CLIENT_APPS_LAN_PROD), - __stringify(IPA_CLIENT_APPS_LAN_CONS), - __stringify(IPA_CLIENT_APPS_WAN_PROD), - __stringify(IPA_CLIENT_APPS_WAN_CONS), - __stringify(IPA_CLIENT_APPS_CMD_PROD), - __stringify(IPA_CLIENT_A5_LAN_WAN_CONS), - __stringify(IPA_CLIENT_ODU_PROD), - __stringify(IPA_CLIENT_ODU_EMB_CONS), - __stringify(RESERVED_PROD_40), - __stringify(IPA_CLIENT_ODU_TETH_CONS), - __stringify(IPA_CLIENT_MHI_PROD), - __stringify(IPA_CLIENT_MHI_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_CONS), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD), - __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS), - __stringify(IPA_CLIENT_ETHERNET_PROD), - __stringify(IPA_CLIENT_ETHERNET_CONS), - __stringify(IPA_CLIENT_Q6_LAN_PROD), - __stringify(IPA_CLIENT_Q6_LAN_CONS), - __stringify(IPA_CLIENT_Q6_WAN_PROD), - __stringify(IPA_CLIENT_Q6_WAN_CONS), - __stringify(IPA_CLIENT_Q6_CMD_PROD), - __stringify(IPA_CLIENT_Q6_DUN_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP_CONS), - __stringify(IPA_CLIENT_Q6_DECOMP2_PROD), - __stringify(IPA_CLIENT_Q6_DECOMP2_CONS), - __stringify(RESERVED_PROD_60), - __stringify(IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS), - __stringify(IPA_CLIENT_TEST_PROD), - __stringify(IPA_CLIENT_TEST_CONS), - __stringify(IPA_CLIENT_TEST1_PROD), - __stringify(IPA_CLIENT_TEST1_CONS), - __stringify(IPA_CLIENT_TEST2_PROD), - __stringify(IPA_CLIENT_TEST2_CONS), - __stringify(IPA_CLIENT_TEST3_PROD), - __stringify(IPA_CLIENT_TEST3_CONS), - __stringify(IPA_CLIENT_TEST4_PROD), - __stringify(IPA_CLIENT_TEST4_CONS), - __stringify(RESERVED_PROD_72), - __stringify(IPA_CLIENT_DUMMY_CONS), - __stringify(IPA_CLIENT_Q6_DL_NLO_DATA_PROD), - __stringify(IPA_CLIENT_Q6_UL_NLO_DATA_CONS), - __stringify(RESERVED_PROD_76), - __stringify(IPA_CLIENT_Q6_UL_NLO_ACK_CONS), - __stringify(RESERVED_PROD_78), - __stringify(IPA_CLIENT_Q6_QBAP_STATUS_CONS), - __stringify(RESERVED_PROD_80), - __stringify(IPA_CLIENT_MHI_DPL_CONS), - __stringify(RESERVED_PROD_82), - __stringify(IPA_CLIENT_ODL_DPL_CONS), - __stringify(IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD), - __stringify(IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS), - __stringify(IPA_CLIENT_WIGIG_PROD), - __stringify(IPA_CLIENT_WIGIG1_CONS), - __stringify(RESERVERD_PROD_88), - __stringify(IPA_CLIENT_WIGIG2_CONS), - __stringify(RESERVERD_PROD_90), - __stringify(IPA_CLIENT_WIGIG3_CONS), - __stringify(RESERVERD_PROD_92), - __stringify(IPA_CLIENT_WIGIG4_CONS), - __stringify(RESERVERD_PROD_94), - __stringify(IPA_CLIENT_APPS_WAN_COAL_CONS), - __stringify(IPA_CLIENT_MHI_PRIME_RMNET_PROD), - __stringify(IPA_CLIENT_MHI_PRIME_RMNET_CONS), - __stringify(IPA_CLIENT_MHI_PRIME_TETH_PROD), - __stringify(IPA_CLIENT_MHI_PRIME_TETH_CONS), - __stringify(IPA_CLIENT_MHI_PRIME_DPL_PROD), - __stringify(RESERVERD_CONS_101), - __stringify(IPA_CLIENT_AQC_ETHERNET_PROD), - __stringify(IPA_CLIENT_AQC_ETHERNET_CONS), - __stringify(IPA_CLIENT_APPS_WAN_LOW_LAT_PROD), - __stringify(IPA_CLIENT_APPS_WAN_LOW_LAT_CONS), -}; -EXPORT_SYMBOL(ipa_clients_strings); - -/** - * ipa_write_64() - convert 64 bit value to byte array - * @w: 64 bit integer - * @dest: byte array - * - * Return value: converted value - */ -u8 *ipa_write_64(u64 w, u8 *dest) -{ - if (unlikely(dest == NULL)) { - pr_err("%s: NULL address\n", __func__); - return dest; - } - *dest++ = (u8)((w) & 0xFF); - *dest++ = (u8)((w >> 8) & 0xFF); - *dest++ = (u8)((w >> 16) & 0xFF); - *dest++ = (u8)((w >> 24) & 0xFF); - *dest++ = (u8)((w >> 32) & 0xFF); - *dest++ = (u8)((w >> 40) & 0xFF); - *dest++ = (u8)((w >> 48) & 0xFF); - *dest++ = (u8)((w >> 56) & 0xFF); - - return dest; -} - -/** - * ipa_write_32() - convert 32 bit value to byte array - * @w: 32 bit integer - * @dest: byte array - * - * Return value: converted value - */ -u8 *ipa_write_32(u32 w, u8 *dest) -{ - if (unlikely(dest == NULL)) { - pr_err("%s: NULL address\n", __func__); - return dest; - } - *dest++ = (u8)((w) & 0xFF); - *dest++ = (u8)((w >> 8) & 0xFF); - *dest++ = (u8)((w >> 16) & 0xFF); - *dest++ = (u8)((w >> 24) & 0xFF); - - return dest; -} - -/** - * ipa_write_16() - convert 16 bit value to byte array - * @hw: 16 bit integer - * @dest: byte array - * - * Return value: converted value - */ -u8 *ipa_write_16(u16 hw, u8 *dest) -{ - if (unlikely(dest == NULL)) { - pr_err("%s: NULL address\n", __func__); - return dest; - } - *dest++ = (u8)((hw) & 0xFF); - *dest++ = (u8)((hw >> 8) & 0xFF); - - return dest; -} - -/** - * ipa_write_8() - convert 8 bit value to byte array - * @hw: 8 bit integer - * @dest: byte array - * - * Return value: converted value - */ -u8 *ipa_write_8(u8 b, u8 *dest) -{ - if (unlikely(dest == NULL)) { - WARN(1, "%s: NULL address\n", __func__); - return dest; - } - *dest++ = (b) & 0xFF; - - return dest; -} - -/** - * ipa_pad_to_64() - pad byte array to 64 bit value - * @dest: byte array - * - * Return value: padded value - */ -u8 *ipa_pad_to_64(u8 *dest) -{ - int i; - int j; - - if (unlikely(dest == NULL)) { - WARN(1, "%s: NULL address\n", __func__); - return dest; - } - - i = (long)dest & 0x7; - - if (i) - for (j = 0; j < (8 - i); j++) - *dest++ = 0; - - return dest; -} - -/** - * ipa_pad_to_32() - pad byte array to 32 bit value - * @dest: byte array - * - * Return value: padded value - */ -u8 *ipa_pad_to_32(u8 *dest) -{ - int i; - int j; - - if (unlikely(dest == NULL)) { - WARN(1, "%s: NULL address\n", __func__); - return dest; - } - - i = (long)dest & 0x7; - - if (i) - for (j = 0; j < (4 - i); j++) - *dest++ = 0; - - return dest; -} - -int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, - struct sg_table *in_sgt_ptr) -{ - unsigned int nents; - - if (in_sgt_ptr != NULL) { - *out_ch_ptr = kzalloc(sizeof(struct sg_table), GFP_KERNEL); - if (*out_ch_ptr == NULL) - return -ENOMEM; - - nents = in_sgt_ptr->nents; - - (*out_ch_ptr)->sgl = - kcalloc(nents, sizeof(struct scatterlist), - GFP_KERNEL); - if ((*out_ch_ptr)->sgl == NULL) { - kfree(*out_ch_ptr); - *out_ch_ptr = NULL; - return -ENOMEM; - } - - memcpy((*out_ch_ptr)->sgl, in_sgt_ptr->sgl, - nents*sizeof((*out_ch_ptr)->sgl)); - (*out_ch_ptr)->nents = nents; - (*out_ch_ptr)->orig_nents = in_sgt_ptr->orig_nents; - } - return 0; -} -EXPORT_SYMBOL(ipa_smmu_store_sgt); - -int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr) -{ - if (*out_sgt_ptr != NULL) { - kfree((*out_sgt_ptr)->sgl); - (*out_sgt_ptr)->sgl = NULL; - kfree(*out_sgt_ptr); - *out_sgt_ptr = NULL; - } - return 0; -} -EXPORT_SYMBOL(ipa_smmu_free_sgt); - -/** - * ipa_cfg_ep - IPA end-point configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * This includes nat, header, mode, aggregation and route settings and is a one - * shot API to configure the IPA end-point fully - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep, clnt_hdl, ipa_ep_cfg); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep); - -/** - * ipa_cfg_ep_nat() - IPA end-point NAT configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ep_nat: [in] IPA NAT end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ep_nat) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_nat, clnt_hdl, ep_nat); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_nat); - -/** - * ipa_cfg_ep_conn_track() - IPA end-point IPv6CT configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ep_conn_track: [in] IPA IPv6CT end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_conn_track(u32 clnt_hdl, - const struct ipa_ep_cfg_conn_track *ep_conn_track) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_conn_track, clnt_hdl, - ep_conn_track); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_conn_track); - -/** - * ipa_cfg_ep_hdr() - IPA end-point header configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ep_hdr) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_hdr, clnt_hdl, ep_hdr); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_hdr); - -/** - * ipa_cfg_ep_hdr_ext() - IPA end-point extended header configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ep_hdr_ext: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_hdr_ext(u32 clnt_hdl, - const struct ipa_ep_cfg_hdr_ext *ep_hdr_ext) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_hdr_ext, clnt_hdl, ep_hdr_ext); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_hdr_ext); - -/** - * ipa_cfg_ep_mode() - IPA end-point mode configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ep_mode) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_mode, clnt_hdl, ep_mode); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_mode); - -/** - * ipa_cfg_ep_aggr() - IPA end-point aggregation configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ep_aggr) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_aggr, clnt_hdl, ep_aggr); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_aggr); - -/** - * ipa_cfg_ep_deaggr() - IPA end-point deaggregation configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ep_deaggr: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_deaggr(u32 clnt_hdl, - const struct ipa_ep_cfg_deaggr *ep_deaggr) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_deaggr, clnt_hdl, ep_deaggr); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_deaggr); - -/** - * ipa_cfg_ep_route() - IPA end-point routing configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ep_route) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_route, clnt_hdl, ep_route); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_route); - -/** - * ipa_cfg_ep_holb() - IPA end-point holb configuration - * - * If an IPA producer pipe is full, IPA HW by default will block - * indefinitely till space opens up. During this time no packets - * including those from unrelated pipes will be processed. Enabling - * HOLB means IPA HW will be allowed to drop packets as/when needed - * and indefinite blocking is avoided. - * - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - */ -int ipa_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ep_holb) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_holb, clnt_hdl, ep_holb); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_holb); - - -/** - * ipa_cfg_ep_cfg() - IPA end-point cfg configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *cfg) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_cfg, clnt_hdl, cfg); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_cfg); - -/** - * ipa_cfg_ep_metadata_mask() - IPA end-point meta-data mask configuration - * @clnt_hdl: [in] opaque client handle assigned by IPA to client - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, const struct ipa_ep_cfg_metadata_mask - *metadata_mask) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_metadata_mask, clnt_hdl, - metadata_mask); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_metadata_mask); - -/** - * ipa_cfg_ep_holb_by_client() - IPA end-point holb configuration - * - * Wrapper function for ipa_cfg_ep_holb() with client name instead of - * client handle. This function is used for clients that does not have - * client handle. - * - * @client: [in] client name - * @ipa_ep_cfg: [in] IPA end-point configuration params - * - * Returns: 0 on success, negative on failure - */ -int ipa_cfg_ep_holb_by_client(enum ipa_client_type client, - const struct ipa_ep_cfg_holb *ep_holb) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_cfg_ep_holb_by_client, client, ep_holb); - - return ret; -} -EXPORT_SYMBOL(ipa_cfg_ep_holb_by_client); - -/** - * ipa_add_hdr_usr() - add the specified headers to SW and optionally - * commit them to IPA HW - * @hdrs: [inout] set of headers to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_hdr_usr, hdrs, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_hdr_usr); - -/** - * ipa_reset_hdr() - reset the current header table in SW (does not commit to - * HW) - * - * @user_only: [in] indicate delete rules installed by userspace - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_reset_hdr(bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_reset_hdr, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_reset_hdr); - -/** - * ipa_add_hdr_proc_ctx() - add the specified headers to SW - * and optionally commit them to IPA HW - * @proc_ctxs: [inout] set of processing context headers to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs, - bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_hdr_proc_ctx, proc_ctxs, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_hdr_proc_ctx); - -/** - * ipa_del_hdr_proc_ctx() - - * Remove the specified processing context headers from SW and - * optionally commit them to IPA HW. - * @hdls: [inout] set of processing context headers to delete - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_del_hdr_proc_ctx, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_del_hdr_proc_ctx); - -/** - * ipa_add_rt_rule_v2() - Add the specified routing rules to SW - * and optionally commit to IPA HW - * @rules: [inout] set of routing rules to add - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_rt_rule_v2(struct ipa_ioc_add_rt_rule_v2 *rules) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_rt_rule_v2, rules); - - return ret; -} -EXPORT_SYMBOL(ipa_add_rt_rule_v2); - -/** - * ipa_add_rt_rule_usr() - Add the specified routing rules to SW and optionally - * commit to IPA HW - * @rules: [inout] set of routing rules to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_rt_rule_usr(struct ipa_ioc_add_rt_rule *rules, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_rt_rule_usr, rules, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_rt_rule_usr); - -/** - * ipa_add_rt_rule_usr_v2() - Add the specified routing rules to - * SW and optionally commit to IPA HW - * @rules: [inout] set of routing rules to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_rt_rule_usr_v2(struct ipa_ioc_add_rt_rule_v2 *rules, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_rt_rule_usr_v2, rules, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_rt_rule_usr_v2); - -/** - * ipa_del_rt_rule() - Remove the specified routing rules to SW and optionally - * commit to IPA HW - * @hdls: [inout] set of routing rules to delete - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_del_rt_rule, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_del_rt_rule); - -/** - * ipa_commit_rt_rule() - Commit the current SW routing table of specified type - * to IPA HW - * @ip: The family of routing tables - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_commit_rt(enum ipa_ip_type ip) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_commit_rt, ip); - - return ret; -} -EXPORT_SYMBOL(ipa_commit_rt); - -/** - * ipa_reset_rt() - reset the current SW routing table of specified type - * (does not commit to HW) - * @ip: The family of routing tables - * @user_only: [in] indicate delete rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_reset_rt(enum ipa_ip_type ip, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_reset_rt, ip, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_reset_rt); - -/** - * ipa_get_rt_tbl() - lookup the specified routing table and return handle if it - * exists, if lookup succeeds the routing table ref cnt is increased - * @lookup: [inout] routing table to lookup and its handle - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - * Caller should call ipa_put_rt_tbl later if this function succeeds - */ -int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_get_rt_tbl, lookup); - - return ret; -} -EXPORT_SYMBOL(ipa_get_rt_tbl); - -/** - * ipa_query_rt_index() - find the routing table index - * which name and ip type are given as parameters - * @in: [out] the index of the wanted routing table - * - * Returns: the routing table which name is given as parameter, or NULL if it - * doesn't exist - */ -int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_query_rt_index, in); - - return ret; -} -EXPORT_SYMBOL(ipa_query_rt_index); - -/** - * ipa_mdfy_rt_rule() - Modify the specified routing rules in SW and optionally - * commit to IPA HW - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_mdfy_rt_rule(struct ipa_ioc_mdfy_rt_rule *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mdfy_rt_rule, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_mdfy_rt_rule); - -/** - * ipa_mdfy_rt_rule_v2() - Modify the specified routing rules in - * SW and optionally commit to IPA HW - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_mdfy_rt_rule_v2(struct ipa_ioc_mdfy_rt_rule_v2 *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mdfy_rt_rule_v2, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_mdfy_rt_rule_v2); - -/** - * ipa_add_flt_rule() - Add the specified filtering rules to SW and optionally - * commit to IPA HW - * @rules: [inout] set of filtering rules to add - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_flt_rule, rules); - - return ret; -} -EXPORT_SYMBOL(ipa_add_flt_rule); - -/** - * ipa_add_flt_rule_v2() - Add the specified filtering rules to - * SW and optionally commit to IPA HW - * @rules: [inout] set of filtering rules to add - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_flt_rule_v2(struct ipa_ioc_add_flt_rule_v2 *rules) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_flt_rule_v2, rules); - - return ret; -} -EXPORT_SYMBOL(ipa_add_flt_rule_v2); - -/** - * ipa_add_flt_rule_usr() - Add the specified filtering rules to - * SW and optionally commit to IPA HW - * @rules: [inout] set of filtering rules to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_flt_rule_usr(struct ipa_ioc_add_flt_rule *rules, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_flt_rule_usr, rules, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_flt_rule_usr); - -/** - * ipa_add_flt_rule_usr_v2() - Add the specified filtering rules - * to SW and optionally commit to IPA HW - * @rules: [inout] set of filtering rules to add - * @user_only: [in] indicate rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_add_flt_rule_usr_v2(struct ipa_ioc_add_flt_rule_v2 *rules, - bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_add_flt_rule_usr_v2, - rules, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_add_flt_rule_usr_v2); - -/** - * ipa_del_flt_rule() - Remove the specified filtering rules from SW and - * optionally commit to IPA HW - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_del_flt_rule, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_del_flt_rule); - -/** - * ipa_mdfy_flt_rule() - Modify the specified filtering rules in SW and - * optionally commit to IPA HW - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mdfy_flt_rule, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_mdfy_flt_rule); - -/** - * ipa_mdfy_flt_rule_v2() - Modify the specified filtering rules - * in SW and optionally commit to IPA HW - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_mdfy_flt_rule_v2(struct ipa_ioc_mdfy_flt_rule_v2 *hdls) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mdfy_flt_rule_v2, hdls); - - return ret; -} -EXPORT_SYMBOL(ipa_mdfy_flt_rule_v2); - -/** - * ipa_commit_flt() - Commit the current SW filtering table of specified type to - * IPA HW - * @ip: [in] the family of routing tables - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_commit_flt(enum ipa_ip_type ip) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_commit_flt, ip); - - return ret; -} -EXPORT_SYMBOL(ipa_commit_flt); - -/** - * ipa_reset_flt() - Reset the current SW filtering table of specified type - * (does not commit to HW) - * @ip: [in] the family of routing tables - * @user_only: [in] indicate delete rules installed by userspace - * - * Returns: 0 on success, negative on failure - * - * Note: Should not be called from atomic context - */ -int ipa_reset_flt(enum ipa_ip_type ip, bool user_only) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_reset_flt, ip, user_only); - - return ret; -} -EXPORT_SYMBOL(ipa_reset_flt); - -/** - * ipa_allocate_nat_device() - Allocates memory for the NAT device - * @mem: [in/out] memory parameters - * - * Called by NAT client driver to allocate memory for the NAT entries. Based on - * the request size either shared or system memory will be used. - * - * Returns: 0 on success, negative on failure - */ -int ipa_allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_allocate_nat_device, mem); - - return ret; -} -EXPORT_SYMBOL(ipa_allocate_nat_device); - -/** - * ipa_allocate_nat_table() - Allocates memory for the NAT table - * @table_alloc: [in/out] memory parameters - * - * Called by NAT client to allocate memory for the table entries. - * Based on the request size either shared or system memory will be used. - * - * Returns: 0 on success, negative on failure - */ -int ipa_allocate_nat_table(struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_allocate_nat_table, table_alloc); - - return ret; -} -EXPORT_SYMBOL(ipa_allocate_nat_table); - - -/** - * ipa_allocate_ipv6ct_table() - Allocates memory for the IPv6CT table - * @table_alloc: [in/out] memory parameters - * - * Called by IPv6CT client to allocate memory for the table entries. - * Based on the request size either shared or system memory will be used. - * - * Returns: 0 on success, negative on failure - */ -int ipa_allocate_ipv6ct_table( - struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_allocate_ipv6ct_table, table_alloc); - - return ret; -} -EXPORT_SYMBOL(ipa_allocate_ipv6ct_table); - -/** - * ipa_nat_init_cmd() - Post IP_V4_NAT_INIT command to IPA HW - * @init: [in] initialization command attributes - * - * Called by NAT client driver to post IP_V4_NAT_INIT command to IPA HW - * - * Returns: 0 on success, negative on failure - */ -int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_nat_init_cmd, init); - - return ret; -} -EXPORT_SYMBOL(ipa_nat_init_cmd); - -/** - * ipa_ipv6ct_init_cmd() - Post IP_V6_CONN_TRACK_INIT command to IPA HW - * @init: [in] initialization command attributes - * - * Called by IPv6CT client driver to post IP_V6_CONN_TRACK_INIT command - * to IPA HW. - * - * Returns: 0 on success, negative on failure - */ -int ipa_ipv6ct_init_cmd(struct ipa_ioc_ipv6ct_init *init) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_ipv6ct_init_cmd, init); - - return ret; -} -EXPORT_SYMBOL(ipa_ipv6ct_init_cmd); - -/** - * ipa_nat_dma_cmd() - Post NAT_DMA command to IPA HW - * @dma: [in] initialization command attributes - * - * Called by NAT client driver to post NAT_DMA command to IPA HW - * - * Returns: 0 on success, negative on failure - */ -int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_nat_dma_cmd, dma); - - return ret; -} -EXPORT_SYMBOL(ipa_nat_dma_cmd); - -/** - * ipa_table_dma_cmd() - Post TABLE_DMA command to IPA HW - * @dma: [in] initialization command attributes - * - * Called by NAT/IPv6CT client to post TABLE_DMA command to IPA HW - * - * Returns: 0 on success, negative on failure - */ -int ipa_table_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_table_dma_cmd, dma); - - return ret; -} -EXPORT_SYMBOL(ipa_table_dma_cmd); - -/** - * ipa_nat_del_cmd() - Delete the NAT table - * @del: [in] delete NAT table parameters - * - * Called by NAT client driver to delete the nat table - * - * Returns: 0 on success, negative on failure - */ -int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_nat_del_cmd, del); - - return ret; -} -EXPORT_SYMBOL(ipa_nat_del_cmd); - -/** - * ipa_del_nat_table() - Delete the NAT table - * @del: [in] delete table parameters - * - * Called by NAT client to delete the table - * - * Returns: 0 on success, negative on failure - */ -int ipa_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_del_nat_table, del); - - return ret; -} -EXPORT_SYMBOL(ipa_del_nat_table); - -/** - * ipa_del_ipv6ct_table() - Delete the IPv6CT table - * @del: [in] delete table parameters - * - * Called by IPv6CT client to delete the table - * - * Returns: 0 on success, negative on failure - */ -int ipa_del_ipv6ct_table(struct ipa_ioc_nat_ipv6ct_table_del *del) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_del_ipv6ct_table, del); - - return ret; -} -EXPORT_SYMBOL(ipa_del_ipv6ct_table); - -/** - * ipa3_nat_mdfy_pdn() - Modify a PDN entry in PDN config table in IPA SRAM - * @mdfy_pdn: [in] PDN info to be written to SRAM - * - * Called by NAT client driver to modify an entry in the PDN config table - * - * Returns: 0 on success, negative on failure - */ -int ipa_nat_mdfy_pdn(struct ipa_ioc_nat_pdn_entry *mdfy_pdn) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_nat_mdfy_pdn, mdfy_pdn); - - return ret; -} -EXPORT_SYMBOL(ipa_nat_mdfy_pdn); - -int ipa_sys_setup(struct ipa_sys_connect_params *sys_in, - unsigned long *ipa_bam_or_gsi_hdl, - u32 *ipa_pipe_num, u32 *clnt_hdl, bool en_status) - -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_sys_setup, sys_in, ipa_bam_or_gsi_hdl, - ipa_pipe_num, clnt_hdl, en_status); - - return ret; -} -EXPORT_SYMBOL(ipa_sys_setup); - -int ipa_sys_teardown(u32 clnt_hdl) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_sys_teardown, clnt_hdl); - - return ret; -} -EXPORT_SYMBOL(ipa_sys_teardown); - -int ipa_sys_update_gsi_hdls(u32 clnt_hdl, unsigned long gsi_ch_hdl, - unsigned long gsi_ev_hdl) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_sys_update_gsi_hdls, clnt_hdl, - gsi_ch_hdl, gsi_ev_hdl); - - return ret; -} -EXPORT_SYMBOL(ipa_sys_update_gsi_hdls); - -/** - * ipa_set_wlan_tx_info() -set WDI statistics from uc - * @info: [inout] set info populated by driver - * - * Returns: 0 on success, negative on failure - * - * @note Cannot be called from atomic context - * - */ -int ipa_set_wlan_tx_info(struct ipa_wdi_tx_info *info) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_set_wlan_tx_info, info); - - return ret; -} -EXPORT_SYMBOL(ipa_set_wlan_tx_info); - -/** - * ipa_wigig_internal_init() - get uc db and register uC - * ready CB if uC not ready, wigig only. - * @inout: [in/out] uc ready input/output parameters - * from/to client - * @int_notify: [in] wigig misc interrupt handler function - * @uc_db_pa: [out] uC db physical address - * - * Returns: 0 on success, negative on failure - * - */ -int ipa_wigig_internal_init( - struct ipa_wdi_uc_ready_params *inout, - ipa_wigig_misc_int_cb int_notify, - phys_addr_t *uc_db_pa) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_wigig_internal_init, inout, - int_notify, uc_db_pa); - - return ret; -} -EXPORT_SYMBOL(ipa_wigig_internal_init); - -/** - * teth_bridge_init() - Initialize the Tethering bridge driver - * @params - in/out params for USB initialization API (please look at struct - * definition for more info) - * - * USB driver gets a pointer to a callback function (usb_notify_cb) and an - * associated data. USB driver installs this callback function in the call to - * ipa_connect(). - * - * Builds IPA resource manager dependency graph. - * - * Return codes: 0: success, - * -EINVAL - Bad parameter - * Other negative value - Failure - */ -int teth_bridge_init(struct teth_bridge_init_params *params) -{ - int ret; - - IPA_API_DISPATCH_RETURN(teth_bridge_init, params); - - return ret; -} -EXPORT_SYMBOL(teth_bridge_init); - -/** - * teth_bridge_disconnect() - Disconnect tethering bridge module - */ -int teth_bridge_disconnect(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(teth_bridge_disconnect, client); - - return ret; -} -EXPORT_SYMBOL(teth_bridge_disconnect); - -/** - * teth_bridge_connect() - Connect bridge for a tethered Rmnet / MBIM call - * @connect_params: Connection info - * - * Return codes: 0: success - * -EINVAL: invalid parameters - * -EPERM: Operation not permitted as the bridge is already - * connected - */ -int teth_bridge_connect(struct teth_bridge_connect_params *connect_params) -{ - int ret; - - IPA_API_DISPATCH_RETURN(teth_bridge_connect, connect_params); - - return ret; -} -EXPORT_SYMBOL(teth_bridge_connect); - -/* ipa_set_client() - provide client mapping - * @client: client type - * - * Return value: none - */ - -void ipa_set_client(int index, enum ipacm_client_enum client, bool uplink) -{ - IPA_API_DISPATCH(ipa_set_client, index, client, uplink); -} -EXPORT_SYMBOL(ipa_set_client); - -/** - * ipa_get_client() - provide client mapping - * @client: client type - * - * Return value: none - */ -enum ipacm_client_enum ipa_get_client(int pipe_idx) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_get_client, pipe_idx); - - return ret; -} -EXPORT_SYMBOL(ipa_get_client); - -/** - * ipa_get_client_uplink() - provide client mapping - * @client: client type - * - * Return value: none - */ -bool ipa_get_client_uplink(int pipe_idx) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_get_client_uplink, pipe_idx); - - return ret; -} -EXPORT_SYMBOL(ipa_get_client_uplink); - -int ipa_mhi_init_engine(struct ipa_mhi_init_engine *params) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_init_engine, params); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_init_engine); - -/** - * ipa_connect_mhi_pipe() - Connect pipe to IPA and start corresponding - * MHI channel - * @in: connect parameters - * @clnt_hdl: [out] client handle for this pipe - * - * This function is called by IPA MHI client driver on MHI channel start. - * This function is called after MHI engine was started. - * This function is doing the following: - * - Send command to uC to start corresponding MHI channel - * - Configure IPA EP control - * - * Return codes: 0 : success - * negative : error - */ -int ipa_connect_mhi_pipe(struct ipa_mhi_connect_params_internal *in, - u32 *clnt_hdl) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_connect_mhi_pipe, in, clnt_hdl); - - return ret; -} -EXPORT_SYMBOL(ipa_connect_mhi_pipe); - -/** - * ipa_disconnect_mhi_pipe() - Disconnect pipe from IPA and reset corresponding - * MHI channel - * @in: connect parameters - * @clnt_hdl: [out] client handle for this pipe - * - * This function is called by IPA MHI client driver on MHI channel reset. - * This function is called after MHI channel was started. - * This function is doing the following: - * - Send command to uC to reset corresponding MHI channel - * - Configure IPA EP control - * - * Return codes: 0 : success - * negative : error - */ -int ipa_disconnect_mhi_pipe(u32 clnt_hdl) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disconnect_mhi_pipe, clnt_hdl); - - return ret; -} -EXPORT_SYMBOL(ipa_disconnect_mhi_pipe); - -bool ipa_mhi_stop_gsi_channel(enum ipa_client_type client) -{ - bool ret; - - IPA_API_DISPATCH_RETURN_BOOL(ipa_mhi_stop_gsi_channel, client); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_stop_gsi_channel); - -int ipa_uc_mhi_reset_channel(int channelHandle) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_reset_channel, channelHandle); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_reset_channel); - -bool ipa_mhi_sps_channel_empty(enum ipa_client_type client) -{ - bool ret; - - IPA_API_DISPATCH_RETURN_BOOL(ipa_mhi_sps_channel_empty, client); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_sps_channel_empty); - -int ipa_qmi_enable_force_clear_datapath_send( - struct ipa_enable_force_clear_datapath_req_msg_v01 *req) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_qmi_enable_force_clear_datapath_send, req); - - return ret; -} -EXPORT_SYMBOL(ipa_qmi_enable_force_clear_datapath_send); - -int ipa_qmi_disable_force_clear_datapath_send( - struct ipa_disable_force_clear_datapath_req_msg_v01 *req) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_qmi_disable_force_clear_datapath_send, req); - - return ret; -} -EXPORT_SYMBOL(ipa_qmi_disable_force_clear_datapath_send); - -int ipa_generate_tag_process(void) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_generate_tag_process); - - return ret; -} -EXPORT_SYMBOL(ipa_generate_tag_process); - -int ipa_disable_sps_pipe(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disable_sps_pipe, client); - - return ret; -} -EXPORT_SYMBOL(ipa_disable_sps_pipe); - -int ipa_mhi_reset_channel_internal(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_reset_channel_internal, client); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_reset_channel_internal); - -int ipa_mhi_start_channel_internal(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_start_channel_internal, client); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_start_channel_internal); - -void ipa_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb) -{ - IPA_API_DISPATCH(ipa_get_holb, ep_idx, holb); -} -EXPORT_SYMBOL(ipa_get_holb); - -void ipa_set_tag_process_before_gating(bool val) -{ - IPA_API_DISPATCH(ipa_set_tag_process_before_gating, val); -} -EXPORT_SYMBOL(ipa_set_tag_process_before_gating); - -int ipa_mhi_query_ch_info(enum ipa_client_type client, - struct gsi_chan_info *ch_info) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_query_ch_info, client, ch_info); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_query_ch_info); - -int ipa_uc_mhi_suspend_channel(int channelHandle) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_suspend_channel, channelHandle); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_suspend_channel); - -int ipa_uc_mhi_stop_event_update_channel(int channelHandle) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_stop_event_update_channel, - channelHandle); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_stop_event_update_channel); - -bool ipa_has_open_aggr_frame(enum ipa_client_type client) -{ - bool ret; - - IPA_API_DISPATCH_RETURN_BOOL(ipa_has_open_aggr_frame, client); - - return ret; -} -EXPORT_SYMBOL(ipa_has_open_aggr_frame); - -int ipa_mhi_resume_channels_internal(enum ipa_client_type client, - bool LPTransitionRejected, bool brstmode_enabled, - union __packed gsi_channel_scratch ch_scratch, u8 index) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_resume_channels_internal, client, - LPTransitionRejected, brstmode_enabled, ch_scratch, - index); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_resume_channels_internal); - -int ipa_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t *cmd) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_send_dl_ul_sync_info, - cmd); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_send_dl_ul_sync_info); - -int ipa_mhi_destroy_channel(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_mhi_destroy_channel, client); - - return ret; -} -EXPORT_SYMBOL(ipa_mhi_destroy_channel); - -int ipa_uc_mhi_init(void (*ready_cb)(void), - void (*wakeup_request_cb)(void)) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_init, ready_cb, wakeup_request_cb); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_init); - -void ipa_uc_mhi_cleanup(void) -{ - IPA_API_DISPATCH(ipa_uc_mhi_cleanup); -} -EXPORT_SYMBOL(ipa_uc_mhi_cleanup); - -int ipa_uc_mhi_print_stats(char *dbg_buff, int size) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_mhi_print_stats, dbg_buff, size); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_mhi_print_stats); - -/** - * ipa_uc_state_check() - Check the status of the uC interface - * - * Return value: 0 if the uC is loaded, interface is initialized - * and there was no recent failure in one of the commands. - * A negative value is returned otherwise. - */ -int ipa_uc_state_check(void) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_state_check); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_state_check); - -int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_write_qmap_id, param_in); - - return ret; -} -EXPORT_SYMBOL(ipa_write_qmap_id); - -/** - * ipa_remove_interrupt_handler() - Removes handler to an interrupt type - * @interrupt: Interrupt type - * - * Removes the handler and disable the specific bit in IRQ_EN register - */ -int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_remove_interrupt_handler, interrupt); - - return ret; -} -EXPORT_SYMBOL(ipa_remove_interrupt_handler); - -/** - * ipa_get_hw_type() - Return IPA HW version - * - * Return value: enum ipa_hw_type - */ -enum ipa_hw_type ipa_get_hw_type_internal(void) -{ - return ipa_api_hw_type; -} - -/** - * ipa_start_gsi_channel()- Startsa GSI channel in IPA - * - * Return value: 0 on success, negative otherwise - */ -int ipa_start_gsi_channel(u32 clnt_hdl) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_start_gsi_channel, clnt_hdl); - - return ret; -} -EXPORT_SYMBOL(ipa_start_gsi_channel); - -/** - * ipa_get_version_string() - Get string representation of IPA version - * @ver: IPA version - * - * Return: Constant string representation - */ -const char *ipa_get_version_string(enum ipa_hw_type ver) -{ - const char *str; - - switch (ver) { - case IPA_HW_v1_0: - str = "1.0"; - break; - case IPA_HW_v1_1: - str = "1.1"; - break; - case IPA_HW_v2_0: - str = "2.0"; - break; - case IPA_HW_v2_1: - str = "2.1"; - break; - case IPA_HW_v2_5: - str = "2.5/2.6"; - break; - case IPA_HW_v2_6L: - str = "2.6L"; - break; - case IPA_HW_v3_0: - str = "3.0"; - break; - case IPA_HW_v3_1: - str = "3.1"; - break; - case IPA_HW_v3_5: - str = "3.5"; - break; - case IPA_HW_v3_5_1: - str = "3.5.1"; - break; - case IPA_HW_v4_0: - str = "4.0"; - break; - case IPA_HW_v4_1: - str = "4.1"; - break; - case IPA_HW_v4_2: - str = "4.2"; - break; - case IPA_HW_v4_5: - str = "4.5"; - break; - case IPA_HW_v4_7: - str = "4.7"; - break; - case IPA_HW_v4_9: - str = "4.9"; - break; - default: - str = "Invalid version"; - break; - } - - return str; -} -EXPORT_SYMBOL(ipa_get_version_string); - -static const struct of_device_id ipa_plat_drv_match[] = { - { .compatible = "qcom,ipa", }, - { .compatible = "qcom,ipa-smmu-ap-cb", }, - { .compatible = "qcom,ipa-smmu-wlan-cb", }, - { .compatible = "qcom,ipa-smmu-uc-cb", }, - { .compatible = "qcom,ipa-smmu-11ad-cb", }, - { .compatible = "qcom,smp2p-map-ipa-1-in", }, - { .compatible = "qcom,smp2p-map-ipa-1-out", }, - {} -}; - -/*********************************************************/ -/* PCIe Version */ -/*********************************************************/ - -static const struct of_device_id ipa_pci_drv_match[] = { - { .compatible = "qcom,ipa", }, - {} -}; - -/* - * Forward declarations of static functions required for PCI - * registraion - * - * VENDOR and DEVICE should be defined in pci_ids.h - */ -static int ipa_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); -static void ipa_pci_remove(struct pci_dev *pdev); -static void ipa_pci_shutdown(struct pci_dev *pdev); -static pci_ers_result_t ipa_pci_io_error_detected(struct pci_dev *dev, - pci_channel_state_t state); -static pci_ers_result_t ipa_pci_io_slot_reset(struct pci_dev *dev); -static void ipa_pci_io_resume(struct pci_dev *dev); - -#define LOCAL_VENDOR 0x17CB -#define LOCAL_DEVICE 0x00ff - -static const char ipa_pci_driver_name[] = "qcipav3"; - -static const struct pci_device_id ipa_pci_tbl[] = { - { PCI_DEVICE(LOCAL_VENDOR, LOCAL_DEVICE) }, - { 0, 0, 0, 0, 0, 0, 0 } -}; - -MODULE_DEVICE_TABLE(pci, ipa_pci_tbl); - -/* PCI Error Recovery */ -static const struct pci_error_handlers ipa_pci_err_handler = { - .error_detected = ipa_pci_io_error_detected, - .slot_reset = ipa_pci_io_slot_reset, - .resume = ipa_pci_io_resume, -}; - -static struct pci_driver ipa_pci_driver = { - .name = ipa_pci_driver_name, - .id_table = ipa_pci_tbl, - .probe = ipa_pci_probe, - .remove = ipa_pci_remove, - .shutdown = ipa_pci_shutdown, - .err_handler = &ipa_pci_err_handler -}; - -static int ipa_generic_plat_drv_probe(struct platform_device *pdev_p) -{ - int result; - - /* - * IPA probe function can be called for multiple times as the same probe - * function handles multiple compatibilities - */ - pr_debug("ipa: IPA driver probing started for %s\n", - pdev_p->dev.of_node->name); - - if (!ipa_api_ctrl) { - ipa_api_ctrl = kzalloc(sizeof(*ipa_api_ctrl), GFP_KERNEL); - if (!ipa_api_ctrl) - return -ENOMEM; - - /* Get IPA HW Version */ - result = of_property_read_u32(pdev_p->dev.of_node, - "qcom,ipa-hw-ver", &ipa_api_hw_type); - if ((result) || (ipa_api_hw_type == 0)) { - pr_err("ipa: get resource failed for ipa-hw-ver!\n"); - kfree(ipa_api_ctrl); - ipa_api_ctrl = 0; - return -ENODEV; - } - pr_debug("ipa: ipa_api_hw_type = %d\n", ipa_api_hw_type); - } - - /* call probe based on IPA HW version */ - switch (ipa_api_hw_type) { - case IPA_HW_v3_0: - case IPA_HW_v3_1: - case IPA_HW_v3_5: - case IPA_HW_v3_5_1: - case IPA_HW_v4_0: - case IPA_HW_v4_1: - case IPA_HW_v4_2: - case IPA_HW_v4_5: - case IPA_HW_v4_7: - case IPA_HW_v4_9: - result = ipa3_plat_drv_probe(pdev_p, ipa_api_ctrl, - ipa_plat_drv_match); - break; - default: - pr_err("ipa: unsupported version %d\n", ipa_api_hw_type); - return -EPERM; - } - - if (result && result != -EPROBE_DEFER) - pr_err("ipa: ipa_plat_drv_probe failed\n"); - - return result; -} - -static int ipa_ap_suspend(struct device *dev) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_ap_suspend, dev); - - return ret; -} - -static int ipa_ap_resume(struct device *dev) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_ap_resume, dev); - - return ret; -} - -/** - * ipa_inc_client_enable_clks() - Increase active clients counter, and - * enable ipa clocks if necessary - * - * Please do not use this API, use the wrapper macros instead (ipa_i.h) - * IPA_ACTIVE_CLIENTS_INC_XXX(); - * - * Return codes: - * None - */ -void ipa_inc_client_enable_clks(struct ipa_active_client_logging_info *id) -{ - IPA_API_DISPATCH(ipa_inc_client_enable_clks, id); -} -EXPORT_SYMBOL(ipa_inc_client_enable_clks); - -/** - * ipa_dec_client_disable_clks() - Increase active clients counter, and - * enable ipa clocks if necessary - * - * Please do not use this API, use the wrapper macros instead (ipa_i.h) - * IPA_ACTIVE_CLIENTS_DEC_XXX(); - * - * Return codes: - * None - */ -void ipa_dec_client_disable_clks(struct ipa_active_client_logging_info *id) -{ - IPA_API_DISPATCH(ipa_dec_client_disable_clks, id); -} -EXPORT_SYMBOL(ipa_dec_client_disable_clks); - -/** - * ipa_inc_client_enable_clks_no_block() - Only increment the number of active - * clients if no asynchronous actions should be done.Asynchronous actions are - * locking a mutex and waking up IPA HW. - * - * Please do not use this API, use the wrapper macros instead(ipa_i.h) - * - * - * Return codes : 0 for success - * -EPERM if an asynchronous action should have been done - */ -int ipa_inc_client_enable_clks_no_block( - struct ipa_active_client_logging_info *id) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_inc_client_enable_clks_no_block, id); - - return ret; -} -EXPORT_SYMBOL(ipa_inc_client_enable_clks_no_block); - -/** - * ipa_suspend_resource_no_block() - suspend client endpoints related to the - * IPA_RM resource and decrement active clients counter. This function is - * guaranteed to avoid sleeping. - * - * @resource: [IN] IPA Resource Manager resource - * - * Return codes: 0 on success, negative on failure. - */ -int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_suspend_resource_no_block, resource); - - return ret; -} -EXPORT_SYMBOL(ipa_suspend_resource_no_block); -/** - * ipa_resume_resource() - resume client endpoints related to the IPA_RM - * resource. - * - * @resource: [IN] IPA Resource Manager resource - * - * Return codes: 0 on success, negative on failure. - */ -int ipa_resume_resource(enum ipa_rm_resource_name resource) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_resume_resource, resource); - - return ret; -} -EXPORT_SYMBOL(ipa_resume_resource); - -/** - * ipa_suspend_resource_sync() - suspend client endpoints related to the IPA_RM - * resource and decrement active clients counter, which may result in clock - * gating of IPA clocks. - * - * @resource: [IN] IPA Resource Manager resource - * - * Return codes: 0 on success, negative on failure. - */ -int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_suspend_resource_sync, resource); - - return ret; -} -EXPORT_SYMBOL(ipa_suspend_resource_sync); - -/** - * ipa_set_required_perf_profile() - set IPA to the specified performance - * profile based on the bandwidth, unless minimum voltage required is - * higher. In this case the floor_voltage specified will be used. - * @floor_voltage: minimum voltage to operate - * @bandwidth_mbps: needed bandwidth from IPA - * - * Return codes: 0 on success, negative on failure. - */ -int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, - u32 bandwidth_mbps) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_set_required_perf_profile, floor_voltage, - bandwidth_mbps); - - return ret; -} -EXPORT_SYMBOL(ipa_set_required_perf_profile); - -/** - * ipa_get_ipc_logbuf() - return a pointer to IPA driver IPC log - */ -void *ipa_get_ipc_logbuf(void) -{ - void *ret; - - IPA_API_DISPATCH_RETURN_PTR(ipa_get_ipc_logbuf); - - return ret; -} -EXPORT_SYMBOL(ipa_get_ipc_logbuf); - -/** - * ipa_get_ipc_logbuf_low() - return a pointer to IPA driver IPC low prio log - */ -void *ipa_get_ipc_logbuf_low(void) -{ - void *ret; - - IPA_API_DISPATCH_RETURN_PTR(ipa_get_ipc_logbuf_low); - - return ret; -} -EXPORT_SYMBOL(ipa_get_ipc_logbuf_low); - -/** - * ipa_assert() - general function for assertion - */ -void ipa_assert(void) -{ - pr_err("IPA: unrecoverable error has occurred, asserting\n"); - BUG(); -} -EXPORT_SYMBOL(ipa_assert); - -/** - * ipa_rx_poll() - Poll the rx packets from IPA HW in the - * softirq context - * - * @budget: number of packets to be polled in single iteration - * - * Return codes: >= 0 : Actual number of packets polled - * - */ -int ipa_rx_poll(u32 clnt_hdl, int budget) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_rx_poll, clnt_hdl, budget); - - return ret; -} -EXPORT_SYMBOL(ipa_rx_poll); - -/** - * ipa_recycle_wan_skb() - Recycle the Wan skb - * - * @skb: skb that needs to recycle - * - */ -void ipa_recycle_wan_skb(struct sk_buff *skb) -{ - IPA_API_DISPATCH(ipa_recycle_wan_skb, skb); -} -EXPORT_SYMBOL(ipa_recycle_wan_skb); - -/** - * ipa_setup_uc_ntn_pipes() - setup uc offload pipes - */ -int ipa_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *inp, - ipa_notify_cb notify, void *priv, u8 hdr_len, - struct ipa_ntn_conn_out_params *outp) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_setup_uc_ntn_pipes, inp, - notify, priv, hdr_len, outp); - - return ret; -} -EXPORT_SYMBOL(ipa_setup_uc_ntn_pipes); - -/** - * ipa_tear_down_uc_offload_pipes() - tear down uc offload pipes - */ -int ipa_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, - int ipa_ep_idx_dl, struct ipa_ntn_conn_in_params *params) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_tear_down_uc_offload_pipes, ipa_ep_idx_ul, - ipa_ep_idx_dl, params); - - return ret; -} -EXPORT_SYMBOL(ipa_tear_down_uc_offload_pipes); - -/** - * ipa_get_pdev() - return a pointer to IPA dev struct - * - * Return value: a pointer to IPA dev struct - * - */ -struct device *ipa_get_pdev(void) -{ - struct device *ret; - - IPA_API_DISPATCH_RETURN_PTR(ipa_get_pdev); - - return ret; -} -EXPORT_SYMBOL(ipa_get_pdev); - -int ipa_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *user_data), - void *user_data) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_ntn_uc_reg_rdyCB, - ipauc_ready_cb, user_data); - - return ret; -} -EXPORT_SYMBOL(ipa_ntn_uc_reg_rdyCB); - -void ipa_ntn_uc_dereg_rdyCB(void) -{ - IPA_API_DISPATCH(ipa_ntn_uc_dereg_rdyCB); -} -EXPORT_SYMBOL(ipa_ntn_uc_dereg_rdyCB); - -/** - * ipa_conn_wdi_pipes() - connect wdi pipes - */ -int ipa_conn_wdi_pipes(struct ipa_wdi_conn_in_params *in, - struct ipa_wdi_conn_out_params *out, - ipa_wdi_meter_notifier_cb wdi_notify) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_conn_wdi_pipes, in, out, wdi_notify); - - return ret; -} -EXPORT_SYMBOL(ipa_conn_wdi_pipes); - -/** - * ipa_disconn_wdi_pipes() - disconnect wdi pipes - */ -int ipa_disconn_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disconn_wdi_pipes, ipa_ep_idx_tx, - ipa_ep_idx_rx); - - return ret; -} -EXPORT_SYMBOL(ipa_disconn_wdi_pipes); - -/** - * ipa_enable_wdi_pipes() - enable wdi pipes - */ -int ipa_enable_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_enable_wdi_pipes, ipa_ep_idx_tx, - ipa_ep_idx_rx); - - return ret; -} -EXPORT_SYMBOL(ipa_enable_wdi_pipes); - -/** - * ipa_disable_wdi_pipes() - disable wdi pipes - */ -int ipa_disable_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disable_wdi_pipes, ipa_ep_idx_tx, - ipa_ep_idx_rx); - - return ret; -} -EXPORT_SYMBOL(ipa_disable_wdi_pipes); - -/** - * ipa_wigig_uc_msi_init() - smmu map\unmap msi related wigig HW registers - * and init\deinit uC msi config - */ -int ipa_wigig_uc_msi_init(bool init, - phys_addr_t periph_baddr_pa, - phys_addr_t pseudo_cause_pa, - phys_addr_t int_gen_tx_pa, - phys_addr_t int_gen_rx_pa, - phys_addr_t dma_ep_misc_pa) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_wigig_uc_msi_init, init, - periph_baddr_pa, - pseudo_cause_pa, - int_gen_tx_pa, - int_gen_rx_pa, - dma_ep_misc_pa); - - return ret; -} -EXPORT_SYMBOL(ipa_wigig_uc_msi_init); - -/** - * ipa_conn_wigig_rx_pipe_i() - connect wigig rx pipe - */ -int ipa_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out, - struct dentry **parent) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_conn_wigig_rx_pipe_i, in, out, parent); - - return ret; -} -EXPORT_SYMBOL(ipa_conn_wigig_rx_pipe_i); - -/** - * ipa_conn_wigig_client_i() - connect a wigig client - */ -int ipa_conn_wigig_client_i(void *in, - struct ipa_wigig_conn_out_params *out, - ipa_notify_cb tx_notify, - void *priv) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_conn_wigig_client_i, in, out, - tx_notify, priv); - - return ret; -} -EXPORT_SYMBOL(ipa_conn_wigig_client_i); - -/** - * ipa_disconn_wigig_pipe_i() - disconnect a wigig pipe - */ -int ipa_disconn_wigig_pipe_i(enum ipa_client_type client, - struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu, - void *dbuff) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disconn_wigig_pipe_i, client, - pipe_smmu, dbuff); - - return ret; -} -EXPORT_SYMBOL(ipa_disconn_wigig_pipe_i); - -/** - * ipa_enable_wigig_pipe() - enable a wigig pipe - */ -int ipa_enable_wigig_pipe_i(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_enable_wigig_pipe_i, client); - - return ret; -} -EXPORT_SYMBOL(ipa_enable_wigig_pipe_i); - -/** - * ipa_disable_wigig_pipe_i() - disable a wigig pipe - */ -int ipa_disable_wigig_pipe_i(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_disable_wigig_pipe_i, client); - - return ret; -} -EXPORT_SYMBOL(ipa_disable_wigig_pipe_i); - -/** - * ipa_tz_unlock_reg() - Allow AP access to memory regions controlled by TZ - */ -int ipa_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_tz_unlock_reg, reg_info, num_regs); - - return ret; -} - -void ipa_register_client_callback(int (*client_cb)(bool is_lock), - bool (*teth_port_state)(void), - enum ipa_client_type client) -{ - IPA_API_DISPATCH(ipa_register_client_callback, - client_cb, teth_port_state, client); -} -EXPORT_SYMBOL(ipa_register_client_callback); - -void ipa_deregister_client_callback(enum ipa_client_type client) -{ - IPA_API_DISPATCH(ipa_deregister_client_callback, - client); -} -EXPORT_SYMBOL(ipa_deregister_client_callback); - -int ipa_uc_debug_stats_alloc( - struct IpaHwOffloadStatsAllocCmdData_t cmdinfo) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_debug_stats_alloc, cmdinfo); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_debug_stats_alloc); - -int ipa_uc_debug_stats_dealloc(uint32_t prot_id) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_uc_debug_stats_dealloc, prot_id); - - return ret; -} -EXPORT_SYMBOL(ipa_uc_debug_stats_dealloc); - -void ipa_get_gsi_stats(int prot_id, - struct ipa_uc_dbg_ring_stats *stats) -{ - IPA_API_DISPATCH(ipa_get_gsi_stats, - prot_id, stats); -} -EXPORT_SYMBOL(ipa_get_gsi_stats); - -int ipa_get_prot_id(enum ipa_client_type client) -{ - int ret; - - IPA_API_DISPATCH_RETURN(ipa_get_prot_id, - client); - - return ret; -} -EXPORT_SYMBOL(ipa_get_prot_id); - -static const struct dev_pm_ops ipa_pm_ops = { - .suspend_noirq = ipa_ap_suspend, - .resume_noirq = ipa_ap_resume, -}; - -static struct platform_driver ipa_plat_drv = { - .probe = ipa_generic_plat_drv_probe, - .driver = { - .name = DRV_NAME, - .pm = &ipa_pm_ops, - .of_match_table = ipa_plat_drv_match, - }, -}; - -/*********************************************************/ -/* PCIe Version */ -/*********************************************************/ - -static int ipa_pci_probe( - struct pci_dev *pci_dev, - const struct pci_device_id *ent) -{ - int result; - - if (!pci_dev || !ent) { - pr_err( - "Bad arg: pci_dev (%pK) and/or ent (%pK)\n", - pci_dev, ent); - return -EOPNOTSUPP; - } - - if (!ipa_api_ctrl) { - ipa_api_ctrl = kzalloc(sizeof(*ipa_api_ctrl), GFP_KERNEL); - if (ipa_api_ctrl == NULL) - return -ENOMEM; - /* Get IPA HW Version */ - result = of_property_read_u32(NULL, - "qcom,ipa-hw-ver", &ipa_api_hw_type); - if (result || ipa_api_hw_type == 0) { - pr_err("ipa: get resource failed for ipa-hw-ver!\n"); - kfree(ipa_api_ctrl); - ipa_api_ctrl = NULL; - return -ENODEV; - } - pr_debug("ipa: ipa_api_hw_type = %d\n", ipa_api_hw_type); - } - - /* - * Call a reduced version of platform_probe appropriate for PCIe - */ - result = ipa3_pci_drv_probe(pci_dev, ipa_api_ctrl, ipa_pci_drv_match); - - if (result && result != -EPROBE_DEFER) - pr_err("ipa: ipa3_pci_drv_probe failed\n"); - - return result; -} - -static void ipa_pci_remove(struct pci_dev *pci_dev) -{ -} - -static void ipa_pci_shutdown(struct pci_dev *pci_dev) -{ -} - -static pci_ers_result_t ipa_pci_io_error_detected(struct pci_dev *pci_dev, - pci_channel_state_t state) -{ - return 0; -} - -static pci_ers_result_t ipa_pci_io_slot_reset(struct pci_dev *pci_dev) -{ - return 0; -} - -static void ipa_pci_io_resume(struct pci_dev *pci_dev) -{ -} - -static int __init ipa_module_init(void) -{ - pr_debug("IPA module init\n"); - - ipa3_ctx = kzalloc(sizeof(*ipa3_ctx), GFP_KERNEL); - if (!ipa3_ctx) { - return -ENOMEM; - } - mutex_init(&ipa3_ctx->lock); - - if (running_emulation) { - /* Register as a PCI device driver */ - return pci_register_driver(&ipa_pci_driver); - } - /* Register as a platform device driver */ - return platform_driver_register(&ipa_plat_drv); -} -subsys_initcall(ipa_module_init); - -static void __exit ipa_module_exit(void) -{ - if (running_emulation) - pci_unregister_driver(&ipa_pci_driver); - platform_driver_unregister(&ipa_plat_drv); - kfree(ipa3_ctx); - ipa3_ctx = NULL; -} -module_exit(ipa_module_exit); - -MODULE_SOFTDEP("pre: subsys-pil-tz"); -MODULE_SOFTDEP("pre: qcom-arm-smmu-mod"); -MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("IPA HW device driver"); diff --git a/drivers/platform/msm/ipa/ipa_api.h b/drivers/platform/msm/ipa/ipa_api.h deleted file mode 100644 index 0751d22671..0000000000 --- a/drivers/platform/msm/ipa/ipa_api.h +++ /dev/null @@ -1,362 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - */ - -#include "ipa_mhi.h" -#include "ipa_uc_offload.h" -#include "ipa_wdi3.h" -#include "ipa_common_i.h" -#include "gsi.h" - -#ifndef _IPA_API_H_ -#define _IPA_API_H_ - -struct ipa_api_controller { - int (*ipa_cfg_ep)(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); - - int (*ipa_cfg_ep_nat)(u32 clnt_hdl, - const struct ipa_ep_cfg_nat *ipa_ep_cfg); - - int (*ipa_cfg_ep_conn_track)(u32 clnt_hdl, - const struct ipa_ep_cfg_conn_track *ipa_ep_cfg); - - int (*ipa_cfg_ep_hdr)(u32 clnt_hdl, - const struct ipa_ep_cfg_hdr *ipa_ep_cfg); - - int (*ipa_cfg_ep_hdr_ext)(u32 clnt_hdl, - const struct ipa_ep_cfg_hdr_ext *ipa_ep_cfg); - - int (*ipa_cfg_ep_mode)(u32 clnt_hdl, - const struct ipa_ep_cfg_mode *ipa_ep_cfg); - - int (*ipa_cfg_ep_aggr)(u32 clnt_hdl, - const struct ipa_ep_cfg_aggr *ipa_ep_cfg); - - int (*ipa_cfg_ep_deaggr)(u32 clnt_hdl, - const struct ipa_ep_cfg_deaggr *ipa_ep_cfg); - - int (*ipa_cfg_ep_route)(u32 clnt_hdl, - const struct ipa_ep_cfg_route *ipa_ep_cfg); - - int (*ipa_cfg_ep_holb)(u32 clnt_hdl, - const struct ipa_ep_cfg_holb *ipa_ep_cfg); - - int (*ipa_cfg_ep_cfg)(u32 clnt_hdl, - const struct ipa_ep_cfg_cfg *ipa_ep_cfg); - - int (*ipa_cfg_ep_metadata_mask)(u32 clnt_hdl, - const struct ipa_ep_cfg_metadata_mask *ipa_ep_cfg); - - int (*ipa_cfg_ep_holb_by_client)(enum ipa_client_type client, - const struct ipa_ep_cfg_holb *ipa_ep_cfg); - - int (*ipa_add_hdr_usr)(struct ipa_ioc_add_hdr *hdrs, bool user_only); - - int (*ipa_reset_hdr)(bool user_only); - - int (*ipa_add_hdr_proc_ctx)(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs, - bool user_only); - - int (*ipa_del_hdr_proc_ctx)(struct ipa_ioc_del_hdr_proc_ctx *hdls); - - int (*ipa_add_rt_rule_v2)(struct ipa_ioc_add_rt_rule_v2 *rules); - - int (*ipa_add_rt_rule_usr)(struct ipa_ioc_add_rt_rule *rules, - bool user_only); - - int (*ipa_add_rt_rule_usr_v2)(struct ipa_ioc_add_rt_rule_v2 *rules, - bool user_only); - - int (*ipa_del_rt_rule)(struct ipa_ioc_del_rt_rule *hdls); - - int (*ipa_commit_rt)(enum ipa_ip_type ip); - - int (*ipa_reset_rt)(enum ipa_ip_type ip, bool user_only); - - int (*ipa_get_rt_tbl)(struct ipa_ioc_get_rt_tbl *lookup); - - int (*ipa_query_rt_index)(struct ipa_ioc_get_rt_tbl_indx *in); - - int (*ipa_mdfy_rt_rule)(struct ipa_ioc_mdfy_rt_rule *rules); - - int (*ipa_mdfy_rt_rule_v2)(struct ipa_ioc_mdfy_rt_rule_v2 *rules); - - int (*ipa_add_flt_rule)(struct ipa_ioc_add_flt_rule *rules); - - int (*ipa_add_flt_rule_v2)(struct ipa_ioc_add_flt_rule_v2 *rules); - - int (*ipa_add_flt_rule_usr)(struct ipa_ioc_add_flt_rule *rules, - bool user_only); - - int (*ipa_add_flt_rule_usr_v2) - (struct ipa_ioc_add_flt_rule_v2 *rules, bool user_only); - - int (*ipa_del_flt_rule)(struct ipa_ioc_del_flt_rule *hdls); - - int (*ipa_mdfy_flt_rule)(struct ipa_ioc_mdfy_flt_rule *rules); - - int (*ipa_mdfy_flt_rule_v2)(struct ipa_ioc_mdfy_flt_rule_v2 *rules); - - int (*ipa_commit_flt)(enum ipa_ip_type ip); - - int (*ipa_reset_flt)(enum ipa_ip_type ip, bool user_only); - - int (*ipa_allocate_nat_device)(struct ipa_ioc_nat_alloc_mem *mem); - - int (*ipa_allocate_nat_table)( - struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); - - int (*ipa_allocate_ipv6ct_table)( - struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); - - int (*ipa_nat_init_cmd)(struct ipa_ioc_v4_nat_init *init); - - int (*ipa_ipv6ct_init_cmd)(struct ipa_ioc_ipv6ct_init *init); - - int (*ipa_nat_dma_cmd)(struct ipa_ioc_nat_dma_cmd *dma); - - int (*ipa_table_dma_cmd)(struct ipa_ioc_nat_dma_cmd *dma); - - int (*ipa_nat_del_cmd)(struct ipa_ioc_v4_nat_del *del); - - int (*ipa_del_nat_table)(struct ipa_ioc_nat_ipv6ct_table_del *del); - - int (*ipa_del_ipv6ct_table)(struct ipa_ioc_nat_ipv6ct_table_del *del); - - int (*ipa_nat_mdfy_pdn)(struct ipa_ioc_nat_pdn_entry *mdfy_pdn); - - int (*ipa_sys_setup)(struct ipa_sys_connect_params *sys_in, - unsigned long *ipa_bam_hdl, - u32 *ipa_pipe_num, u32 *clnt_hdl, bool en_status); - - int (*ipa_sys_teardown)(u32 clnt_hdl); - - int (*ipa_sys_update_gsi_hdls)(u32 clnt_hdl, unsigned long gsi_ch_hdl, - unsigned long gsi_ev_hdl); - - int (*ipa_set_wlan_tx_info)(struct ipa_wdi_tx_info *info); - - int (*teth_bridge_init)(struct teth_bridge_init_params *params); - - int (*teth_bridge_disconnect)(enum ipa_client_type client); - - int (*teth_bridge_connect)( - struct teth_bridge_connect_params *connect_params); - - void (*ipa_set_client)( - int index, enum ipacm_client_enum client, bool uplink); - - enum ipacm_client_enum (*ipa_get_client)(int pipe_idx); - - bool (*ipa_get_client_uplink)(int pipe_idx); - - bool (*ipa_has_open_aggr_frame)(enum ipa_client_type client); - - int (*ipa_generate_tag_process)(void); - - int (*ipa_disable_sps_pipe)(enum ipa_client_type client); - - void (*ipa_set_tag_process_before_gating)(bool val); - - int (*ipa_mhi_init_engine)(struct ipa_mhi_init_engine *params); - - int (*ipa_connect_mhi_pipe)(struct ipa_mhi_connect_params_internal *in, - u32 *clnt_hdl); - - int (*ipa_disconnect_mhi_pipe)(u32 clnt_hdl); - - bool (*ipa_mhi_stop_gsi_channel)(enum ipa_client_type client); - - int (*ipa_qmi_disable_force_clear)(u32 request_id); - - int (*ipa_qmi_enable_force_clear_datapath_send)( - struct ipa_enable_force_clear_datapath_req_msg_v01 *req); - - int (*ipa_qmi_disable_force_clear_datapath_send)( - struct ipa_disable_force_clear_datapath_req_msg_v01 *req); - - bool (*ipa_mhi_sps_channel_empty)(enum ipa_client_type client); - - int (*ipa_mhi_reset_channel_internal)(enum ipa_client_type client); - - int (*ipa_mhi_start_channel_internal)(enum ipa_client_type client); - - void (*ipa_get_holb)(int ep_idx, struct ipa_ep_cfg_holb *holb); - - int (*ipa_mhi_query_ch_info)(enum ipa_client_type client, - struct gsi_chan_info *ch_info); - - int (*ipa_mhi_resume_channels_internal)( - enum ipa_client_type client, - bool LPTransitionRejected, - bool brstmode_enabled, - union __packed gsi_channel_scratch ch_scratch, - u8 index); - - int (*ipa_mhi_destroy_channel)(enum ipa_client_type client); - - int (*ipa_uc_mhi_send_dl_ul_sync_info) - (union IpaHwMhiDlUlSyncCmdData_t *cmd); - - int (*ipa_uc_mhi_init) - (void (*ready_cb)(void), void (*wakeup_request_cb)(void)); - - void (*ipa_uc_mhi_cleanup)(void); - - int (*ipa_uc_mhi_print_stats)(char *dbg_buff, int size); - - int (*ipa_uc_mhi_reset_channel)(int channelHandle); - - int (*ipa_uc_mhi_suspend_channel)(int channelHandle); - - int (*ipa_uc_mhi_stop_event_update_channel)(int channelHandle); - - int (*ipa_uc_state_check)(void); - - int (*ipa_write_qmap_id)(struct ipa_ioc_write_qmapid *param_in); - - int (*ipa_remove_interrupt_handler)(enum ipa_irq_type interrupt); - - int (*ipa_ap_suspend)(struct device *dev); - - int (*ipa_ap_resume)(struct device *dev); - - int (*ipa_start_gsi_channel)(u32 clnt_hdl); - - void (*ipa_inc_client_enable_clks)( - struct ipa_active_client_logging_info *id); - - void (*ipa_dec_client_disable_clks)( - struct ipa_active_client_logging_info *id); - - int (*ipa_inc_client_enable_clks_no_block)( - struct ipa_active_client_logging_info *id); - - int (*ipa_suspend_resource_no_block)( - enum ipa_rm_resource_name resource); - - int (*ipa_resume_resource)(enum ipa_rm_resource_name name); - - int (*ipa_suspend_resource_sync)(enum ipa_rm_resource_name resource); - - int (*ipa_set_required_perf_profile)( - enum ipa_voltage_level floor_voltage, u32 bandwidth_mbps); - - void *(*ipa_get_ipc_logbuf)(void); - - void *(*ipa_get_ipc_logbuf_low)(void); - - int (*ipa_rx_poll)(u32 clnt_hdl, int budget); - - void (*ipa_recycle_wan_skb)(struct sk_buff *skb); - - int (*ipa_setup_uc_ntn_pipes)(struct ipa_ntn_conn_in_params *in, - ipa_notify_cb notify, void *priv, u8 hdr_len, - struct ipa_ntn_conn_out_params *outp); - - int (*ipa_tear_down_uc_offload_pipes)(int ipa_ep_idx_ul, - int ipa_ep_idx_dl, struct ipa_ntn_conn_in_params *params); - - struct device *(*ipa_get_pdev)(void); - - int (*ipa_ntn_uc_reg_rdyCB)(void (*ipauc_ready_cb)(void *user_data), - void *user_data); - - void (*ipa_ntn_uc_dereg_rdyCB)(void); - - int (*ipa_conn_wdi_pipes)(struct ipa_wdi_conn_in_params *in, - struct ipa_wdi_conn_out_params *out, - ipa_wdi_meter_notifier_cb wdi_notify); - - int (*ipa_disconn_wdi_pipes)(int ipa_ep_idx_tx, - int ipa_ep_idx_rx); - - int (*ipa_enable_wdi_pipes)(int ipa_ep_idx_tx, - int ipa_ep_idx_rx); - - int (*ipa_disable_wdi_pipes)(int ipa_ep_idx_tx, - int ipa_ep_idx_rx); - - int (*ipa_tz_unlock_reg)(struct ipa_tz_unlock_reg_info *reg_info, - u16 num_regs); - - int (*ipa_get_smmu_params)(struct ipa_smmu_in_params *in, - struct ipa_smmu_out_params *out); - int (*ipa_is_vlan_mode)(enum ipa_vlan_ifaces iface, bool *res); - - int (*ipa_wigig_internal_init)( - struct ipa_wdi_uc_ready_params *inout, - ipa_wigig_misc_int_cb int_notify, - phys_addr_t *uc_db_pa); - - int (*ipa_conn_wigig_rx_pipe_i)(void *in, - struct ipa_wigig_conn_out_params *out, - struct dentry **parent); - - int (*ipa_conn_wigig_client_i)(void *in, - struct ipa_wigig_conn_out_params *out, - ipa_notify_cb tx_notify, - void *priv); - - int (*ipa_disconn_wigig_pipe_i)(enum ipa_client_type client, - struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu, - void *dbuff); - - int (*ipa_wigig_uc_msi_init)(bool init, - phys_addr_t periph_baddr_pa, - phys_addr_t pseudo_cause_pa, - phys_addr_t int_gen_tx_pa, - phys_addr_t int_gen_rx_pa, - phys_addr_t dma_ep_misc_pa); - - int (*ipa_enable_wigig_pipe_i)(enum ipa_client_type client); - - int (*ipa_disable_wigig_pipe_i)(enum ipa_client_type client); - - void (*ipa_register_client_callback)( - int (*client_cb)(bool is_lock), - bool (*teth_port_state)(void), enum ipa_client_type client); - - void (*ipa_deregister_client_callback)(enum ipa_client_type client); - - int (*ipa_uc_debug_stats_alloc)( - struct IpaHwOffloadStatsAllocCmdData_t cmdinfo); - - int (*ipa_uc_debug_stats_dealloc)(uint32_t prot_id); - - void (*ipa_get_gsi_stats)(int prot_id, - struct ipa_uc_dbg_ring_stats *stats); - - int (*ipa_get_prot_id)(enum ipa_client_type client); -}; - -#if IS_ENABLED(CONFIG_IPA3) - -int ipa3_plat_drv_probe(struct platform_device *pdev_p, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match); -int ipa3_pci_drv_probe( - struct pci_dev *pci_dev, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match); - -#else /* IS_ENABLED(CONFIG_IPA3) */ - -static inline int ipa3_plat_drv_probe(struct platform_device *pdev_p, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match) -{ - return -ENODEV; -} -static inline int ipa3_pci_drv_probe( - struct pci_dev *pci_dev, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match) -{ - return -ENODEV; -} - -#endif /* IS_ENABLED(CONFIG_IPA3) */ - -#endif /* _IPA_API_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c b/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c index 4af2016776..665e974a5f 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c +++ b/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c @@ -1328,7 +1328,7 @@ static int ecm_ipa_ep_registers_cfg(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, /* enable hdr_metadata_reg_valid */ usb_to_ipa_ep_cfg.hdr.hdr_metadata_reg_valid = true; - result = ipa_cfg_ep(usb_to_ipa_hdl, &usb_to_ipa_ep_cfg); + result = ipa3_cfg_ep(usb_to_ipa_hdl, &usb_to_ipa_ep_cfg); if (result) { ECM_IPA_ERROR("failed to configure USB to IPA point\n"); goto out; @@ -1337,7 +1337,7 @@ static int ecm_ipa_ep_registers_cfg(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, ipa_to_usb_ep_cfg.aggr.aggr_en = IPA_BYPASS_AGGR; ipa_to_usb_ep_cfg.hdr.hdr_len = ETH_HLEN + hdr_add; ipa_to_usb_ep_cfg.nat.nat_en = IPA_BYPASS_NAT; - result = ipa_cfg_ep(ipa_to_usb_hdl, &ipa_to_usb_ep_cfg); + result = ipa3_cfg_ep(ipa_to_usb_hdl, &ipa_to_usb_ep_cfg); if (result) { ECM_IPA_ERROR("failed to configure IPA to USB end-point\n"); goto out; diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c index fbfc2ce72f..75d9d0e22c 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c @@ -32,9 +32,9 @@ do { \ pr_debug(IPA_GSB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_GSB_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_GSB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -42,7 +42,7 @@ do { \ pr_debug(IPA_GSB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_GSB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -50,9 +50,9 @@ do { \ pr_err(IPA_GSB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_GSB_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_GSB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -1034,7 +1034,7 @@ static int ipa_bridge_resume_internal(u32 hdl) return ret; } - ret = ipa_start_gsi_channel( + ret = ipa3_start_gsi_channel( ipa_gsb_ctx->cons_hdl); if (ret) { IPA_GSB_ERR( @@ -1112,7 +1112,7 @@ static int ipa_bridge_suspend_internal(u32 hdl) ret = ipa_pm_deactivate_sync(ipa_gsb_ctx->pm_hdl); if (ret) { IPA_GSB_ERR("fail to deactivate ipa pm\n"); - ipa_start_gsi_channel(ipa_gsb_ctx->cons_hdl); + ipa3_start_gsi_channel(ipa_gsb_ctx->cons_hdl); atomic_set(&ipa_gsb_ctx->suspend_in_progress, 0); mutex_unlock(&ipa_gsb_ctx->lock); mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]); diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c index cc533967b9..4adfc32ce2 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c @@ -23,9 +23,9 @@ do { \ pr_debug(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,7 +33,7 @@ do { \ pr_debug(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -42,9 +42,9 @@ do { \ pr_err(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -361,7 +361,7 @@ static ssize_t ipa_mhi_debugfs_uc_stats(struct file *file, { int nbytes = 0; - nbytes += ipa_uc_mhi_print_stats(dbg_buff, IPA_MHI_MAX_MSG_LEN); + nbytes += ipa3_uc_mhi_print_stats(dbg_buff, IPA_MHI_MAX_MSG_LEN); return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, nbytes); } @@ -726,7 +726,7 @@ static int ipa_mhi_start_internal(struct ipa_mhi_start_params *params) init_params.uC.ipa_cached_dl_ul_sync_info = &ipa_cached_dl_ul_sync_info; - res = ipa_mhi_init_engine(&init_params); + res = ipa3_mhi_init_engine(&init_params); if (res) { IPA_MHI_ERR("IPA core failed to start MHI %d\n", res); goto fail_init_engine; @@ -956,7 +956,7 @@ static bool ipa_mhi_gsi_channel_empty(struct ipa_mhi_channel_ctx *channel) return true; } - if (ipa_mhi_stop_gsi_channel(channel->client)) { + if (ipa3_mhi_stop_gsi_channel(channel->client)) { channel->stop_in_proc = false; return true; } @@ -1030,7 +1030,7 @@ static int ipa_mhi_enable_force_clear(u32 request_id, bool throttle_source) IPA_MHI_DBG("req_id=0x%x src_pipe_btmk=0x%x throt_src=%d\n", req.request_id, req.source_pipe_bitmask, req.throttle_source); - res = ipa_qmi_enable_force_clear_datapath_send(&req); + res = ipa3_qmi_enable_force_clear_datapath_send(&req); if (res) { IPA_MHI_ERR( "ipa_qmi_enable_force_clear_datapath_send failed %d\n" @@ -1051,10 +1051,10 @@ static int ipa_mhi_disable_force_clear(u32 request_id) memset(&req, 0, sizeof(req)); req.request_id = request_id; IPA_MHI_DBG("req_id=0x%x\n", req.request_id); - res = ipa_qmi_disable_force_clear_datapath_send(&req); + res = ipa3_qmi_disable_force_clear_datapath_send(&req); if (res) { IPA_MHI_ERR( - "ipa_qmi_disable_force_clear_datapath_send failed %d\n" + "ipa3_qmi_disable_force_clear_datapath_send failed %d\n" , res); return res; } @@ -1133,7 +1133,7 @@ static int ipa_mhi_reset_ul_channel(struct ipa_mhi_channel_ctx *channel) ipa_mhi_client_ctx->qmi_req_id++; } - res = ipa_mhi_reset_channel_internal(channel->client); + res = ipa3_mhi_reset_channel_internal(channel->client); if (res) { IPA_MHI_ERR("ipa_mhi_reset_ul_channel_internal failed %d\n" , res); @@ -1157,7 +1157,7 @@ static int ipa_mhi_reset_dl_channel(struct ipa_mhi_channel_ctx *channel) return res; } - res = ipa_mhi_reset_channel_internal(channel->client); + res = ipa3_mhi_reset_channel_internal(channel->client); if (res) { IPA_MHI_ERR( "ipa_mhi_reset_ul_channel_internal failed %d\n" @@ -1304,7 +1304,7 @@ static int ipa_mhi_connect_pipe_internal(struct ipa_mhi_connect_params *in, u32 &channel->cached_gsi_evt_ring_hdl; internal.start.gsi.evchid = channel->index; - res = ipa_connect_mhi_pipe(&internal, clnt_hdl); + res = ipa3_connect_mhi_pipe(&internal, clnt_hdl); if (res) { IPA_MHI_ERR("ipa_connect_mhi_pipe failed %d\n", res); goto fail_connect_pipe; @@ -1390,7 +1390,7 @@ static int ipa_mhi_disconnect_pipe_internal(u32 clnt_hdl) } mutex_lock(&mhi_client_general_mutex); - res = ipa_disconnect_mhi_pipe(clnt_hdl); + res = ipa3_disconnect_mhi_pipe(clnt_hdl); if (res) { IPA_MHI_ERR( "IPA core driver failed to disconnect the pipe hdl %d, res %d" @@ -1460,7 +1460,7 @@ static bool ipa_mhi_check_pending_packets_from_host(void) if (!channel->valid) continue; - res = ipa_mhi_query_ch_info(channel->client, + res = ipa3_mhi_query_ch_info(channel->client, &channel->ch_info); if (res) { IPA_MHI_ERR("gsi_query_channel_info failed\n"); @@ -1502,7 +1502,7 @@ static int ipa_mhi_resume_channels(bool LPTransitionRejected, channel = &channels[i]; IPA_MHI_DBG("resuming channel %d\n", channel->id); - res = ipa_mhi_resume_channels_internal(channel->client, + res = ipa3_mhi_resume_channels_internal(channel->client, LPTransitionRejected, channel->brstmode_enabled, channel->ch_scratch, channel->index); @@ -1628,7 +1628,7 @@ static bool ipa_mhi_has_open_aggr_frame(void) if (!channel->valid) continue; - if (ipa_has_open_aggr_frame(channel->client)) + if (ipa3_has_open_aggr_frame(channel->client)) return true; } @@ -1647,7 +1647,7 @@ static void ipa_mhi_update_host_ch_state(bool update_rp) continue; if (update_rp) { - res = ipa_mhi_query_ch_info(channel->client, + res = ipa3_mhi_query_ch_info(channel->client, &channel->ch_info); if (res) { IPA_MHI_ERR("gsi_query_channel_info failed\n"); @@ -1686,7 +1686,7 @@ static void ipa_mhi_update_host_ch_state(bool update_rp) continue; if (update_rp) { - res = ipa_mhi_query_ch_info(channel->client, + res = ipa3_mhi_query_ch_info(channel->client, &channel->ch_info); if (res) { IPA_MHI_ERR("gsi_query_channel_info failed\n"); @@ -1825,7 +1825,7 @@ static int ipa_mhi_suspend_internal(bool force) usleep_range(IPA_MHI_SUSPEND_SLEEP_MIN, IPA_MHI_SUSPEND_SLEEP_MAX); if (!empty) - ipa_set_tag_process_before_gating(false); + ipa3_set_tag_process_before_gating(false); res = ipa_mhi_set_state(IPA_MHI_STATE_SUSPENDED); if (res) { @@ -1969,10 +1969,10 @@ static int ipa_mhi_destroy_channels(struct ipa_mhi_channel_ctx *channels, goto fail; } } - res = ipa_mhi_destroy_channel(channel->client); + res = ipa3_mhi_destroy_channel(channel->client); if (res) { IPA_MHI_ERR( - "ipa_mhi_destroy_channel failed %d" + "ipa3_mhi_destroy_channel failed %d" , res); goto fail; } @@ -2051,7 +2051,7 @@ static void ipa_mhi_destroy_internal(void) return; } - ipa_deregister_client_callback(IPA_CLIENT_MHI_PROD); + ipa3_deregister_client_callback(IPA_CLIENT_MHI_PROD); /* reset all UL and DL acc channels and its accociated event rings */ res = ipa_mhi_destroy_all_channels(); @@ -2236,7 +2236,7 @@ static int ipa_mhi_init_internal(struct ipa_mhi_init_params *params) ipa_mhi_set_state(IPA_MHI_STATE_READY); - ipa_register_client_callback(&ipa_mhi_set_lock_unlock, NULL, + ipa3_register_client_callback(&ipa_mhi_set_lock_unlock, NULL, IPA_CLIENT_MHI_PROD); /* Initialize debugfs */ diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_uc_offload.c b/drivers/platform/msm/ipa/ipa_clients/ipa_uc_offload.c index 193d5fdf01..aab36bfab1 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_uc_offload.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_uc_offload.c @@ -16,9 +16,9 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -26,7 +26,7 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -34,9 +34,9 @@ do { \ pr_err(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -44,9 +44,9 @@ do { \ pr_info(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -408,7 +408,7 @@ int ipa_uc_ntn_conn_pipes(struct ipa_ntn_conn_in_params *inp, } ntn_ctx->state = IPA_UC_OFFLOAD_STATE_UP; - result = ipa_setup_uc_ntn_pipes(inp, ntn_ctx->notify, + result = ipa3_setup_uc_ntn_pipes(inp, ntn_ctx->notify, ntn_ctx->priv, ntn_ctx->hdr_len, outp); if (result) { IPA_UC_OFFLOAD_ERR("fail to setup uc offload pipes: %d\n", @@ -502,7 +502,7 @@ static int ipa_uc_ntn_disconn_pipes(struct ipa_uc_offload_ctx *ntn_ctx) ipa_ep_idx_ul = ipa_get_ep_mapping(IPA_CLIENT_ETHERNET_PROD); ipa_ep_idx_dl = ipa_get_ep_mapping(IPA_CLIENT_ETHERNET_CONS); - ret = ipa_tear_down_uc_offload_pipes(ipa_ep_idx_ul, ipa_ep_idx_dl, + ret = ipa3_tear_down_uc_offload_pipes(ipa_ep_idx_ul, ipa_ep_idx_dl, &ntn_ctx->conn); if (ret) { IPA_UC_OFFLOAD_ERR("fail to tear down ntn offload pipes, %d\n", @@ -648,7 +648,7 @@ int ipa_uc_offload_reg_rdyCB_internal(struct ipa_uc_ready_params *inp) } if (inp->proto == IPA_UC_NTN) - ret = ipa_ntn_uc_reg_rdyCB(inp->notify, inp->priv); + ret = ipa3_ntn_uc_reg_rdyCB(inp->notify, inp->priv); if (ret == -EEXIST) { inp->is_uC_ready = true; @@ -662,7 +662,7 @@ int ipa_uc_offload_reg_rdyCB_internal(struct ipa_uc_ready_params *inp) void ipa_uc_offload_dereg_rdyCB_internal(enum ipa_uc_offload_proto proto) { if (proto == IPA_UC_NTN) - ipa_ntn_uc_dereg_rdyCB(); + ipa3_ntn_uc_dereg_rdyCB(); } int ipa_set_perf_profile_internal(struct ipa_perf_profile *profile) diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c index a9b75610bd..efb5d9f4d5 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c @@ -31,9 +31,9 @@ do { \ pr_debug(IPA_USB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -41,7 +41,7 @@ do { \ pr_debug(IPA_USB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -49,9 +49,9 @@ do { \ pr_err(IPA_USB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -59,9 +59,9 @@ do { \ pr_info(IPA_USB_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_USB_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -605,7 +605,7 @@ static int ipa3_usb_init_teth_bridge(void) { int result; - result = teth_bridge_init(&ipa3_usb_ctx->teth_bridge_params); + result = ipa3_teth_bridge_init(&ipa3_usb_ctx->teth_bridge_params); if (result) { IPA_USB_ERR("Failed to initialize teth_bridge\n"); return result; @@ -870,7 +870,7 @@ static int ipa_usb_init_teth_prot_internal(enum ipa_usb_teth_prot teth_prot, * If needed we can include the same for IPA_PROD ep. * For IPA_USB_DIAG/DPL config there will not be any UL ep. */ - ipa_register_client_callback(&ipa_usb_set_lock_unlock, + ipa3_register_client_callback(&ipa_usb_set_lock_unlock, &ipa3_usb_get_teth_port_state, IPA_CLIENT_USB_PROD); break; case IPA_USB_DIAG: @@ -1319,7 +1319,7 @@ static int ipa3_usb_connect_teth_bridge( { int result; - result = teth_bridge_connect(params); + result = ipa3_teth_bridge_connect(params); if (result) { IPA_USB_ERR("failed to connect teth_bridge (%s)\n", params->tethering_mode == TETH_TETHERING_MODE_RMNET ? @@ -1459,7 +1459,7 @@ static int ipa3_usb_disconnect_teth_bridge(void) { int result; - result = teth_bridge_disconnect(IPA_CLIENT_USB_PROD); + result = ipa3_teth_bridge_disconnect(IPA_CLIENT_USB_PROD); if (result) { IPA_USB_ERR("failed to disconnect teth_bridge\n"); return result; @@ -2044,7 +2044,7 @@ static int ipa_usb_xdci_disconnect_internal(u32 ul_clnt_hdl, u32 dl_clnt_hdl, memset(&holb_cfg, 0, sizeof(holb_cfg)); holb_cfg.en = IPA_HOLB_TMR_EN; holb_cfg.tmr_val = 0; - ipa_cfg_ep_holb(dl_clnt_hdl, &holb_cfg); + ipa3_cfg_ep_holb(dl_clnt_hdl, &holb_cfg); } spin_lock_irqsave(&ipa3_usb_ctx->state_lock, flags); @@ -2635,7 +2635,7 @@ void ipa3_usb_exit(void) * If needed we can include the same for IPA_PROD ep. * For IPA_USB_DIAG/DPL config there will not be any UL config. */ - ipa_deregister_client_callback(IPA_CLIENT_USB_PROD); + ipa3_deregister_client_callback(IPA_CLIENT_USB_PROD); ipa_usb_debugfs_remove(); kfree(ipa3_usb_ctx); diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c b/drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c index e86039ade1..4efb6f99e0 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c @@ -15,9 +15,9 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -25,7 +25,7 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,9 +33,9 @@ do { \ pr_err(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -107,7 +107,7 @@ static int ipa_wdi_init_internal(struct ipa_wdi_init_in_params *in, out->is_uC_ready = uc_ready_params.is_uC_ready; smmu_in.smmu_client = IPA_SMMU_WLAN_CLIENT; - if (ipa_get_smmu_params(&smmu_in, &smmu_out)) + if (ipa3_get_smmu_params(&smmu_in, &smmu_out)) out->is_smmu_enabled = false; else out->is_smmu_enabled = smmu_out.smmu_enable; @@ -432,7 +432,7 @@ static int ipa_wdi_conn_pipes_internal(struct ipa_wdi_conn_in_params *in, } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { - if (ipa_conn_wdi_pipes(in, out, ipa_wdi_ctx->wdi_notify)) { + if (ipa3_conn_wdi3_pipes(in, out, ipa_wdi_ctx->wdi_notify)) { IPA_WDI_ERR("fail to setup wdi pipes\n"); ret = -EFAULT; goto fail_connect_pipe; @@ -591,7 +591,7 @@ static int ipa_wdi_disconn_pipes_internal(void) } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { - if (ipa_disconn_wdi_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { + if (ipa3_disconn_wdi3_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { IPA_WDI_ERR("fail to tear down wdi pipes\n"); return -EFAULT; } @@ -636,7 +636,7 @@ static int ipa_wdi_enable_pipes_internal(void) return -EFAULT; if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { - if (ipa_enable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { + if (ipa3_enable_wdi3_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { IPA_WDI_ERR("fail to enable wdi pipes\n"); return -EFAULT; } @@ -694,7 +694,7 @@ static int ipa_wdi_disable_pipes_internal(void) } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { - if (ipa_disable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { + if (ipa3_disable_wdi3_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { IPA_WDI_ERR("fail to disable wdi pipes\n"); return -EFAULT; } @@ -759,7 +759,7 @@ void ipa_wdi3_register(void) funcs.ipa_wdi_reg_intf = ipa_wdi_reg_intf_internal; funcs.ipa_wdi_release_smmu_mapping = ipa3_release_wdi_mapping; funcs.ipa_wdi_set_perf_profile = ipa_wdi_set_perf_profile_internal; - funcs.ipa_wdi_sw_stats = ipa_set_wlan_tx_info; + funcs.ipa_wdi_sw_stats = ipa3_set_wlan_tx_info; if (ipa_fmwk_register_ipa_wdi3(&funcs)) pr_err("failed to register ipa_wdi3 APIs\n"); diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c b/drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c index 17dd2204ce..82ee5ec4d3 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c @@ -15,9 +15,9 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -25,7 +25,7 @@ do { \ pr_debug(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,9 +33,9 @@ do { \ pr_err(OFFLOAD_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -44,7 +44,7 @@ pr_err_ratelimited_ipa( \ OFFLOAD_DRV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args);\ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ OFFLOAD_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -163,7 +163,7 @@ static int ipa_wigig_init_internal(struct ipa_wigig_init_in_params *in, inout.notify = in->notify; inout.priv = in->priv; - if (ipa_wigig_internal_init(&inout, in->int_notify, + if (ipa3_wigig_internal_init(&inout, in->int_notify, &out->uc_db_pa)) { kfree(ipa_wigig_ctx); ipa_wigig_ctx = NULL; @@ -219,7 +219,7 @@ static bool ipa_wigig_is_smmu_enabled_internal(void) IPA_WIGIG_DBG("\n"); in.smmu_client = IPA_SMMU_WIGIG_CLIENT; - ipa_get_smmu_params(&in, &out); + ipa3_get_smmu_params(&in, &out); IPA_WIGIG_DBG("exit (%d)\n", out.smmu_enable); @@ -235,7 +235,7 @@ static int ipa_wigig_init_smmu_params(void) IPA_WIGIG_DBG("\n"); in.smmu_client = IPA_SMMU_WIGIG_CLIENT; - ret = ipa_get_smmu_params(&in, &out); + ret = ipa3_get_smmu_params(&in, &out); if (ret) { IPA_WIGIG_ERR("couldn't get SMMU params %d\n", ret); return ret; @@ -623,7 +623,7 @@ static int ipa_wigig_conn_rx_pipe_internal(struct ipa_wigig_conn_rx_in_params *i return -EPERM; } - ret = ipa_uc_state_check(); + ret = ipa3_uc_state_check(); if (ret) { IPA_WIGIG_ERR("uC not ready\n"); return ret; @@ -649,7 +649,7 @@ static int ipa_wigig_conn_rx_pipe_internal(struct ipa_wigig_conn_rx_in_params *i } IPA_WIGIG_DBG("pm hdl %d\n", ipa_wigig_ctx->ipa_pm_hdl); - ret = ipa_wigig_uc_msi_init(true, + ret = ipa3_wigig_uc_msi_init(true, ipa_wigig_ctx->periph_baddr_pa, ipa_wigig_ctx->pseudo_cause_pa, ipa_wigig_ctx->int_gen_tx_pa, @@ -661,7 +661,7 @@ static int ipa_wigig_conn_rx_pipe_internal(struct ipa_wigig_conn_rx_in_params *i goto fail_msi; } - if (ipa_conn_wigig_rx_pipe_i(in, out, &ipa_wigig_ctx->parent)) { + if (ipa3_conn_wigig_rx_pipe_i(in, out, &ipa_wigig_ctx->parent)) { IPA_WIGIG_ERR("fail to connect rx pipe\n"); ret = -EFAULT; goto fail_connect_pipe; @@ -684,7 +684,7 @@ static int ipa_wigig_conn_rx_pipe_internal(struct ipa_wigig_conn_rx_in_params *i return 0; fail_connect_pipe: - ipa_wigig_uc_msi_init(false, + ipa3_wigig_uc_msi_init(false, ipa_wigig_ctx->periph_baddr_pa, ipa_wigig_ctx->pseudo_cause_pa, ipa_wigig_ctx->int_gen_tx_pa, @@ -1400,7 +1400,7 @@ static int ipa_wigig_conn_rx_pipe_smmu_internal( return -EPERM; } - ret = ipa_uc_state_check(); + ret = ipa3_uc_state_check(); if (ret) { IPA_WIGIG_ERR("uC not ready\n"); return ret; @@ -1425,7 +1425,7 @@ static int ipa_wigig_conn_rx_pipe_smmu_internal( goto fail_pm; } - ret = ipa_wigig_uc_msi_init(true, + ret = ipa3_wigig_uc_msi_init(true, ipa_wigig_ctx->periph_baddr_pa, ipa_wigig_ctx->pseudo_cause_pa, ipa_wigig_ctx->int_gen_tx_pa, @@ -1437,7 +1437,7 @@ static int ipa_wigig_conn_rx_pipe_smmu_internal( goto fail_msi; } - if (ipa_conn_wigig_rx_pipe_i(in, out, &ipa_wigig_ctx->parent)) { + if (ipa3_conn_wigig_rx_pipe_i(in, out, &ipa_wigig_ctx->parent)) { IPA_WIGIG_ERR("fail to connect rx pipe\n"); ret = -EFAULT; goto fail_connect_pipe; @@ -1463,11 +1463,11 @@ static int ipa_wigig_conn_rx_pipe_smmu_internal( return 0; fail_smmu_store: - ipa_disconn_wigig_pipe_i(IPA_CLIENT_WIGIG_PROD, + ipa3_disconn_wigig_pipe_i(IPA_CLIENT_WIGIG_PROD, &in->pipe_smmu, &in->dbuff_smmu); fail_connect_pipe: - ipa_wigig_uc_msi_init(false, + ipa3_wigig_uc_msi_init(false, ipa_wigig_ctx->periph_baddr_pa, ipa_wigig_ctx->pseudo_cause_pa, ipa_wigig_ctx->int_gen_tx_pa, @@ -1562,7 +1562,7 @@ static int ipa_wigig_conn_client_internal(struct ipa_wigig_conn_tx_in_params *in return -EFAULT; } - if (ipa_uc_state_check()) { + if (ipa3_uc_state_check()) { IPA_WIGIG_ERR("uC not ready\n"); return -EFAULT; } @@ -1572,7 +1572,7 @@ static int ipa_wigig_conn_client_internal(struct ipa_wigig_conn_tx_in_params *in return -EFAULT; } - if (ipa_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify, + if (ipa3_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify, ipa_wigig_ctx->priv)) { IPA_WIGIG_ERR( "fail to connect client. MAC [%X][%X][%X][%X][%X][%X]\n" @@ -1607,7 +1607,7 @@ static int ipa_wigig_conn_client_internal(struct ipa_wigig_conn_tx_in_params *in fail_sendmsg: ipa_wigig_clean_pipe_info(idx); fail_convert_client_to_idx: - ipa_disconn_wigig_pipe_i(out->client, NULL, NULL); + ipa3_disconn_wigig_pipe_i(out->client, NULL, NULL); return -EINVAL; } @@ -1643,7 +1643,7 @@ static int ipa_wigig_conn_client_smmu_internal( return -EFAULT; } - ret = ipa_uc_state_check(); + ret = ipa3_uc_state_check(); if (ret) { IPA_WIGIG_ERR("uC not ready\n"); return ret; @@ -1654,7 +1654,7 @@ static int ipa_wigig_conn_client_smmu_internal( return -EFAULT; } - if (ipa_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify, + if (ipa3_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify, ipa_wigig_ctx->priv)) { IPA_WIGIG_ERR( "fail to connect client. MAC [%X][%X][%X][%X][%X][%X]\n" @@ -1693,7 +1693,7 @@ fail_smmu: ipa_wigig_send_wlan_msg(WLAN_CLIENT_DISCONNECT, netdev_name, in->client_mac); fail_sendmsg: - ipa_disconn_wigig_pipe_i(out->client, &in->pipe_smmu, &in->dbuff_smmu); + ipa3_disconn_wigig_pipe_i(out->client, &in->pipe_smmu, &in->dbuff_smmu); return ret; } @@ -1751,7 +1751,7 @@ static int ipa_wigig_disconn_pipe_internal(enum ipa_client_type client) if (ret) return ret; - ret = ipa_disconn_wigig_pipe_i(client, + ret = ipa3_disconn_wigig_pipe_i(client, pipe_smmu, rx_dbuff_smmu); } else { @@ -1760,13 +1760,13 @@ static int ipa_wigig_disconn_pipe_internal(enum ipa_client_type client) if (ret) return ret; - ret = ipa_disconn_wigig_pipe_i(client, + ret = ipa3_disconn_wigig_pipe_i(client, pipe_smmu, tx_dbuff_smmu); } } else { - ret = ipa_disconn_wigig_pipe_i(client, NULL, NULL); + ret = ipa3_disconn_wigig_pipe_i(client, NULL, NULL); } if (ret) { @@ -1777,7 +1777,7 @@ static int ipa_wigig_disconn_pipe_internal(enum ipa_client_type client) /* RX will be disconnected last, deinit uC msi config */ if (client == IPA_CLIENT_WIGIG_PROD) { IPA_WIGIG_DBG("Rx pipe disconnected, deIniting uc\n"); - ret = ipa_wigig_uc_msi_init(false, + ret = ipa3_wigig_uc_msi_init(false, ipa_wigig_ctx->periph_baddr_pa, ipa_wigig_ctx->pseudo_cause_pa, ipa_wigig_ctx->int_gen_tx_pa, @@ -1829,7 +1829,7 @@ static int ipa_wigig_enable_pipe_internal(enum ipa_client_type client) IPA_WIGIG_DBG("enabling pipe %d\n", client); - ret = ipa_enable_wigig_pipe_i(client); + ret = ipa3_enable_wigig_pipe_i(client); if (ret) return ret; @@ -1847,7 +1847,7 @@ static int ipa_wigig_enable_pipe_internal(enum ipa_client_type client) return 0; fail_pm_active: - ipa_disable_wigig_pipe_i(client); + ipa3_disable_wigig_pipe_i(client); return ret; } @@ -1861,7 +1861,7 @@ static int ipa_wigig_disable_pipe_internal(enum ipa_client_type client) if (ret) return ret; - ret = ipa_disable_wigig_pipe_i(client); + ret = ipa3_disable_wigig_pipe_i(client); if (ret) return ret; diff --git a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c index 9ec6334c87..c68fd45e4e 100644 --- a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c +++ b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c @@ -1951,7 +1951,7 @@ static int rndis_ipa_ep_registers_cfg( } usb_to_ipa_ep_cfg->deaggr.max_packet_len = max_xfer_size_bytes_to_dev; - result = ipa_cfg_ep(usb_to_ipa_hdl, usb_to_ipa_ep_cfg); + result = ipa3_cfg_ep(usb_to_ipa_hdl, usb_to_ipa_ep_cfg); if (result) { pr_err("failed to configure USB to IPA point\n"); return result; @@ -1981,7 +1981,7 @@ static int rndis_ipa_ep_registers_cfg( /* enable hdr_metadata_reg_valid */ usb_to_ipa_ep_cfg->hdr.hdr_metadata_reg_valid = true; - result = ipa_cfg_ep(ipa_to_usb_hdl, &ipa_to_usb_ep_cfg); + result = ipa3_cfg_ep(ipa_to_usb_hdl, &ipa_to_usb_ep_cfg); if (result) { pr_err("failed to configure IPA to USB end-point\n"); return result; @@ -2372,7 +2372,7 @@ static ssize_t rndis_ipa_debugfs_aggr_write return -EFAULT; rndis_ipa_ctx = file->private_data; - result = ipa_cfg_ep(rndis_ipa_ctx->usb_to_ipa_hdl, &ipa_to_usb_ep_cfg); + result = ipa3_cfg_ep(rndis_ipa_ctx->usb_to_ipa_hdl, &ipa_to_usb_ep_cfg); if (result) { pr_err("failed to re-configure USB to IPA point\n"); return result; diff --git a/drivers/platform/msm/ipa/ipa_common_i.h b/drivers/platform/msm/ipa/ipa_common_i.h index e5cffd46a1..2fa221f6ed 100644 --- a/drivers/platform/msm/ipa/ipa_common_i.h +++ b/drivers/platform/msm/ipa/ipa_common_i.h @@ -51,56 +51,56 @@ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa_inc_client_enable_clks(&log_info); \ + ipa3_inc_client_enable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_DEC_EP(client) \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_EP(log_info, client); \ - ipa_dec_client_disable_clks(&log_info); \ + ipa3_dec_client_disable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_INC_SIMPLE() \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa_inc_client_enable_clks(&log_info); \ + ipa3_inc_client_enable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_DEC_SIMPLE() \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info); \ - ipa_dec_client_disable_clks(&log_info); \ + ipa3_dec_client_disable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_INC_RESOURCE(resource_name) \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa_inc_client_enable_clks(&log_info); \ + ipa3_inc_client_enable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_DEC_RESOURCE(resource_name) \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, resource_name); \ - ipa_dec_client_disable_clks(&log_info); \ + ipa3_dec_client_disable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_INC_SPECIAL(id_str) \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa_inc_client_enable_clks(&log_info); \ + ipa3_inc_client_enable_clks(&log_info); \ } while (0) #define IPA_ACTIVE_CLIENTS_DEC_SPECIAL(id_str) \ do { \ struct ipa_active_client_logging_info log_info; \ IPA_ACTIVE_CLIENTS_PREP_SPECIAL(log_info, id_str); \ - ipa_dec_client_disable_clks(&log_info); \ + ipa3_dec_client_disable_clks(&log_info); \ } while (0) /* @@ -450,64 +450,64 @@ extern const char *ipa_clients_strings[]; ## args); \ } while (0) -void ipa_inc_client_enable_clks(struct ipa_active_client_logging_info *id); -void ipa_dec_client_disable_clks(struct ipa_active_client_logging_info *id); -int ipa_inc_client_enable_clks_no_block( +void ipa3_inc_client_enable_clks(struct ipa_active_client_logging_info *id); +void ipa3_dec_client_disable_clks(struct ipa_active_client_logging_info *id); +int ipa3_inc_client_enable_clks_no_block( struct ipa_active_client_logging_info *id); -int ipa_suspend_resource_no_block(enum ipa_rm_resource_name resource); -int ipa_resume_resource(enum ipa_rm_resource_name name); -int ipa_suspend_resource_sync(enum ipa_rm_resource_name resource); -int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage, +int ipa3_suspend_resource_no_block(enum ipa_rm_resource_name resource); +int ipa3_resume_resource(enum ipa_rm_resource_name name); +int ipa3_suspend_resource_sync(enum ipa_rm_resource_name resource); +int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage, u32 bandwidth_mbps); -void *ipa_get_ipc_logbuf(void); -void *ipa_get_ipc_logbuf_low(void); +void *ipa3_get_ipc_logbuf(void); +void *ipa3_get_ipc_logbuf_low(void); void ipa_assert(void); /* MHI */ -int ipa_mhi_init_engine(struct ipa_mhi_init_engine *params); -int ipa_connect_mhi_pipe(struct ipa_mhi_connect_params_internal *in, +int ipa3_mhi_init_engine(struct ipa_mhi_init_engine *params); +int ipa3_connect_mhi_pipe(struct ipa_mhi_connect_params_internal *in, u32 *clnt_hdl); -int ipa_disconnect_mhi_pipe(u32 clnt_hdl); -bool ipa_mhi_stop_gsi_channel(enum ipa_client_type client); -int ipa_qmi_enable_force_clear_datapath_send( +int ipa3_disconnect_mhi_pipe(u32 clnt_hdl); +bool ipa3_mhi_stop_gsi_channel(enum ipa_client_type client); +int ipa3_qmi_enable_force_clear_datapath_send( struct ipa_enable_force_clear_datapath_req_msg_v01 *req); -int ipa_qmi_disable_force_clear_datapath_send( +int ipa3_qmi_disable_force_clear_datapath_send( struct ipa_disable_force_clear_datapath_req_msg_v01 *req); -int ipa_generate_tag_process(void); -int ipa_disable_sps_pipe(enum ipa_client_type client); -int ipa_mhi_reset_channel_internal(enum ipa_client_type client); -int ipa_mhi_start_channel_internal(enum ipa_client_type client); -bool ipa_mhi_sps_channel_empty(enum ipa_client_type client); -int ipa_mhi_resume_channels_internal(enum ipa_client_type client, +int ipa3_generate_tag_process(void); +int ipa3_disable_sps_pipe(enum ipa_client_type client); +int ipa3_mhi_reset_channel_internal(enum ipa_client_type client); +int ipa3_mhi_start_channel_internal(enum ipa_client_type client); +bool ipa3_mhi_sps_channel_empty(enum ipa_client_type client); +int ipa3_mhi_resume_channels_internal(enum ipa_client_type client, bool LPTransitionRejected, bool brstmode_enabled, union __packed gsi_channel_scratch ch_scratch, u8 index); -int ipa_mhi_query_ch_info(enum ipa_client_type client, +int ipa3_mhi_query_ch_info(enum ipa_client_type client, struct gsi_chan_info *ch_info); -int ipa_mhi_destroy_channel(enum ipa_client_type client); +int ipa3_mhi_destroy_channel(enum ipa_client_type client); int ipa_mhi_is_using_dma(bool *flag); /* MHI uC */ -int ipa_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t *cmd); -int ipa_uc_mhi_init +int ipa3_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t *cmd); +int ipa3_uc_mhi_init (void (*ready_cb)(void), void (*wakeup_request_cb)(void)); -void ipa_uc_mhi_cleanup(void); -int ipa_uc_mhi_reset_channel(int channelHandle); -int ipa_uc_mhi_suspend_channel(int channelHandle); -int ipa_uc_mhi_stop_event_update_channel(int channelHandle); -int ipa_uc_mhi_print_stats(char *dbg_buff, int size); +void ipa3_uc_mhi_cleanup(void); +int ipa3_uc_mhi_reset_channel(int channelHandle); +int ipa3_uc_mhi_suspend_channel(int channelHandle); +int ipa3_uc_mhi_stop_event_update_channel(int channelHandle); +int ipa3_uc_mhi_print_stats(char *dbg_buff, int size); /* uC */ -int ipa_uc_state_check(void); +int ipa3_uc_state_check(void); /* general */ -void ipa_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb); -void ipa_set_tag_process_before_gating(bool val); -bool ipa_has_open_aggr_frame(enum ipa_client_type client); -int ipa_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *in, +void ipa3_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb); +void ipa3_set_tag_process_before_gating(bool val); +bool ipa3_has_open_aggr_frame(enum ipa_client_type client); +int ipa3_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *in, ipa_notify_cb notify, void *priv, u8 hdr_len, struct ipa_ntn_conn_out_params *outp); -int ipa_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, int ipa_ep_idx_dl, +int ipa3_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, int ipa_ep_idx_dl, struct ipa_ntn_conn_in_params *params); u8 *ipa_write_64(u64 w, u8 *dest); u8 *ipa_write_32(u32 w, u8 *dest); @@ -515,22 +515,22 @@ u8 *ipa_write_16(u16 hw, u8 *dest); u8 *ipa_write_8(u8 b, u8 *dest); u8 *ipa_pad_to_64(u8 *dest); u8 *ipa_pad_to_32(u8 *dest); -int ipa_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *user_data), +int ipa3_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *user_data), void *user_data); -void ipa_ntn_uc_dereg_rdyCB(void); +void ipa3_ntn_uc_dereg_rdyCB(void); -int ipa_conn_wdi_pipes(struct ipa_wdi_conn_in_params *in, +int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in, struct ipa_wdi_conn_out_params *out, ipa_wdi_meter_notifier_cb wdi_notify); -int ipa_disconn_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); +int ipa3_disconn_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); -int ipa_enable_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); +int ipa3_enable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); -int ipa_disable_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); +int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); const char *ipa_get_version_string(enum ipa_hw_type ver); -int ipa_start_gsi_channel(u32 clnt_hdl); +int ipa3_start_gsi_channel(u32 clnt_hdl); int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, struct sg_table *in_sgt_ptr); @@ -549,19 +549,19 @@ static inline void ipa_ut_module_exit(void) } #endif -int ipa_wigig_internal_init( +int ipa3_wigig_internal_init( struct ipa_wdi_uc_ready_params *inout, ipa_wigig_misc_int_cb int_notify, phys_addr_t *uc_db_pa); -int ipa_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out, +int ipa3_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out, struct dentry **parent); -int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out, +int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out, ipa_notify_cb tx_notify, void *priv); -int ipa_wigig_uc_msi_init( +int ipa3_wigig_uc_msi_init( bool init, phys_addr_t periph_baddr_pa, phys_addr_t pseudo_cause_pa, @@ -569,13 +569,13 @@ int ipa_wigig_uc_msi_init( phys_addr_t int_gen_rx_pa, phys_addr_t dma_ep_misc_pa); -int ipa_disconn_wigig_pipe_i(enum ipa_client_type client, +int ipa3_disconn_wigig_pipe_i(enum ipa_client_type client, struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu, void *dbuff); -int ipa_enable_wigig_pipe_i(enum ipa_client_type client); +int ipa3_enable_wigig_pipe_i(enum ipa_client_type client); -int ipa_disable_wigig_pipe_i(enum ipa_client_type client); +int ipa3_disable_wigig_pipe_i(enum ipa_client_type client); int ipa_wigig_send_msg(int msg_type, const char *netdev_name, u8 *mac, @@ -584,19 +584,19 @@ int ipa_wigig_send_msg(int msg_type, int ipa_wigig_send_wlan_msg(enum ipa_wlan_event msg_type, const char *netdev_name, u8 *mac); -void ipa_register_client_callback(int (*client_cb)(bool is_lock), +void ipa3_register_client_callback(int (*client_cb)(bool is_lock), bool (*teth_port_state)(void), u32 ipa_ep_idx); -void ipa_deregister_client_callback(u32 ipa_ep_idx); +void ipa3_deregister_client_callback(u32 ipa_ep_idx); /* * Configuration */ -int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); +int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); -int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg); +int ipa3_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg); -int ipa_cfg_ep_conn_track(u32 clnt_hdl, +int ipa3_cfg_ep_conn_track(u32 clnt_hdl, const struct ipa_ep_cfg_conn_track *ep_conn_track); int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg); @@ -630,124 +630,106 @@ int ipa3_add_hdr(struct ipa_ioc_add_hdr *hdrs); int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls); -int ipa_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool user_only); +int ipa3_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool user_only); -int ipa_reset_hdr(bool user_only); +int ipa3_reset_hdr(bool user_only); /* * Header Processing Context */ -int ipa_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs, +int ipa3_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs, bool user_only); -int ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); +int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); /* * Routing */ -int ipa_add_rt_rule_v2(struct ipa_ioc_add_rt_rule_v2 *rules); +int ipa3_add_rt_rule_v2(struct ipa_ioc_add_rt_rule_v2 *rules); -int ipa_add_rt_rule_usr(struct ipa_ioc_add_rt_rule *rules, bool user_only); +int ipa3_add_rt_rule_usr(struct ipa_ioc_add_rt_rule *rules, bool user_only); -int ipa_add_rt_rule_usr_v2(struct ipa_ioc_add_rt_rule_v2 *rules, +int ipa3_add_rt_rule_usr_v2(struct ipa_ioc_add_rt_rule_v2 *rules, bool user_only); -int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls); +int ipa3_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls); -int ipa_commit_rt(enum ipa_ip_type ip); +int ipa3_commit_rt(enum ipa_ip_type ip); -int ipa_reset_rt(enum ipa_ip_type ip, bool user_only); - -int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in); - -int ipa_mdfy_rt_rule(struct ipa_ioc_mdfy_rt_rule *rules); - -int ipa_mdfy_rt_rule_v2(struct ipa_ioc_mdfy_rt_rule_v2 *rules); - -int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup); +int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only); /* * Filtering */ -int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules); -int ipa_add_flt_rule_v2(struct ipa_ioc_add_flt_rule_v2 *rules); +int ipa3_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls); -int ipa_add_flt_rule_usr(struct ipa_ioc_add_flt_rule *rules, bool user_only); +int ipa3_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules); -int ipa_add_flt_rule_usr_v2(struct ipa_ioc_add_flt_rule_v2 *rules, - bool user_only); +int ipa3_mdfy_flt_rule_v2(struct ipa_ioc_mdfy_flt_rule_v2 *rules); -int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls); - -int ipa_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules); - -int ipa_mdfy_flt_rule_v2(struct ipa_ioc_mdfy_flt_rule_v2 *rules); - -int ipa_commit_flt(enum ipa_ip_type ip); - -int ipa_reset_flt(enum ipa_ip_type ip, bool user_only); +int ipa3_reset_flt(enum ipa_ip_type ip, bool user_only); /* * NAT\IPv6CT */ -int ipa_allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem); -int ipa_allocate_nat_table(struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); -int ipa_allocate_ipv6ct_table( +int ipa3_allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem); +int ipa3_allocate_nat_table(struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); +int ipa3_allocate_ipv6ct_table( struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); -int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init); -int ipa_ipv6ct_init_cmd(struct ipa_ioc_ipv6ct_init *init); +int ipa3_nat_init_cmd(struct ipa_ioc_v4_nat_init *init); +int ipa3_ipv6ct_init_cmd(struct ipa_ioc_ipv6ct_init *init); -int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); -int ipa_table_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); +int ipa3_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); +int ipa3_table_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); -int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del); -int ipa_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del); -int ipa_del_ipv6ct_table(struct ipa_ioc_nat_ipv6ct_table_del *del); +int ipa3_nat_del_cmd(struct ipa_ioc_v4_nat_del *del); +int ipa3_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del); +int ipa3_del_ipv6ct_table(struct ipa_ioc_nat_ipv6ct_table_del *del); -int ipa_nat_mdfy_pdn(struct ipa_ioc_nat_pdn_entry *mdfy_pdn); +int ipa3_nat_mdfy_pdn(struct ipa_ioc_nat_pdn_entry *mdfy_pdn); /* * Data path */ -int ipa_rx_poll(u32 clnt_hdl, int budget); -void ipa_recycle_wan_skb(struct sk_buff *skb); +int ipa3_rx_poll(u32 clnt_hdl, int budget); +void ipa3_recycle_wan_skb(struct sk_buff *skb); /* * System pipes */ -int ipa_set_wlan_tx_info(struct ipa_wdi_tx_info *info); +int ipa3_set_wlan_tx_info(struct ipa_wdi_tx_info *info); /* * Tethering bridge (Rmnet / MBIM) */ -int teth_bridge_init(struct teth_bridge_init_params *params); +int ipa3_teth_bridge_init(struct teth_bridge_init_params *params); -int teth_bridge_disconnect(enum ipa_client_type client); +int ipa3_teth_bridge_disconnect(enum ipa_client_type client); -int teth_bridge_connect(struct teth_bridge_connect_params *connect_params); +int ipa3_teth_bridge_connect(struct teth_bridge_connect_params *connect_params); /* * Tethering client info */ -void ipa_set_client(int index, enum ipacm_client_enum client, bool uplink); +void ipa3_set_client(int index, enum ipacm_client_enum client, bool uplink); -enum ipacm_client_enum ipa_get_client(int pipe_idx); +enum ipacm_client_enum ipa3_get_client(int pipe_idx); -bool ipa_get_client_uplink(int pipe_idx); +bool ipa3_get_client_uplink(int pipe_idx); /* * mux id */ -int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); +int ipa3_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); /* * interrupts */ -int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt); +int ipa3_remove_interrupt_handler(enum ipa_irq_type interrupt); /* * Interface @@ -763,13 +745,15 @@ int ipa3_deregister_intf(const char *name); * Miscellaneous */ -int ipa_uc_debug_stats_alloc( +int ipa3_uc_debug_stats_alloc( struct IpaHwOffloadStatsAllocCmdData_t cmdinfo); -int ipa_uc_debug_stats_dealloc(uint32_t protocol); -void ipa_get_gsi_stats(int prot_id, +int ipa3_uc_debug_stats_dealloc(uint32_t protocol); +void ipa3_get_gsi_stats(int prot_id, struct ipa_uc_dbg_ring_stats *stats); -int ipa_get_prot_id(enum ipa_client_type client); +int ipa3_get_prot_id(enum ipa_client_type client); bool ipa_is_client_handle_valid(u32 clnt_hdl); +int ipa3_get_smmu_params(struct ipa_smmu_in_params *in, + struct ipa_smmu_out_params *out); /** * ipa_tz_unlock_reg - Unlocks memory regions so that they become accessible @@ -784,6 +768,6 @@ bool ipa_is_client_handle_valid(u32 clnt_hdl); * * Returns: 0 on success, negative on failure */ -int ipa_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs); +int ipa3_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs); #endif /* _IPA_COMMON_I_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_rm.c b/drivers/platform/msm/ipa/ipa_rm.c index b30438ccff..7956cb0dd4 100644 --- a/drivers/platform/msm/ipa/ipa_rm.c +++ b/drivers/platform/msm/ipa/ipa_rm.c @@ -412,7 +412,7 @@ static void ipa_rm_wq_suspend_handler(struct work_struct *work) IPA_RM_ERR("resource is not CONS\n"); return; } - ipa_suspend_resource_sync(ipa_rm_work->resource_name); + ipa3_suspend_resource_sync(ipa_rm_work->resource_name); spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags); if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph, ipa_rm_work->resource_name, @@ -626,10 +626,10 @@ static void ipa_rm_perf_profile_notify_to_ipa_work(struct work_struct *work) IPA_RM_DBG_LOW("calling to IPA driver. voltage %d bandwidth %d\n", notify_work->volt, notify_work->bandwidth_mbps); - res = ipa_set_required_perf_profile(notify_work->volt, + res = ipa3_set_required_perf_profile(notify_work->volt, notify_work->bandwidth_mbps); if (res) { - IPA_RM_ERR("ipa_set_required_perf_profile failed %d\n", res); + IPA_RM_ERR("ipa3_set_required_perf_profile failed %d\n", res); goto bail; } diff --git a/drivers/platform/msm/ipa/ipa_rm_i.h b/drivers/platform/msm/ipa/ipa_rm_i.h index bdb20dc9c7..2c23893cc0 100644 --- a/drivers/platform/msm/ipa/ipa_rm_i.h +++ b/drivers/platform/msm/ipa/ipa_rm_i.h @@ -17,16 +17,16 @@ do { \ pr_debug(IPA_RM_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_RM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) #define IPA_RM_DBG(fmt, args...) \ do { \ pr_debug(IPA_RM_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_RM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_RM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -34,9 +34,9 @@ do { \ pr_err(IPA_RM_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_RM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_RM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) diff --git a/drivers/platform/msm/ipa/ipa_rm_resource.c b/drivers/platform/msm/ipa/ipa_rm_resource.c index 998a0bdd18..a7f8347290 100644 --- a/drivers/platform/msm/ipa/ipa_rm_resource.c +++ b/drivers/platform/msm/ipa/ipa_rm_resource.c @@ -126,7 +126,7 @@ int ipa_rm_resource_consumer_request_work(struct ipa_rm_resource_cons *consumer, } else { consumer->resource.state = IPA_RM_GRANTED; ipa_rm_perf_profile_change(consumer->resource.name); - ipa_resume_resource(consumer->resource.name); + ipa3_resume_resource(consumer->resource.name); } } else if (driver_result != -EINPROGRESS) { consumer->resource.state = prev_state; @@ -162,7 +162,7 @@ int ipa_rm_resource_consumer_request( IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, ipa_rm_resource_str(consumer->resource.name)); if (prev_state == IPA_RM_RELEASE_IN_PROGRESS || - ipa_inc_client_enable_clks_no_block(&log_info) != 0) { + ipa3_inc_client_enable_clks_no_block(&log_info) != 0) { IPA_RM_DBG_LOW("async resume work for %s\n", ipa_rm_resource_str(consumer->resource.name)); ipa_rm_wq_send_resume_cmd(consumer->resource.name, @@ -229,7 +229,7 @@ int ipa_rm_resource_consumer_release( if (consumer->usage_count == 0) { consumer->resource.state = IPA_RM_RELEASE_IN_PROGRESS; if (save_state == IPA_RM_REQUEST_IN_PROGRESS || - ipa_suspend_resource_no_block( + ipa3_suspend_resource_no_block( consumer->resource.name) != 0) { ipa_rm_wq_send_suspend_cmd( consumer->resource.name, @@ -1015,7 +1015,7 @@ void ipa_rm_resource_consumer_handle_cb(struct ipa_rm_resource_cons *consumer, goto bail; consumer->resource.state = IPA_RM_GRANTED; ipa_rm_perf_profile_change(consumer->resource.name); - ipa_resume_resource(consumer->resource.name); + ipa3_resume_resource(consumer->resource.name); complete_all(&consumer->request_consumer_in_progress); break; case IPA_RM_RELEASE_IN_PROGRESS: diff --git a/drivers/platform/msm/ipa/ipa_uc_offload_common_i.h b/drivers/platform/msm/ipa/ipa_uc_offload_common_i.h index 97d6db091e..1babae8433 100644 --- a/drivers/platform/msm/ipa/ipa_uc_offload_common_i.h +++ b/drivers/platform/msm/ipa/ipa_uc_offload_common_i.h @@ -9,14 +9,14 @@ #ifndef _IPA_UC_OFFLOAD_COMMON_I_H_ #define _IPA_UC_OFFLOAD_COMMON_I_H_ -int ipa_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *in, +int ipa3_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *in, ipa_notify_cb notify, void *priv, u8 hdr_len, struct ipa_ntn_conn_out_params *outp); -int ipa_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, int ipa_ep_idx_dl, +int ipa3_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, int ipa_ep_idx_dl, struct ipa_ntn_conn_in_params *params); -int ipa_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *user_data), +int ipa3_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *user_data), void *user_data); -void ipa_ntn_uc_dereg_rdyCB(void); +void ipa3_ntn_uc_dereg_rdyCB(void); #endif /* _IPA_UC_OFFLOAD_COMMON_I_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index f074fe11b8..ec67c5befb 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -44,6 +44,8 @@ #endif +#define DRV_NAME "ipa" + #define IPA_SUBSYSTEM_NAME "ipa_fws" #define IPA_UC_SUBSYSTEM_NAME "ipa_uc" @@ -144,6 +146,296 @@ static struct clk *ipa3_clk; struct ipa3_context *ipa3_ctx = NULL; +int ipa3_plat_drv_probe(struct platform_device *pdev_p); +int ipa3_pci_drv_probe( + struct pci_dev *pci_dev, + const struct pci_device_id *ent); + +/** + * ipa_get_hw_type() - Return IPA HW version + * + * Return value: enum ipa_hw_type + */ +enum ipa_hw_type ipa_get_hw_type_internal(void) +{ + if (ipa3_ctx == NULL) + return IPA_HW_None; + + return ipa3_ctx->ipa_hw_type; +} + +/** + * ipa_assert() - general function for assertion + */ +void ipa_assert(void) +{ + pr_err("IPA: unrecoverable error has occurred, asserting\n"); + BUG(); +} +EXPORT_SYMBOL(ipa_assert); + +#if defined(CONFIG_IPA_EMULATION) +static bool running_emulation = true; +#else +static bool running_emulation; +#endif + +static const struct of_device_id ipa_pci_drv_match[] = { + { .compatible = "qcom,ipa", }, + {} +}; + +#define LOCAL_VENDOR 0x17CB +#define LOCAL_DEVICE 0x00ff + +static const char ipa_pci_driver_name[] = "qcipav3"; + +static const struct pci_device_id ipa_pci_tbl[] = { + { PCI_DEVICE(LOCAL_VENDOR, LOCAL_DEVICE) }, + { 0, 0, 0, 0, 0, 0, 0 } +}; + +MODULE_DEVICE_TABLE(pci, ipa_pci_tbl); + +static void ipa_pci_remove(struct pci_dev *pci_dev) +{ +} + +static void ipa_pci_shutdown(struct pci_dev *pci_dev) +{ +} + +static pci_ers_result_t ipa_pci_io_error_detected(struct pci_dev *pci_dev, + pci_channel_state_t state) +{ + return 0; +} + +static pci_ers_result_t ipa_pci_io_slot_reset(struct pci_dev *pci_dev) +{ + return 0; +} + +static void ipa_pci_io_resume(struct pci_dev *pci_dev) +{ +} + +/* PCI Error Recovery */ +static const struct pci_error_handlers ipa_pci_err_handler = { + .error_detected = ipa_pci_io_error_detected, + .slot_reset = ipa_pci_io_slot_reset, + .resume = ipa_pci_io_resume, +}; + +static struct pci_driver ipa_pci_driver = { + .name = ipa_pci_driver_name, + .id_table = ipa_pci_tbl, + .probe = ipa3_pci_drv_probe, + .remove = ipa_pci_remove, + .shutdown = ipa_pci_shutdown, + .err_handler = &ipa_pci_err_handler +}; + +static const struct of_device_id ipa_plat_drv_match[] = { + { .compatible = "qcom,ipa", }, + { .compatible = "qcom,ipa-smmu-ap-cb", }, + { .compatible = "qcom,ipa-smmu-wlan-cb", }, + { .compatible = "qcom,ipa-smmu-uc-cb", }, + { .compatible = "qcom,ipa-smmu-11ad-cb", }, + { .compatible = "qcom,smp2p-map-ipa-1-in", }, + { .compatible = "qcom,smp2p-map-ipa-1-out", }, + {} +}; + +/** + * ipa_write_64() - convert 64 bit value to byte array + * @w: 64 bit integer + * @dest: byte array + * + * Return value: converted value + */ +u8 *ipa_write_64(u64 w, u8 *dest) +{ + if (unlikely(dest == NULL)) { + pr_err("%s: NULL address\n", __func__); + return dest; + } + *dest++ = (u8)((w) & 0xFF); + *dest++ = (u8)((w >> 8) & 0xFF); + *dest++ = (u8)((w >> 16) & 0xFF); + *dest++ = (u8)((w >> 24) & 0xFF); + *dest++ = (u8)((w >> 32) & 0xFF); + *dest++ = (u8)((w >> 40) & 0xFF); + *dest++ = (u8)((w >> 48) & 0xFF); + *dest++ = (u8)((w >> 56) & 0xFF); + + return dest; +} + +/** + * ipa_write_32() - convert 32 bit value to byte array + * @w: 32 bit integer + * @dest: byte array + * + * Return value: converted value + */ +u8 *ipa_write_32(u32 w, u8 *dest) +{ + if (unlikely(dest == NULL)) { + pr_err("%s: NULL address\n", __func__); + return dest; + } + *dest++ = (u8)((w) & 0xFF); + *dest++ = (u8)((w >> 8) & 0xFF); + *dest++ = (u8)((w >> 16) & 0xFF); + *dest++ = (u8)((w >> 24) & 0xFF); + + return dest; +} + +/** + * ipa_write_16() - convert 16 bit value to byte array + * @hw: 16 bit integer + * @dest: byte array + * + * Return value: converted value + */ +u8 *ipa_write_16(u16 hw, u8 *dest) +{ + if (unlikely(dest == NULL)) { + pr_err("%s: NULL address\n", __func__); + return dest; + } + *dest++ = (u8)((hw) & 0xFF); + *dest++ = (u8)((hw >> 8) & 0xFF); + + return dest; +} + +/** + * ipa_write_8() - convert 8 bit value to byte array + * @hw: 8 bit integer + * @dest: byte array + * + * Return value: converted value + */ +u8 *ipa_write_8(u8 b, u8 *dest) +{ + if (unlikely(dest == NULL)) { + WARN(1, "%s: NULL address\n", __func__); + return dest; + } + *dest++ = (b) & 0xFF; + + return dest; +} + +/** + * ipa_pad_to_64() - pad byte array to 64 bit value + * @dest: byte array + * + * Return value: padded value + */ +u8 *ipa_pad_to_64(u8 *dest) +{ + int i; + int j; + + if (unlikely(dest == NULL)) { + WARN(1, "%s: NULL address\n", __func__); + return dest; + } + + i = (long)dest & 0x7; + + if (i) + for (j = 0; j < (8 - i); j++) + *dest++ = 0; + + return dest; +} + +/** + * ipa_pad_to_32() - pad byte array to 32 bit value + * @dest: byte array + * + * Return value: padded value + */ +u8 *ipa_pad_to_32(u8 *dest) +{ + int i; + int j; + + if (unlikely(dest == NULL)) { + WARN(1, "%s: NULL address\n", __func__); + return dest; + } + + i = (long)dest & 0x7; + + if (i) + for (j = 0; j < (4 - i); j++) + *dest++ = 0; + + return dest; +} + +int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, + struct sg_table *in_sgt_ptr) +{ + unsigned int nents; + + if (in_sgt_ptr != NULL) { + *out_ch_ptr = kzalloc(sizeof(struct sg_table), GFP_KERNEL); + if (*out_ch_ptr == NULL) + return -ENOMEM; + + nents = in_sgt_ptr->nents; + + (*out_ch_ptr)->sgl = + kcalloc(nents, sizeof(struct scatterlist), + GFP_KERNEL); + if ((*out_ch_ptr)->sgl == NULL) { + kfree(*out_ch_ptr); + *out_ch_ptr = NULL; + return -ENOMEM; + } + + memcpy((*out_ch_ptr)->sgl, in_sgt_ptr->sgl, + nents*sizeof((*out_ch_ptr)->sgl)); + (*out_ch_ptr)->nents = nents; + (*out_ch_ptr)->orig_nents = in_sgt_ptr->orig_nents; + } + return 0; +} +EXPORT_SYMBOL(ipa_smmu_store_sgt); + +int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr) +{ + if (*out_sgt_ptr != NULL) { + kfree((*out_sgt_ptr)->sgl); + (*out_sgt_ptr)->sgl = NULL; + kfree(*out_sgt_ptr); + *out_sgt_ptr = NULL; + } + return 0; +} +EXPORT_SYMBOL(ipa_smmu_free_sgt); + +static const struct dev_pm_ops ipa_pm_ops = { + .suspend_late = ipa3_ap_suspend, + .resume_early = ipa3_ap_resume, +}; + +static struct platform_driver ipa_plat_drv = { + .probe = ipa3_plat_drv_probe, + .driver = { + .name = DRV_NAME, + .pm = &ipa_pm_ops, + .of_match_table = ipa_plat_drv_match, + }, +}; + static struct { bool present[IPA_SMMU_CB_MAX]; bool arm_smmu; @@ -5052,6 +5344,7 @@ void ipa3_inc_client_enable_clks(struct ipa_active_client_logging_info *id) atomic_read(&ipa3_ctx->ipa3_active_clients.cnt)); mutex_unlock(&ipa3_ctx->ipa3_active_clients.mutex); } +EXPORT_SYMBOL(ipa3_inc_client_enable_clks); static void ipa3_handle_gsi_differ_irq(void) { @@ -5091,6 +5384,7 @@ int ipa3_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info return -EPERM; } +EXPORT_SYMBOL(ipa3_inc_client_enable_clks_no_block); static void __ipa3_dec_client_disable_clks(void) { @@ -5169,6 +5463,7 @@ void ipa3_dec_client_disable_clks(struct ipa_active_client_logging_info *id) ipa3_active_clients_log_dec(id, false); __ipa3_dec_client_disable_clks(); } +EXPORT_SYMBOL(ipa3_dec_client_disable_clks); static void ipa_dec_clients_disable_clks_on_wq(struct work_struct *work) { @@ -5406,6 +5701,7 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage, return 0; } +EXPORT_SYMBOL(ipa3_set_required_perf_profile); static void ipa3_process_irq_schedule_rel(void) { @@ -7501,7 +7797,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, /* Get IPA HW Version */ result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver", &ipa_drv_res->ipa_hw_type); - if ((result) || (ipa_drv_res->ipa_hw_type == 0)) { + if ((result) || (ipa_drv_res->ipa_hw_type == IPA_HW_None)) { IPAERR(":get resource failed for ipa-hw-ver\n"); return -ENODEV; } @@ -8522,14 +8818,46 @@ static void ipa_smmu_update_fw_loader(void) } } -int ipa3_plat_drv_probe(struct platform_device *pdev_p, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match) +int ipa3_plat_drv_probe(struct platform_device *pdev_p) { int result; struct device *dev = &pdev_p->dev; struct ipa_smmu_cb_ctx *cb; + /* + * IPA probe function can be called for multiple times as the same probe + * function handles multiple compatibilities + */ + pr_debug("ipa: IPA driver probing started for %s\n", + pdev_p->dev.of_node->name); + + if (ipa3_ctx == NULL) { + IPAERR("ipa3_ctx was not initialized\n"); + return -EPROBE_DEFER; + } + + if (ipa3_ctx->ipa_hw_type == 0) { + + /* Get IPA HW Version */ + result = of_property_read_u32(pdev_p->dev.of_node, + "qcom,ipa-hw-ver", &ipa3_ctx->ipa_hw_type); + if ((result) || (ipa3_ctx->ipa_hw_type == IPA_HW_None)) { + pr_err("ipa: get resource failed for ipa-hw-ver!\n"); + return -ENODEV; + } + pr_debug("ipa: ipa_hw_type = %d\n", ipa3_ctx->ipa_hw_type); + } + + if (ipa3_ctx->ipa_hw_type < IPA_HW_v3_0) { + pr_err(":IPA version below 3.0 not supported\n"); + return -ENODEV; + } + + if (ipa3_ctx->ipa_hw_type >= IPA_HW_MAX) { + pr_err(":IPA version is greater than the MAX\n"); + return -ENODEV; + } + IPADBG("IPA driver probing started\n"); IPADBG("dev->of_node->name = %s\n", dev->of_node->name); @@ -8601,12 +8929,6 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p, /* Get GSI version */ ipa3_ctx->gsi_ver = ipa3_get_gsi_ver(ipa3_res.ipa_hw_type); - result = ipa3_bind_api_controller(ipa3_res.ipa_hw_type, api_ctrl); - if (result) { - IPAERR("IPA API binding failed\n"); - return result; - } - if (of_property_read_bool(pdev_p->dev.of_node, "qcom,arm-smmu")) { if (of_property_read_bool(pdev_p->dev.of_node, "qcom,use-64-bit-dma-mask")) @@ -8640,12 +8962,15 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p, } result = of_platform_populate(pdev_p->dev.of_node, - pdrv_match, NULL, &pdev_p->dev); + ipa_plat_drv_match, NULL, &pdev_p->dev); if (result) { IPAERR("failed to populate platform\n"); return result; } + if (result && result != -EPROBE_DEFER) + IPAERR("ipa: ipa_plat_drv_probe failed\n"); + return result; } @@ -8877,6 +9202,7 @@ int ipa3_get_smmu_params(struct ipa_smmu_in_params *in, return 0; } +EXPORT_SYMBOL(ipa3_get_smmu_params); #define MAX_LEN 96 @@ -8925,8 +9251,7 @@ void ipa_pc_qmp_enable(void) int ipa3_pci_drv_probe( struct pci_dev *pci_dev, - struct ipa_api_controller *api_ctrl, - const struct of_device_id *pdrv_match) + const struct pci_device_id *ent) { int result; struct ipa3_plat_drv_res *ipa_drv_res; @@ -8938,13 +9263,29 @@ int ipa3_pci_drv_probe( struct device *dev; static struct platform_device platform_dev; - if (!pci_dev || !api_ctrl || !pdrv_match) { - IPAERR( - "Bad arg: pci_dev (%pK) and/or api_ctrl (%pK) and/or pdrv_match (%pK)\n", - pci_dev, api_ctrl, pdrv_match); + if (!pci_dev || !ent) { + pr_err( + "Bad arg: pci_dev (%pK) and/or ent (%pK)\n", + pci_dev, ent); return -EOPNOTSUPP; } + if (ipa3_ctx == NULL) { + IPAERR("ipa3_ctx was not initialized\n"); + return -EPROBE_DEFER; + } + + if (ipa3_ctx->ipa_hw_type == 0) { + /* Get IPA HW Version */ + result = of_property_read_u32(NULL, + "qcom,ipa-hw-ver", &ipa3_ctx->ipa_hw_type); + if (result || ipa3_ctx->ipa_hw_type == IPA_HW_None) { + pr_err("ipa: get resource failed for ipa-hw-ver!\n"); + return -ENODEV; + } + pr_debug("ipa: ipa_hw_type = %d\n", ipa3_ctx->ipa_hw_type); + } + dev = &(pci_dev->dev); IPADBG("IPA PCI driver probing started\n"); @@ -9041,14 +9382,6 @@ int ipa3_pci_drv_probe( IPADBG("emulator_intcntrlr_mem_size = 0x%x\n", ipa_drv_res->emulator_intcntrlr_mem_size); - result = ipa3_bind_api_controller(ipa_drv_res->ipa_hw_type, api_ctrl); - if (result != 0) { - IPAERR("ipa3_bind_api_controller() failed\n"); - pci_release_region(pci_dev, 0); - pci_disable_device(pci_dev); - return result; - } - bits = (ipa_drv_res->use_64_bit_dma_mask) ? 64 : 32; if (dma_set_mask(dev, DMA_BIT_MASK(bits)) != 0) { @@ -9114,6 +9447,37 @@ uint ipa3_get_emulation_type(void) return emulation_type; } +static int __init ipa_module_init(void) +{ + pr_debug("IPA module init\n"); + + ipa3_ctx = kzalloc(sizeof(*ipa3_ctx), GFP_KERNEL); + if (!ipa3_ctx) { + return -ENOMEM; + } + mutex_init(&ipa3_ctx->lock); + + if (running_emulation) { + /* Register as a PCI device driver */ + return pci_register_driver(&ipa_pci_driver); + } + /* Register as a platform device driver */ + return platform_driver_register(&ipa_plat_drv); +} +subsys_initcall(ipa_module_init); + +static void __exit ipa_module_exit(void) +{ + if (running_emulation) + pci_unregister_driver(&ipa_pci_driver); + platform_driver_unregister(&ipa_plat_drv); + kfree(ipa3_ctx); + ipa3_ctx = NULL; +} +module_exit(ipa_module_exit); + +MODULE_SOFTDEP("pre: subsys-pil-tz"); +MODULE_SOFTDEP("pre: qcom-arm-smmu-mod"); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("IPA HW device driver"); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c index f087bde382..fd8339c15c 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c @@ -479,6 +479,7 @@ void ipa3_register_client_callback(int (*client_cb)(bool is_lock), ipa3_ctx->get_teth_port_state[client] = teth_port_state; IPADBG("exit\n"); } +EXPORT_SYMBOL(ipa3_register_client_callback); void ipa3_deregister_client_callback(enum ipa_client_type client_type) { @@ -500,6 +501,7 @@ void ipa3_deregister_client_callback(enum ipa_client_type client_type) ipa3_ctx->get_teth_port_state[client_cb] = NULL; IPADBG("exit\n"); } +EXPORT_SYMBOL(ipa3_deregister_client_callback); static void client_lock_unlock_cb(enum ipa_client_type client, bool is_lock) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dma.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dma.c index 60e37aeac8..9685fa0876 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_dma.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dma.c @@ -29,9 +29,9 @@ do { \ pr_debug(IPADMA_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPADMA_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPADMA_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -39,7 +39,7 @@ do { \ pr_debug(IPADMA_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPADMA_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -47,9 +47,9 @@ do { \ pr_err(IPADMA_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPADMA_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPADMA_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index caeefbc382..a383097076 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -23,7 +23,6 @@ #include #include #include "ipa_qmi_service.h" -#include "ipa_api.h" #include "ipahal_reg.h" #include "ipahal.h" #include "ipahal_fltrt.h" @@ -2435,8 +2434,6 @@ int ipa3_request_gsi_channel(struct ipa_request_gsi_channel_params *params, int ipa3_release_gsi_channel(u32 clnt_hdl); -int ipa3_start_gsi_channel(u32 clnt_hdl); - int ipa3_stop_gsi_channel(u32 clnt_hdl); int ipa3_reset_gsi_channel(u32 clnt_hdl); @@ -2454,10 +2451,6 @@ int ipa3_xdci_connect(u32 clnt_hdl); int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id); void ipa3_xdci_ep_delay_rm(u32 clnt_hdl); -void ipa3_register_client_callback(int (*client_cb)(bool), - bool (*teth_port_state)(void), - enum ipa_client_type client_type); -void ipa3_deregister_client_callback(enum ipa_client_type client_type); int ipa3_set_reset_client_prod_pipe_delay(bool set_reset, enum ipa_client_type client); int ipa3_start_stop_client_prod_gsi_chnl(enum ipa_client_type client, @@ -2481,15 +2474,8 @@ int ipa3_clear_endpoint_delay(u32 clnt_hdl); /* * Configuration */ -int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); - int ipa3_cfg_ep_seq(u32 clnt_hdl, const struct ipa_ep_cfg_seq *seq_cfg); -int ipa3_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg); - -int ipa3_cfg_ep_conn_track(u32 clnt_hdl, - const struct ipa_ep_cfg_conn_track *ep_conn_track); - int ipa3_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg); int ipa3_cfg_ep_hdr_ext(u32 clnt_hdl, @@ -2523,15 +2509,10 @@ int ipa3_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl); * Header removal / addition */ - -int ipa3_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool by_user); - int ipa3_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user); int ipa3_commit_hdr(void); -int ipa3_reset_hdr(bool user_only); - int ipa3_get_hdr(struct ipa_ioc_get_hdr *lookup); int ipa3_put_hdr(u32 hdr_hdl); @@ -2541,10 +2522,6 @@ int ipa3_copy_hdr(struct ipa_ioc_copy_hdr *copy); /* * Header Processing Context */ -int ipa3_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs, - bool user_only); - -int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); int ipa3_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, bool by_user); @@ -2554,14 +2531,6 @@ int ipa3_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, */ int ipa3_add_rt_rule(struct ipa_ioc_add_rt_rule *rules); -int ipa3_add_rt_rule_v2(struct ipa_ioc_add_rt_rule_v2 *rules); - -int ipa3_add_rt_rule_usr(struct ipa_ioc_add_rt_rule *rules, - bool user_only); - -int ipa3_add_rt_rule_usr_v2(struct ipa_ioc_add_rt_rule_v2 *rules, - bool user_only); - int ipa3_add_rt_rule_ext(struct ipa_ioc_add_rt_rule_ext *rules); int ipa3_add_rt_rule_ext_v2(struct ipa_ioc_add_rt_rule_ext_v2 *rules); @@ -2571,12 +2540,6 @@ int ipa3_add_rt_rule_after(struct ipa_ioc_add_rt_rule_after *rules); int ipa3_add_rt_rule_after_v2(struct ipa_ioc_add_rt_rule_after_v2 *rules); -int ipa3_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls); - -int ipa3_commit_rt(enum ipa_ip_type ip); - -int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only); - int ipa3_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup); int ipa3_put_rt_tbl(u32 rt_tbl_hdl); @@ -2605,8 +2568,6 @@ int ipa3_add_flt_rule_after(struct ipa_ioc_add_flt_rule_after *rules); int ipa3_add_flt_rule_after_v2(struct ipa_ioc_add_flt_rule_after_v2 *rules); -int ipa3_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls); - int ipa3_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules); int ipa3_mdfy_flt_rule_v2(struct ipa_ioc_mdfy_flt_rule_v2 *rules); @@ -2626,18 +2587,6 @@ int ipa3_allocate_nat_table( struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); int ipa3_allocate_ipv6ct_table( struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc); - -int ipa3_nat_init_cmd(struct ipa_ioc_v4_nat_init *init); -int ipa3_ipv6ct_init_cmd(struct ipa_ioc_ipv6ct_init *init); - -int ipa3_table_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); -int ipa3_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); - -int ipa3_nat_del_cmd(struct ipa_ioc_v4_nat_del *del); -int ipa3_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del); -int ipa3_del_ipv6ct_table(struct ipa_ioc_nat_ipv6ct_table_del *del); - -int ipa3_nat_mdfy_pdn(struct ipa_ioc_nat_pdn_entry *mdfy_pdn); int ipa3_nat_get_sram_info(struct ipa_nat_in_sram_info *info_ptr); int ipa3_app_clk_vote(enum ipa_app_clock_vote_type vote_type); @@ -2692,15 +2641,6 @@ int ipa3_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl); int ipa3_teardown_sys_pipe(u32 clnt_hdl); -int ipa3_sys_setup(struct ipa_sys_connect_params *sys_in, - unsigned long *ipa_transport_hdl, - u32 *ipa_pipe_num, u32 *clnt_hdl, bool en_status); - -int ipa3_sys_teardown(u32 clnt_hdl); - -int ipa3_sys_update_gsi_hdls(u32 clnt_hdl, unsigned long gsi_ch_hdl, - unsigned long gsi_ev_hdl); - int ipa3_connect_wdi_pipe(struct ipa_wdi_in_params *in, struct ipa_wdi_out_params *out); int ipa3_connect_gsi_wdi_pipe(struct ipa_wdi_in_params *in, @@ -2715,53 +2655,13 @@ int ipa3_disconnect_gsi_wdi_pipe(u32 clnt_hdl); int ipa3_resume_wdi_pipe(u32 clnt_hdl); int ipa3_resume_gsi_wdi_pipe(u32 clnt_hdl); int ipa3_suspend_wdi_pipe(u32 clnt_hdl); -void ipa3_get_gsi_stats(int prot_id, - struct ipa_uc_dbg_ring_stats *stats); int ipa3_get_wdi_gsi_stats(struct ipa_uc_dbg_ring_stats *stats); int ipa3_get_wdi3_gsi_stats(struct ipa_uc_dbg_ring_stats *stats); int ipa3_get_usb_gsi_stats(struct ipa_uc_dbg_ring_stats *stats); int ipa3_get_aqc_gsi_stats(struct ipa_uc_dbg_ring_stats *stats); int ipa3_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats); -int ipa3_get_prot_id(enum ipa_client_type client); u16 ipa3_get_smem_restr_bytes(void); int ipa3_broadcast_wdi_quota_reach_ind(uint32_t fid, uint64_t num_bytes); -int ipa3_setup_uc_ntn_pipes(struct ipa_ntn_conn_in_params *in, - ipa_notify_cb notify, void *priv, u8 hdr_len, - struct ipa_ntn_conn_out_params *outp); -int ipa3_tear_down_uc_offload_pipes(int ipa_ep_idx_ul, int ipa_ep_idx_dl, - struct ipa_ntn_conn_in_params *params); -int ipa3_ntn_uc_reg_rdyCB(void (*ipauc_ready_cb)(void *), void *priv); -void ipa3_ntn_uc_dereg_rdyCB(void); -int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in, - struct ipa_wdi_conn_out_params *out, - ipa_wdi_meter_notifier_cb wdi_notify); -int ipa3_disconn_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); -int ipa3_enable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); -int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx); - -int ipa3_conn_wigig_rx_pipe_i(void *in, - struct ipa_wigig_conn_out_params *out, - struct dentry **parent); - -int ipa3_conn_wigig_client_i(void *in, - struct ipa_wigig_conn_out_params *out, - ipa_notify_cb tx_notify, - void *priv); - -int ipa3_wigig_uc_msi_init(bool init, - phys_addr_t periph_baddr_pa, - phys_addr_t pseudo_cause_pa, - phys_addr_t int_gen_tx_pa, - phys_addr_t int_gen_rx_pa, - phys_addr_t dma_ep_misc_pa); - -int ipa3_disconn_wigig_pipe_i(enum ipa_client_type client, - struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu, - void *dbuff); - -int ipa3_enable_wigig_pipe_i(enum ipa_client_type client); - -int ipa3_disable_wigig_pipe_i(enum ipa_client_type client); int ipa3_wigig_init_debugfs_i(struct dentry *dent); @@ -2795,22 +2695,12 @@ void ipa3_release_wdi3_gsi_smmu_mappings(u8 dir); /* * Tethering bridge (Rmnet / MBIM) */ -int ipa3_teth_bridge_init(struct teth_bridge_init_params *params); - -int ipa3_teth_bridge_disconnect(enum ipa_client_type client); - -int ipa3_teth_bridge_connect(struct teth_bridge_connect_params *connect_params); int ipa3_teth_bridge_get_pm_hdl(void); /* * Tethering client info */ -void ipa3_set_client(int index, enum ipacm_client_enum client, bool uplink); - -enum ipacm_client_enum ipa3_get_client(int pipe_idx); - -bool ipa3_get_client_uplink(int pipe_idx); int ipa3_get_wlan_stats(struct ipa_get_wdi_sap_stats *wdi_sap_stats); @@ -2840,32 +2730,9 @@ void ipa3_dma_destroy(void); * MHI */ -int ipa3_mhi_init_engine(struct ipa_mhi_init_engine *params); - -int ipa3_connect_mhi_pipe( - struct ipa_mhi_connect_params_internal *in, - u32 *clnt_hdl); - -int ipa3_disconnect_mhi_pipe(u32 clnt_hdl); - -bool ipa3_mhi_stop_gsi_channel(enum ipa_client_type client); - -int ipa3_mhi_reset_channel_internal(enum ipa_client_type client); - -int ipa3_mhi_start_channel_internal(enum ipa_client_type client); - -bool ipa3_has_open_aggr_frame(enum ipa_client_type client); - -int ipa3_mhi_resume_channels_internal(enum ipa_client_type client, - bool LPTransitionRejected, bool brstmode_enabled, - union __packed gsi_channel_scratch ch_scratch, u8 index); - -int ipa3_mhi_destroy_channel(enum ipa_client_type client); - /* * mux id */ -int ipa3_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); /* * interrupts @@ -2875,8 +2742,6 @@ int ipa3_add_interrupt_handler(enum ipa_irq_type interrupt, bool deferred_flag, void *private_data); -int ipa3_remove_interrupt_handler(enum ipa_irq_type interrupt); - /* * Miscellaneous */ @@ -2904,9 +2769,6 @@ bool ipa3_get_modem_cfg_emb_pipe_flt(void); u8 ipa3_get_qmb_master_sel(enum ipa_client_type client); -int ipa3_get_smmu_params(struct ipa_smmu_in_params *in, - struct ipa_smmu_out_params *out); - bool ipa3_get_lan_rx_napi(void); bool ipa3_get_qmap_pipe_enable(void); @@ -2915,9 +2777,6 @@ bool ipa3_get_qmap_pipe_enable(void); u8 ipa3_get_hw_type_index(void); -int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type, - struct ipa_api_controller *api_ctrl); - bool ipa_is_modem_pipe(int pipe_idx); int ipa3_send_one(struct ipa3_sys_context *sys, struct ipa3_desc *desc, @@ -2957,10 +2816,8 @@ int ipa3_straddle_boundary(u32 start, u32 end, u32 boundary); struct ipa3_context *ipa3_get_ctx(void); void ipa3_enable_clks(void); void ipa3_disable_clks(void); -void ipa3_inc_client_enable_clks(struct ipa_active_client_logging_info *id); int ipa3_inc_client_enable_clks_no_block(struct ipa_active_client_logging_info *id); -void ipa3_dec_client_disable_clks(struct ipa_active_client_logging_info *id); void ipa3_dec_client_disable_clks_no_block( struct ipa_active_client_logging_info *id); void ipa3_active_clients_log_dec(struct ipa_active_client_logging_info *id, @@ -3030,15 +2887,9 @@ int ipa3_enable_force_clear(u32 request_id, bool throttle_source, u32 source_pipe_bitmask); int ipa3_disable_force_clear(u32 request_id); -int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage, - u32 bandwidth_mbps); - int ipa3_cfg_ep_status(u32 clnt_hdl, const struct ipahal_reg_ep_cfg_status *ipa_ep_cfg); -int ipa3_suspend_resource_no_block(enum ipa_rm_resource_name name); -int ipa3_suspend_resource_sync(enum ipa_rm_resource_name name); -int ipa3_resume_resource(enum ipa_rm_resource_name name); bool ipa3_should_pipe_be_suspended(enum ipa_client_type client); int ipa3_tag_aggr_force_close(int pipe_num); @@ -3057,12 +2908,9 @@ void ipa3_update_ssr_state(bool is_ssr); int ipa3_init_q6_smem(void); int ipa3_mhi_handle_ipa_config_req(struct ipa_config_req_msg_v01 *config_req); -int ipa3_mhi_query_ch_info(enum ipa_client_type client, - struct gsi_chan_info *ch_info); int ipa3_uc_interface_init(void); int ipa3_uc_is_gsi_channel_empty(enum ipa_client_type ipa_client); -int ipa3_uc_state_check(void); int ipa3_uc_loaded_check(void); int ipa3_uc_holb_enabled_check(void); int ipa3_uc_register_ready_cb(struct notifier_block *nb); @@ -3079,24 +2927,11 @@ void ipa3_dma_async_memcpy_notify_cb(void *priv, int ipa3_uc_update_hw_flags(u32 flags); -int ipa3_uc_mhi_init(void (*ready_cb)(void), void (*wakeup_request_cb)(void)); -void ipa3_uc_mhi_cleanup(void); -int ipa3_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t *cmd); -int ipa3_uc_mhi_init_engine(struct ipa_mhi_msi_info *msi, u32 mmio_addr, - u32 host_ctrl_addr, u32 host_data_addr, u32 first_ch_idx, - u32 first_evt_idx); int ipa3_uc_mhi_init_channel(int ipa_ep_idx, int channelHandle, int contexArrayIndex, int channelDirection); -int ipa3_uc_mhi_reset_channel(int channelHandle); -int ipa3_uc_mhi_suspend_channel(int channelHandle); int ipa3_uc_mhi_resume_channel(int channelHandle, bool LPTransitionRejected); -int ipa3_uc_mhi_stop_event_update_channel(int channelHandle); -int ipa3_uc_mhi_print_stats(char *dbg_buff, int size); int ipa3_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len); int ipa3_uc_send_remote_ipa_info(u32 remote_addr, uint32_t mbox_n); -int ipa3_uc_debug_stats_alloc( - struct IpaHwOffloadStatsAllocCmdData_t cmdinfo); -int ipa3_uc_debug_stats_dealloc(uint32_t protocol); int ipa3_uc_quota_monitor(uint64_t quota); int ipa3_uc_enable_holb_monitor(uint32_t polling_period); int ipa3_uc_add_holb_monitor(uint16_t gsi_ch, uint32_t action_mask, @@ -3105,17 +2940,11 @@ int ipa3_uc_del_holb_monitor(uint16_t gsi_ch, uint8_t ee); int ipa3_uc_disable_holb_monitor(void); int ipa3_uc_bw_monitor(struct ipa_wdi_bw_info *info); int ipa3_uc_setup_event_ring(void); -int ipa3_set_wlan_tx_info(struct ipa_wdi_tx_info *info); -int ipa3_uc_debug_stats_dealloc(uint32_t prot_id); void ipa3_tag_destroy_imm(void *user1, int user2); const struct ipa_gsi_ep_config *ipa3_get_gsi_ep_info (enum ipa_client_type client); int ipa3_wigig_init_i(void); -int ipa3_wigig_internal_init( - struct ipa_wdi_uc_ready_params *inout, - ipa_wigig_misc_int_cb int_notify, - phys_addr_t *uc_db_pa); /* Hardware stats */ @@ -3227,7 +3056,6 @@ int ipa3_teardown_apps_low_lat_pipes(void); void ipa3_rmnet_ctl_ready_notifier(void); const char *ipa_hw_error_str(enum ipa3_hw_errors err_type); int ipa_gsi_ch20_wa(void); -int ipa3_rx_poll(u32 clnt_hdl, int budget); int ipa3_lan_rx_poll(u32 clnt_hdl, int weight); int ipa3_smmu_map_peer_reg(phys_addr_t phys_addr, bool map, enum ipa_smmu_cb_type cb_type); @@ -3237,7 +3065,6 @@ void ipa3_reset_freeze_vote(void); int ipa3_ntn_init(void); int ipa3_get_ntn_stats(struct Ipa3HwStatsNTNInfoData_t *stats); struct dentry *ipa_debugfs_get_root(void); -struct device *ipa3_get_pdev(void); void ipa3_enable_dcd(void); void ipa3_disable_prefetch(enum ipa_client_type client); int ipa3_alloc_common_event_ring(void); @@ -3247,7 +3074,6 @@ int ipa3_allocate_coal_close_frame(void); void ipa3_free_coal_close_frame(void); int ipa3_set_clock_plan_from_pm(int idx); void __ipa_gsi_irq_rx_scedule_poll(struct ipa3_sys_context *sys); -int ipa3_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs); void ipa3_init_imm_cmd_desc(struct ipa3_desc *desc, struct ipahal_imm_cmd_pyld *cmd_pyld); int ipa3_is_vlan_mode(enum ipa_vlan_ifaces iface, bool *res); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c index 59844bf451..a14f0a5956 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c @@ -23,9 +23,9 @@ do { \ pr_debug(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,7 +33,7 @@ do { \ pr_debug(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -42,9 +42,9 @@ do { \ pr_err(IPA_MHI_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MHI_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -99,6 +99,7 @@ bool ipa3_mhi_stop_gsi_channel(enum ipa_client_type client) return false; } +EXPORT_SYMBOL(ipa3_mhi_stop_gsi_channel); static int ipa3_mhi_reset_gsi_channel(enum ipa_client_type client) { @@ -143,6 +144,7 @@ int ipa3_mhi_reset_channel_internal(enum ipa_client_type client) return 0; } +EXPORT_SYMBOL(ipa3_mhi_reset_channel_internal); int ipa3_mhi_start_channel_internal(enum ipa_client_type client) { @@ -473,6 +475,7 @@ int ipa3_mhi_init_engine(struct ipa_mhi_init_engine *params) fail_init_engine: return res; } +EXPORT_SYMBOL(ipa3_mhi_init_engine); /** * ipa3_connect_mhi_pipe() - Connect pipe to IPA and start corresponding @@ -546,6 +549,7 @@ fail_start_channel: memset(ep, 0, offsetof(struct ipa3_ep_context, sys)); return -EPERM; } +EXPORT_SYMBOL(ipa3_connect_mhi_pipe); /** * ipa3_disconnect_mhi_pipe() - Disconnect pipe from IPA and reset corresponding @@ -612,6 +616,7 @@ int ipa3_disconnect_mhi_pipe(u32 clnt_hdl) fail_reset_channel: return res; } +EXPORT_SYMBOL(ipa3_disconnect_mhi_pipe); int ipa3_mhi_resume_channels_internal(enum ipa_client_type client, bool LPTransitionRejected, bool brstmode_enabled, @@ -683,6 +688,7 @@ int ipa3_mhi_resume_channels_internal(enum ipa_client_type client, IPA_MHI_FUNC_EXIT(); return 0; } +EXPORT_SYMBOL(ipa3_mhi_resume_channels_internal); int ipa3_mhi_query_ch_info(enum ipa_client_type client, struct gsi_chan_info *ch_info) @@ -708,6 +714,7 @@ int ipa3_mhi_query_ch_info(enum ipa_client_type client, IPA_MHI_FUNC_EXIT(); return 0; } +EXPORT_SYMBOL(ipa3_mhi_query_ch_info); bool ipa3_has_open_aggr_frame(enum ipa_client_type client) { @@ -728,6 +735,7 @@ bool ipa3_has_open_aggr_frame(enum ipa_client_type client) return false; } +EXPORT_SYMBOL(ipa3_has_open_aggr_frame); int ipa3_mhi_destroy_channel(enum ipa_client_type client) { @@ -771,6 +779,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_EP(client); return res; } +EXPORT_SYMBOL(ipa3_mhi_destroy_channel); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("IPA MHI driver"); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c index 4b5bb58f25..c71f443946 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c @@ -19,9 +19,9 @@ do { \ pr_debug(IMP_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IMP_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IMP_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -29,7 +29,7 @@ do { \ pr_debug(IMP_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IMP_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -38,9 +38,9 @@ do { \ pr_err(IMP_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IMP_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IMP_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c index e1732bc9ac..b9d4619f3d 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c @@ -23,9 +23,9 @@ do { \ pr_debug(IPA_MPM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MPM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MPM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,7 +33,7 @@ do { \ pr_debug(IPA_MPM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MPM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -42,9 +42,9 @@ do { \ pr_err(IPA_MPM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_MPM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_MPM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -3003,7 +3003,7 @@ static int ipa_mpm_populate_smmu_info(struct platform_device *pdev) /* get IPA SMMU enabled status */ smmu_in.smmu_client = IPA_SMMU_AP_CLIENT; - if (ipa_get_smmu_params(&smmu_in, &smmu_out)) + if (ipa3_get_smmu_params(&smmu_in, &smmu_out)) ipa_mpm_ctx->dev_info.ipa_smmu_enabled = false; else ipa_mpm_ctx->dev_info.ipa_smmu_enabled = diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c index 4ce38b9865..d7866fcceb 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c @@ -14,25 +14,25 @@ do { \ pr_debug(IPA_PM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_PM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_PM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) #define IPA_PM_DBG_LOW(fmt, args...) \ do { \ pr_debug(IPA_PM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_PM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) #define IPA_PM_ERR(fmt, args...) \ do { \ pr_err(IPA_PM_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_PM_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_PM_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) #define IPA_PM_DBG_STATE(hdl, name, state) \ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c index c3711b7134..a99cd9f3bd 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c @@ -1258,6 +1258,7 @@ int ipa3_qmi_enable_force_clear_datapath_send( resp.resp.result, resp.resp.error, "ipa_enable_force_clear_datapath"); } +EXPORT_SYMBOL(ipa3_qmi_enable_force_clear_datapath_send); int ipa3_qmi_disable_force_clear_datapath_send( struct ipa_disable_force_clear_datapath_req_msg_v01 *req) @@ -1315,6 +1316,7 @@ int ipa3_qmi_disable_force_clear_datapath_send( resp.resp.result, resp.resp.error, "ipa_disable_force_clear_datapath"); } +EXPORT_SYMBOL(ipa3_qmi_disable_force_clear_datapath_send); /* sending filter-installed-notify-request to modem*/ int ipa3_qmi_filter_notify_send( diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h index f5b491a12d..0bb30194c1 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h @@ -30,9 +30,9 @@ do { \ pr_debug(DEV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ DEV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ DEV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -41,7 +41,7 @@ do { \ pr_debug(DEV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ DEV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -49,9 +49,9 @@ do { \ pr_err(DEV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ DEV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ DEV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -59,9 +59,9 @@ do { \ pr_err_ratelimited_ipa(DEV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ DEV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ DEV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -69,9 +69,9 @@ do { \ pr_info(DEV_NAME " %s:%d " fmt, __func__,\ __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ DEV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ DEV_NAME " %s:%d " fmt, ## args); \ } while (0) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c index 589390e0a8..f68246c851 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c @@ -617,6 +617,7 @@ int ipa3_uc_state_check(void) return 0; } +EXPORT_SYMBOL(ipa3_uc_state_check); /** * ipa3_uc_loaded_check() - Check the uC has been loaded @@ -1761,6 +1762,7 @@ int ipa3_set_wlan_tx_info(struct ipa_wdi_tx_info *info) return 0; } +EXPORT_SYMBOL(ipa3_set_wlan_tx_info); int ipa3_uc_send_enable_flow_control(uint16_t gsi_chid, uint16_t redMarkerThreshold) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_ntn.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_ntn.c index 461f792246..3adf6e11b8 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_ntn.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_ntn.c @@ -136,12 +136,14 @@ int ipa3_ntn_uc_reg_rdyCB(void (*ipa_ready_cb)(void *), void *user_data) return -EEXIST; } +EXPORT_SYMBOL(ipa3_ntn_uc_reg_rdyCB); void ipa3_ntn_uc_dereg_rdyCB(void) { ipa3_ctx->uc_ntn_ctx.uc_ready_cb = NULL; ipa3_ctx->uc_ntn_ctx.priv = NULL; } +EXPORT_SYMBOL(ipa3_ntn_uc_dereg_rdyCB); static void ipa3_uc_ntn_loaded_handler(void) { @@ -522,6 +524,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_setup_uc_ntn_pipes); /** * ipa3_tear_down_uc_offload_pipes() - tear down uc offload pipes @@ -633,3 +636,4 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_tear_down_uc_offload_pipes); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c index b815566746..2e7bc1d96d 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c @@ -3549,6 +3549,186 @@ static struct ipa3_mem_partition ipa_4_9_mem_part = { .end_ofst = 0x4850, }; + + +const char *ipa_clients_strings[IPA_CLIENT_MAX] = { + __stringify(IPA_CLIENT_HSIC1_PROD), + __stringify(IPA_CLIENT_HSIC1_CONS), + __stringify(IPA_CLIENT_HSIC2_PROD), + __stringify(IPA_CLIENT_HSIC2_CONS), + __stringify(IPA_CLIENT_HSIC3_PROD), + __stringify(IPA_CLIENT_HSIC3_CONS), + __stringify(IPA_CLIENT_HSIC4_PROD), + __stringify(IPA_CLIENT_HSIC4_CONS), + __stringify(IPA_CLIENT_HSIC5_PROD), + __stringify(IPA_CLIENT_HSIC5_CONS), + __stringify(IPA_CLIENT_WLAN1_PROD), + __stringify(IPA_CLIENT_WLAN1_CONS), + __stringify(IPA_CLIENT_WLAN2_PROD), + __stringify(IPA_CLIENT_WLAN2_CONS), + __stringify(RESERVED_PROD_14), + __stringify(IPA_CLIENT_WLAN3_CONS), + __stringify(RESERVED_PROD_16), + __stringify(IPA_CLIENT_WLAN4_CONS), + __stringify(IPA_CLIENT_USB_PROD), + __stringify(IPA_CLIENT_USB_CONS), + __stringify(IPA_CLIENT_USB2_PROD), + __stringify(IPA_CLIENT_USB2_CONS), + __stringify(IPA_CLIENT_USB3_PROD), + __stringify(IPA_CLIENT_USB3_CONS), + __stringify(IPA_CLIENT_USB4_PROD), + __stringify(IPA_CLIENT_USB4_CONS), + __stringify(IPA_CLIENT_UC_USB_PROD), + __stringify(IPA_CLIENT_USB_DPL_CONS), + __stringify(IPA_CLIENT_A2_EMBEDDED_PROD), + __stringify(IPA_CLIENT_A2_EMBEDDED_CONS), + __stringify(IPA_CLIENT_A2_TETHERED_PROD), + __stringify(IPA_CLIENT_A2_TETHERED_CONS), + __stringify(IPA_CLIENT_APPS_LAN_PROD), + __stringify(IPA_CLIENT_APPS_LAN_CONS), + __stringify(IPA_CLIENT_APPS_WAN_PROD), + __stringify(IPA_CLIENT_APPS_WAN_CONS), + __stringify(IPA_CLIENT_APPS_CMD_PROD), + __stringify(IPA_CLIENT_A5_LAN_WAN_CONS), + __stringify(IPA_CLIENT_ODU_PROD), + __stringify(IPA_CLIENT_ODU_EMB_CONS), + __stringify(RESERVED_PROD_40), + __stringify(IPA_CLIENT_ODU_TETH_CONS), + __stringify(IPA_CLIENT_MHI_PROD), + __stringify(IPA_CLIENT_MHI_CONS), + __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_PROD), + __stringify(IPA_CLIENT_MEMCPY_DMA_SYNC_CONS), + __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD), + __stringify(IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS), + __stringify(IPA_CLIENT_ETHERNET_PROD), + __stringify(IPA_CLIENT_ETHERNET_CONS), + __stringify(IPA_CLIENT_Q6_LAN_PROD), + __stringify(IPA_CLIENT_Q6_LAN_CONS), + __stringify(IPA_CLIENT_Q6_WAN_PROD), + __stringify(IPA_CLIENT_Q6_WAN_CONS), + __stringify(IPA_CLIENT_Q6_CMD_PROD), + __stringify(IPA_CLIENT_Q6_DUN_CONS), + __stringify(IPA_CLIENT_Q6_DECOMP_PROD), + __stringify(IPA_CLIENT_Q6_DECOMP_CONS), + __stringify(IPA_CLIENT_Q6_DECOMP2_PROD), + __stringify(IPA_CLIENT_Q6_DECOMP2_CONS), + __stringify(RESERVED_PROD_60), + __stringify(IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS), + __stringify(IPA_CLIENT_TEST_PROD), + __stringify(IPA_CLIENT_TEST_CONS), + __stringify(IPA_CLIENT_TEST1_PROD), + __stringify(IPA_CLIENT_TEST1_CONS), + __stringify(IPA_CLIENT_TEST2_PROD), + __stringify(IPA_CLIENT_TEST2_CONS), + __stringify(IPA_CLIENT_TEST3_PROD), + __stringify(IPA_CLIENT_TEST3_CONS), + __stringify(IPA_CLIENT_TEST4_PROD), + __stringify(IPA_CLIENT_TEST4_CONS), + __stringify(RESERVED_PROD_72), + __stringify(IPA_CLIENT_DUMMY_CONS), + __stringify(IPA_CLIENT_Q6_DL_NLO_DATA_PROD), + __stringify(IPA_CLIENT_Q6_UL_NLO_DATA_CONS), + __stringify(RESERVED_PROD_76), + __stringify(IPA_CLIENT_Q6_UL_NLO_ACK_CONS), + __stringify(RESERVED_PROD_78), + __stringify(IPA_CLIENT_Q6_QBAP_STATUS_CONS), + __stringify(RESERVED_PROD_80), + __stringify(IPA_CLIENT_MHI_DPL_CONS), + __stringify(RESERVED_PROD_82), + __stringify(IPA_CLIENT_ODL_DPL_CONS), + __stringify(IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD), + __stringify(IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS), + __stringify(IPA_CLIENT_WIGIG_PROD), + __stringify(IPA_CLIENT_WIGIG1_CONS), + __stringify(RESERVERD_PROD_88), + __stringify(IPA_CLIENT_WIGIG2_CONS), + __stringify(RESERVERD_PROD_90), + __stringify(IPA_CLIENT_WIGIG3_CONS), + __stringify(RESERVERD_PROD_92), + __stringify(IPA_CLIENT_WIGIG4_CONS), + __stringify(RESERVERD_PROD_94), + __stringify(IPA_CLIENT_APPS_WAN_COAL_CONS), + __stringify(IPA_CLIENT_MHI_PRIME_RMNET_PROD), + __stringify(IPA_CLIENT_MHI_PRIME_RMNET_CONS), + __stringify(IPA_CLIENT_MHI_PRIME_TETH_PROD), + __stringify(IPA_CLIENT_MHI_PRIME_TETH_CONS), + __stringify(IPA_CLIENT_MHI_PRIME_DPL_PROD), + __stringify(RESERVERD_CONS_101), + __stringify(IPA_CLIENT_AQC_ETHERNET_PROD), + __stringify(IPA_CLIENT_AQC_ETHERNET_CONS), + __stringify(IPA_CLIENT_APPS_WAN_LOW_LAT_PROD), + __stringify(IPA_CLIENT_APPS_WAN_LOW_LAT_CONS), +}; +EXPORT_SYMBOL(ipa_clients_strings); + +/** + * ipa_get_version_string() - Get string representation of IPA version + * @ver: IPA version + * + * Return: Constant string representation + */ +const char *ipa_get_version_string(enum ipa_hw_type ver) +{ + const char *str; + + switch (ver) { + case IPA_HW_v1_0: + str = "1.0"; + break; + case IPA_HW_v1_1: + str = "1.1"; + break; + case IPA_HW_v2_0: + str = "2.0"; + break; + case IPA_HW_v2_1: + str = "2.1"; + break; + case IPA_HW_v2_5: + str = "2.5/2.6"; + break; + case IPA_HW_v2_6L: + str = "2.6L"; + break; + case IPA_HW_v3_0: + str = "3.0"; + break; + case IPA_HW_v3_1: + str = "3.1"; + break; + case IPA_HW_v3_5: + str = "3.5"; + break; + case IPA_HW_v3_5_1: + str = "3.5.1"; + break; + case IPA_HW_v4_0: + str = "4.0"; + break; + case IPA_HW_v4_1: + str = "4.1"; + break; + case IPA_HW_v4_2: + str = "4.2"; + break; + case IPA_HW_v4_5: + str = "4.5"; + break; + case IPA_HW_v4_7: + str = "4.7"; + break; + case IPA_HW_v4_9: + str = "4.9"; + break; + default: + str = "Invalid version"; + break; + } + + return str; +} +EXPORT_SYMBOL(ipa_get_version_string); + /** * ipa3_get_clients_from_rm_resource() - get IPA clients which are related to an * IPA_RM resource @@ -4519,6 +4699,7 @@ enum ipacm_client_enum ipa3_get_client(int pipe_idx) return ipa3_ctx->ipacm_client[pipe_idx].client_enum; } } +EXPORT_SYMBOL(ipa3_get_client); /** * ipa2_get_client_uplink() - provide client mapping @@ -4775,6 +4956,7 @@ int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg) return 0; } +EXPORT_SYMBOL(ipa3_cfg_ep); static const char *ipa3_get_nat_en_str(enum ipa_nat_en_type nat_en) { @@ -5614,6 +5796,7 @@ success: ep_holb->tmr_val); return 0; } +EXPORT_SYMBOL(ipa3_cfg_ep_holb); /** * ipa3_cfg_ep_holb_by_client() - IPA end-point holb configuration @@ -7135,31 +7318,34 @@ int ipa3_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count) return res; } -static void *ipa3_get_ipc_logbuf(void) +void *ipa3_get_ipc_logbuf(void) { if (ipa3_ctx) return ipa3_ctx->logbuf; return NULL; } +EXPORT_SYMBOL(ipa3_get_ipc_logbuf); -static void *ipa3_get_ipc_logbuf_low(void) +void *ipa3_get_ipc_logbuf_low(void) { if (ipa3_ctx) return ipa3_ctx->logbuf_low; return NULL; } +EXPORT_SYMBOL(ipa3_get_ipc_logbuf_low); -static void ipa3_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb) +void ipa3_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb) { *holb = ipa3_ctx->ep[ep_idx].holb; } -static void ipa3_set_tag_process_before_gating(bool val) +void ipa3_set_tag_process_before_gating(bool val) { ipa3_ctx->tag_process_before_gating = val; } +EXPORT_SYMBOL(ipa3_set_tag_process_before_gating); /** * ipa3_is_vlan_mode - check if a LAN driver should load in VLAN mode @@ -7193,152 +7379,6 @@ int ipa3_is_vlan_mode(enum ipa_vlan_ifaces iface, bool *res) return 0; } -int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type, - struct ipa_api_controller *api_ctrl) -{ - if (ipa_hw_type < IPA_HW_v3_0) { - IPAERR("Unsupported IPA HW version %d\n", ipa_hw_type); - WARN_ON(1); - return -EPERM; - } - - api_ctrl->ipa_cfg_ep = ipa3_cfg_ep; - api_ctrl->ipa_cfg_ep_nat = ipa3_cfg_ep_nat; - api_ctrl->ipa_cfg_ep_conn_track = ipa3_cfg_ep_conn_track; - api_ctrl->ipa_cfg_ep_hdr = ipa3_cfg_ep_hdr; - api_ctrl->ipa_cfg_ep_hdr_ext = ipa3_cfg_ep_hdr_ext; - api_ctrl->ipa_cfg_ep_mode = ipa3_cfg_ep_mode; - api_ctrl->ipa_cfg_ep_aggr = ipa3_cfg_ep_aggr; - api_ctrl->ipa_cfg_ep_deaggr = ipa3_cfg_ep_deaggr; - api_ctrl->ipa_cfg_ep_route = ipa3_cfg_ep_route; - api_ctrl->ipa_cfg_ep_holb = ipa3_cfg_ep_holb; - api_ctrl->ipa_get_holb = ipa3_get_holb; - api_ctrl->ipa_set_tag_process_before_gating = - ipa3_set_tag_process_before_gating; - api_ctrl->ipa_cfg_ep_cfg = ipa3_cfg_ep_cfg; - api_ctrl->ipa_cfg_ep_metadata_mask = ipa3_cfg_ep_metadata_mask; - api_ctrl->ipa_cfg_ep_holb_by_client = ipa3_cfg_ep_holb_by_client; - api_ctrl->ipa_add_hdr_usr = ipa3_add_hdr_usr; - api_ctrl->ipa_reset_hdr = ipa3_reset_hdr; - api_ctrl->ipa_add_hdr_proc_ctx = ipa3_add_hdr_proc_ctx; - api_ctrl->ipa_del_hdr_proc_ctx = ipa3_del_hdr_proc_ctx; - api_ctrl->ipa_add_rt_rule_v2 = ipa3_add_rt_rule_v2; - api_ctrl->ipa_add_rt_rule_usr = ipa3_add_rt_rule_usr; - api_ctrl->ipa_add_rt_rule_usr_v2 = ipa3_add_rt_rule_usr_v2; - api_ctrl->ipa_del_rt_rule = ipa3_del_rt_rule; - api_ctrl->ipa_commit_rt = ipa3_commit_rt; - api_ctrl->ipa_reset_rt = ipa3_reset_rt; - api_ctrl->ipa_get_rt_tbl = ipa3_get_rt_tbl; - api_ctrl->ipa_query_rt_index = ipa3_query_rt_index; - api_ctrl->ipa_mdfy_rt_rule = ipa3_mdfy_rt_rule; - api_ctrl->ipa_mdfy_rt_rule_v2 = ipa3_mdfy_rt_rule_v2; - api_ctrl->ipa_add_flt_rule = ipa3_add_flt_rule; - api_ctrl->ipa_add_flt_rule_v2 = ipa3_add_flt_rule_v2; - api_ctrl->ipa_add_flt_rule_usr = ipa3_add_flt_rule_usr; - api_ctrl->ipa_add_flt_rule_usr_v2 = ipa3_add_flt_rule_usr_v2; - api_ctrl->ipa_del_flt_rule = ipa3_del_flt_rule; - api_ctrl->ipa_mdfy_flt_rule = ipa3_mdfy_flt_rule; - api_ctrl->ipa_mdfy_flt_rule_v2 = ipa3_mdfy_flt_rule_v2; - api_ctrl->ipa_commit_flt = ipa3_commit_flt; - api_ctrl->ipa_reset_flt = ipa3_reset_flt; - api_ctrl->ipa_allocate_nat_device = ipa3_allocate_nat_device; - api_ctrl->ipa_allocate_nat_table = ipa3_allocate_nat_table; - api_ctrl->ipa_allocate_ipv6ct_table = ipa3_allocate_ipv6ct_table; - api_ctrl->ipa_nat_init_cmd = ipa3_nat_init_cmd; - api_ctrl->ipa_ipv6ct_init_cmd = ipa3_ipv6ct_init_cmd; - api_ctrl->ipa_nat_dma_cmd = ipa3_nat_dma_cmd; - api_ctrl->ipa_table_dma_cmd = ipa3_table_dma_cmd; - api_ctrl->ipa_nat_del_cmd = ipa3_nat_del_cmd; - api_ctrl->ipa_del_nat_table = ipa3_del_nat_table; - api_ctrl->ipa_del_ipv6ct_table = ipa3_del_ipv6ct_table; - api_ctrl->ipa_nat_mdfy_pdn = ipa3_nat_mdfy_pdn; - api_ctrl->ipa_sys_setup = ipa3_sys_setup; - api_ctrl->ipa_sys_teardown = ipa3_sys_teardown; - api_ctrl->ipa_sys_update_gsi_hdls = ipa3_sys_update_gsi_hdls; - api_ctrl->ipa_set_wlan_tx_info = ipa3_set_wlan_tx_info; - api_ctrl->teth_bridge_init = ipa3_teth_bridge_init; - api_ctrl->teth_bridge_disconnect = ipa3_teth_bridge_disconnect; - api_ctrl->teth_bridge_connect = ipa3_teth_bridge_connect; - api_ctrl->ipa_set_client = ipa3_set_client; - api_ctrl->ipa_get_client = ipa3_get_client; - api_ctrl->ipa_get_client_uplink = ipa3_get_client_uplink; - api_ctrl->ipa_mhi_init_engine = ipa3_mhi_init_engine; - api_ctrl->ipa_connect_mhi_pipe = ipa3_connect_mhi_pipe; - api_ctrl->ipa_disconnect_mhi_pipe = ipa3_disconnect_mhi_pipe; - api_ctrl->ipa_mhi_stop_gsi_channel = ipa3_mhi_stop_gsi_channel; - api_ctrl->ipa_uc_mhi_reset_channel = ipa3_uc_mhi_reset_channel; - api_ctrl->ipa_qmi_enable_force_clear_datapath_send = - ipa3_qmi_enable_force_clear_datapath_send; - api_ctrl->ipa_qmi_disable_force_clear_datapath_send = - ipa3_qmi_disable_force_clear_datapath_send; - api_ctrl->ipa_mhi_reset_channel_internal = - ipa3_mhi_reset_channel_internal; - api_ctrl->ipa_mhi_start_channel_internal = - ipa3_mhi_start_channel_internal; - api_ctrl->ipa_mhi_query_ch_info = ipa3_mhi_query_ch_info; - api_ctrl->ipa_mhi_resume_channels_internal = - ipa3_mhi_resume_channels_internal; - api_ctrl->ipa_has_open_aggr_frame = ipa3_has_open_aggr_frame; - api_ctrl->ipa_mhi_destroy_channel = ipa3_mhi_destroy_channel; - api_ctrl->ipa_uc_mhi_send_dl_ul_sync_info = - ipa3_uc_mhi_send_dl_ul_sync_info; - api_ctrl->ipa_uc_mhi_init = ipa3_uc_mhi_init; - api_ctrl->ipa_uc_mhi_suspend_channel = ipa3_uc_mhi_suspend_channel; - api_ctrl->ipa_uc_mhi_stop_event_update_channel = - ipa3_uc_mhi_stop_event_update_channel; - api_ctrl->ipa_uc_mhi_cleanup = ipa3_uc_mhi_cleanup; - api_ctrl->ipa_uc_state_check = ipa3_uc_state_check; - api_ctrl->ipa_write_qmap_id = ipa3_write_qmap_id; - api_ctrl->ipa_remove_interrupt_handler = ipa3_remove_interrupt_handler; - api_ctrl->ipa_ap_suspend = ipa3_ap_suspend; - api_ctrl->ipa_ap_resume = ipa3_ap_resume; - api_ctrl->ipa_start_gsi_channel = ipa3_start_gsi_channel; - api_ctrl->ipa_inc_client_enable_clks = ipa3_inc_client_enable_clks; - api_ctrl->ipa_dec_client_disable_clks = ipa3_dec_client_disable_clks; - api_ctrl->ipa_inc_client_enable_clks_no_block = - ipa3_inc_client_enable_clks_no_block; - api_ctrl->ipa_suspend_resource_no_block = - ipa3_suspend_resource_no_block; - api_ctrl->ipa_resume_resource = ipa3_resume_resource; - api_ctrl->ipa_suspend_resource_sync = ipa3_suspend_resource_sync; - api_ctrl->ipa_set_required_perf_profile = - ipa3_set_required_perf_profile; - api_ctrl->ipa_get_ipc_logbuf = ipa3_get_ipc_logbuf; - api_ctrl->ipa_get_ipc_logbuf_low = ipa3_get_ipc_logbuf_low; - api_ctrl->ipa_rx_poll = ipa3_rx_poll; - api_ctrl->ipa_setup_uc_ntn_pipes = ipa3_setup_uc_ntn_pipes; - api_ctrl->ipa_tear_down_uc_offload_pipes = - ipa3_tear_down_uc_offload_pipes; - api_ctrl->ipa_get_pdev = ipa3_get_pdev; - api_ctrl->ipa_ntn_uc_reg_rdyCB = ipa3_ntn_uc_reg_rdyCB; - api_ctrl->ipa_ntn_uc_dereg_rdyCB = ipa3_ntn_uc_dereg_rdyCB; - api_ctrl->ipa_conn_wdi_pipes = ipa3_conn_wdi3_pipes; - api_ctrl->ipa_disconn_wdi_pipes = ipa3_disconn_wdi3_pipes; - api_ctrl->ipa_enable_wdi_pipes = ipa3_enable_wdi3_pipes; - api_ctrl->ipa_disable_wdi_pipes = ipa3_disable_wdi3_pipes; - api_ctrl->ipa_tz_unlock_reg = ipa3_tz_unlock_reg; - api_ctrl->ipa_wigig_internal_init = ipa3_wigig_internal_init; - api_ctrl->ipa_conn_wigig_rx_pipe_i = ipa3_conn_wigig_rx_pipe_i; - api_ctrl->ipa_conn_wigig_client_i = ipa3_conn_wigig_client_i; - api_ctrl->ipa_disconn_wigig_pipe_i = ipa3_disconn_wigig_pipe_i; - api_ctrl->ipa_wigig_uc_msi_init = ipa3_wigig_uc_msi_init; - api_ctrl->ipa_enable_wigig_pipe_i = ipa3_enable_wigig_pipe_i; - api_ctrl->ipa_disable_wigig_pipe_i = ipa3_disable_wigig_pipe_i; - api_ctrl->ipa_register_client_callback = - ipa3_register_client_callback; - api_ctrl->ipa_deregister_client_callback = - ipa3_deregister_client_callback; - api_ctrl->ipa_uc_debug_stats_alloc = - ipa3_uc_debug_stats_alloc; - api_ctrl->ipa_uc_debug_stats_dealloc = - ipa3_uc_debug_stats_dealloc; - api_ctrl->ipa_get_gsi_stats = - ipa3_get_gsi_stats; - api_ctrl->ipa_get_prot_id = - ipa3_get_prot_id; - return 0; -} - /** * ipa_is_modem_pipe()- Checks if pipe is owned by the modem * diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c index 2865f893bf..12d03dfcab 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c @@ -663,6 +663,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_conn_wdi3_pipes); int ipa3_disconn_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) { @@ -738,6 +739,7 @@ exit: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_by_pipe(ipa_ep_idx_tx)); return result; } +EXPORT_SYMBOL(ipa3_disconn_wdi3_pipes); int ipa3_enable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) { @@ -834,6 +836,7 @@ exit: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(ipa_ep_idx_tx)); return result; } +EXPORT_SYMBOL(ipa3_enable_wdi3_pipes); int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) { @@ -929,6 +932,7 @@ fail: return result; } +EXPORT_SYMBOL(ipa3_disable_wdi3_pipes); int ipa3_write_qmapid_wdi3_gsi_pipe(u32 clnt_hdl, u8 qmap_id) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c b/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c index 6762075b73..670e958b3c 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c @@ -128,6 +128,7 @@ int ipa3_wigig_internal_init( return 0; } +EXPORT_SYMBOL(ipa3_wigig_internal_init); static int ipa3_wigig_tx_bit_to_ep( const u8 tx_bit_num, @@ -1143,6 +1144,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_conn_wigig_rx_pipe_i); int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out, @@ -1374,6 +1376,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_conn_wigig_client_i); int ipa3_disconn_wigig_pipe_i(enum ipa_client_type client, struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu, @@ -1488,6 +1491,7 @@ fail: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return result; } +EXPORT_SYMBOL(ipa3_disconn_wigig_pipe_i); int ipa3_wigig_uc_msi_init(bool init, phys_addr_t periph_baddr_pa, @@ -1642,6 +1646,7 @@ fail_gen_tx: fail: return result; } +EXPORT_SYMBOL(ipa3_wigig_uc_msi_init); int ipa3_enable_wigig_pipe_i(enum ipa_client_type client) { @@ -1763,6 +1768,7 @@ fail_enable_datapath: IPA_ACTIVE_CLIENTS_DEC_EP(client); return res; } +EXPORT_SYMBOL(ipa3_enable_wigig_pipe_i); int ipa3_disable_wigig_pipe_i(enum ipa_client_type client) { @@ -1869,6 +1875,7 @@ fail_stop_channel: ipa_assert(); return res; } +EXPORT_SYMBOL(ipa3_disable_wigig_pipe_i); static void ipa_wigig_free_msg(void *msg, uint32_t len, uint32_t type) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_i.h b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_i.h index 80f9b4888a..cdb267ddf3 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_i.h @@ -15,9 +15,9 @@ do { \ pr_debug(IPAHAL_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -25,7 +25,7 @@ do { \ pr_debug(IPAHAL_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -33,9 +33,9 @@ do { \ pr_err(IPAHAL_DRV_NAME " %s:%d " fmt, __func__, __LINE__, \ ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -43,9 +43,9 @@ do { \ pr_err_ratelimited_ipa(IPAHAL_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index fd008175b2..e6b13515b8 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -471,7 +471,7 @@ static void ipa3_del_dflt_wan_rt_tables(void) IPAWANERR("Deleting Route hdl:(0x%x) with ip type: %d\n", rt_rule_entry->hdl, IPA_IP_v4); - if (ipa_del_rt_rule(rt_rule) || + if (ipa3_del_rt_rule(rt_rule) || (rt_rule_entry->status)) { IPAWANERR("Routing rule deletion failed\n"); } @@ -480,7 +480,7 @@ static void ipa3_del_dflt_wan_rt_tables(void) rt_rule_entry->hdl = rmnet_ipa3_ctx->dflt_v6_wan_rt_hdl; IPAWANERR("Deleting Route hdl:(0x%x) with ip type: %d\n", rt_rule_entry->hdl, IPA_IP_v6); - if (ipa_del_rt_rule(rt_rule) || + if (ipa3_del_rt_rule(rt_rule) || (rt_rule_entry->status)) { IPAWANERR("Routing rule deletion failed\n"); } @@ -795,7 +795,7 @@ static int ipa3_wwan_add_ul_flt_rule_to_ipa(void) sizeof(struct ipa_ipfltri_rule_eq)); memcpy(&(param->rules[0]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add)); - if (ipa_add_flt_rule((struct ipa_ioc_add_flt_rule *)param)) { + if (ipa3_add_flt_rule((struct ipa_ioc_add_flt_rule *)param)) { retval = -EFAULT; IPAWANERR("add A7 UL filter rule(%d) failed\n", i); } else { @@ -857,7 +857,7 @@ static int ipa3_wwan_del_ul_flt_rule_to_ipa(void) IPAWANDBG("delete-IPA rule index(%d)\n", i); memcpy(&(param->hdl[0]), &flt_rule_entry, sizeof(struct ipa_flt_rule_del)); - if (ipa_del_flt_rule((struct ipa_ioc_del_flt_rule *)param)) { + if (ipa3_del_flt_rule((struct ipa_ioc_del_flt_rule *)param)) { IPAWANERR("del A7 UL filter rule(%d) failed\n", i); kfree(param); return -EFAULT; @@ -3287,10 +3287,10 @@ int rmnet_ipa3_set_tether_client_pipe( IPAWANDBG("UL index-%d pipe %d\n", i, data->ul_src_pipe_list[i]); if (data->reset_client) - ipa_set_client(data->ul_src_pipe_list[i], + ipa3_set_client(data->ul_src_pipe_list[i], 0, false); else - ipa_set_client(data->ul_src_pipe_list[i], + ipa3_set_client(data->ul_src_pipe_list[i], data->ipa_client, true); } number = data->dl_dst_pipe_len; @@ -3298,10 +3298,10 @@ int rmnet_ipa3_set_tether_client_pipe( IPAWANDBG("DL index-%d pipe %d\n", i, data->dl_dst_pipe_list[i]); if (data->reset_client) - ipa_set_client(data->dl_dst_pipe_list[i], + ipa3_set_client(data->dl_dst_pipe_list[i], 0, false); else - ipa_set_client(data->dl_dst_pipe_list[i], + ipa3_set_client(data->dl_dst_pipe_list[i], data->ipa_client, false); } return 0; @@ -3418,9 +3418,9 @@ static int rmnet_ipa3_query_tethering_stats_modem( IPAWANDBG_LOW("dl_b_v4(%lu)v6(%lu)\n", (unsigned long) stat_ptr->num_ipv4_bytes, (unsigned long) stat_ptr->num_ipv6_bytes); - if (ipa_get_client_uplink( + if (ipa3_get_client_uplink( stat_ptr->pipe_index) == false) { - if (data->ipa_client == ipa_get_client( + if (data->ipa_client == ipa3_get_client( stat_ptr->pipe_index)) { /* update the DL stats */ data->ipv4_rx_packets += @@ -3456,9 +3456,9 @@ static int rmnet_ipa3_query_tethering_stats_modem( IPAWANDBG_LOW("ul_b_v4(%lu)v6(%lu)\n", (unsigned long)stat_ptr->num_ipv4_bytes, (unsigned long) stat_ptr->num_ipv6_bytes); - if (ipa_get_client_uplink( + if (ipa3_get_client_uplink( stat_ptr->pipe_index) == true) { - if (data->ipa_client == ipa_get_client( + if (data->ipa_client == ipa3_get_client( stat_ptr->pipe_index)) { /* update the DL stats */ data->ipv4_tx_packets += @@ -4985,7 +4985,7 @@ static int ipa3_rmnet_poll(struct napi_struct *napi, int budget) { int rcvd_pkts = 0; - rcvd_pkts = ipa_rx_poll(rmnet_ipa3_ctx->ipa3_to_apps_hdl, + rcvd_pkts = ipa3_rx_poll(rmnet_ipa3_ctx->ipa3_to_apps_hdl, NAPI_WEIGHT); IPAWANDBG_LOW("rcvd packets: %d\n", rcvd_pkts); return rcvd_pkts; diff --git a/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c b/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c index cfe8e445ad..04e2f80866 100644 --- a/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c +++ b/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c @@ -106,6 +106,7 @@ int ipa3_teth_bridge_init(struct teth_bridge_init_params *params) TETH_DBG_FUNC_EXIT(); return 0; } +EXPORT_SYMBOL(ipa3_teth_bridge_init); /** * ipa3_teth_bridge_get_pm_hdl() - Get the Tethering bridge Driver pm hdl @@ -150,6 +151,7 @@ int ipa3_teth_bridge_disconnect(enum ipa_client_type client) return res; } +EXPORT_SYMBOL(ipa3_teth_bridge_disconnect); /** * ipa3_teth_bridge_connect() - Connect bridge for a tethered Rmnet / MBIM call @@ -187,6 +189,7 @@ int ipa3_teth_bridge_connect(struct teth_bridge_connect_params *connect_params) TETH_DBG_FUNC_EXIT(); return res; } +EXPORT_SYMBOL(ipa3_teth_bridge_connect); static long ipa3_teth_bridge_ioctl(struct file *filp, unsigned int cmd, diff --git a/drivers/platform/msm/ipa/test/ipa_test_hw_stats.c b/drivers/platform/msm/ipa/test/ipa_test_hw_stats.c index 5355142a6a..2bc7ec1e8e 100644 --- a/drivers/platform/msm/ipa/test/ipa_test_hw_stats.c +++ b/drivers/platform/msm/ipa/test/ipa_test_hw_stats.c @@ -227,13 +227,13 @@ static int ipa_test_hw_stats_add_FnR(void *priv) rt_rule->rules)[0].rule.cnt_idx = ctx->rt4_usb_cnt_id; ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) + if (ipa3_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; goto free_query; } - if (ipa_get_rt_tbl(&rt_lookup)) { + if (ipa3_get_rt_tbl(&rt_lookup)) { IPA_UT_ERR("failed to query V4 rules\n"); ret = -EFAULT; goto free_query; @@ -261,13 +261,13 @@ static int ipa_test_hw_stats_add_FnR(void *priv) rt_rule->rules)[0].rule.cnt_idx = ctx->rt6_usb_cnt_id; ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) + if (ipa3_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; goto free_query; } - if (ipa_get_rt_tbl(&rt_lookup)) { + if (ipa3_get_rt_tbl(&rt_lookup)) { IPA_UT_ERR("failed to query V4 rules\n"); ret = -EFAULT; goto free_query; @@ -295,13 +295,13 @@ static int ipa_test_hw_stats_add_FnR(void *priv) rt_rule->rules)[0].rule.cnt_idx = ctx->rt4_odu_cnt_id; ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) + if (ipa3_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; goto free_query; } - if (ipa_get_rt_tbl(&rt_lookup)) { + if (ipa3_get_rt_tbl(&rt_lookup)) { IPA_UT_ERR("failed to query V4 rules\n"); ret = -EFAULT; goto free_query; @@ -329,13 +329,13 @@ static int ipa_test_hw_stats_add_FnR(void *priv) rt_rule->rules)[0].rule.cnt_idx = ctx->rt6_odu_cnt_id; ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) + if (ipa3_add_rt_rule_v2(rt_rule) || ((struct ipa_rt_rule_add_v2 *) rt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; goto free_query; } - if (ipa_get_rt_tbl(&rt_lookup)) { + if (ipa3_get_rt_tbl(&rt_lookup)) { IPA_UT_ERR("failed to query V4 rules\n"); ret = -EFAULT; goto free_query; @@ -364,7 +364,7 @@ static int ipa_test_hw_stats_add_FnR(void *priv) flt_rule->rules)[0].rule.cnt_idx = ctx->flt4_usb_cnt_id; ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) + if (ipa3_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; @@ -393,7 +393,7 @@ static int ipa_test_hw_stats_add_FnR(void *priv) flt_rule->rules)[0].rule.cnt_idx = ctx->flt6_usb_cnt_id; ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) + if (ipa3_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V6 rules\n"); ret = -EFAULT; @@ -422,7 +422,7 @@ static int ipa_test_hw_stats_add_FnR(void *priv) flt_rule->rules)[0].rule.cnt_idx = ctx->flt4_odu_cnt_id; ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) + if (ipa3_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V4 rules\n"); ret = -EFAULT; @@ -451,7 +451,7 @@ static int ipa_test_hw_stats_add_FnR(void *priv) flt_rule->rules)[0].rule.cnt_idx = ctx->flt6_odu_cnt_id; ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].rule.enable_stats = true; - if (ipa_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) + if (ipa3_add_flt_rule_v2(flt_rule) || ((struct ipa_flt_rule_add_v2 *) flt_rule->rules)[0].status) { IPA_UT_ERR("failed to install V6 rules\n"); ret = -EFAULT; diff --git a/drivers/platform/msm/ipa/test/ipa_test_wdi3.c b/drivers/platform/msm/ipa/test/ipa_test_wdi3.c index 944fbbdde1..a9d08fee0f 100644 --- a/drivers/platform/msm/ipa/test/ipa_test_wdi3.c +++ b/drivers/platform/msm/ipa/test/ipa_test_wdi3.c @@ -812,7 +812,7 @@ static int ipa_wdi3_test_single_transfer(void *priv) ep_cfg.seq.set_dynamic = true; - ipa_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); + ipa3_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); if (ipa_wdi3_send_one_packet()) { IPA_UT_ERR("fail to transfer packet.\n"); @@ -1014,7 +1014,7 @@ static int ipa_wdi3_test_multi_transfer(void *priv) ep_cfg.seq.set_dynamic = true; - ipa_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); + ipa3_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); if (ipa_wdi3_send_multi_packet()) { IPA_UT_ERR("fail to transfer packet.\n"); @@ -1058,7 +1058,7 @@ static int ipa_wdi3_test_multi_transfer2(void *priv) ep_cfg.seq.set_dynamic = true; - ipa_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); + ipa3_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); IPA_UT_DBG("-----start transfer 32 pkt----\n"); for (i = 0; i < 32; i++) { @@ -1106,7 +1106,7 @@ static int ipa_wdi3_test_multi_transfer3(void *priv) ep_cfg.seq.set_dynamic = true; - ipa_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); + ipa3_cfg_ep(ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD), &ep_cfg); IPA_UT_DBG("-----start transfer 256 pkt----\n"); for (i = 0; i < 32; i++) { diff --git a/drivers/platform/msm/ipa/test/ipa_ut_framework.h b/drivers/platform/msm/ipa/test/ipa_ut_framework.h index 88323ff2c2..c5d93018ab 100644 --- a/drivers/platform/msm/ipa/test/ipa_ut_framework.h +++ b/drivers/platform/msm/ipa/test/ipa_ut_framework.h @@ -16,9 +16,9 @@ do { \ pr_debug(IPA_UT_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -26,7 +26,7 @@ do { \ pr_debug(IPA_UT_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -34,9 +34,9 @@ do { \ pr_err(IPA_UT_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ } while (0) @@ -44,9 +44,9 @@ do { \ pr_info(IPA_UT_DRV_NAME " %s:%d " fmt, \ __func__, __LINE__, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ - IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \ + IPA_IPC_LOGGING(ipa3_get_ipc_logbuf_low(), \ IPA_UT_DRV_NAME " %s:%d " fmt, ## args); \ } while (0)