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 v2 01/11] vendor_quirks: initial skeleton
Date: Wed, 27 Aug 2025 05:54:51 -0700	[thread overview]
Message-ID: <20250827125501.477908-1-prestwoj@gmail.com> (raw)

This module will provide a database for known issues or quirks with
wireless vendors.

The vendor_quirks_append_for_oui() API is intended to be called from
scan.c when parsing vendor attributes. This will lookup any quirks
associated with the OUI provided and combine them into an existing
vendor_quirk structure. This can be repeated against all the vendor
OUI's seen in the scan then referenced later to alter IWD behavior.

In the future more critera could be added such as MAC address prefix
or more generalized IE matches e.g.

vendor_quirks_append_for_mac()
vendor_quirks_append_for_ie()
etc.
---
 Makefile.am         |  2 ++
 src/vendor_quirks.c | 67 +++++++++++++++++++++++++++++++++++++++++++++
 src/vendor_quirks.h | 39 ++++++++++++++++++++++++++
 3 files changed, 108 insertions(+)
 create mode 100644 src/vendor_quirks.c
 create mode 100644 src/vendor_quirks.h

v2:
 * Use a bitfield structure rather than enums/masks
 * Rename API to be specific to OUI matches. Potentially to extend
   in the future to match MAC/IE's

diff --git a/Makefile.am b/Makefile.am
index 92adfa6e..c01cd4c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -274,6 +274,8 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h \
 					src/dpp.c \
 					src/udev.c \
 					src/pmksa.h src/pmksa.c \
+					src/vendor_quirks.h \
+					src/vendor_quirks.c \
 					$(eap_sources) \
 					$(builtin_sources)
 
diff --git a/src/vendor_quirks.c b/src/vendor_quirks.c
new file mode 100644
index 00000000..18a9ba7a
--- /dev/null
+++ b/src/vendor_quirks.c
@@ -0,0 +1,67 @@
+/*
+ *
+ *  Wireless daemon for Linux
+ *
+ *  Copyright (C) 2025  Locus Robotics Corporation. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+
+#include <ell/ell.h>
+
+#include "src/vendor_quirks.h"
+
+static const struct {
+	uint8_t oui[3];
+	struct vendor_quirk quirks;
+} oui_quirk_db[] = {
+	{ }
+};
+
+void vendor_quirks_append_for_oui(const uint8_t *oui,
+					struct vendor_quirk *quirks)
+{
+	size_t i;
+
+	for (i = 0; i < L_ARRAY_SIZE(oui_quirk_db); i++) {
+		const struct vendor_quirk *quirk = &oui_quirk_db[i].quirks;
+
+		if (memcmp(oui_quirk_db[i].oui, oui, 3))
+			continue;
+
+		quirks->ignore_bss_tm_candidates |=
+				quirk->ignore_bss_tm_candidates;
+		quirks->replay_counter_mismatch |=
+				quirk->replay_counter_mismatch;
+	}
+}
+
+const char *vendor_quirks_to_string(struct vendor_quirk quirks)
+{
+	static char out[1024];
+	size_t s = 0;
+
+	if (!s)
+		return NULL;
+
+	return out;
+}
diff --git a/src/vendor_quirks.h b/src/vendor_quirks.h
new file mode 100644
index 00000000..b5d726ca
--- /dev/null
+++ b/src/vendor_quirks.h
@@ -0,0 +1,39 @@
+/*
+ *
+ *  Wireless daemon for Linux
+ *
+ *  Copyright (C) 2025  Locus Robotics Corporation. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __IWD_VENDOR_QUIRKS_H
+#define __IWD_VENDOR_QUIRKS_H
+
+
+#include <stdint.h>
+
+struct vendor_quirk {
+	bool ignore_bss_tm_candidates : 1;
+	bool replay_counter_mismatch : 1;
+};
+
+void vendor_quirks_append_for_oui(const uint8_t *oui,
+					struct vendor_quirk *quirks);
+
+const char *vendor_quirks_to_string(struct vendor_quirk quirks);
+
+#endif /* __IWD_VENDOR_QUIRKS_H */
-- 
2.34.1


             reply	other threads:[~2025-08-27 12:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 12:54 James Prestwood [this message]
2025-08-27 12:54 ` [PATCH v2 02/11] vendor_quirks: implement two vendor quirks James Prestwood
2025-08-27 12:54 ` [PATCH v2 03/11] handshake: pass object to handshake_util_ap_ie_matches James Prestwood
2025-08-27 12:54 ` [PATCH v2 04/11] handshake: add vendor quirks into handshake object James Prestwood
2025-08-27 12:54 ` [PATCH v2 05/11] scan: store vendor quirks in scan_bss James Prestwood
2025-08-27 12:54 ` [PATCH v2 06/11] station: set vendor quirks into handshake object James Prestwood
2025-08-27 12:54 ` [PATCH v2 07/11] handshake: use vendor quirk to disable check of replay counters James Prestwood
2025-08-27 12:54 ` [PATCH v2 08/11] station: get neighbor report on BSS TM request James Prestwood
2025-08-27 12:54 ` [PATCH v2 09/11] station: check vendor quirk for BSS TM request candidate list James Prestwood
2025-08-27 12:55 ` [PATCH v2 10/11] auto-t: add AP roam test for bad neighbor reports/candidate lists James Prestwood
2025-08-27 12:55 ` [PATCH v2 11/11] station: print vendor quirks (if any) when connecting/roaming James Prestwood
2025-08-27 17:42 ` [PATCH v2 01/11] vendor_quirks: initial skeleton 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=20250827125501.477908-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