remove "max IR" from database
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 27 May 2008 10:36:49 +0000 (12:36 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 27 May 2008 10:36:49 +0000 (12:36 +0200)
db.txt
db2bin.py
dbparse.py
dump.c
regdb.h
web/Regulatory.py

diff --git a/db.txt b/db.txt
index f96175c..5a8f033 100644 (file)
--- a/db.txt
+++ b/db.txt
@@ -72,7 +72,7 @@ band MKK2: 5040 - 5080 @ 20
 ############
 # Second: power definitions
 
-power DEFAULT: 6, 30, 100 mW
+power DEFAULT: 6, 100 mW
 
 ############
 # Finally, country definitions
@@ -155,11 +155,11 @@ country CY, DK, EE, ES, FI, GB, IE, IS, IT, LT, LU, LN, NO, PL, PT, SE, SI, UK,
 # downloaded from http://www.bundesnetzagentur.de/media/archive/13358.pdf
 country DE:
        # entries 279004 and 280006
-       (2400 - 2483.5 @ 40), (N/A, N/A, 100 mW)
+       (2400 - 2483.5 @ 40), (N/A, 100 mW)
        # entries 303005 and 304002
-       (5150 - 5255 @ 40), (N/A, N/A, 200 mW), NO-OUTDOOR, DFS
+       (5150 - 5255 @ 40), (N/A, 200 mW), NO-OUTDOOR, DFS
        # entries 308002 and 309001
-       (5470 - 5650 @ 40), (N/A, N/A, 1000 mW), DFS
+       (5470 - 5650 @ 40), (N/A, 1000 mW), DFS
 
 country CH, HU, LI, AT:
        ETSI1, DEFAULT
index 41e2083..98181df 100755 (executable)
--- a/db2bin.py
+++ b/db2bin.py
@@ -71,9 +71,9 @@ siglen = PTR(output)
 power_rules = {}
 for pr in power:
     power_rules[pr] = output.tell()
-    pr = [int(v * 100.0) for v in (pr.max_ant_gain, pr.max_ir, pr.max_eirp)]
+    pr = [int(v * 100.0) for v in (pr.max_ant_gain, pr.max_eirp)]
     # struct regdb_file_power_rule
-    output.write(struct.pack('>III', *pr))
+    output.write(struct.pack('>II', *pr))
 
 freq_ranges = {}
 for fr in bands:
index 2ba3369..5de3d74 100644 (file)
@@ -37,9 +37,8 @@ class FreqBand(object):
                   self.start, self.end, self.maxbw)
 
 class PowerRestriction(object):
-    def __init__(self, max_ant_gain, max_ir, max_eirp, comments = None):
+    def __init__(self, max_ant_gain, max_eirp, comments = None):
         self.max_ant_gain = max_ant_gain
-        self.max_ir = max_ir
         self.max_eirp = max_eirp
         self.comments = comments or []
 
@@ -48,15 +47,15 @@ class PowerRestriction(object):
         o = other
         if not isinstance(o, PowerRestriction):
             return False
-        return cmp((s.max_ant_gain, s.max_ir, s.max_eirp),
-                   (o.max_ant_gain, o.max_ir, o.max_eirp))
+        return cmp((s.max_ant_gain, s.max_eirp),
+                   (o.max_ant_gain, o.max_eirp))
 
     def __str__(self):
         return '<PowerRestriction ...>'
 
     def __hash__(self):
         s = self
-        return hash((s.max_ant_gain, s.max_ir, s.max_eirp))
+        return hash((s.max_ant_gain, s.max_eirp))
 
 class FlagError(Exception):
     def __init__(self, flag):
@@ -177,12 +176,9 @@ class DBParser(object):
     def _parse_power_def(self, pname, line, dupwarn=True):
         try:
             (max_ant_gain,
-             max_ir,
              max_eirp) = line.split(',')
             if max_ant_gain == 'N/A':
                 max_ant_gain = '0'
-            if max_ir == 'N/A':
-                max_ir = '0'
             if max_eirp == 'N/A':
                 max_eirp = '0'
             max_ant_gain = float(max_ant_gain)
@@ -192,12 +188,11 @@ class DBParser(object):
                     return 10.0 * math.log10(pwr)
                 else:
                     return float(pwr)
-            max_ir = conv_pwr(max_ir)
             max_eirp = conv_pwr(max_eirp)
         except ValueError:
             self._syntax_error("invalid power data")
 
-        p = PowerRestriction(max_ant_gain, max_ir, max_eirp,
+        p = PowerRestriction(max_ant_gain, max_eirp,
                              comments=self._comments)
         self._comments = []
         self._powerdup[pname] = pname
diff --git a/dump.c b/dump.c
index eede05f..01553d2 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -59,11 +59,6 @@ static void print_reg_rule(__u8 *db, int dblen, __be32 ruleptr)
        else
                printf("N/A, ");
 
-       if (power->max_ir)
-               printf("%.2f, ", ((float)ntohl(power->max_ir)/100.0));
-       else
-               printf("N/A, ");
-
        if (power->max_eirp)
                printf("%.2f)", ((float)ntohl(power->max_eirp)/100.0));
        else
diff --git a/regdb.h b/regdb.h
index e190049..0dc4461 100644 (file)
--- a/regdb.h
+++ b/regdb.h
@@ -51,8 +51,8 @@ struct regdb_file_freq_range {
 struct regdb_file_power_rule {
        /* antenna gain is in mBi (100 * dBi) */
        __be32  max_antenna_gain;
-       /* these are in mBm (100 * dBm) */
-       __be32  max_ir, max_eirp;
+       /* this is in mBm (100 * dBm) */
+       __be32  max_eirp;
 };
 
 enum reg_rule_flags {
index a084cb1..f56fddd 100644 (file)
@@ -52,11 +52,6 @@ def _country(macro, countries, code):
             f.text('Max antenna gain [dBi]'),
           f.strong(0), f.table_cell(0),
           f.table_cell(1), f.strong(1),
-            f.text('Max IR [dBm'),
-            f.hardspace,
-            f.text('(mW)]'),
-          f.strong(0), f.table_cell(0),
-          f.table_cell(1), f.strong(1),
             f.text('Max EIRP [dBm'),
             f.hardspace,
             f.text('(mW)]'),
@@ -86,9 +81,6 @@ def _country(macro, countries, code):
                 f.text(str_or_na(perm.power.max_ant_gain)),
               f.table_cell(0),
               f.table_cell(1),
-                f.text(str_or_na(perm.power.max_ir, dBm=True)),
-              f.table_cell(0),
-              f.table_cell(1),
                 f.text(str_or_na(perm.power.max_eirp, dBm=True)),
               f.table_cell(0),
             f.table_row(0),