Message ID | 20250220003103.4484-1-pkshih@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Johannes Berg |
Headers | show |
Series | [v4,1/3] wireless-regdb: allow NO-INDOOR flag in db.txt | expand |
Context | Check | Description |
---|---|---|
jmberg/tree_selection | success | Not a local patch |
On Thu, 20 Feb 2025 08:31:01 +0800, Ping-Ke Shih wrote: > 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. > > > [...] Applied to master in wens/wireless-regdb.git, thanks! [1/3] wireless-regdb: allow NO-INDOOR flag in db.txt https://git.kernel.org/wens/wireless-regdb/c/9f7101175aec [2/3] wireless-regdb: Update regulatory rules for Iran (IR) on both 2.4 and 5Ghz for 2021 https://git.kernel.org/wens/wireless-regdb/c/719593ae617f [3/3] wireless-regdb: Update frequency range with NO-INDOOR for Oman (OM) https://git.kernel.org/wens/wireless-regdb/c/974ae194f8b1 Best regards,
On Thu, 20 Feb 2025 08:31:01 +0800, Ping-Ke Shih wrote: > 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. > > > [...] Sorry, I had to immediately do a force push as I mistakenly squashed in database binary changes into one of the commits. Here are the new commit hashes: [1/3] wireless-regdb: allow NO-INDOOR flag in db.txt https://git.kernel.org/wens/wireless-regdb/c/3dd7ceb8aa75 [2/3] wireless-regdb: Update regulatory rules for Iran (IR) on both 2.4 and 5Ghz for 2021 https://git.kernel.org/wens/wireless-regdb/c/4d754a1d5a3e [3/3] wireless-regdb: Update frequency range with NO-INDOOR for Oman (OM) https://git.kernel.org/wens/wireless-regdb/c/8c8308a154df Best regards,
diff --git a/dbparse.py b/dbparse.py index cc5012bc05bd..29f422445563 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): @@ -135,6 +138,9 @@ class Permission(object): if not flag in flag_definitions: raise FlagError(flag) self.flags |= flag_definitions[flag] + # ignore rule with NO-INDOOR so that kernel doesn't need special deal. + if 'NO-INDOOR' in flags: + raise IgnoreRule() self.textflags = flags def _as_tuple(self): @@ -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' % (