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.kwaczyn...@tieto.com>
---
 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

_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to