diff mbox series

mac80211: add STBC encoding to ieee80211_parse_tx_radiotap

Message ID 20210125150744.83065-1-borgers@mi.fu-berlin.de
State New
Headers show
Series mac80211: add STBC encoding to ieee80211_parse_tx_radiotap | expand

Commit Message

Philipp Borgers Jan. 25, 2021, 3:07 p.m. UTC
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 <borgers@mi.fu-berlin.de>
---
 net/mac80211/tx.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

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: