From: Ping-Ke Shih <pkshih@gmail.com>
To: wens@kernel.org
Cc: linux-wireless@vger.kernel.org,
wireless-regdb@lists.infradead.org, johannes@sipsolutions.net,
mobin@mobintestserver.ir
Subject: [PATCH v3 1/3] wireless-regdb: allow NO-INDOOR flag in db.txt
Date: Wed, 19 Feb 2025 10:34:13 +0800 [thread overview]
Message-ID: <20250219023415.14229-1-pkshih@gmail.com> (raw)
From: Ping-Ke Shih <pkshih@realtek.com>
For certain regulations, frequency range is outdoor only, which flag should
be NO-INDOOR, but db2fw.py doesn't allow this flag.
As suggestion, only fill NO-INDOOR flag in db.txt, but ignore this rule
in parsing to binary.
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Link: https://lore.kernel.org/linux-wireless/5e433cd8d070682cb6ed31de3a2dd337e6f48b50.camel@sipsolutions.net/T/#t
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
v3:
- new introduction by v3
---
dbparse.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dbparse.py b/dbparse.py
index cc5012bc05bd..450406ff1b34 100755
--- a/dbparse.py
+++ b/dbparse.py
@@ -121,6 +121,9 @@ class FlagError(Exception):
def __init__(self, flag):
self.flag = flag
+class IgnoreRule(Exception):
+ pass
+
@total_ordering
class Permission(object):
def __init__(self, freqband, power, flags, wmmrule):
@@ -134,6 +137,9 @@ class Permission(object):
for flag in flags:
if not flag in flag_definitions:
raise FlagError(flag)
+ # skip rule with NO-INDOOR so that kernel doesn't need special deal.
+ if flag == 'NO-INDOOR':
+ raise IgnoreRule()
self.flags |= flag_definitions[flag]
self.textflags = flags
@@ -429,6 +435,8 @@ class DBParser(object):
perm = Permission(b, p, flags, w)
except FlagError as e:
self._syntax_error("Invalid flag '%s'" % e.flag)
+ except IgnoreRule:
+ return
for cname, c in self._current_countries.items():
if perm in c:
self._warn('Rule "%s, %s" added to "%s" twice' % (
--
2.25.1
next reply other threads:[~2025-02-19 2:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 2:34 Ping-Ke Shih [this message]
2025-02-19 2:34 ` [PATCH v3 2/3] wireless-regdb: Update regulatory rules for Iran (IR) on both 2.4 and 5Ghz for 2021 Ping-Ke Shih
2025-02-19 2:34 ` [PATCH v3 3/3] wireless-regdb: Update frequency range with NO-INDOOR for Oman (OM) Ping-Ke Shih
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=20250219023415.14229-1-pkshih@gmail.com \
--to=pkshih@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mobin@mobintestserver.ir \
--cc=wens@kernel.org \
--cc=wireless-regdb@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.