From 338eb798c779cc97a63a252dd4224d07eedd4406 Mon Sep 17 00:00:00 2001 From: Ashok Vuyyuru Date: Thu, 23 Mar 2023 15:06:09 +0530 Subject: [PATCH] msm: ipa3: Adding changes to remove dependency ipa3_ctx global variable ipa3_ctx variable not able to access from the client module and so adding changes to get qmap id details from ipa core driver. Change-Id: I215ed0137fdad531e23be35b496d4b8e4a43a554 Signed-off-by: Ashok Vuyyuru --- drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c | 4 ++-- drivers/platform/msm/ipa/ipa_v3/ipa_i.h | 3 ++- drivers/platform/msm/ipa/ipa_v3/ipa_utils.c | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c index cfd88852b19d..ea1f07859da7 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -1216,7 +1216,7 @@ static int ipa_bridge_tx_dp_internal(u32 hdl, struct sk_buff *skb, sizeof(struct ipa_gsb_mux_hdr)); memset(mux_hdr, 0, sizeof(struct ipa_gsb_mux_hdr)); mux_hdr->iface_hdl = (u8)hdl; - mux_hdr->qmap_id = (u8)ipa3_ctx->ep[ipa_gsb_ctx->prod_hdl].cfg.meta.qmap_id; + mux_hdr->qmap_id = (u8)ipa3_get_qmap_id(ipa_gsb_ctx->prod_hdl); ret = ipa_tx_dp(IPA_CLIENT_ODU_PROD, skb, metadata); if (ret) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index 7e4b2c86e6b0..b979156eb14e 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _IPA3_I_H_ @@ -2815,6 +2815,7 @@ bool ipa3_is_client_handle_valid(u32 clnt_hdl); enum ipa_client_type ipa3_get_client_mapping(int pipe_idx); enum ipa_client_type ipa3_get_client_by_pipe(int pipe_idx); +u32 ipa3_get_qmap_id(int pipe_idx); void ipa_init_ep_flt_bitmap(void); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c index 5c3edacfa78a..a71731729c37 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved */ #include @@ -9615,6 +9616,20 @@ u32 ipa3_get_r_rev_version(void) } EXPORT_SYMBOL(ipa3_get_r_rev_version); +u32 ipa3_get_qmap_id(int pipe_idx) +{ + if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { + IPAERR("Bad pipe index!\n"); + WARN_ON(1); + return -EINVAL; + } + + return ipa3_ctx->ep[pipe_idx].cfg.meta.qmap_id; + +} +EXPORT_SYMBOL(ipa3_get_qmap_id); + + /** * ipa3_ctx_get_type() - to get platform type, hw type * and hw mode