mac80211: Parse legacy and HT rate in injected frames
Subsystems (3)
PATCH v3 1/1 mac80211: Parse legacy and HT rate in injected frames
Drivers/devices without their own rate control algorithm can get the information what rates they should use from either the radiotap header of injected frames or from the rate control algorithm. But the parsing of the legacy rate information from the radiotap header was removed in commit e6a9854b05c1 ("mac80211/drivers: rewrite the rate control API").
The removal of this feature heavily reduced the usefulness of frame injection when wanting to simulate specific transmission behavior. Having rate parsing together with MCS rates and retry support allows a fine grained selection of the tx behavior of injected frames for these kind of tests.
---
v3:
- switch order of arguments in ieee80211_parse_tx_radiotap
- simplify selection of the retry counter
- move IEEE80211_TX_CTRL_RATE_INJECT check inside ieee80211_tx_h_rate_ctrl to let it set use_rts, use_cts_prot, short_preamble
v2:
- resent RFC as v2 because first patch was not correctly marked as RFC
- removed check from ieee80211_xmit_fast because this one is never called for injected frames
--- Documentation/networking/mac80211-injection.txt | 17 ++++++ include/net/mac80211.h | 2 + net/mac80211/tx.c | 72 ++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 2 deletions(-)
Documentation/networking/mac80211-injection.txt +17 -0
@@ -28,6 +28,23 @@ radiotap headers and used to control injection: IEEE80211_RADIOTAP_F_TX_NOACK: frame should be sent without waiting for an ACK even if it is a unicast frame + * IEEE80211_RADIOTAP_RATE + + legacy rate for the transmission (only for devices without own rate control) + + * IEEE80211_RADIOTAP_MCS + + HT rate for the transmission (only for devices without own rate control). + Also some flags are parsed + + IEEE80211_TX_RC_SHORT_GI: use short guard interval + IEEE80211_TX_RC_40_MHZ_WIDTH: send in HT40 mode + + * IEEE80211_RADIOTAP_DATA_RETRIES + + number of retries when either IEEE80211_RADIOTAP_RATE or + IEEE80211_RADIOTAP_MCS was used + The injection code can also skip all other currently defined radiotap fields facilitating replay of captured radiotap headers directly.
include/net/mac80211.h +2 -0
@@ -708,12 +708,14 @@ enum mac80211_tx_info_flags {* protocol frame (e.g. EAP) * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll * frame (PS-Poll or uAPSD). +* @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information * * 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_PS_RESPONSE =BIT (1 ), +IEEE80211_TX_CTRL_RATE_INJECT =BIT (2 ), };/*
net/mac80211/tx.c +70 -2
110 lines not on this page · raw message
Signature · 1 line
2.7.0
Quoted 9 lines · Sven Eckelmann
Drivers/devices without their own rate control algorithm can get the information what rates they should use from either the radiotap header of
injected frames or from the rate control algorithm. But the parsing of the
legacy rate information from the radiotap header was removed in commite6a9854b05c1("mac80211/drivers: rewrite the rate control API").
Applied.
johannes