aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipa/ipa_table.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2022-09-26 17:09:18 -0500
committerJakub Kicinski <kuba@kernel.org>2022-09-27 18:42:49 -0700
commit6bfb753850d3bad78fc2eb6f4e0fa5675055ad97 (patch)
tree5ed6c13d3bbbaad4f8f1a06345bcbc26332c7911 /drivers/net/ipa/ipa_table.c
parentnet: ipa: introduce IPA register IDs (diff)
downloadlinux-dev-6bfb753850d3bad78fc2eb6f4e0fa5675055ad97.tar.xz
linux-dev-6bfb753850d3bad78fc2eb6f4e0fa5675055ad97.zip
net: ipa: use IPA register IDs to determine offsets
Expose two inline functions that return the offset for a register whose ID is provided; one of them takes an additional argument that's used for registers that are parameterized. These both use a common helper function __ipa_reg_offset(), which just uses the offset symbols already defined. Replace all references to the offset macros defined for IPA registers with calls to ipa_reg_offset() or ipa_reg_n_offset(). Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ipa/ipa_table.c')
-rw-r--r--drivers/net/ipa/ipa_table.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c
index 037cec2fd594..268e1df75bad 100644
--- a/drivers/net/ipa/ipa_table.c
+++ b/drivers/net/ipa/ipa_table.c
@@ -384,7 +384,7 @@ void ipa_table_reset(struct ipa *ipa, bool modem)
int ipa_table_hash_flush(struct ipa *ipa)
{
- u32 offset = ipa_reg_filt_rout_hash_flush_offset(ipa->version);
+ u32 offset = ipa_reg_offset(ipa, FILT_ROUT_HASH_FLUSH);
struct gsi_trans *trans;
u32 val;
@@ -516,10 +516,11 @@ int ipa_table_setup(struct ipa *ipa)
static void ipa_filter_tuple_zero(struct ipa_endpoint *endpoint)
{
u32 endpoint_id = endpoint->endpoint_id;
+ struct ipa *ipa = endpoint->ipa;
u32 offset;
u32 val;
- offset = IPA_REG_ENDP_FILTER_ROUTER_HSH_CFG_N_OFFSET(endpoint_id);
+ offset = ipa_reg_n_offset(ipa, ENDP_FILTER_ROUTER_HSH_CFG, endpoint_id);
val = ioread32(endpoint->ipa->reg_virt + offset);
@@ -565,9 +566,11 @@ static bool ipa_route_id_modem(u32 route_id)
*/
static void ipa_route_tuple_zero(struct ipa *ipa, u32 route_id)
{
- u32 offset = IPA_REG_ENDP_FILTER_ROUTER_HSH_CFG_N_OFFSET(route_id);
+ u32 offset;
u32 val;
+ offset = ipa_reg_n_offset(ipa, ENDP_FILTER_ROUTER_HSH_CFG, route_id);
+
val = ioread32(ipa->reg_virt + offset);
/* Zero all route-related fields, preserving the rest */