wlan: Low Power Heartbeat feature

New customer requirement, Low power heartbeat
FW will handle TCP/UDP level heartbeat failure detection.
Host will send configuration request to FW with parameters.
Host will use TESTMODE as a command path.

Change-Id: I7a0ad93e409fa432c68b9d73aff64b6c3fc13782
CRs-fixed: 518667
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index 51edf88..0c565e6 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -393,6 +393,9 @@
   /* TDLS_Indication */
   WDI_TDLS_IND,
 
+  /* LPHB Timeout Indication from FW to umac */
+  WDI_LPHB_WAIT_TIMEOUT_IND,
+
   WDI_MAX_IND
 }WDI_LowLevelIndEnumType;
 
@@ -601,6 +604,18 @@
     wpt_uint8       bssIdx;  /*bssidx on which beacon is missed*/
 } WDI_MissedBeaconIndType;
 
+#ifdef FEATURE_WLAN_LPHB
+/*---------------------------------------------------------------------------
+ WDI_LPHBTimeoutIndData
+-----------------------------------------------------------------------------*/
+typedef struct
+{
+   wpt_uint8 bssIdx;
+   wpt_uint8 sessionIdx;
+   wpt_uint8 protocolType; /*TCP or UDP*/
+   wpt_uint8 eventReason;
+} WDI_LPHBTimeoutIndData;
+#endif /* FEATURE_WLAN_LPHB */
 
 /*---------------------------------------------------------------------------
   WDI_LowLevelIndType
@@ -651,6 +666,9 @@
     WDI_WakeReasonIndType        wdiWakeReasonInd;
 #endif // WLAN_WAKEUP_EVENTS
     WDI_MissedBeaconIndType      wdiMissedBeaconInd;
+#ifdef FEATURE_WLAN_LPHB
+    WDI_LPHBTimeoutIndData       wdiLPHBTimeoutInd;
+#endif /* FEATURE_WLAN_LPHB */
   }  wdiIndicationData;
 }WDI_LowLevelIndType;
 
@@ -4305,6 +4323,83 @@
   WDI_Status   wdiStatus; 
 }WDI_SuspendResumeRspParamsType;
 
+#ifdef FEATURE_WLAN_LPHB
+/*---------------------------------------------------------------------------
+  WDI Low Power Heart Beat Config request
+  Copy from sirApi.h to avoid compile error
+---------------------------------------------------------------------------*/
+#define WDI_LPHB_FILTER_LEN   64
+
+typedef enum
+{
+   WDI_LPHB_SET_EN_PARAMS_INDID = 0x0001,
+   WDI_LPHB_SET_TCP_PARAMS_INDID,
+   WDI_LPHB_SET_TCP_PKT_FILTER_INDID,
+   WDI_LPHB_SET_UDP_PARAMS_INDID,
+   WDI_LPHB_SET_UDP_PKT_FILTER_INDID,
+   WDI_LPHB_SET_NETWORK_INFO_INDID,
+} WDI_LPHBIndType;
+
+typedef struct
+{
+   wpt_uint8 enable;
+   wpt_uint8 item;
+   wpt_uint8 session;
+} WDI_LPHBEnableStruct;
+
+typedef struct
+{
+   wpt_uint32 srv_ip;
+   wpt_uint32 dev_ip;
+   wpt_uint16 src_port;
+   wpt_uint16 dst_port;
+   wpt_uint16 timeout;
+   wpt_uint8  session;
+   wpt_uint8  gateway_mac[WDI_MAC_ADDR_LEN];
+} WDI_LPHBTcpParamStruct;
+
+typedef struct
+{
+   wpt_uint16 length;
+   wpt_uint8  offset;
+   wpt_uint8  session;
+   wpt_uint8  filter[WDI_LPHB_FILTER_LEN];
+} WDI_LPHBTcpFilterStruct;
+
+typedef struct
+{
+   wpt_uint32 srv_ip;
+   wpt_uint32 dev_ip;
+   wpt_uint16 src_port;
+   wpt_uint16 dst_port;
+   wpt_uint16 interval;
+   wpt_uint16 timeout;
+   wpt_uint8  session;
+   wpt_uint8  gateway_mac[WDI_MAC_ADDR_LEN];
+} WDI_LPHBUdpParamStruct;
+
+typedef struct
+{
+   wpt_uint16 length;
+   wpt_uint8  offset;
+   wpt_uint8  session;
+   wpt_uint8  filter[WDI_LPHB_FILTER_LEN];
+} WDI_LPHBUdpFilterStruct;
+
+typedef struct
+{
+   wpt_uint16 cmd;
+   wpt_uint16 dummy;
+   union
+   {
+      WDI_LPHBEnableStruct     lphbEnableReq;
+      WDI_LPHBTcpParamStruct   lphbTcpParamReq;
+      WDI_LPHBTcpFilterStruct  lphbTcpFilterReq;
+      WDI_LPHBUdpParamStruct   lphbUdpParamReq;
+      WDI_LPHBUdpFilterStruct  lphbUdpFilterReq;
+   } params;
+} WDI_LPHBReq;
+#endif /* FEATURE_WLAN_LPHB */
 
 #ifdef FEATURE_WLAN_SCAN_PNO
 
@@ -4989,6 +5084,16 @@
   void*            pUserData;
 }WDI_SetTmLevelRspType;
 
+#ifdef FEATURE_WLAN_LPHB
+/*---------------------------------------------------------------------------
+  WDI_LPHBConfigParamsType
+---------------------------------------------------------------------------*/
+typedef struct
+{
+  void*             pLphsConfIndData;
+}WDI_LPHBConfigParamsType;
+#endif /* FEATURE_WLAN_LPHB */
+
 /*----------------------------------------------------------------------------
  *   WDI callback types
  *--------------------------------------------------------------------------*/
@@ -6788,6 +6893,10 @@
                                 void*        pUserData);
 #endif
 
+#ifdef FEATURE_WLAN_LPHB
+typedef void  (*WDI_LphbCfgCb)(WDI_Status   wdiStatus,
+                                void*        pUserData);
+#endif /* FEATURE_WLAN_LPHB */
 
 /*========================================================================
  *     Function Declarations and Documentation
@@ -9699,6 +9808,24 @@
 */
 void WDI_SetEnableSSR(wpt_boolean  enableSSR);
 
+#ifdef FEATURE_WLAN_LPHB
+/**
+ @brief WDI_LPHBConfReq
+    This API is called to config FW LPHB rule
+
+ @param lphbconfParam : LPHB rule should config to FW
+        usrData : Client context
+        lphbCfgCb : Configuration status callback
+ @see
+ @return SUCCESS or FAIL
+*/
+WDI_Status WDI_LPHBConfReq
+(
+   void *lphbconfParam,
+   void *usrData,
+   WDI_LphbCfgCb lphbCfgCb
+);
+#endif /* FEATURE_WLAN_LPHB */
 #ifdef __cplusplus
  }
 #endif