Search Linux Wireless

[PATCH 1/2] mac80211: add no update durationId bit in radiotap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adds a new bit in radiotap_tx flags, which allows injections
frames without changing durationId filed. The intention is
a NAV update testing.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@xxxxxxxxx>
---
 include/net/ieee80211_radiotap.h |   14 +++++++++-----
 include/net/mac80211.h           |    3 +++
 net/mac80211/tx.c                |    4 ++++
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index b0fd947..b00b7dd 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -261,11 +261,15 @@ enum ieee80211_radiotap_type {
 
 /* For IEEE80211_RADIOTAP_TX_FLAGS */
 #define IEEE80211_RADIOTAP_F_TX_FAIL	0x0001	/* failed due to excessive
-						 * retries */
-#define IEEE80211_RADIOTAP_F_TX_CTS	0x0002	/* used cts 'protection' */
-#define IEEE80211_RADIOTAP_F_TX_RTS	0x0004	/* used rts/cts handshake */
-#define IEEE80211_RADIOTAP_F_TX_NOACK	0x0008	/* don't expect an ack */
-
+							 * retries */
+#define IEEE80211_RADIOTAP_F_TX_CTS		0x0002	/* used cts
+							 * 'protection' */
+#define IEEE80211_RADIOTAP_F_TX_RTS		0x0004	/* used rts/cts
+							 * handshake */
+#define IEEE80211_RADIOTAP_F_TX_NOACK		0x0008	/* don't expect an
+							 * ack */
+#define IEEE80211_RADIOTAP_F_TX_NO_DUR_UPDATE	0x0010  /* don't touch
+							 * durationId field */
 
 /* For IEEE80211_RADIOTAP_MCS */
 #define IEEE80211_RADIOTAP_MCS_HAVE_BW		0x01
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2de7ff4..8c55eb9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -512,11 +512,14 @@ enum mac80211_tx_info_flags {
  *
  * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
  *	protocol frame (e.g. EAP)
+ * @IEEE80211_TX_CTRL_NO_DUR_UPDATE: This frame should be send without
+ *	changing durationID field.
  *
  * These flags are used in tx_info->control.flags.
  */
 enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_PORT_CTRL_PROTO	= BIT(0),
+	IEEE80211_TX_CTRL_NO_DUR_UPDATE		= BIT(1),
 };
 
 /*
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 19d36d4..3b8087e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -104,6 +104,10 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
 		 *    and its SIFS
 		 * PS Poll: BIT(15) | BIT(14) | aid
 		 */
+		/* Don't touch durationId field */
+		if (info->flags & IEEE80211_TX_CTRL_NO_DUR_UPDATE)
+			return hdr->duration_id;
+
 		return 0;
 	}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux