public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH] unit: add test with list of known unsupported frequencies
Date: Thu, 24 Oct 2024 11:43:38 -0700	[thread overview]
Message-ID: <20241024184338.186018-1-prestwoj@gmail.com> (raw)

These frequencies were seen being advertised by a driver and IWD has
no operating class/channel mapping for them. Specifically 5960 was
causing issues due to a few bugs and mapping to channel 2 of the 6ghz
band. Those bugs have now been resolved.

If these frequencies can be supported in a clean manor we can remove
this test, but until then ensure IWD does not parse them.
---
 unit/test-band.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/unit/test-band.c b/unit/test-band.c
index 606bb854..edf1e02e 100644
--- a/unit/test-band.c
+++ b/unit/test-band.c
@@ -683,6 +683,26 @@ static void test_conversion_fallback(const void *data)
 	assert(band == BAND_FREQ_5_GHZ);
 }
 
+static void test_unsupported_freqs(const void *data)
+{
+	/*
+	 * These are frequencies that were seen advertised by some drivers
+	 * but that don't match any global operating classes IWD has. They may
+	 * be valid, but IWD should not parse them correctly without added
+	 * support in band.c.
+	 */
+	uint32_t unsupported[] = {
+		5920, 5940, 5960, 5980, 6000, 6020, 6040, 6060, 6080,
+	};
+	unsigned int i;
+
+	for (i = 0; i < L_ARRAY_SIZE(unsupported); i++) {
+		uint8_t channel = band_freq_to_channel(unsupported[i], NULL);
+
+		assert(!channel);
+	}
+}
+
 int main(int argc, char *argv[])
 {
 	l_test_init(&argc, &argv);
@@ -750,6 +770,7 @@ int main(int argc, char *argv[])
 
 	l_test_add("/band/conversions", test_conversions, NULL);
 	l_test_add("/band/conversion fallback", test_conversion_fallback, NULL);
+	l_test_add("/band/unsupported freqs", test_unsupported_freqs, NULL);
 
 	return l_test_run();
 }
-- 
2.34.1


             reply	other threads:[~2024-10-24 18:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 18:43 James Prestwood [this message]
2024-10-24 21:01 ` [PATCH] unit: add test with list of known unsupported frequencies Denis Kenzior

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=20241024184338.186018-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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