qcacmn: Add Support for msdu retry stats

Requirement to provide various msdu retry stats to host:-
1. successfully transmitted msdus
2. Retried msdus
3. msdus retried for more than once
4. failed msdus

Change-Id: I4cd7dfceae16b4223df605fa174299858a8651c8
diff --git a/wmi_unified_api.h b/wmi_unified_api.h
index 7a4c1fe..23ca0d6 100644
--- a/wmi_unified_api.h
+++ b/wmi_unified_api.h
@@ -1201,6 +1201,18 @@
 QDF_STATUS wmi_extract_vdev_nac_rssi_stats(void *wmi_hdl, void *evt_buf,
 		struct wmi_host_vdev_nac_rssi_event *vdev_nac_rssi_stats);
 
+/**
+ * wmi_extract_peer_retry_stats() - extract peer retry stats from event
+ * @wmi_handle: wmi handle
+ * @evt_buf: pointer to event buffer
+ * @index: Index into peer retry stats
+ * @peer_retry_stats: Pointer to hold  peer retry stats
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_extract_peer_retry_stats(void *wmi_hdl, void *evt_buf,
+	uint32_t index, struct wmi_host_peer_retry_stats *peer_retry_stats);
+
 QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl,
 				struct wmi_power_dbg_params *param);
 
diff --git a/wmi_unified_param.h b/wmi_unified_param.h
index aa49e25..267c70f 100644
--- a/wmi_unified_param.h
+++ b/wmi_unified_param.h
@@ -959,6 +959,7 @@
 	WMI_HOST_REQUEST_NAC_RSSI =  0x200,
 	WMI_HOST_REQUEST_BCN_STAT =  0x800,
 	WMI_HOST_REQUEST_BCN_STAT_RESET =  0x1000,
+	WMI_HOST_REQUEST_PEER_RETRY_STAT = 0x2000,
 } wmi_host_stats_id;
 
 typedef struct {
@@ -4464,6 +4465,25 @@
 	uint32_t rssi_seq_num;
 };
 
+/**
+ * structure wmi_host_peer_retry_stats - peer retry stats
+ * @peer_macaddr: peer macaddr
+ * @retry_counter_wraparnd_ind: wraparound counter indication
+ * @msdu_success: successfully transmitted msdus
+ * @msdu_retried: Retried msdus
+ * @msdu_mul_retried: msdus retried for more than once
+ * @msdu_failed: msdus failed
+ * @reserved: for furure extensions
+ */
+struct wmi_host_peer_retry_stats {
+	wmi_host_mac_addr peer_macaddr;
+	uint32_t retry_counter_wraparnd_ind;
+	uint32_t msdus_success;
+	uint32_t msdus_retried;
+	uint32_t msdus_mul_retried;
+	uint32_t msdus_failed;
+	uint32_t reserved[4];
+};
 
 /**
  * struct wmi_host_per_chain_rssi_stats - VDEV nac rssi stats
@@ -4888,6 +4908,7 @@
 	wmi_pdev_param_esp_airtime_fraction,
 	wmi_pdev_param_esp_ppdu_duration,
 	wmi_pdev_param_use_nol,
+	wmi_pdev_param_enable_peer_retry_stats,
 	wmi_pdev_param_max,
 } wmi_conv_pdev_params_id;
 
diff --git a/wmi_unified_priv.h b/wmi_unified_priv.h
index ef16617..d928d48 100644
--- a/wmi_unified_priv.h
+++ b/wmi_unified_priv.h
@@ -1503,6 +1503,10 @@
 QDF_STATUS (*extract_peer_extd_stats)(wmi_unified_t wmi_handle, void *evt_buf,
 		 uint32_t index, wmi_host_peer_extd_stats *peer_extd_stats);
 
+QDF_STATUS (*extract_peer_retry_stats)(wmi_unified_t wmi_handle, void *evt_buf,
+	    uint32_t index,
+	    struct wmi_host_peer_retry_stats *peer_retry_stats);
+
 QDF_STATUS (*extract_chan_stats)(wmi_unified_t wmi_handle, void *evt_buf,
 			 uint32_t index, wmi_host_chan_stats *chan_stats);