Skip to contentSkip to conversation

Work on STBC Rx monitoring

PATCH Superseded Oleksij Rempel 2 participants 20 messages May 19, 2013 – May 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Work on STBC Rx monitoring

This patch set will pass RxSTBC flags from ath9k to ieee80211 and to radiotap.
This field is now a part of radiotap specification:
http://www.radiotap.org/defined-fields/MCS

Oleksij Rempel (3):
mac80211: add STBC flag for radiotap
ath9k: remove useless flag conversation.
ath9k: check for Rx-STBC flag and pass it to ieee80211

 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 16 ++++++++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  4 +++-
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 include/net/ieee80211_radiotap.h            |  7 +++++++
 include/net/mac80211.h                      |  4 ++++
 net/mac80211/main.c                         |  3 ++-
 net/mac80211/rx.c                           |  4 ++++
 net/mac80211/status.c                       |  3 ++-
 9 files changed, 38 insertions(+), 13 deletions(-)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/3 mac80211: add STBC flag for radiotap

---
 include/net/ieee80211_radiotap.h | 7 +++++++
 include/net/mac80211.h           | 4 ++++
 net/mac80211/main.c              | 3 ++-
 net/mac80211/rx.c                | 4 ++++
 net/mac80211/status.c            | 3 ++-
 5 files changed, 19 insertions(+), 2 deletions(-)
include/net/ieee80211_radiotap.h +7 -0
index c399963..c6d07cb 100644
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
+#define IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
 
 #define IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
 #define		IEEE80211_RADIOTAP_MCS_BW_20	0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_SGI		0x04
 #define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+#define IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
+#define		IEEE80211_RADIOTAP_MCS_STBC_1	1
+#define		IEEE80211_RADIOTAP_MCS_STBC_2	2
+#define		IEEE80211_RADIOTAP_MCS_STBC_3	3
+
+#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
 
 /* For IEEE80211_RADIOTAP_AMPDU_STATUS */
 #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
include/net/mac80211.h +4 -0
index 885898a..16705a9 100644
@@ -805,6 +805,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *	on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  *	is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR		= BIT(0),
@@ -832,8 +833,11 @@ enum mac80211_rx_flags {
 	RX_FLAG_80MHZ			= BIT(23),
 	RX_FLAG_80P80MHZ		= BIT(24),
 	RX_FLAG_160MHZ			= BIT(25),
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
 };
 
+#define RX_FLAG_STBC_SHIFT		26
+
 /**
  * struct ieee80211_rx_status - receive status
  *
net/mac80211/main.c +2 -1
index 8a7bfc4..44191a3 100644
@@ -589,7 +589,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 	local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
 	local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
 					 IEEE80211_RADIOTAP_MCS_HAVE_GI |
-					 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+					 IEEE80211_RADIOTAP_MCS_HAVE_BW |
+					 IEEE80211_RADIOTAP_MCS_HAVE_STBC;
 	local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
 					 IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
 	local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
net/mac80211/rx.c +4 -0
index 8e29526..22bb2af 100644
@@ -258,6 +258,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc = status->flag & RX_FLAG_STBC_MASK;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		*pos++ = local->hw.radiotap_mcs_details;
 		*pos = 0;
@@ -267,6 +268,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		if (stbc)
+			*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+					<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
net/mac80211/status.c +2 -1
index 4343920..41143f8 100644
@@ -312,7 +312,8 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		pos[0] = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
 			 IEEE80211_RADIOTAP_MCS_HAVE_GI |
-			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+			 IEEE80211_RADIOTAP_MCS_HAVE_BW |
+			 IEEE80211_RADIOTAP_MCS_HAVE_STBC;
 		if (info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
 			pos[1] |= IEEE80211_RADIOTAP_MCS_SGI;
 		if (info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
Signature · 1 line
1.8.1.2
maintainer
#2 lore raw

PATCH 1/3 mac80211: add STBC flag for radiotap

Quoted 15 lines · Oleksij Rempel

+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3

include/net/mac80211.h +2 -0
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
@@ -258,6 +258,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc = status->flag & RX_FLAG_STBC_MASK;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		*pos++ = local->hw.radiotap_mcs_details;
 		*pos = 0;

include/net/mac80211.h ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, · line 275

Quoted 8 lines
include/net/mac80211.h +3 -0
@@ -267,6 +268,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		if (stbc)
+			*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+					<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;

Here you forgot the "HAVE" bit.

net/mac80211/main.c struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, · line 593

Quoted 3 lines
net/mac80211/main.c +2 -1
-			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+			 IEEE80211_RADIOTAP_MCS_HAVE_BW |
+			 IEEE80211_RADIOTAP_MCS_HAVE_STBC;

And here it's completely bogus.

johannes

#3 lore raw

PATCH v2 1/3 mac80211: add STBC flag for radiotap

revision:
- v2. set HAVE_STBC only if it is present.
do not set STBC flag on TX packets.

---
 include/net/ieee80211_radiotap.h |  7 +++++++
 include/net/mac80211.h           |  4 ++++
 net/mac80211/rx.c                | 13 ++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)
include/net/ieee80211_radiotap.h +7 -0
index c399963..c6d07cb 100644
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
+#define IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
 
 #define IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
 #define		IEEE80211_RADIOTAP_MCS_BW_20	0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_SGI		0x04
 #define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+#define IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
+#define		IEEE80211_RADIOTAP_MCS_STBC_1	1
+#define		IEEE80211_RADIOTAP_MCS_STBC_2	2
+#define		IEEE80211_RADIOTAP_MCS_STBC_3	3
+
+#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
 
 /* For IEEE80211_RADIOTAP_AMPDU_STATUS */
 #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
