aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2014-02-10 20:15:41 +0100
committerJohn W. Linville <linville@tuxdriver.com>2014-05-19 14:30:40 -0400
commitff459d77110ce4b9d08589e1d0b12484f5c0a961 (patch)
tree1c5132433b5e99cfa79874cab8b661102270db1d
parenta04bb64e5a5e770254fe80529171038bac030188 (diff)
downloadwireless-regdb-ff459d77110ce4b9d08589e1d0b12484f5c0a961.tar.gz
wireless-regdb: allow max bandwidth to be AUTO calculated
Allow max bandwidth to be AUTO calculated, base on contiguous rules. This AUTO ( bw = 0) parameter will be send to the kernel mode (cfg80211/nl80211) and next maximum allowed bandwidth will be calculated base on contiguous rules. Eg. country PL: DFS-ETSI (2402 - 2482 @ 40), (N/A, 20) (5170 - 5250 @ AUTO), (N/A, 20) (5250 - 5330 @ AUTO), (N/A, 20), DFS (5490 - 5710 @ 80), (N/A, 27), DFS This mean we will calculate maximum bw for rules where AUTO were set, 160MHz (5330 - 5170) in example above. So we will get: (5170 - 5250 @ 160), (N/A, 20) (5250 - 5330 @ 160), (N/A, 20), DFS In other case: country FR: DFS-ETSI (2402 - 2482 @ 40), (N/A, 20) (5170 - 5250 @ AUTO), (N/A, 20) (5250 - 5330 @ 80), (N/A, 20), DFS (5490 - 5710 @ 80), (N/A, 27), DFS We will get 80MHz (5250 - 5170): (5170 - 5250 @ 80), (N/A, 20) (5250 - 5330 @ 80), (N/A, 20), DFS Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rwxr-xr-xdbparse.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/dbparse.py b/dbparse.py
index ac7234b..7c7bc19 100755
--- a/dbparse.py
+++ b/dbparse.py
@@ -144,7 +144,10 @@ class DBParser(object):
def _parse_band_def(self, bname, banddef, dupwarn=True):
try:
freqs, bw = banddef.split('@')
- bw = float(bw)
+ if bw == "AUTO":
+ bw = 0.0
+ else:
+ bw = float(bw)
except ValueError:
bw = 20.0