msm: ipa4: add multi PDN support
IPAv4 presents multi PDN support. This change provides backward
compatibility towards user space and allows setting NAT rules
for several PDNs. Metadata replacement is also supported as part
of this feature.
CRs-Fixed: 2040674
Change-Id: If0ee3cb1da5b40a4d0887aaec276e5b78e947337
Signed-off-by: Amir Levy <alevy@codeaurora.org>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c
index d35b8a7..6f46ebf 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c
@@ -32,6 +32,7 @@
__stringify(IPA_IMM_CMD_DMA_SHARED_MEM),
__stringify(IPA_IMM_CMD_IP_PACKET_TAG_STATUS),
__stringify(IPA_IMM_CMD_DMA_TASK_32B_ADDR),
+ __stringify(IPA_IMM_CMD_TABLE_DMA),
};
static const char *ipahal_pkt_status_exception_to_str
@@ -371,6 +372,31 @@
return pyld;
}
+static struct ipahal_imm_cmd_pyld *ipa_imm_cmd_construct_table_dma_ipav4(
+ enum ipahal_imm_cmd_name cmd, const void *params, bool is_atomic_ctx)
+{
+ struct ipahal_imm_cmd_pyld *pyld;
+ struct ipa_imm_cmd_hw_table_dma_ipav4 *data;
+ struct ipahal_imm_cmd_table_dma *nat_params =
+ (struct ipahal_imm_cmd_table_dma *)params;
+
+ pyld = IPAHAL_MEM_ALLOC(sizeof(*pyld) + sizeof(*data), is_atomic_ctx);
+ if (unlikely(!pyld)) {
+ IPAHAL_ERR("kzalloc err\n");
+ return pyld;
+ }
+ pyld->opcode = ipahal_imm_cmd_get_opcode(cmd);
+ pyld->len = sizeof(*data);
+ data = (struct ipa_imm_cmd_hw_table_dma_ipav4 *)pyld->data;
+
+ data->table_index = nat_params->table_index;
+ data->base_addr = nat_params->base_addr;
+ data->offset = nat_params->offset;
+ data->data = nat_params->data;
+
+ return pyld;
+}
+
static struct ipahal_imm_cmd_pyld *ipa_imm_cmd_construct_hdr_init_system(
enum ipahal_imm_cmd_name cmd, const void *params, bool is_atomic_ctx)
{
@@ -640,6 +666,13 @@
[IPA_HW_v4_0][IPA_IMM_CMD_REGISTER_WRITE] = {
ipa_imm_cmd_construct_register_write_v_4_0,
12},
+ /* NAT_DMA was renamed to TABLE_DMA for IPAv4 */
+ [IPA_HW_v4_0][IPA_IMM_CMD_NAT_DMA] = {
+ NULL,
+ -1 },
+ [IPA_HW_v4_0][IPA_IMM_CMD_TABLE_DMA] = {
+ ipa_imm_cmd_construct_table_dma_ipav4,
+ 14},
[IPA_HW_v4_0][IPA_IMM_CMD_DMA_SHARED_MEM] = {
ipa_imm_cmd_construct_dma_shared_mem_v_4_0,
19},