qcacmn: Add support for STA inactive time in Hawkeye

Currently there is not STA inactive time support for lithium.
Read inactive_time from htt_peer_stats_cmn_tlv by sending
HTT_DBG_EXT_STATS_PEER_INFO to firmware.
After sending command, wait on completion variable till
firmware to response, trigger completion upon firmware response.

CRs-Fixed: 2319219
Change-Id: I93e6343641ae5c72610a57dd6ba551cca0b010c1
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index e812f9b..eb46540 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -3370,6 +3370,7 @@
 	/* initlialize cal client timer */
 	dp_cal_client_attach(&pdev->cal_client_ctx, pdev, pdev->soc->osdev,
 			     &dp_iterate_update_peer_list);
+	qdf_event_create(&pdev->fw_peer_stats_event);
 
 	return (struct cdp_pdev *)pdev;
 
@@ -7829,6 +7830,7 @@
  * @pdev_handle: DP_PDEV handle
  * @mac_addr: mac address of the peer
  * @cap: Type of htt stats requested
+ * @is_wait: if set, wait on completion from firmware response
  *
  * Currently Supporting only MAC ID based requests Only
  *	1: HTT_PEER_STATS_REQ_MODE_NO_QUERY
@@ -7839,7 +7841,7 @@
  */
 static void
 dp_get_fw_peer_stats(struct cdp_pdev *pdev_handle, uint8_t *mac_addr,
-		uint32_t cap)
+		uint32_t cap, uint32_t is_wait)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	int i;
@@ -7863,9 +7865,20 @@
 	config_param3 |= (mac_addr[4] & 0x000000ff);
 	config_param3 |= ((mac_addr[5] << 8) & 0x0000ff00);
 
-	dp_h2t_ext_stats_msg_send(pdev, HTT_DBG_EXT_STATS_PEER_INFO,
-			config_param0, config_param1, config_param2,
-			config_param3, 0, 0, 0);
+	if (is_wait) {
+		qdf_event_reset(&pdev->fw_peer_stats_event);
+		dp_h2t_ext_stats_msg_send(pdev, HTT_DBG_EXT_STATS_PEER_INFO,
+					  config_param0, config_param1,
+					  config_param2, config_param3,
+					  0, 1, 0);
+		qdf_wait_single_event(&pdev->fw_peer_stats_event,
+				      DP_FW_PEER_STATS_CMP_TIMEOUT_MSEC);
+	} else {
+		dp_h2t_ext_stats_msg_send(pdev, HTT_DBG_EXT_STATS_PEER_INFO,
+					  config_param0, config_param1,
+					  config_param2, config_param3,
+					  0, 0, 0);
+	}
 
 }