2021-01-25 15:50:13

by Philipp Borgers

[permalink] [raw]
Subject: [PATCH] mac80211: add STBC encoding to ieee80211_parse_tx_radiotap

This patch adds support for STBC encoding to the radiotap tx parse
function. Prior to this change adding the STBC flag to the radiotap
header did not encode frames with STBC.

Signed-off-by: Philipp Borgers <[email protected]>
---
net/mac80211/tx.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ebb3228ce971..cd53675d9955 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2038,6 +2038,7 @@ bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
u16 vht_known;
u8 vht_mcs = 0, vht_nss = 0;
int i;
+ int stbc;

/* check for not even having the fixed radiotap header part */
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
@@ -2133,6 +2134,12 @@ bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW &&
mcs_bw == IEEE80211_RADIOTAP_MCS_BW_40)
rate_flags |= IEEE80211_TX_RC_40_MHZ_WIDTH;
+
+ if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_STBC) {
+ stbc = mcs_flags & IEEE80211_RADIOTAP_MCS_STBC_MASK;
+ stbc = stbc >> IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
+ info->flags |= stbc << IEEE80211_TX_CTL_STBC_SHIFT;
+ }
break;

case IEEE80211_RADIOTAP_VHT:
--
2.30.0