wireless-regdb: assert and correct maximum bandwidth within frequency difference
PATCH v2 1/1 wireless-regdb: assert and correct maximum bandwidth within frequency difference
From: Ping-Ke Shih <[email protected]>
Since kernel will reject max bandwidth being larger than freq_diff in is_valid_reg_rule(), as well reject it ahead.
Closes https://lore.kernel.org/linux-wireless/CAPGdDAmPp80VEZ0TG=cS3QAYKqELHfqChid0wYZ7eLAENFY86Q@mail.gmail.com/T/#u open here
Reported-by Ivan Bulatovic <[email protected]>
Signed-off-by Ping-Ke Shih <[email protected]>
---
v2:
- error message in dbparse.py should be "... _larger_ ..." instead.
- by the way, reporter tested v1 and got positive result
--- db.txt | 8 ++++---- dbparse.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-)
db.txt +4 -4
@@ -787,11 +787,11 @@ country GT: (2400 - 2483.5 @ 40), (500 mW) (5150 - 5350 @ 80), (200 mW), NO-OUTDOOR (5470 - 5725 @ 160), (250 mW), NO-OUTDOOR - (5725 - 5850 @ 160), (500 mW), NO-OUTDOOR + (5725 - 5850 @ 80), (500 mW), NO-OUTDOOR (5925 - 6425 @ 320), (200 mW), NO-OUTDOOR, AUTO-BW - (6425 - 6525 @ 320), (200 mW), NO-OUTDOOR, AUTO-BW + (6425 - 6525 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW (6525 - 6875 @ 320), (150 mW), NO-OUTDOOR, AUTO-BW - (6875 - 7125 @ 320), (150 mW), NO-OUTDOOR, AUTO-BW + (6875 - 7125 @ 160), (150 mW), NO-OUTDOOR, AUTO-BW (57000 - 66000 @ 2160), (20 mW), NO-OUTDOOR country GU: DFS-FCC
@@ -1646,7 +1646,7 @@ country RS: DFS-ETSI (5250 - 5350 @ 80), (23), DFS, AUTO-BW (5470 - 5725 @ 160), (27), DFS (5725 - 5850 @ 80), (24), DFS, AUTO-BW - (5850 - 5875 @ 80), (24), AUTO-BW + (5850 - 5875 @ 20), (24), AUTO-BW (5925 - 6425 @ 320), (23), NO-OUTDOOR # 60 GHz band channels 1-4, ref: Etsi En 302 567 (57000 - 66000 @ 2160), (40)
dbparse.py +3 -0
@@ -218,6 +218,9 @@ class DBParser(object): self._syntax_error("Inverted freq range (%d - %d)" % (start, end)) if start == end: self._syntax_error("Start and end freqs are equal (%d)" % start) + if bw > end - start: + self._syntax_error("BW is larger than freq_diff (%d - %d) (%d)" + % (start, end, bw)) except ValueError: self._syntax_error("band must have frequency range")
Signature · 1 line
2.25.1
Chen-Yu Tsai
AppliedQuoted 4 lines · Ping-Ke Shih
Since kernel will reject max bandwidth being larger than
freq_diffinis_valid_reg_rule(), as well reject it ahead.
Applied to master in wens/wireless-regdb.git, thanks!
[1/1] wireless-regdb: assert and correct maximum bandwidth within frequency difference
https://git.kernel.org/wens/wireless-regdb/c/b43aeb518a07
Best regards,
Signature · 1 line
Chen-Yu Tsai <[email protected]>