summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_data-sdm845.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-03-26 18:11:21 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-27 01:02:39 +0300
commit4fd704b3608a4c89260ea33895a694bc5385e00f (patch)
treeab2501657eef882472d8bc14d886289ef9ed25b2 /drivers/net/ipa/ipa_data-sdm845.c
parent93c03729c548ea30b8bb38f2ab51008f11babe2a (diff)
downloadlinux-4fd704b3608a4c89260ea33895a694bc5385e00f.tar.xz
net: ipa: record number of groups in data
The arrays of source and destination resource limits defined in configuration data are of a fixed size--which is the maximum number of resource groups supported for any platform. Most platforms will use fewer than that many groups. Add new members to the ipa_rsrc_group_id enumerated type to define the number of source and destination resource groups are defined for the platform. (This type is defined for each platform in its data file.) Add a new field to the resource configuration data that indicates how many of the source and destination resource groups are actually used for the platform, and initialize it with the count value. This allows us to determine the number of groups defined for the platform without exposing the ipa_rsrc_group_id enumerated type. As a result, we no longer need ipa_resource_group_src_count() and ipa_resource_group_dst_count(), because each platform now defines its supported number of resource groups. So get rid of those two functions. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_data-sdm845.c')
-rw-r--r--drivers/net/ipa/ipa_data-sdm845.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c
index 3c9675ce556c..e14e3fb1d970 100644
--- a/drivers/net/ipa/ipa_data-sdm845.c
+++ b/drivers/net/ipa/ipa_data-sdm845.c
@@ -32,11 +32,13 @@ enum ipa_rsrc_group_id {
IPA_RSRC_GROUP_SRC_UL_DL,
IPA_RSRC_GROUP_SRC_MHI_DMA,
IPA_RSRC_GROUP_SRC_UC_RX_Q,
+ IPA_RSRC_GROUP_SRC_COUNT, /* Last in set; not a source group */
/* Destination resource group identifiers */
IPA_RSRC_GROUP_DST_LWA_DL = 0,
IPA_RSRC_GROUP_DST_UL_DL_DPL,
IPA_RSRC_GROUP_DST_UNUSED_2,
+ IPA_RSRC_GROUP_DST_COUNT, /* Last; not a destination group */
};
/* QSB configuration for the SDM845 SoC. */
@@ -270,6 +272,8 @@ static const struct ipa_resource ipa_resource_dst[] = {
/* Resource configuration for the SDM845 SoC. */
static const struct ipa_resource_data ipa_resource_data = {
+ .rsrc_group_src_count = IPA_RSRC_GROUP_SRC_COUNT,
+ .rsrc_group_dst_count = IPA_RSRC_GROUP_DST_COUNT,
.resource_src_count = ARRAY_SIZE(ipa_resource_src),
.resource_src = ipa_resource_src,
.resource_dst_count = ARRAY_SIZE(ipa_resource_dst),