linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used
@ 2019-08-07  7:59 John Crispin
  2019-08-07  7:59 ` [PATCH 2/4] mac80211: fix bad guard when reporting legacy rates John Crispin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Crispin @ 2019-08-07  7:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin

The RX Radiotap header length was not calculated properly when reporting
legacy rates using tx_status_ext.

fixes commit 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status
support to ieee80211_add_tx_radiotap_header")

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/mac80211/status.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index f03aa8924d23..f984943cdabd 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -260,9 +260,15 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info,
 	int len = sizeof(struct ieee80211_radiotap_header);
 
 	/* IEEE80211_RADIOTAP_RATE rate */
-	if (info->status.rates[0].idx >= 0 &&
-	    !(info->status.rates[0].flags & (IEEE80211_TX_RC_MCS |
-					     IEEE80211_TX_RC_VHT_MCS)))
+	if (status && status->rate && !(status->rate->flags &
+					(RATE_INFO_FLAGS_MCS |
+					 RATE_INFO_FLAGS_60G |
+					 RATE_INFO_FLAGS_VHT_MCS |
+					 RATE_INFO_FLAGS_HE_MCS)))
+		len += 2;
+	else if (info->status.rates[0].idx >= 0 &&
+		 !(info->status.rates[0].flags &
+		   (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)))
 		len += 2;
 
 	/* IEEE80211_RADIOTAP_TX_FLAGS */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/4] mac80211: fix bad guard when reporting legacy rates
  2019-08-07  7:59 [PATCH 1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used John Crispin
@ 2019-08-07  7:59 ` John Crispin
  2019-08-07  7:59 ` [PATCH 3/4] mac80211: 80Mhz was not reported properly when using tx_status_ext John Crispin
  2019-08-07  7:59 ` [PATCH 4/4] mac80211: add missing length field increment when generating Radiotap header John Crispin
  2 siblings, 0 replies; 4+ messages in thread
From: John Crispin @ 2019-08-07  7:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin

When reporting legacy rates inside the TX Radiotap header we need to split
the check u between "uses tx_statua_ext" and "is legacy rate". Not doing so
would make the code drop into the !tx_status_ext path.

fixes commit 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status
support to ieee80211_add_tx_radiotap_header")

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/mac80211/status.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index f984943cdabd..eaea07db83e7 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -327,13 +327,14 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
 
 	/* IEEE80211_RADIOTAP_RATE */
 
-	if (status && status->rate && !(status->rate->flags &
-					(RATE_INFO_FLAGS_MCS |
-					 RATE_INFO_FLAGS_60G |
-					 RATE_INFO_FLAGS_VHT_MCS |
-					 RATE_INFO_FLAGS_HE_MCS)))
-		legacy_rate = status->rate->legacy;
-	else if (info->status.rates[0].idx >= 0 &&
+	if (status && status->rate) {
+		if (!(status->rate->flags &
+		      (RATE_INFO_FLAGS_MCS |
+		       RATE_INFO_FLAGS_60G |
+		       RATE_INFO_FLAGS_VHT_MCS |
+		       RATE_INFO_FLAGS_HE_MCS)))
+			legacy_rate = status->rate->legacy;
+	} else if (info->status.rates[0].idx >= 0 &&
 		 !(info->status.rates[0].flags & (IEEE80211_TX_RC_MCS |
 						  IEEE80211_TX_RC_VHT_MCS)))
 		legacy_rate =
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/4] mac80211: 80Mhz was not reported properly when using tx_status_ext
  2019-08-07  7:59 [PATCH 1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used John Crispin
  2019-08-07  7:59 ` [PATCH 2/4] mac80211: fix bad guard when reporting legacy rates John Crispin
@ 2019-08-07  7:59 ` John Crispin
  2019-08-07  7:59 ` [PATCH 4/4] mac80211: add missing length field increment when generating Radiotap header John Crispin
  2 siblings, 0 replies; 4+ messages in thread
From: John Crispin @ 2019-08-07  7:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin

When reporting 80MHz, we need to set 4 and not 2 inside the corresponding
field inside the Tx Radiotap header.

fixes commit 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status
support to ieee80211_add_tx_radiotap_header")

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/mac80211/status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index eaea07db83e7..471fcdc0f381 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -404,7 +404,7 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
 			*pos = 11;
 			break;
 		case RATE_INFO_BW_80:
-			*pos = 2;
+			*pos = 4;
 			break;
 		case RATE_INFO_BW_40:
 			*pos = 1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/4] mac80211: add missing length field increment when generating Radiotap header
  2019-08-07  7:59 [PATCH 1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used John Crispin
  2019-08-07  7:59 ` [PATCH 2/4] mac80211: fix bad guard when reporting legacy rates John Crispin
  2019-08-07  7:59 ` [PATCH 3/4] mac80211: 80Mhz was not reported properly when using tx_status_ext John Crispin
@ 2019-08-07  7:59 ` John Crispin
  2 siblings, 0 replies; 4+ messages in thread
From: John Crispin @ 2019-08-07  7:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin

The code generating the Tx Radiotap header when using tx_status_ext was
missing a field increment after setting the VHT bandwidth.

fixes commit 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status
support to ieee80211_add_tx_radiotap_header")

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/mac80211/status.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 471fcdc0f381..40886734fdc5 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -413,6 +413,7 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
 			*pos = 0;
 			break;
 		}
+		pos++;
 
 		/* u8 mcs_nss[4] */
 		*pos = (status->rate->mcs << 4) | status->rate->nss;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-07  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07  7:59 [PATCH 1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used John Crispin
2019-08-07  7:59 ` [PATCH 2/4] mac80211: fix bad guard when reporting legacy rates John Crispin
2019-08-07  7:59 ` [PATCH 3/4] mac80211: 80Mhz was not reported properly when using tx_status_ext John Crispin
2019-08-07  7:59 ` [PATCH 4/4] mac80211: add missing length field increment when generating Radiotap header John Crispin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).