linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH] iw:  Fix EHT rates printing.
Date: Tue, 16 May 2023 11:02:38 -0700	[thread overview]
Message-ID: <20230516180238.673624-1-greearb@candelatech.com> (raw)

From: Ben Greear <greearb@candelatech.com>

The 20Mhz rates thing is a union with the others, so print one or
the other.  This appears to fix the output of the mcs/bw printout.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 util.c | 46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/util.c b/util.c
index 31b0308..75f415e 100644
--- a/util.c
+++ b/util.c
@@ -1541,33 +1541,29 @@ static void __print_eht_capa(int band,
 			printf("%s\t\tEHT bw=20 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
 			       pre, mcs[i],
 			       mcs_set[i] & 0xf, mcs_set[i] >> 4);
-	}
-
-	mcs_set += 4;
-	if (he_phy_cap[0] & (BIT(2) << 8)) {
-		for (i = 0; i < 3; i++)
-			printf("%s\t\tEHT bw <= 80 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-			       pre, mcs[i + 1],
-			       mcs_set[i] & 0xf, mcs_set[i] >> 4);
-
-	}
-
-	mcs_set += 3;
-	if (he_phy_cap[0] & (BIT(3) << 8)) {
-		for (i = 0; i < 3; i++)
-			printf("%s\t\tEHT bw=160 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-			       pre, mcs[i + 1],
-			       mcs_set[i] & 0xf, mcs_set[i] >> 4);
-
-	}
+	} else {
+		if (he_phy_cap[0] & (BIT(2) << 8)) {
+			for (i = 0; i < 3; i++)
+				printf("%s\t\tEHT bw <= 80 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
+				       pre, mcs[i + 1],
+				       mcs_set[i] & 0xf, mcs_set[i] >> 4);
+		}
+		mcs_set += 3;
 
-	mcs_set += 3;
-	if (band == NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) {
-		for (i = 0; i < 3; i++)
-			printf("%s\t\tEHT bw=320 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-			       pre, mcs[i + 1],
-			       mcs_set[i] & 0xf, mcs_set[i] >> 4);
+		if (he_phy_cap[0] & (BIT(3) << 8)) {
+			for (i = 0; i < 3; i++)
+				printf("%s\t\tEHT bw=160 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
+				       pre, mcs[i + 1],
+				       mcs_set[i] & 0xf, mcs_set[i] >> 4);
+		}
 
+		mcs_set += 3;
+		if (band == NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) {
+			for (i = 0; i < 3; i++)
+				printf("%s\t\tEHT bw=320 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
+				       pre, mcs[i + 1],
+				       mcs_set[i] & 0xf, mcs_set[i] >> 4);
+		}
 	}
 
 	if (ppet && ppet_len && (phy_cap[1] & BIT(11))) {
-- 
2.40.0


                 reply	other threads:[~2023-05-16 18:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230516180238.673624-1-greearb@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).