Merge "[qca-nss-drv] Add inline tunneling support"
diff --git a/exports/nss_dynamic_interface.h b/exports/nss_dynamic_interface.h
index a44f10d..0c037d4 100644
--- a/exports/nss_dynamic_interface.h
+++ b/exports/nss_dynamic_interface.h
@@ -64,6 +64,8 @@
 	NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER,
 	NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER,
 	NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER,
+	NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER,
+	NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER,
 	NSS_DYNAMIC_INTERFACE_TYPE_MAX
 };
 
diff --git a/exports/nss_gre_tunnel.h b/exports/nss_gre_tunnel.h
index 5aaeafe..f447c7b 100644
--- a/exports/nss_gre_tunnel.h
+++ b/exports/nss_gre_tunnel.h
@@ -40,6 +40,7 @@
 	NSS_GRE_TUNNEL_MSG_CONFIGURE,
 	NSS_GRE_TUNNEL_MSG_SESSION_DESTROY,
 	NSS_GRE_TUNNEL_MSG_STATS,
+	NSS_GRE_TUNNEL_MSG_CONFIGURE_DI_TO_WLAN_ID,
 	NSS_GRE_TUNNEL_MSG_MAX,
 };
 
@@ -91,10 +92,21 @@
 	NSS_GRE_TUNNEL_ERR_SIBLING_IF = 10,
 	NSS_GRE_TUNNEL_ERR_CRYPTO_NODE_ID = 11,
 	NSS_GRE_TUNNEL_ERR_RPS = 12,
+	NSS_GRE_TUNNEL_ERR_DI_INVALID = 13,
 	NSS_GRE_TUNNEL_ERR_MAX,
 };
 
 /**
+ * nss_gre_tunnel_di_to_wlan_id
+ *	Dynamic interface to WLAN ID message structure.
+ */
+struct nss_gre_tunnel_di_to_wlan_id {
+	uint32_t dynamic_interface_num;		/**< Dynamic interface number. */
+	uint16_t wlan_id;			/**< WLAN ID number. */
+	uint16_t reserved0;			/**< Reserved padding. */
+};
+
+/**
  * nss_gre_tunnel_configure
  *	Message information for configuring a GRE tunnel.
  */
@@ -116,6 +128,9 @@
 	uint8_t ttl;			/**< Time-to-live value of the IP header. */
 	int8_t rps;			/**< Steer packets to host core. */
 	uint16_t reserved;		/**< Reserved space. */
+	uint32_t word1;			/**< Word1 header. */
+	uint32_t word2;			/**< Word2 header. */
+	uint32_t word3;			/**< Word3 header. */
 };
 
 /**
@@ -169,6 +184,7 @@
 	union {
 		struct nss_gre_tunnel_configure configure;	/**< Tunnel configuration data. */
 		struct nss_gre_tunnel_stats stats;		/**< Tunnel statistics. */
+		struct nss_gre_tunnel_di_to_wlan_id dtwi;	/**< Tunnel dynamic interface number to WLAN ID mapping. */
 	} msg;							/**< Message payload. */
 };
 
diff --git a/nss_gre_tunnel.c b/nss_gre_tunnel.c
index 383e10f..3f58274 100644
--- a/nss_gre_tunnel.c
+++ b/nss_gre_tunnel.c
@@ -37,7 +37,15 @@
 static bool nss_gre_tunnel_verify_if_num(uint32_t if_num)
 {
 	uint32_t type = nss_dynamic_interface_get_type(nss_gre_tunnel_get_ctx(), if_num);
-	if ((type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER) || (type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER)) {
+
+	switch (type) {
+	case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER:
+		return true;
+	case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER:
+		return true;
+	case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER:
+		return true;
+	case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER:
 		return true;
 	}
 
diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c
index cd3592a..d3e31e5 100644
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -463,6 +463,8 @@
 		nss_top->gre_tunnel_handler_id = nss_dev->id;
 		nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER] = nss_dev->id;
 		nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER] = nss_dev->id;
+		nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER] = nss_dev->id;
+		nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER] = nss_dev->id;
 	}
 
 	if (npd->portid_enabled == NSS_FEATURE_ENABLED) {