浏览代码

qcacmn: Add extension2 data to radiotap header

There is a requirement to get sequence number and tid for tx
data packets in packet capture mode. These fields are not
received as part of WBM tx completion, but are obtained from
FW in ppdu stats. As WBM tx completion and FW ppdu stats are
two different events, the ppdu_stats of previously sent ppdu
are filled in the radiotap header of current tx ppdu in packet
capture mode.

Enhance code to add required fields such as ppdu_id of tx current
ppdu and ppdu_id, tid, start_seq, ba_bitmap of previously sent ppdu
as extension2 to radiotap header. These fields will be added in
radiotap header only when add_rtap_ext2 is set.

Change-Id: I448a9c03a770b61ab802d855bc5f1a6587bd01b3
CRs-Fixed: 3004472
Surabhi Vishnoi 4 年之前
父节点
当前提交
878eeb8f5d
共有 2 个文件被更改,包括 47 次插入2 次删除
  1. 27 1
      qdf/inc/qdf_nbuf.h
  2. 20 1
      qdf/linux/src/qdf_nbuf.c

+ 27 - 1
qdf/inc/qdf_nbuf.h

@@ -199,6 +199,8 @@
  * 4 bytes padding for alignment
  */
 #define RADIOTAP_HEADER_EXT_LEN (2 * sizeof(uint32_t))
+#define RADIOTAP_HEADER_EXT2_LEN \
+	(sizeof(struct qdf_radiotap_ext2))
 #define RADIOTAP_HEADER_LEN (RADIOTAP_BASE_HEADER_LEN + \
 				RADIOTAP_FIXED_HEADER_LEN + \
 				RADIOTAP_HT_FLAGS_LEN + \
@@ -208,7 +210,8 @@
 				RADIOTAP_HE_MU_FLAGS_LEN + \
 				RADIOTAP_HE_MU_OTHER_FLAGS_LEN + \
 				RADIOTAP_VENDOR_NS_LEN + \
-				RADIOTAP_HEADER_EXT_LEN)
+				RADIOTAP_HEADER_EXT_LEN + \
+				RADIOTAP_HEADER_EXT2_LEN)
 
 /**
  * struct mon_rx_status - This will have monitor mode rx_status extracted from
@@ -286,6 +289,9 @@
  * @tx_status: packet tx status
  * @tx_retry_cnt: tx retry count
  * @add_rtap_ext: add radio tap extension
+ * @start_seq: starting sequence number
+ * @ba_bitmap: 256 bit block ack bitmap
+ * @add_rtap_ext2: add radiotap extension2
  */
 struct mon_rx_status {
 	uint64_t tsft;
@@ -370,6 +376,9 @@ struct mon_rx_status {
 	uint8_t  tx_status;
 	uint8_t  tx_retry_cnt;
 	bool add_rtap_ext;
+	uint16_t start_seq;
+	uint32_t ba_bitmap[8];
+	bool add_rtap_ext2;
 };
 
 /**
@@ -468,6 +477,23 @@ struct qdf_radiotap_vendor_ns_ath {
 	uint32_t ppdu_start_timestamp;
 } __attribute__((__packed__));
 
+/**
+ * struct qdf_radiotap_ext2 - radiotap ext2 fields
+ * ppdu_id: ppdu_id of current msdu
+ * prev_ppdu_id: ppdu_id of previous msdu
+ * tid: tid number of previous msdu
+ * start_seq: start sequence of previous msdu
+ * ba_bitmap: block ack bitmap of previous msdu
+ */
+struct qdf_radiotap_ext2 {
+	uint32_t ppdu_id;
+	uint32_t prev_ppdu_id;
+	uint16_t tid:8,
+		 reserved:8;
+	uint16_t start_seq;
+	uint32_t ba_bitmap[8];
+} __attribute__((__packed__));
+
 #define QDF_MEM_FUNC_NAME_SIZE 48
 
 /* Masks for HE SIG known fields in mon_rx_status structure */

+ 20 - 1
qdf/linux/src/qdf_nbuf.c

@@ -4525,7 +4525,7 @@ qdf_nbuf_update_radiotap_he_mu_other_flags(struct mon_rx_status *rx_status,
 
 #define IEEE80211_RADIOTAP_TX_STATUS 0
 #define IEEE80211_RADIOTAP_RETRY_COUNT 1
-
+#define IEEE80211_RADIOTAP_EXTENSION2 2
 uint8_t ATH_OUI[] = {0x00, 0x03, 0x7f}; /* Atheros OUI */
 
 /**
@@ -4580,6 +4580,7 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
 	uint32_t rtap_len = rtap_hdr_len;
 	uint8_t length = rtap_len;
 	struct qdf_radiotap_vendor_ns_ath *radiotap_vendor_ns_ath;
+	struct qdf_radiotap_ext2 *rtap_ext2;
 	uint32_t *rtap_ext = NULL;
 
 	/* Adding Extended Header space */
@@ -4785,6 +4786,24 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
 		rtap_len += 1;
 	}
 
+	/* Add Extension2 to Radiotap Header */
+	if (rx_status->add_rtap_ext2) {
+		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_EXT);
+		rtap_ext = (uint32_t *)&rthdr->it_present;
+		rtap_ext++;
+		*rtap_ext |= cpu_to_le32(1 << IEEE80211_RADIOTAP_EXTENSION2);
+
+		rtap_ext2 = (struct qdf_radiotap_ext2 *)(rtap_buf + rtap_len);
+		rtap_ext2->ppdu_id = rx_status->ppdu_id;
+		rtap_ext2->prev_ppdu_id = rx_status->prev_ppdu_id;
+		rtap_ext2->tid = rx_status->tid;
+		rtap_ext2->start_seq = rx_status->start_seq;
+		qdf_mem_copy(rtap_ext2->ba_bitmap,
+			     rx_status->ba_bitmap, 8 * (sizeof(uint32_t)));
+
+		rtap_len += sizeof(*rtap_ext2);
+	}
+
 	rthdr->it_len = cpu_to_le16(rtap_len);
 	rthdr->it_present = cpu_to_le32(rthdr->it_present);