diff mbox series

Add extra check in regdb scripts

Message ID CAE+BM3=Neb_g3QPMiGjpmkkpUK6wupM1FX06DyZOtDnQgBz_YA@mail.gmail.com (mailing list archive)
State Changes Requested
Delegated to: Chen-Yu Tsai
Headers show
Series Add extra check in regdb scripts | expand

Commit Message

Rusty Howell Sept. 13, 2023, 5:08 p.m. UTC
From 434588b8f06f78a3188909c298a6f6671dab7b3f Mon Sep 17 00:00:00 2001
From: Rusty Howell <rhowell@control4.com>
Date: Thu, 7 Sep 2023 12:56:47 -0600
Subject: [PATCH] Add same check that kernel uses to check reg domain

The kernel will reject a regulatory domain if the max bandwidth is greater than
the span from start to end. We should catch this error when compiling the
regulatory database.
---
 dbparse.py | 3 +++
 1 file changed, 3 insertions(+)

         except ValueError:
             self._syntax_error("band must have frequency range")

Comments

Chen-Yu Tsai Dec. 5, 2023, 2:50 a.m. UTC | #1
Hi,

On Thu, Sep 14, 2023 at 12:16 PM Rusty Howell <rustyhowell@gmail.com> wrote:
>
> From 434588b8f06f78a3188909c298a6f6671dab7b3f Mon Sep 17 00:00:00 2001
> From: Rusty Howell <rhowell@control4.com>
> Date: Thu, 7 Sep 2023 12:56:47 -0600
> Subject: [PATCH] Add same check that kernel uses to check reg domain
>
> The kernel will reject a regulatory domain if the max bandwidth is greater than
> the span from start to end. We should catch this error when compiling the
> regulatory database.
> ---
>  dbparse.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/dbparse.py b/dbparse.py
> index 5f7e082..1e87813 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("Max bandwidth must not exceed the
> range from start to end")
> +
>          except ValueError:
>              self._syntax_error("band must have frequency range")
>
> --
> 2.25.1

It looks like this patch was incorrectly line wrapped (by Gmail maybe).
Can you resend?


Thanks
ChenYu
diff mbox series

Patch

diff --git a/dbparse.py b/dbparse.py
index 5f7e082..1e87813 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("Max bandwidth must not exceed the
range from start to end")
+