1 /* SPDX-License-Identifier: GPL-2.0 */
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2020 Linaro Ltd.
9 #include <linux/types.h>
13 /* The maximum number of filter table entries (IPv4, IPv6; hashed or not) */
14 #define IPA_FILTER_COUNT_MAX 14
16 /* The number of route table entries allotted to the modem */
17 #define IPA_ROUTE_MODEM_COUNT 8
19 /* The maximum number of route table entries (IPv4, IPv6; hashed or not) */
20 #define IPA_ROUTE_COUNT_MAX 15
25 * ipa_table_valid() - Validate route and filter table memory regions
28 * Return: true if all regions are valid, false otherwise
30 bool ipa_table_valid(struct ipa *ipa);
33 * ipa_filter_map_valid() - Validate a filter table endpoint bitmap
36 * Return: true if all regions are valid, false otherwise
38 bool ipa_filter_map_valid(struct ipa *ipa, u32 filter_mask);
40 #else /* !IPA_VALIDATE */
42 static inline bool ipa_table_valid(struct ipa *ipa)
47 static inline bool ipa_filter_map_valid(struct ipa *ipa, u32 filter_mask)
52 #endif /* !IPA_VALIDATE */
55 * ipa_table_reset() - Reset filter and route tables entries to "none"
57 * @modem: Whether to reset modem or AP entries
59 void ipa_table_reset(struct ipa *ipa, bool modem);
62 * ipa_table_hash_flush() - Synchronize hashed filter and route updates
65 int ipa_table_hash_flush(struct ipa *ipa);
68 * ipa_table_setup() - Set up filter and route tables
71 int ipa_table_setup(struct ipa *ipa);
74 * ipa_table_teardown() - Inverse of ipa_table_setup()
77 void ipa_table_teardown(struct ipa *ipa);
80 * ipa_table_config() - Configure filter and route tables
83 void ipa_table_config(struct ipa *ipa);
86 * ipa_table_deconfig() - Inverse of ipa_table_config()
89 void ipa_table_deconfig(struct ipa *ipa);
92 * ipa_table_init() - Do early initialization of filter and route tables
95 int ipa_table_init(struct ipa *ipa);
98 * ipa_table_exit() - Inverse of ipa_table_init()
101 void ipa_table_exit(struct ipa *ipa);
103 #endif /* _IPA_TABLE_H_ */