include/net/mac80211.h +4 -0
index 885898a..16705a9 100644
@@ -805,6 +805,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *	on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  *	is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR		= BIT(0),
@@ -832,8 +833,11 @@ enum mac80211_rx_flags {
 	RX_FLAG_80MHZ			= BIT(23),
 	RX_FLAG_80P80MHZ		= BIT(24),
 	RX_FLAG_160MHZ			= BIT(25),
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
 };
 
+#define RX_FLAG_STBC_SHIFT		26
+
 /**
  * struct ieee80211_rx_status - receive status
  *
net/mac80211/rx.c +12 -1
index 8e29526..db7c68a 100644
@@ -258,8 +258,16 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc = status->flag & RX_FLAG_STBC_MASK;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
-		*pos++ = local->hw.radiotap_mcs_details;
+
+		/* MCS known field */
+		*pos = local->hw.radiotap_mcs_details;
+		if (stbc)
+			*pos |= IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+		*pos++;
+
+		/* MCS flags field */
 		*pos = 0;
 		if (status->flag & RX_FLAG_SHORT_GI)
 			*pos |= IEEE80211_RADIOTAP_MCS_SGI;
@@ -267,6 +275,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		if (stbc)
+			*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+					<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
Signature · 1 line
1.8.1.2
maintainer
#4 lore raw

PATCH v2 1/3 mac80211: add STBC flag for radiotap

Quoted 3 lines · Oleksij Rempel

revision:
- v2. set HAVE_STBC only if it is present.
do not set STBC flag on TX packets.

Please don't include changes *inside* the changelog. Also, an actual commit message would be nice.

johannes

#5 lore raw

PATCH v3 1/3 mac80211: add STBC flag for radiotap

In reply to Johannes Berg

Some chips can tell us if received frame was encoded with STBC or not. To make this information available in user space we can use updated radiotap specification:
http://www.radiotap.org/defined-fields/MCS

This patch add HAVE_STBC flag and provide number
of STBC encoded spatial streams (Nss).

---
 include/net/ieee80211_radiotap.h |  7 +++++++
 include/net/mac80211.h           |  4 ++++
 net/mac80211/rx.c                | 13 ++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)
include/net/ieee80211_radiotap.h +7 -0
index c399963..c6d07cb 100644
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
+#define IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
 
 #define IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
 #define		IEEE80211_RADIOTAP_MCS_BW_20	0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_SGI		0x04
 #define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+#define IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
+#define		IEEE80211_RADIOTAP_MCS_STBC_1	1
+#define		IEEE80211_RADIOTAP_MCS_STBC_2	2
+#define		IEEE80211_RADIOTAP_MCS_STBC_3	3
+
+#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
 
 /* For IEEE80211_RADIOTAP_AMPDU_STATUS */
 #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
