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 05/15] vendor_quirks: initial skeleton
Date: Fri, 22 Aug 2025 12:51:08 -0700	[thread overview]
Message-ID: <20250822195118.271122-5-prestwoj@gmail.com> (raw)
In-Reply-To: <20250822195118.271122-1-prestwoj@gmail.com>

This module will provide a database for known issues or quirks with
wireless vendors. For now the list of quirks is limited to 32 as
that is the size returned in the bit mask. This could be extended
to 64 in the future if needed, but of course the goal is to never
reach that level.

The vendor_quirks() API is intended to be called from scan.c when
parsing vendor attributes. This will lookup any quirks associated
with the OUI provided and a mask of quirks will be returned. This
can be repeated against all the vendor OUI's seen in the scan. The
result is then a bitmask containing all quirks for that BSS. This
can then be referenced later during various operations in IWD.
---
 Makefile.am         |  2 ++
 src/vendor_quirks.c | 53 +++++++++++++++++++++++++++++++++++++++++++++
 src/vendor_quirks.h | 25 +++++++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 src/vendor_quirks.c
 create mode 100644 src/vendor_quirks.h

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..ccfcb444
--- /dev/null
+++ b/src/vendor_quirks.c
@@ -0,0 +1,53 @@
+/*
+ *
+ *  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];
+	uint32_t quirks;
+} quirk_db[] = {
+	{ }
+};
+
+uint32_t vendor_quirks(const uint8_t *oui)
+{
+	size_t i;
+	uint32_t ret = 0;
+
+	for (i = 0; i < L_ARRAY_SIZE(quirk_db); i++) {
+		if (memcmp(quirk_db[i].oui, oui, 3))
+			continue;
+
+		ret |= quirk_db[i].quirks;
+	}
+
+	return ret;
+}
diff --git a/src/vendor_quirks.h b/src/vendor_quirks.h
new file mode 100644
index 00000000..758073b3
--- /dev/null
+++ b/src/vendor_quirks.h
@@ -0,0 +1,25 @@
+/*
+ *
+ *  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
+ *
+ */
+
+#include <stdint.h>
+
+uint32_t vendor_quirks(const uint8_t *oui);
-- 
2.34.1


  parent reply	other threads:[~2025-08-22 19:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 19:51 [PATCH 01/15] wiphy: add driver quirk for the colocated scan flag James Prestwood
2025-08-22 19:51 ` [PATCH 02/15] wiphy: add comments around the driver quirks James Prestwood
2025-08-22 19:51 ` [PATCH 03/15] scan: check support before using colocated flag James Prestwood
2025-08-22 19:51 ` [PATCH 04/15] monitor: add Cisco Meraki as a printable vendor James Prestwood
2025-08-22 19:51 ` James Prestwood [this message]
2025-08-23 14:43   ` [PATCH 05/15] vendor_quirks: initial skeleton Marcel Holtmann
2025-08-25 14:31     ` James Prestwood
2025-08-26 14:56   ` Denis Kenzior
2025-08-22 19:51 ` [PATCH 06/15] vendor_quirks: add two new vendor quirks James Prestwood
2025-08-23 14:46   ` Marcel Holtmann
2025-08-25 14:32     ` James Prestwood
2025-08-22 19:51 ` [PATCH 07/15] handshake: pass object to handshake_util_ap_ie_matches James Prestwood
2025-08-22 19:51 ` [PATCH 08/15] handshake: add vendor quirks into handshake object James Prestwood
2025-08-22 19:51 ` [PATCH 09/15] scan: store vendor quirks in scan_bss James Prestwood
2025-08-22 19:51 ` [PATCH 10/15] station: set vendor quirks into handshake object James Prestwood
2025-08-22 19:51 ` [PATCH 11/15] handshake: use vendor quirk to disable check of replay counters James Prestwood
2025-08-22 19:51 ` [PATCH 12/15] station: get neighbor report on BSS TM request James Prestwood
2025-08-22 19:51 ` [PATCH 13/15] station: check vendor quirk for BSS TM request candidate list James Prestwood
2025-08-23 14:48   ` Marcel Holtmann
2025-08-25 14:37     ` James Prestwood
2025-08-22 19:51 ` [PATCH 14/15] station: clear roam_freqs on delayed roam James Prestwood
2025-08-26 15:00   ` Denis Kenzior
2025-08-22 19:51 ` [PATCH 15/15] auto-t: add AP roam test for bad neighbor reports/candidate lists James Prestwood
2025-08-26 14:47 ` [PATCH 01/15] wiphy: add driver quirk for the colocated scan flag Denis Kenzior
2025-08-26 15:24   ` James Prestwood

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=20250822195118.271122-5-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