summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVulupala Shashank Reddy <vulupa@codeaurora.org>2019-08-29 09:48:40 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-10-09 01:38:03 -0700
commit700a1204af197134f49fdbe3a536acb3603407cc (patch)
tree57e00e7314986ed80d300240aa6b5edda300c410
parent7b0707fe7cfbe13023e9fae5077339d266469c9a (diff)
qcacmn: Add support to include ACK status for mon interface
Extend radiotap header to append ACK status for packets sent to virtual mon interface. Change-Id: I2f57f7dbf1efdb44185fc9a1383c2d0c3a795f99 CRs-Fixed: 2538423
-rw-r--r--qdf/inc/qdf_nbuf.h6
-rw-r--r--qdf/linux/src/qdf_nbuf.c35
2 files changed, 37 insertions, 4 deletions
diff --git a/qdf/inc/qdf_nbuf.h b/qdf/inc/qdf_nbuf.h
index 27dbb7c2b33c..612a04ef6140 100644
--- a/qdf/inc/qdf_nbuf.h
+++ b/qdf/inc/qdf_nbuf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -155,6 +155,8 @@
* @sgi: Rx frame short guard interval
* @ldpc: ldpc enabled
* @beamformed: Is frame beamformed.
+ * @tx_status: Status of Tx frame
+ * @add_rtap_ext: Bool to add extension to radiotap header
*/
struct mon_rx_status {
uint64_t tsft;
@@ -179,6 +181,8 @@ struct mon_rx_status {
uint8_t sgi;
uint8_t ldpc;
uint8_t beamformed;
+ uint8_t tx_status;
+ bool add_rtap_ext;
};
/* DHCP Related Mask */
diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c
index 32226d4c9b08..2544d8da6952 100644
--- a/qdf/linux/src/qdf_nbuf.c
+++ b/qdf/linux/src/qdf_nbuf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -3417,13 +3417,23 @@ static unsigned int qdf_nbuf_update_radiotap_vht_flags(
#define NORMALIZED_TO_NOISE_FLOOR (-96)
+#define IEEE80211_RADIOTAP_TX_STATUS 0
+
+/* This is Radio Tap Header Extension Length.
+ * 4 Bytes for Extended it_present bit map +
+ * 4 bytes padding for alignment
+ */
+#define RADIOTAP_HEADER_EXT_LEN (2 * sizeof(uint32_t))
+
/* This is the length for radiotap, combined length
- * (Mandatory part struct ieee80211_radiotap_header + RADIOTAP_HEADER_LEN)
+ * (Mandatory part struct ieee80211_radiotap_header +
+ * RADIOTAP_HEADER_LEN + RADIOTAP_HEADER_EXT_LEN)
* cannot be more than available headroom_sz.
* Max size current radiotap we are populating is less than 100 bytes,
* increase this when we add more radiotap elements.
*/
-#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + 100)
+#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + \
+ RADIOTAP_HEADER_EXT_LEN + 100)
/**
* qdf_nbuf_update_radiotap() - Update radiotap header from rx_status
@@ -3441,6 +3451,13 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
(struct ieee80211_radiotap_header *)rtap_buf;
uint32_t rtap_hdr_len = sizeof(struct ieee80211_radiotap_header);
uint32_t rtap_len = rtap_hdr_len;
+ uint32_t *rtap_ext = NULL;
+
+ /* Adding Extended Header space */
+ if (rx_status->add_rtap_ext) {
+ rtap_hdr_len += RADIOTAP_HEADER_EXT_LEN;
+ rtap_len = rtap_hdr_len;
+ }
/* IEEE80211_RADIOTAP_TSFT __le64 microseconds*/
rthdr->it_present = cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
@@ -3510,6 +3527,18 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
rtap_buf,
rtap_len);
}
+
+ /* Add Extension to Radiotap Header & corresponding data */
+ if (rx_status->add_rtap_ext) {
+ 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_TX_STATUS);
+
+ rtap_buf[rtap_len] = rx_status->tx_status;
+ rtap_len += 1;
+ }
+
rthdr->it_len = cpu_to_le16(rtap_len);
if (headroom_sz < rtap_len) {