mac80211: add no update durationId bit in radiotap
PATCH 1/2 mac80211: add no update durationId bit in radiotap
Adds a new bit in radiotap_tx flags, which allows injections frames without changing durationId filed. The intention is a NAV update testing.
--- include/net/ieee80211_radiotap.h | 14 +++++++++----- include/net/mac80211.h | 3 +++ net/mac80211/tx.c | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-)
include/net/ieee80211_radiotap.h +9 -5
@@ -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
include/net/mac80211.h +3 -0
@@ -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 ), };/*
net/mac80211/tx.c +4 -0
@@ -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 ; }
Signature · 1 line
1.7.9.5
PATCH 2/2 ath9k: Handling flag IEEE80211_TX_CTRL_NO_DUR_UPDATE
Prevents durationId field updates for injected frames when this information is included in radiotap header. It could be very useful for testing NAV update.
--- drivers/net/wireless/ath/ath9k/xmit.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +9 -2
@@ -1092,8 +1092,15 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, rates = bf->rates; hdr = (struct ieee80211_hdr *)skb->data; -/* set dur_update_en for l-sig computation except for PS-Poll frames */ - info->dur_update = !ieee80211_is_pspoll (hdr->frame_control); +if (tx_info->flags &IEEE80211_TX_CTRL_NO_DUR_UPDATE ) { + info->dur_update =0 ; + }else { +/* set dur_update_en for l-sig computation except for PS-Poll +* frames +*/ + info->dur_update = !ieee80211_is_pspoll (hdr->frame_control); + } + info->rtscts_rate = fi->rtscts_rate;for (i =0 ; i <ARRAY_SIZE (bf->rates); i++) {
Signature · 1 line
1.7.9.5
PATCH 1/2 mac80211: add no update durationId bit in radiotap
In reply to Marek KwaczynskiQuoted 3 lines · Marek Kwaczynski
Adds a new bit in
radiotap_txflags, which allows injections frames without changing durationId filed. The intention is a NAV update testing.
NACK.
http://www.radiotap.org/suggested-fields/TX%20flags
And since I'm tired of this, I'll make any further radiotap updates to this particular field contingent on somebody actually standardising it properly.
johannes
PATCH 1/2 mac80211: add no update durationId bit in radiotap
Hi Johannes,
I can achieve the same result without changing radiotap header if durationID filed won't be updated for all injected frames. What do you think about it?
Best regards,
Marek Kwaczynski
Quoted 15 lines · Johannes Berg
Quoted 3 lines · Marek Kwaczynski
Adds a new bit in
radiotap_txflags, which allows injections frames without changing durationId filed. The intention is a NAV update testing.NACK.
http://www.radiotap.org/suggested-fields/TX%20flags
And since I'm tired of this, I'll make any further radiotap updates to this particular field contingent on somebody actually standardising it properly.
johannes
Johannes Berg
maintainerPATCH 1/2 mac80211: add no update durationId bit in radiotap
Quoted 5 lines · Marek Kwaczynski
Hi Johannes,
I can achieve the same result without changing radiotap header if durationID filed won't be updated for all injected frames. What do you think about it?
I think that's a terrible idea, particularly backward compatibility with older hostapd versions.
johannes