include/net/mac80211.h +4 -0
index 885898a..16705a9 100644
@@ -805,6 +805,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *	on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  *	is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR		= BIT(0),
@@ -832,8 +833,11 @@ enum mac80211_rx_flags {
 	RX_FLAG_80MHZ			= BIT(23),
 	RX_FLAG_80P80MHZ		= BIT(24),
 	RX_FLAG_160MHZ			= BIT(25),
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
 };
 
+#define RX_FLAG_STBC_SHIFT		26
+
 /**
  * struct ieee80211_rx_status - receive status
  *
net/mac80211/rx.c +12 -1
index 8e29526..db7c68a 100644
@@ -258,8 +258,16 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc = status->flag & RX_FLAG_STBC_MASK;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
-		*pos++ = local->hw.radiotap_mcs_details;
+
+		/* MCS known field */
+		*pos = local->hw.radiotap_mcs_details;
+		if (stbc)
+			*pos |= IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+		*pos++;
+
+		/* MCS flags field */
 		*pos = 0;
 		if (status->flag & RX_FLAG_SHORT_GI)
 			*pos |= IEEE80211_RADIOTAP_MCS_SGI;
@@ -267,6 +275,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		if (stbc)
+			*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+					<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
Signature · 1 line
1.8.1.2
maintainer
#6 lore raw

PATCH v3 1/3 mac80211: add STBC flag for radiotap

net/mac80211/rx.c ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, · line 267

Quoted 6 lines · Oleksij Rempel
net/mac80211/rx.c +5 -1
-		*pos++ = local->hw.radiotap_mcs_details;
+
+		/* MCS known field */
+		*pos = local->hw.radiotap_mcs_details;
+		if (stbc)
+			*pos |= IEEE80211_RADIOTAP_MCS_HAVE_STBC;

I think you shouldn't make this change, and the driver should include the HAVE_STBC flag in the hw.radiotap_mcs_details. I actually thought of this approach as well, but now just realized that this means that if the driver _knows_ that a certain frame was received w/o STBC, this knowledge cannot be transferred to the user, which would be a loss of information.

Quoted 4 lines
net/mac80211/rx.c +3 -0
+               if (stbc)
+                       *pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+                                       <<

IEEE80211_RADIOTAP_MCS_STBC_SHIFT;

No need for the if() here, OR'ing in 0 doesn't do anything.

johannes

#7 lore raw

PATCH v4 1/3 mac80211: add STBC flag for radiotap

In reply to Johannes Berg

Some chips can tell us if received frame was encoded with STBC or not. To make this information available in user space we can use updated radiotap specification:
http://www.radiotap.org/defined-fields/MCS

This patch will set number of STBC encoded spatial streams (Nss). The HAVE_STBC flag should be provided by driver.

---
 include/net/ieee80211_radiotap.h | 7 +++++++
 include/net/mac80211.h           | 4 ++++
 net/mac80211/rx.c                | 4 ++++
 3 files changed, 15 insertions(+)
include/net/ieee80211_radiotap.h +7 -0
index c399963..c6d07cb 100644
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
+#define IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
 
 #define IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
 #define		IEEE80211_RADIOTAP_MCS_BW_20	0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_MCS_SGI		0x04
 #define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+#define IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
+#define		IEEE80211_RADIOTAP_MCS_STBC_1	1
+#define		IEEE80211_RADIOTAP_MCS_STBC_2	2
+#define		IEEE80211_RADIOTAP_MCS_STBC_3	3
+
+#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
 
 /* For IEEE80211_RADIOTAP_AMPDU_STATUS */
 #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
include/net/mac80211.h +4 -0
index 885898a..16705a9 100644
@@ -805,6 +805,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *	on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  *	is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR		= BIT(0),
@@ -832,8 +833,11 @@ enum mac80211_rx_flags {
 	RX_FLAG_80MHZ			= BIT(23),
 	RX_FLAG_80P80MHZ		= BIT(24),
 	RX_FLAG_160MHZ			= BIT(25),
+	RX_FLAG_STBC_MASK		= BIT(26) | BIT(27),
 };
 
