Browse Source

qcacmn: Add missing fields in CDP Rx PPDU Statistics structure

Enable reaping of HAL PPDU Status ring when ol stats are enabled.
Added peer mac address and first_data_seqcntl fields into CDP Rx PPDU_stats
structure. Added support to disable printing of per packet stats through
iwpriv command.

Change-Id: If0f967676e867c7ba9870770c3c818cbea43461a
Pamidipati, Vijay 7 năm trước cách đây
mục cha
commit
d7eb83ec15
3 tập tin đã thay đổi với 33 bổ sung4 xóa
  1. 18 0
      dp/inc/cdp_txrx_cmn_struct.h
  2. 9 2
      dp/wifi3.0/dp_htt.c
  3. 6 2
      dp/wifi3.0/dp_rx_mon_status.c

+ 18 - 0
dp/inc/cdp_txrx_cmn_struct.h

@@ -159,6 +159,18 @@ enum cdp_host_txrx_stats {
 	TXRX_HOST_STATS_MAX,
 };
 
+/*
+ * cdp_ppdu_ftype: PPDU Frame Type
+ * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
+ * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
+*/
+enum cdp_ppdu_ftype {
+	CDP_PPDU_FTYPE_DATA,
+	CDP_PPDU_FTYPE_CTRL,
+	CDP_PPDU_FTYPE_MAX
+};
+
+
 /**
  * @brief General specification of the tx frame contents
  *
@@ -1168,6 +1180,9 @@ struct cdp_tx_completion_msdu {
  * @duration: PPDU duration
  * @tid: TID number
  * @peer_id: Peer ID
+ * @vdev_id: VAP ID
+ * @mac_addr: Peer MAC Address
+ * @first_data_seq_ctrl: Sequence control field of first data frame
  * @ltf_size: ltf_size
  * @stbc: When set, STBC rate was used
  * @he_re: he_re (range extension)
@@ -1200,6 +1215,9 @@ struct cdp_rx_indication_ppdu {
 	uint16_t duration;
 	uint32_t tid:8,
 		 peer_id:16;
+	uint8_t vdev_id;
+	uint8_t mac_addr[6];
+	uint16_t first_data_seq_ctrl;
 	union {
 		uint32_t rate_info;
 		struct {

+ 9 - 2
dp/wifi3.0/dp_htt.c

@@ -1320,6 +1320,7 @@ static uint8_t dp_get_ppdu_info_user_index(struct dp_pdev *pdev,
 static void dp_process_ppdu_stats_common_tlv(struct dp_pdev *pdev,
 		uint32_t *tag_buf)
 {
+	uint16_t frame_type;
 	struct cdp_tx_completion_ppdu *ppdu_desc;
 	htt_ppdu_stats_common_tlv *dp_stats_buf =
 		(htt_ppdu_stats_common_tlv *)tag_buf;
@@ -1332,8 +1333,14 @@ static void dp_process_ppdu_stats_common_tlv(struct dp_pdev *pdev,
 	ppdu_desc->num_users =
 		HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_GET(*tag_buf);
 	tag_buf++;
-	ppdu_desc->frame_type =
-		HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(*tag_buf);
+	frame_type = HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(*tag_buf);
+
+	if ((frame_type == HTT_STATS_FTYPE_TIDQ_DATA_SU) ||
+			(frame_type == HTT_STATS_FTYPE_TIDQ_DATA_MU))
+		ppdu_desc->frame_type = CDP_PPDU_FTYPE_DATA;
+	else
+		ppdu_desc->frame_type = CDP_PPDU_FTYPE_CTRL;
+
 	ppdu_desc->ppdu_start_timestamp = dp_stats_buf->ppdu_start_tstmp_us;
 	ppdu_desc->ppdu_end_timestamp = 0; /*TODO: value to be provided by FW */
 	tag_buf += 6;

+ 6 - 2
dp/wifi3.0/dp_rx_mon_status.c

@@ -66,7 +66,12 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_soc *soc,
 		return;
 	}
 
+	qdf_mem_copy(cdp_rx_ppdu->mac_addr,
+			peer->mac_addr.raw, DP_MAC_ADDR_LEN);
+	cdp_rx_ppdu->first_data_seq_ctrl =
+		ppdu_info->rx_status.first_data_seq_ctrl;
 	cdp_rx_ppdu->peer_id = peer->peer_ids[0];
+	cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id;
 	cdp_rx_ppdu->ppdu_id = ppdu_info->com_info.ppdu_id;
 	cdp_rx_ppdu->duration = ppdu_info->rx_status.duration;
 	cdp_rx_ppdu->u.bw = ppdu_info->rx_status.bw;
@@ -76,7 +81,6 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_soc *soc,
 	cdp_rx_ppdu->rssi = ppdu_info->rx_status.rssi_comb;
 	cdp_rx_ppdu->timestamp = ppdu_info->com_info.ppdu_timestamp;
 	cdp_rx_ppdu->channel = ppdu_info->rx_status.chan_freq;
-
 }
 #else
 static inline void
@@ -165,7 +169,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 			status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, mac_id);
 #endif
 #endif
-		if (pdev->monitor_vdev != NULL) {
+		if ((pdev->monitor_vdev != NULL) || (pdev->enhanced_stats_en)) {
 
 			do {
 				tlv_status = hal_rx_status_get_tlv_info(rx_tlv,