qcacld-3.0: Add frag_header to support pre-wdi2.0 platform

wdi2.0 feature adds extra 2 bytes to frag_header and thus hdr_len
to IPA HW also adds 2 bytes. This change breaks pre-wdi2.0 platform
with WiFi FW discarding all TX traffic since packet payload is
with an extra 2-byte offset.

Fix is to add frag_header structure with pre-wdi2.0 pattern.

Change-Id: I467a05bab4111a305ae23250c61cecc050821611
CRs-Fixed: 2047714
diff --git a/components/ipa/core/inc/wlan_ipa_priv.h b/components/ipa/core/inc/wlan_ipa_priv.h
index 0e6f523..81568b5 100644
--- a/components/ipa/core/inc/wlan_ipa_priv.h
+++ b/components/ipa/core/inc/wlan_ipa_priv.h
@@ -179,11 +179,20 @@
  * @reserved1: Reserved not used
  * @reserved2: Reserved not used
  */
+#if defined (QCA_WIFI_3_0) || defined (CONFIG_LITHIUM)
 struct frag_header {
 	uint16_t length;
 	uint32_t reserved1;
 	uint32_t reserved2;
 } qdf_packed;
+#else
+struct frag_header {
+	uint32_t
+		length:16,
+		reserved16:16;
+	uint32_t reserved2;
+} qdf_packed;
+#endif
 
 /**
  * struct ipa_header - ipa header type registered to IPA hardware
diff --git a/core/dp/txrx/ol_txrx_ipa.c b/core/dp/txrx/ol_txrx_ipa.c
index 63bea7e..c406dd5 100644
--- a/core/dp/txrx/ol_txrx_ipa.c
+++ b/core/dp/txrx/ol_txrx_ipa.c
@@ -77,6 +77,7 @@
 #include <ol_txrx_ipa.h>
 
 /* For Tx pipes, use Ethernet-II Header format */
+#ifdef QCA_WIFI_3_0
 struct ol_txrx_ipa_uc_tx_hdr ipa_uc_tx_hdr = {
 	{
 		0x0000,
@@ -92,6 +93,22 @@
 		0x0008
 	}
 };
+#else
+struct ol_txrx_ipa_uc_tx_hdr ipa_uc_tx_hdr = {
+	{
+		0x00000000,
+		0x00000000
+	},
+	{
+		0x00000000
+	},
+	{
+		{0x00, 0x03, 0x7f, 0xaa, 0xbb, 0xcc},
+		{0x00, 0x03, 0x7f, 0xdd, 0xee, 0xff},
+		0x0008
+	}
+};
+#endif
 
 /**
  * ol_txrx_ipa_uc_get_resource() - Client request resource information
diff --git a/core/dp/txrx/ol_txrx_ipa.h b/core/dp/txrx/ol_txrx_ipa.h
index d489e8e..cadf1a0 100644
--- a/core/dp/txrx/ol_txrx_ipa.h
+++ b/core/dp/txrx/ol_txrx_ipa.h
@@ -29,11 +29,20 @@
  * @reserved2: Reserved not used
  *
  */
+#ifdef QCA_WIFI_3_0
 struct frag_header {
 	uint16_t length;
 	uint32_t reserved1;
 	uint32_t reserved2;
 } __packed;
+#else
+struct frag_header {
+	uint32_t
+		length:16,
+		reserved16:16;
+	uint32_t reserved2;
+} __packed;
+#endif
 
 /**
  * struct ipa_header - ipa header type registered to IPA hardware