+#define RX_FLAG_STBC_SHIFT		26
+
 /**
  * struct ieee80211_rx_status - receive status
  *
net/mac80211/rx.c +4 -0
index 8e29526..811dd64 100644
@@ -258,6 +258,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	pos += 2;
 
 	if (status->flag & RX_FLAG_HT) {
+		unsigned int stbc;
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
 		*pos++ = local->hw.radiotap_mcs_details;
 		*pos = 0;
@@ -267,6 +268,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
 		if (status->flag & RX_FLAG_HT_GF)
 			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
+		stbc = status->flag & RX_FLAG_STBC_MASK;
+		*pos |= (stbc >> RX_FLAG_STBC_SHIFT)
+				<< IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
Signature · 1 line
1.8.1.2
maintainer Applied
#8 lore raw

PATCH v4 1/3 mac80211: add STBC flag for radiotap

Quoted 7 lines · Oleksij Rempel

Some chips can tell us if received frame was encoded with STBC or not. To make this information available in user space we can use updated radiotap specification:
http://www.radiotap.org/defined-fields/MCS

This patch will set number of STBC encoded spatial streams (Nss). The HAVE_STBC flag should be provided by driver.

Applied, thanks.

johannes

#9 lore raw

PATCH v4 1/3 mac80211: add STBC flag for radiotap

Am 24.05.2013 12:08, schrieb Johannes Berg:

Quoted 11 lines · Oleksij Rempel
Quoted 7 lines

Some chips can tell us if received frame was encoded with STBC or not. To make this information available in user space we can use updated radiotap specification:
http://www.radiotap.org/defined-fields/MCS

This patch will set number of STBC encoded spatial streams (Nss). The HAVE_STBC flag should be provided by driver.

Applied, thanks.

thank you.

Signature · 2 lines
Regards,
Oleksij
#10 lore raw

PATCH 2/3 ath9k: remove useless flag conversation.

In reply to Oleksij Rempel

some flags used only outside of ath9k - In this case we can use "enum mac80211_rx_flags" and pass it upstream without extra conversation.

---
 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 11 +++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  1 +
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 4 files changed, 12 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_mac.c +3 -2
index 301bf72..5163abd 100644
@@ -469,6 +469,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 
 	rxs->rs_status = 0;
 	rxs->rs_flags =  0;
+	rxs->flag =  0;
 
 	rxs->rs_datalen = rxsp->status2 & AR_DataLen;
 	rxs->rs_tstamp =  rxsp->status3;
@@ -493,8 +494,8 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 	rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
 	rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
 	rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
-	rxs->rs_flags  = (rxsp->status4 & AR_GI) ? ATH9K_RX_GI : 0;
-	rxs->rs_flags  |= (rxsp->status4 & AR_2040) ? ATH9K_RX_2040 : 0;
+	rxs->flag  |= (rxsp->status4 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rxs->flag  |= (rxsp->status4 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	rxs->evm0 = rxsp->status6;
 	rxs->evm1 = rxsp->status7;
drivers/net/wireless/ath/ath9k/mac.c +7 -4
index 498fee0..a52081d 100644
@@ -547,6 +547,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 
 	rs->rs_status = 0;
 	rs->rs_flags = 0;
+	rs->flag = 0;
 
 	rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
 	rs->rs_tstamp = ads.AR_RcvTimestamp;
@@ -586,10 +587,12 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 	rs->rs_moreaggr =
 		(ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
 	rs->rs_antenna = MS(ads.ds_rxstatus3, AR_RxAntenna);
-	rs->rs_flags =
-		(ads.ds_rxstatus3 & AR_GI) ? ATH9K_RX_GI : 0;
-	rs->rs_flags |=
-		(ads.ds_rxstatus3 & AR_2040) ? ATH9K_RX_2040 : 0;
+
+	/* directly mapped flags for ieee80211_rx_status */
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
drivers/net/wireless/ath/ath9k/mac.h +1 -0
index 5865f92..3f1e775 100644
@@ -149,6 +149,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
+	u32 flag; /* see enum mac80211_rx_flags */
 };
 
 struct ath_htc_rx_status {
drivers/net/wireless/ath/ath9k/recv.c +1 -4
index 8be2b5d..b4b758d 100644
@@ -868,10 +868,7 @@ static int ath9k_process_rate(struct ath_common *common,
 	if (rx_stats->rs_rate & 0x80) {
 		/* HT rate */
 		rxs->flag |= RX_FLAG_HT;
-		if (rx_stats->rs_flags & ATH9K_RX_2040)
-			rxs->flag |= RX_FLAG_40MHZ;
-		if (rx_stats->rs_flags & ATH9K_RX_GI)
-			rxs->flag |= RX_FLAG_SHORT_GI;
+		rxs->flag |= rx_stats->flag;
 		rxs->rate_idx = rx_stats->rs_rate & 0x7f;
 		return 0;
 	}
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 3/3 ath9k: check for Rx-STBC flag and pass it to ieee80211

In reply to Oleksij Rempel
---
 drivers/net/wireless/ath/ath9k/mac.c | 5 +++++
 drivers/net/wireless/ath/ath9k/mac.h | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/mac.c +5 -0
index a52081d..d055e38 100644
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
 	rs->flag |=
 		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+	if (AR_SREV_9280_20_OR_LATER(ah))
+		rs->flag |=
+			(ads.ds_rxstatus3 & AR_STBC) ?
+				/* we can only Nss=1 STBC */
+				(1 << RX_FLAG_STBC_SHIFT) : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
drivers/net/wireless/ath/ath9k/mac.h +2 -1
index 3f1e775..b02dfce 100644
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
Signature · 1 line
1.8.1.2
#12 lore raw

cover ath9k: STBC Rx monitoring

In reply to Oleksij Rempel

this are two remaining patches to allow STBC Rx monitoring on ath9k devices.
This patches depend on currently applied:
[PATCH v4 1/3] mac80211: add STBC flag for radiotap

Oleksij Rempel (2):
ath9k: remove useless flag conversation.
ath9k: check for Rx-STBC flag and pass it to ieee80211

 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/init.c       |  9 +++++++--
 drivers/net/wireless/ath/ath9k/mac.c        | 16 ++++++++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  4 +++-
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 5 files changed, 26 insertions(+), 13 deletions(-)
Signature · 1 line
1.8.1.2
#13 lore raw

PATCH 1/2 ath9k: remove useless flag conversation.

some flags used only outside of ath9k - In this case we can use "enum mac80211_rx_flags" and pass it upstream without extra conversation.

---
 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 11 +++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  1 +
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 4 files changed, 12 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_mac.c +3 -2
index 301bf72..5163abd 100644
@@ -469,6 +469,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 
 	rxs->rs_status = 0;
 	rxs->rs_flags =  0;
+	rxs->flag =  0;
 
 	rxs->rs_datalen = rxsp->status2 & AR_DataLen;
 	rxs->rs_tstamp =  rxsp->status3;
@@ -493,8 +494,8 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 	rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
 	rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
 	rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
-	rxs->rs_flags  = (rxsp->status4 & AR_GI) ? ATH9K_RX_GI : 0;
-	rxs->rs_flags  |= (rxsp->status4 & AR_2040) ? ATH9K_RX_2040 : 0;
+	rxs->flag  |= (rxsp->status4 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rxs->flag  |= (rxsp->status4 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	rxs->evm0 = rxsp->status6;
 	rxs->evm1 = rxsp->status7;
drivers/net/wireless/ath/ath9k/mac.c +7 -4
index 498fee0..a52081d 100644
@@ -547,6 +547,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 
 	rs->rs_status = 0;
 	rs->rs_flags = 0;
+	rs->flag = 0;
 
 	rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
 	rs->rs_tstamp = ads.AR_RcvTimestamp;
@@ -586,10 +587,12 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 	rs->rs_moreaggr =
 		(ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
 	rs->rs_antenna = MS(ads.ds_rxstatus3, AR_RxAntenna);
-	rs->rs_flags =
-		(ads.ds_rxstatus3 & AR_GI) ? ATH9K_RX_GI : 0;
-	rs->rs_flags |=
-		(ads.ds_rxstatus3 & AR_2040) ? ATH9K_RX_2040 : 0;
+
+	/* directly mapped flags for ieee80211_rx_status */
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
drivers/net/wireless/ath/ath9k/mac.h +1 -0
index 5865f92..3f1e775 100644
@@ -149,6 +149,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
+	u32 flag; /* see enum mac80211_rx_flags */
 };
 
 struct ath_htc_rx_status {
drivers/net/wireless/ath/ath9k/recv.c +1 -4
index 8be2b5d..b4b758d 100644
@@ -868,10 +868,7 @@ static int ath9k_process_rate(struct ath_common *common,
 	if (rx_stats->rs_rate & 0x80) {
 		/* HT rate */
 		rxs->flag |= RX_FLAG_HT;
-		if (rx_stats->rs_flags & ATH9K_RX_2040)
-			rxs->flag |= RX_FLAG_40MHZ;
-		if (rx_stats->rs_flags & ATH9K_RX_GI)
-			rxs->flag |= RX_FLAG_SHORT_GI;
+		rxs->flag |= rx_stats->flag;
 		rxs->rate_idx = rx_stats->rs_rate & 0x7f;
 		return 0;
 	}
Signature · 1 line
1.8.1.2
#14 lore raw

PATCH 2/2 ath9k: check for Rx-STBC flag and pass it to ieee80211

In reply to Oleksij Rempel
---
 drivers/net/wireless/ath/ath9k/init.c | 9 +++++++--
 drivers/net/wireless/ath/ath9k/mac.c  | 5 +++++
 drivers/net/wireless/ath/ath9k/mac.h  | 3 ++-
 3 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +7 -2
index aba4151..7739b05 100644
@@ -769,8 +769,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
 		IEEE80211_HW_SUPPORTS_RC_TABLE;
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+	}
 
 	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || ath9k_modparam_nohwcrypt)
 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
drivers/net/wireless/ath/ath9k/mac.c +5 -0
index a52081d..d055e38 100644
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
 	rs->flag |=
 		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+	if (AR_SREV_9280_20_OR_LATER(ah))
+		rs->flag |=
+			(ads.ds_rxstatus3 & AR_STBC) ?
+				/* we can only Nss=1 STBC */
+				(1 << RX_FLAG_STBC_SHIFT) : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
drivers/net/wireless/ath/ath9k/mac.h +2 -1
index 3f1e775..b02dfce 100644
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
Signature · 1 line
1.8.1.2
maintainer
#15 lore raw

PATCH 2/2 ath9k: check for Rx-STBC flag and pass it to ieee80211

Quoted 14 lines · Oleksij Rempel
---
 drivers/net/wireless/ath/ath9k/init.c | 9 +++++++--
 drivers/net/wireless/ath/ath9k/mac.c  | 5 +++++
 drivers/net/wireless/ath/ath9k/mac.h  | 3 ++-
 3 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +0 -0
index aba4151..7739b05 100644
@@ -769,8 +769,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
 		IEEE80211_HW_SUPPORTS_RC_TABLE;

drivers/net/wireless/ath/ath9k/init.c void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) · line 778

Quoted 10 lines
drivers/net/wireless/ath/ath9k/init.c +7 -2
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+	}

Are you sure this is right? It seems that if other devices don't support STBC they can report all frames to be w/o STBC. Or do they support STBC but don't report it?

johannes

#16 lore raw

PATCH 2/2 ath9k: check for Rx-STBC flag and pass it to ieee80211

Am 24.05.2013 12:29, schrieb Johannes Berg:

Quoted 16 lines · Oleksij Rempel
Quoted 15 lines
---
  drivers/net/wireless/ath/ath9k/init.c | 9 +++++++--
  drivers/net/wireless/ath/ath9k/mac.c  | 5 +++++
  drivers/net/wireless/ath/ath9k/mac.h  | 3 ++-
  3 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +0 -0
index aba4151..7739b05 100644
@@ -769,8 +769,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
  		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
  		IEEE80211_HW_SUPPORTS_RC_TABLE;
 
Quoted 13 lines

drivers/net/wireless/ath/ath9k/init.c void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) · line 778

Quoted 9 lines
drivers/net/wireless/ath/ath9k/init.c +7 -2
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+	}

Are you sure this is right? It seems that if other devices don't support STBC they can report all frames to be w/o STBC. Or do they support STBC but don't report it?

They support STBC but don't report it. First device whhic can report it is ar9280.

Signature · 2 lines
Regards,
Oleksij
#17 lore raw

PATCH 2/2 ath9k: check for Rx-STBC flag and pass it to ieee80211

In reply to Oleksij Rempel

Am 24.05.2013 12:18, schrieb Oleksij Rempel:

Quoted 13 lines
---
  drivers/net/wireless/ath/ath9k/init.c | 9 +++++++--
  drivers/net/wireless/ath/ath9k/mac.c  | 5 +++++
  drivers/net/wireless/ath/ath9k/mac.h  | 3 ++-
  3 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +0 -0
index aba4151..7739b05 100644
@@ -769,8 +769,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
  		IEEE80211_HW_REPORTS_TX_ACK_STATUS |

drivers/net/wireless/ath/ath9k/init.c void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) · line 777

Quoted 10 lines
drivers/net/wireless/ath/ath9k/init.c +6 -2
  		IEEE80211_HW_SUPPORTS_RC_TABLE;
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;

comment for my self. i forgot to include <net/ieee80211_radiotap.h> for IEEE80211_RADIOTAP_MCS_HAVE_STBC. This patch is broken.

Signature · 2 lines
Regards,
Oleksij
#18 lore raw

PATCH v4 2/2 ath9k: check for Rx-STBC flag and pass it to ieee80211

In reply to Oleksij Rempel

This patch make use of STBC flag in DMA RX descriptor. Only devices after ar9280 can provide this information.

If card support it we will set HAVE_STBC flag, to show clint programm thet STBC is supported but not received.

---
 drivers/net/wireless/ath/ath9k/init.c | 10 ++++++++--
 drivers/net/wireless/ath/ath9k/mac.c  |  5 +++++
 drivers/net/wireless/ath/ath9k/mac.h  |  3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +8 -2
index aba4151..b9c97d4 100644
@@ -21,6 +21,7 @@
 #include <linux/ath9k_platform.h>
 #include <linux/module.h>
 #include <linux/relay.h>
+#include <net/ieee80211_radiotap.h>
 
 #include "ath9k.h"
 
@@ -769,8 +770,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
 		IEEE80211_HW_SUPPORTS_RC_TABLE;
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+	}
 
 	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || ath9k_modparam_nohwcrypt)
 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
drivers/net/wireless/ath/ath9k/mac.c +5 -0
index a52081d..d055e38 100644
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
 	rs->flag |=
 		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+	if (AR_SREV_9280_20_OR_LATER(ah))
