* [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference
@ 2024-11-16 8:24 Ping-Ke Shih
2024-11-16 8:33 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Ping-Ke Shih @ 2024-11-16 8:24 UTC (permalink / raw)
To: wens; +Cc: linux-wireless, wireless-regdb, combuster
From: Ping-Ke Shih <pkshih@realtek.com>
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
Reported-by: Ivan Bulatovic <combuster@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
db.txt | 8 ++++----
dbparse.py | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/db.txt b/db.txt
index 32b533e800f5..a12f931ef4b2 100644
--- a/db.txt
+++ b/db.txt
@@ -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)
diff --git a/dbparse.py b/dbparse.py
index 5f7e08200fa0..b27690166427 100755
--- a/dbparse.py
+++ b/dbparse.py
@@ -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 smaller than freq_diff (%d - %d) (%d)"
+ % (start, end, bw))
except ValueError:
self._syntax_error("band must have frequency range")
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference
2024-11-16 8:24 [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference Ping-Ke Shih
@ 2024-11-16 8:33 ` Johannes Berg
2024-11-16 8:38 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2024-11-16 8:33 UTC (permalink / raw)
To: Ping-Ke Shih, wens; +Cc: linux-wireless, wireless-regdb, combuster
On Sat, 2024-11-16 at 16:24 +0800, Ping-Ke Shih wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
>
> Since kernel will reject max bandwidth being larger than freq_diff in
> is_valid_reg_rule(), as well reject it ahead.
Not sure that's generally true, if you have AUTO-BW I think it should be
OK?
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference
2024-11-16 8:33 ` Johannes Berg
@ 2024-11-16 8:38 ` Johannes Berg
2024-11-16 8:58 ` Ping-Ke Shih
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2024-11-16 8:38 UTC (permalink / raw)
To: Ping-Ke Shih, wens; +Cc: linux-wireless, wireless-regdb, combuster
On Sat, 2024-11-16 at 09:33 +0100, Johannes Berg wrote:
> On Sat, 2024-11-16 at 16:24 +0800, Ping-Ke Shih wrote:
> > From: Ping-Ke Shih <pkshih@realtek.com>
> >
> > Since kernel will reject max bandwidth being larger than freq_diff in
> > is_valid_reg_rule(), as well reject it ahead.
>
> Not sure that's generally true, if you have AUTO-BW I think it should be
> OK?
>
Sorry, no, I guess AUTO-BW just lets it expand the bandwidth beyond the
listed, if there are adjacent ranges. Been ages since I looked at this.
Anyway this probably doesn't fix the user's problem, it just makes it
rejected when compiling already ;-)
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference
2024-11-16 8:38 ` Johannes Berg
@ 2024-11-16 8:58 ` Ping-Ke Shih
2024-11-16 13:32 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Ping-Ke Shih @ 2024-11-16 8:58 UTC (permalink / raw)
To: Johannes Berg; +Cc: wens, linux-wireless, wireless-regdb, combuster
Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Sat, 2024-11-16 at 09:33 +0100, Johannes Berg wrote:
> > On Sat, 2024-11-16 at 16:24 +0800, Ping-Ke Shih wrote:
> > > From: Ping-Ke Shih <pkshih@realtek.com>
> > >
> > > Since kernel will reject max bandwidth being larger than freq_diff in
> > > is_valid_reg_rule(), as well reject it ahead.
> >
> > Not sure that's generally true, if you have AUTO-BW I think it should be
> > OK?
> >
>
> Sorry, no, I guess AUTO-BW just lets it expand the bandwidth beyond the
> listed, if there are adjacent ranges. Been ages since I looked at this.
>
I have similar thought as you, but I should admit I have not yet
looked into reg.c
to know the detail.
I quickly check the warning reported by user "kernel: cfg80211:
Invalid regulatory domain detected: RS.",
and lookup possible cause could be is_valid_reg_rule() to make this patch.
I hope original reporter can help to test this, or I will try it when
I have free time.
> Anyway this probably doesn't fix the user's problem, it just makes it
> rejected when compiling already ;-)
Honestly these mistakes were made by me. I should fix them.
Since rtw89 still use wireless-regdb, I will keep updating the
regulatory especially
lack of 6GHz frequencies.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference
2024-11-16 8:58 ` Ping-Ke Shih
@ 2024-11-16 13:32 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2024-11-16 13:32 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: wens, linux-wireless, wireless-regdb, combuster
On Sat, 2024-11-16 at 16:58 +0800, Ping-Ke Shih wrote:
>
> > Anyway this probably doesn't fix the user's problem, it just makes it
> > rejected when compiling already ;-)
>
> Honestly these mistakes were made by me. I should fix them.
> Since rtw89 still use wireless-regdb, I will keep updating the
> regulatory especially lack of 6GHz frequencies.
>
It's nice that 6 GHz is reaching more users :)
Sorry about my earlier comment, I somehow managed to misread the patch.
Of course this fixes it, and I see they already tested :)
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-16 13:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-16 8:24 [PATCH] wireless-regdb: assert and correct maximum bandwidth within frequency difference Ping-Ke Shih
2024-11-16 8:33 ` Johannes Berg
2024-11-16 8:38 ` Johannes Berg
2024-11-16 8:58 ` Ping-Ke Shih
2024-11-16 13:32 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox