qcacld-3.0: Export max IPA interface numbers

As for Rome, currently it usually just only support two
IPA interfaces offload, if use the default value 3, which
will cause the IPA pipe setup failure issue. So export
the max IPA interface numbers, and it's better to set
the appropriate value from build file according to
different requirement for different chipset and platform.
Meanwhile, it support SMMU on the sa415 platform, so
enable SMMU for it.

Change-Id: I2de31bcb4d38f5e7964d2cbdc2fc6f143eef510d
CRs-Fixed: 2480627
diff --git a/Kbuild b/Kbuild
index 46119eb..964a514 100644
--- a/Kbuild
+++ b/Kbuild
@@ -2437,6 +2437,16 @@
 endif
 endif
 
+#Define Max IPA interface
+ifeq ($(CONFIG_IPA_OFFLOAD), y)
+ifdef CONFIG_NUM_IPA_IFACE
+cppflags-y += -DMAX_IPA_IFACE=$(CONFIG_NUM_IPA_IFACE)
+else
+NUM_IPA_IFACE ?= 3
+cppflags-y += -DMAX_IPA_IFACE=$(NUM_IPA_IFACE)
+endif
+endif
+
 cppflags-$(CONFIG_TUFELLO_DUAL_FW_SUPPORT) += -DCONFIG_TUFELLO_DUAL_FW_SUPPORT
 cppflags-$(CONFIG_CHANNEL_HOPPING_ALL_BANDS) += -DCHANNEL_HOPPING_ALL_BANDS
 
diff --git a/components/ipa/core/inc/wlan_ipa_priv.h b/components/ipa/core/inc/wlan_ipa_priv.h
index 1790a88..a62645a 100644
--- a/components/ipa/core/inc/wlan_ipa_priv.h
+++ b/components/ipa/core/inc/wlan_ipa_priv.h
@@ -52,7 +52,8 @@
 #define WLAN_IPA_UC_RT_DEBUG_FILL_INTERVAL  10000
 
 #define WLAN_IPA_WLAN_HDR_DES_MAC_OFFSET    0
-#define WLAN_IPA_MAX_IFACE                  3
+#define WLAN_IPA_MAX_IFACE                  MAX_IPA_IFACE
+#define WLAN_IPA_CLIENT_MAX_IFACE           3
 #define WLAN_IPA_MAX_SYSBAM_PIPE            4
 #define WLAN_IPA_MAX_SESSION                5
 #define WLAN_IPA_MAX_STA_COUNT              41
diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c
index e754198..7e2b385 100644
--- a/components/ipa/core/src/wlan_ipa_core.c
+++ b/components/ipa/core/src/wlan_ipa_core.c
@@ -31,7 +31,7 @@
 static struct wlan_ipa_iface_2_client {
 	qdf_ipa_client_type_t cons_client;
 	qdf_ipa_client_type_t prod_client;
-} wlan_ipa_iface_2_client[WLAN_IPA_MAX_IFACE] = {
+} wlan_ipa_iface_2_client[WLAN_IPA_CLIENT_MAX_IFACE] = {
 	{
 		QDF_IPA_CLIENT_WLAN2_CONS, QDF_IPA_CLIENT_WLAN1_PROD
 	}, {
diff --git a/configs/qca6174_defconfig b/configs/qca6174_defconfig
index 1be3191..49c01e6 100644
--- a/configs/qca6174_defconfig
+++ b/configs/qca6174_defconfig
@@ -468,6 +468,13 @@
 CONFIG_IPA_OFFLOAD := y
 endif
 
+#Set MAX IPA Offload Interface
+ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y)
+ifeq ($(CONFIG_IPA_OFFLOAD), y)
+CONFIG_NUM_IPA_IFACE := 2
+endif
+endif
+
 #Flag to enable SMMU S1 support
 ifeq ($(CONFIG_ARCH_SDM845), y)
 ifeq ($(CONFIG_IPA_OFFLOAD), y)
@@ -481,6 +488,12 @@
 endif
 endif
 
+ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y)
+ifeq ($(CONFIG_IPA_OFFLOAD), y)
+CONFIG_ENABLE_SMMU_S1_TRANSLATION := y
+endif
+endif
+
 ifeq ($(CONFIG_ARCH_SDX20), y)
 ifeq ($(CONFIG_QCA_WIFI_SDIO), y)
 ifeq ($(CONFIG_WCNSS_SKB_PRE_ALLOC), y)
diff --git a/core/dp/txrx/ol_txrx_ipa.h b/core/dp/txrx/ol_txrx_ipa.h
index 2070c3e..c2ce70d 100644
--- a/core/dp/txrx/ol_txrx_ipa.h
+++ b/core/dp/txrx/ol_txrx_ipa.h
@@ -83,7 +83,7 @@
 #define OL_TXRX_IPA_IPV4_NAME_EXT              "_ipv4"
 #define OL_TXRX_IPA_IPV6_NAME_EXT              "_ipv6"
 
-#define OL_TXRX_IPA_MAX_IFACE                  3
+#define OL_TXRX_IPA_MAX_IFACE                  MAX_IPA_IFACE
 
 #define OL_TXRX_IPA_WLAN_FRAG_HEADER        sizeof(struct frag_header)
 #define OL_TXRX_IPA_WLAN_IPA_HEADER         sizeof(struct ipa_header)