+		rs->flag |=
+			(ads.ds_rxstatus3 & AR_STBC) ?
+				/* we can only Nss=1 STBC */
+				(1 << RX_FLAG_STBC_SHIFT) : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
drivers/net/wireless/ath/ath9k/mac.h +2 -1
index 3f1e775..b02dfce 100644
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
Signature · 1 line
1.8.1.2
#19 lore raw

cover Work on STBC Rx monitoring

In reply to Oleksij Rempel

Any updates here? can some one please apply last two patches? Felix?

Am 19.05.2013 09:38, schrieb Oleksij Rempel:

Quoted 21 lines

This patch set will pass RxSTBC flags from ath9k to ieee80211 and to radiotap.
This field is now a part of radiotap specification:
http://www.radiotap.org/defined-fields/MCS

Oleksij Rempel (3):
mac80211: add STBC flag for radiotap
ath9k: remove useless flag conversation.
ath9k: check for Rx-STBC flag and pass it to ieee80211

  drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
  drivers/net/wireless/ath/ath9k/mac.c        | 16 ++++++++++++----
  drivers/net/wireless/ath/ath9k/mac.h        |  4 +++-
  drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
  include/net/ieee80211_radiotap.h            |  7 +++++++
  include/net/mac80211.h                      |  4 ++++
  net/mac80211/main.c                         |  3 ++-
  net/mac80211/rx.c                           |  4 ++++
  net/mac80211/status.c                       |  3 ++-
  9 files changed, 38 insertions(+), 13 deletions(-)
Signature · 2 lines
Regards,
Oleksij