From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: bjorn.andersson@linaro.org, evgreen@chromium.org,
cpratapa@codeaurora.org, subashab@codeaurora.org,
elder@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 10/12] net: ipa: pass data for source and dest resource config
Date: Fri, 26 Mar 2021 10:11:20 -0500 [thread overview]
Message-ID: <20210326151122.3121383-11-elder@linaro.org> (raw)
In-Reply-To: <20210326151122.3121383-1-elder@linaro.org>
Pass the resource data pointer to ipa_resource_config_src() and
ipa_resource_config_dst() to be used for configuring resource
limits.
Signed-off-by: Alex Elder <elder@linaro.org>
---
drivers/net/ipa/ipa_resource.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ipa/ipa_resource.c b/drivers/net/ipa/ipa_resource.c
index c7edacfa7d19d..3db4dd3bda9cc 100644
--- a/drivers/net/ipa/ipa_resource.c
+++ b/drivers/net/ipa/ipa_resource.c
@@ -129,12 +129,15 @@ ipa_resource_config_common(struct ipa *ipa, u32 offset,
}
static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type,
- const struct ipa_resource *resource)
+ const struct ipa_resource_data *data)
{
u32 group_count = ipa_resource_group_src_count(ipa->version);
const struct ipa_resource_limits *ylimits;
+ const struct ipa_resource *resource;
u32 offset;
+ resource = &data->resource_src[resource_type];
+
offset = IPA_REG_SRC_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type);
ylimits = group_count == 1 ? NULL : &resource->limits[1];
ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits);
@@ -155,12 +158,15 @@ static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type,
}
static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type,
- const struct ipa_resource *resource)
+ const struct ipa_resource_data *data)
{
u32 group_count = ipa_resource_group_dst_count(ipa->version);
const struct ipa_resource_limits *ylimits;
+ const struct ipa_resource *resource;
u32 offset;
+ resource = &data->resource_dst[resource_type];
+
offset = IPA_REG_DST_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type);
ylimits = group_count == 1 ? NULL : &resource->limits[1];
ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits);
@@ -189,10 +195,10 @@ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data)
return -EINVAL;
for (i = 0; i < data->resource_src_count; i++)
- ipa_resource_config_src(ipa, i, &data->resource_src[i]);
+ ipa_resource_config_src(ipa, i, data);
for (i = 0; i < data->resource_dst_count; i++)
- ipa_resource_config_dst(ipa, i, &data->resource_dst[i]);
+ ipa_resource_config_dst(ipa, i, data);
return 0;
}
--
2.27.0
next prev parent reply other threads:[~2021-03-26 15:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 15:11 [PATCH net-next 00/12] net: ipa: rework resource programming Alex Elder
2021-03-26 15:11 ` [PATCH net-next 01/12] net: ipa: introduce ipa_resource.c Alex Elder
2021-03-26 15:11 ` [PATCH net-next 02/12] net: ipa: fix bug in resource group limit programming Alex Elder
2021-03-26 15:11 ` [PATCH net-next 03/12] net: ipa: identify resource groups Alex Elder
2021-03-26 15:11 ` [PATCH net-next 04/12] net: ipa: add some missing resource limits Alex Elder
2021-03-26 15:11 ` [PATCH net-next 05/12] net: ipa: combine resource type definitions Alex Elder
2021-03-26 15:11 ` [PATCH net-next 06/12] net: ipa: index resource limits with type Alex Elder
2021-03-26 15:11 ` [PATCH net-next 07/12] net: ipa: move ipa_resource_type definition Alex Elder
2021-03-26 15:11 ` [PATCH net-next 08/12] net: ipa: combine source and destination group limits Alex Elder
2021-03-26 15:11 ` [PATCH net-next 09/12] net: ipa: combine source and destation resource types Alex Elder
2021-03-26 15:11 ` Alex Elder [this message]
2021-03-26 15:11 ` [PATCH net-next 11/12] net: ipa: record number of groups in data Alex Elder
2021-03-26 15:11 ` [PATCH net-next 12/12] net: ipa: support more than 6 resource groups Alex Elder
2021-03-26 22:10 ` [PATCH net-next 00/12] net: ipa: rework resource programming patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210326151122.3121383-11-elder@linaro.org \
--to=elder@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=cpratapa@codeaurora.org \
--cc=davem@davemloft.net \
--cc=elder@kernel.org \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox