Skip to contentSkip to conversation

wireless-regdb: allow NO-INDOOR flag in db.txt

PATCH Applied Ping-Ke Shih 2 participants 5 messages Feb 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 wireless-regdb: allow NO-INDOOR flag in db.txt

From: Ping-Ke Shih <[email protected]>

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.

---
v4:
- check NO-INDOOR after checking validity of all flags
v3:
- new introduction by v3

---
 dbparse.py | 8 ++++++++
 1 file changed, 8 insertions(+)
dbparse.py +8 -0
index cc5012bc05bd..29f422445563 100755
@@ -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' % (
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 2/3 wireless-regdb: Update regulatory rules for Iran (IR) on both 2.4 and 5Ghz for 2021

From: Ping-Ke Shih <[email protected]>

Decision No. 4004-01DEC-CRA, 8th Edition - February 2021, Radiocommunications and Regulatory Organization. General radio license for the use of parts of the frequency bands 2400-2483.5 MHz, 5150-5250 MHz, 5350-5250 MHz, 5470-5725 MHz, and 5850-5725 MHz in radio access networks. [1]

* 2400 - 2483.5
- indoor
* 100 mW e.i.r.p
* 10dBm in every 1Mhz
- outdoor
* 4000 mW e.i.r.p
- Intersection of indoor and outdoor. Indoor values are adopted.
* 5150 - 5250
- indoor & outdoor
* 200 mW e.i.r.p
* 10dBm/MHz per 1MHz bandwidth or -6dBm/25kHz per 25kHz bandwidth
* 5250 - 5350
- indoor
* 200 mW e.i.r.p
* 10dBm/MHz per 1MHz bandwidth
- outdoor
* 1000 mW e.i.r.p
* 17dBm/MHz per 1MHz bandwidth
* DFS
- For outdoor usage, TPC is required, and there is no provision for 3 dB power reduction if TPC is not implemented. Mark this band as indoor-only.
* 5470 - 5725
- 1000 mW e.i.r.p
- 17dBm/MHz per 1MHz bandwidth
- DFS
- If TPC is not used, the maximum radiated e.i.r.p. must be reduced

    by 3dB.

- Outdoor use only
* 5725 - 5850
- 4000 mW e.i.r.p
- 36dBm in every 500 kHz
- DFS
- Outdoor use only
- P2P only
- TPC is required without provision for no TPC. (Don't add this rule)

These information is from [4], Mobin Aydinfar shared the official link [1] (inaccessible from outside of Iran), a mirror version [2] and translated version [3].

[1] https://asnad.cra.ir/fa/Public/Documents/Details/73af8590-f065-eb11-968f-0050569b0899
[2] https://mobintestserver.ir/Iran-2.4Ghz-5Ghz-cra-official-doc.pdf
[3] https://mobintestserver.ir/Iran-2.4Ghz-5Ghz-cra-official-table.ods
[4] https://lore.kernel.org/linux-wireless/[email protected]/T/#u

---
v4:
- no change
v3:
- correct release year 2021
- add NO-INDOOR entry
v2:
- add outdoor info to commit message as reference
- add Reported-by and Closes tags
- db.txt: mark 5250 - 5350 as NO-OUTDOOR

---
 db.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
db.txt +7 -3
index d56ad32d31c9..7fe673111f62 100644
@@ -934,9 +934,13 @@ country IN:
 	(5470 - 5725 @ 160), (24), DFS
 	(5725 - 5875 @ 80), (30)
 
-country IR: DFS-JP
-	(2402 - 2482 @ 40), (20)
-	(5735 - 5835 @ 80), (30)
+# Source:
+# https://asnad.cra.ir/fa/Public/Documents/Details/73af8590-f065-eb11-968f-0050569b0899
+country IR: DFS-ETSI
+	(2400 - 2483.5 @ 40), (100 mW)
+	(5150 - 5250 @ 80), (200 mW)
+	(5250 - 5350 @ 80), (200 mW), DFS, NO-OUTDOOR
+	(5470 - 5725 @ 160), (27), DFS, NO-INDOOR
 
 # IS as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
 # and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 3/3 wireless-regdb: Update frequency range with NO-INDOOR for Oman (OM)

In reply to Ping-Ke Shih

From: Ping-Ke Shih <[email protected]>

The commit f67f40d00919 ("wireless-regdb: Update regulatory info for Oman (OM)") describes the range 5725-5850 MHz is outdoor use only, and currently we can use NO-INDOOR flag. Add the entry accordingly.

* 5725-5850 MHz
- 2 W max. mean EIRP
- TPC: FWA systems operating in frequency band 5725-5850 MHz shall employ TPC with a range of at least 5 dB.
(28 dBm Is adopted)
- Outdoor use only
- DFS

---
v4:
- no change
v3:
- new introduction by v3

---
 db.txt | 1 +
 1 file changed, 1 insertion(+)
db.txt +1 -0
index 7fe673111f62..803f1bc5405f 100644
@@ -1480,6 +1480,7 @@ country OM: DFS-ETSI
 	(5170 - 5250 @ 80), (200 mW), AUTO-BW
 	(5250 - 5350 @ 80), (20), DFS, AUTO-BW
 	(5470 - 5725 @ 160), (27), DFS
+	(5725 - 5850 @ 80), (28), DFS, NO-INDOOR
 	(5925 - 6425 @ 320), (200 mW), NO-OUTDOOR
 	(57000 - 66000 @ 2160), (40), NO-OUTDOOR
 
Signature · 1 line
2.25.1
Applied
#3 lore raw
In reply to Ping-Ke Shih
Quoted 8 lines · Ping-Ke Shih

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,

Signature · 1 line
Chen-Yu Tsai <[email protected]>
#4 lore raw
In reply to Ping-Ke Shih
Quoted 8 lines · Ping-Ke Shih

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,

Signature · 1 line
Chen-Yu Tsai <[email protected]>