[qca-nss-ecm] Add protocol entry to feci

We didn't have protocol in feci but we had it in ci. While establishing
interface ci has not been initialized with the protocol number. We need
the protocol number to identify inner/outer dynamic interface type for
GRE like flows. To achieve this protocol number field is added to feci
and initialized before interface establish.

Change-Id: Ie5a883fac5dc864d28b5e4f8ae3068b3ba1dc8b2
Signed-off-by: Swaraj Sha <ssha@codeaurora.org>
diff --git a/frontends/include/ecm_front_end_types.h b/frontends/include/ecm_front_end_types.h
index 5c5e273..a7ad880 100644
--- a/frontends/include/ecm_front_end_types.h
+++ b/frontends/include/ecm_front_end_types.h
@@ -158,6 +158,7 @@
 	 * Common control items to all front end instances
 	 */
 	int ip_version;						/* RO: The version of IP protocol this instance was established for */
+	int protocol;						/* RO: The protocol this instance was established for */
 	struct ecm_db_connection_instance *ci;			/* RO: The connection instance relating to this instance. */
 	bool can_accel;						/* RO: True when the connection can be accelerated */
 	bool is_defunct;					/* True if the connection has become defunct */
diff --git a/frontends/nss/ecm_nss_non_ported_ipv4.c b/frontends/nss/ecm_nss_non_ported_ipv4.c
index 2e53b6a..a2dcbb1 100644
--- a/frontends/nss/ecm_nss_non_ported_ipv4.c
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.c
@@ -1807,7 +1807,7 @@
  */
 static struct ecm_nss_non_ported_ipv4_connection_instance *ecm_nss_non_ported_ipv4_connection_instance_alloc(
 								struct ecm_db_connection_instance *ci,
-								bool can_accel)
+								int protocol, bool can_accel)
 {
 	struct ecm_nss_non_ported_ipv4_connection_instance *nnpci;
 	struct ecm_front_end_connection_instance *feci;
@@ -1841,6 +1841,8 @@
 
 	feci->ip_version = 4;
 
+	feci->protocol = protocol;
+
 	/*
 	 * Populate the methods and callbacks
 	 */
@@ -1962,7 +1964,7 @@
 		/*
 		 * Connection must have a front end instance associated with it
 		 */
-		feci = (struct ecm_front_end_connection_instance *)ecm_nss_non_ported_ipv4_connection_instance_alloc(nci, can_accel);
+		feci = (struct ecm_front_end_connection_instance *)ecm_nss_non_ported_ipv4_connection_instance_alloc(nci, protocol, can_accel);
 		if (!feci) {
 			DEBUG_WARN("Failed to allocate front end\n");
 			goto fail_1;
diff --git a/frontends/nss/ecm_nss_non_ported_ipv6.c b/frontends/nss/ecm_nss_non_ported_ipv6.c
index d6cb45b..048f62a 100644
--- a/frontends/nss/ecm_nss_non_ported_ipv6.c
+++ b/frontends/nss/ecm_nss_non_ported_ipv6.c
@@ -1606,7 +1606,7 @@
  */
 static struct ecm_nss_non_ported_ipv6_connection_instance *ecm_nss_non_ported_ipv6_connection_instance_alloc(
 								struct ecm_db_connection_instance *ci,
-								bool can_accel)
+								int protocol, bool can_accel)
 {
 	struct ecm_nss_non_ported_ipv6_connection_instance *nnpci;
 	struct ecm_front_end_connection_instance *feci;
@@ -1640,6 +1640,8 @@
 
 	feci->ip_version = 6;
 
+	feci->protocol = protocol;
+
 	/*
 	 * Populate the methods and callbacks
 	 */
@@ -1760,7 +1762,7 @@
 		/*
 		 * Connection must have a front end instance associated with it
 		 */
-		feci = (struct ecm_front_end_connection_instance *)ecm_nss_non_ported_ipv6_connection_instance_alloc(nci, can_accel);
+		feci = (struct ecm_front_end_connection_instance *)ecm_nss_non_ported_ipv6_connection_instance_alloc(nci, protocol, can_accel);
 		if (!feci) {
 			DEBUG_WARN("Failed to allocate front end\n");
 			goto fail_1;
diff --git a/frontends/nss/ecm_nss_ported_ipv4.c b/frontends/nss/ecm_nss_ported_ipv4.c
index c51ed8e..23dbefd 100644
--- a/frontends/nss/ecm_nss_ported_ipv4.c
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
@@ -1818,6 +1818,8 @@
 
 	feci->ip_version = 4;
 
+	feci->protocol = protocol;
+
 	/*
 	 * Populate the methods and callbacks
 	 */
diff --git a/frontends/nss/ecm_nss_ported_ipv6.c b/frontends/nss/ecm_nss_ported_ipv6.c
index d1b4707..5486550 100644
--- a/frontends/nss/ecm_nss_ported_ipv6.c
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
@@ -1709,6 +1709,8 @@
 
 	feci->ip_version = 6;
 
+	feci->protocol = protocol;
+
 	/*
 	 * Populate the methods and callbacks
 	 */