All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-02 12:02 ` Janusz Dziedzic
  0 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-02 12:02 UTC (permalink / raw)
  To: wireless-regdb; +Cc: mcgrof, linux-wireless, Janusz Dziedzic

db2rd, parse and print DFS CAC time

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 crda.c   |    3 +++
 reglib.c |   15 ++++++++++++++-
 reglib.h |    1 +
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/crda.c b/crda.c
index 4751a39..f40131f 100644
--- a/crda.c
+++ b/crda.c
@@ -131,6 +131,9 @@ static int put_reg_rule(const struct ieee80211_reg_rule *rule, struct nl_msg *ms
 	NLA_PUT_U32(msg, NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,	power_rule->max_antenna_gain);
 	NLA_PUT_U32(msg, NL80211_ATTR_POWER_RULE_MAX_EIRP,	power_rule->max_eirp);
 
+	if (rule->dfs_cac_ms)
+		NLA_PUT_U32(msg, NL80211_ATTR_DFS_CAC_TIME, rule->dfs_cac_ms);
+
 	return 0;
 
 nla_put_failure:
diff --git a/reglib.c b/reglib.c
index 6db3e75..e00e9b8 100644
--- a/reglib.c
+++ b/reglib.c
@@ -723,6 +723,11 @@ static void print_reg_rule(const struct ieee80211_reg_rule *rule)
 	else
 		printf("N/A)");
 
+	if (rule->dfs_cac_ms)
+		printf(", (%u)", rule->dfs_cac_ms);
+	else
+		printf(", (N/A)");
+
 	if (rule->flags & RRF_NO_OFDM)
 		printf(", NO-OFDM");
 	if (rule->flags & RRF_NO_CCK)
@@ -801,6 +806,7 @@ static int reglib_parse_rule(FILE *fp, struct ieee80211_reg_rule *reg_rule)
 	char *line_p;
 	int hits, r = 0;
 	float start_freq_khz, end_freq_khz, max_bandwidth_khz, max_eirp;
+	unsigned int dfs_cac_ms = 0;
 
 	memset(line, 0, sizeof(line));
 	line_p = fgets(line, sizeof(line), fp);
@@ -846,8 +852,15 @@ static int reglib_parse_rule(FILE *fp, struct ieee80211_reg_rule *reg_rule)
 
 	/* Next get optional arguments (flags ...) */
 	strsep(&line_p, ",");
-	if (line_p)
+	if (line_p) {
+		/* Check DFS CAC time */
+		hits = sscanf(line_p, " (%u)", &dfs_cac_ms);
+		if (hits == 1)
+			reg_rule->dfs_cac_ms = dfs_cac_ms;
+
+		/* Check flags */
 		reg_rule->flags = reglib_parse_rule_flag(line_p);
+	}
 
 	return r;
 }
diff --git a/reglib.h b/reglib.h
index afd5ef6..77aa42a 100644
--- a/reglib.h
+++ b/reglib.h
@@ -28,6 +28,7 @@ struct ieee80211_reg_rule {
 	struct ieee80211_freq_range freq_range;
 	struct ieee80211_power_rule power_rule;
 	uint32_t flags;
+	uint32_t dfs_cac_ms;
 };
 
 struct ieee80211_regdomain {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-02 12:02 ` Janusz Dziedzic
  0 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-02 12:02 UTC (permalink / raw)
  To: wireless-regdb; +Cc: Janusz Dziedzic, linux-wireless, mcgrof

db2rd, parse and print DFS CAC time

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 crda.c   |    3 +++
 reglib.c |   15 ++++++++++++++-
 reglib.h |    1 +
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/crda.c b/crda.c
index 4751a39..f40131f 100644
--- a/crda.c
+++ b/crda.c
@@ -131,6 +131,9 @@ static int put_reg_rule(const struct ieee80211_reg_rule *rule, struct nl_msg *ms
 	NLA_PUT_U32(msg, NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,	power_rule->max_antenna_gain);
 	NLA_PUT_U32(msg, NL80211_ATTR_POWER_RULE_MAX_EIRP,	power_rule->max_eirp);
 
+	if (rule->dfs_cac_ms)
+		NLA_PUT_U32(msg, NL80211_ATTR_DFS_CAC_TIME, rule->dfs_cac_ms);
+
 	return 0;
 
 nla_put_failure:
diff --git a/reglib.c b/reglib.c
index 6db3e75..e00e9b8 100644
--- a/reglib.c
+++ b/reglib.c
@@ -723,6 +723,11 @@ static void print_reg_rule(const struct ieee80211_reg_rule *rule)
 	else
 		printf("N/A)");
 
+	if (rule->dfs_cac_ms)
+		printf(", (%u)", rule->dfs_cac_ms);
+	else
+		printf(", (N/A)");
+
 	if (rule->flags & RRF_NO_OFDM)
 		printf(", NO-OFDM");
 	if (rule->flags & RRF_NO_CCK)
@@ -801,6 +806,7 @@ static int reglib_parse_rule(FILE *fp, struct ieee80211_reg_rule *reg_rule)
 	char *line_p;
 	int hits, r = 0;
 	float start_freq_khz, end_freq_khz, max_bandwidth_khz, max_eirp;
+	unsigned int dfs_cac_ms = 0;
 
 	memset(line, 0, sizeof(line));
 	line_p = fgets(line, sizeof(line), fp);
@@ -846,8 +852,15 @@ static int reglib_parse_rule(FILE *fp, struct ieee80211_reg_rule *reg_rule)
 
 	/* Next get optional arguments (flags ...) */
 	strsep(&line_p, ",");
-	if (line_p)
+	if (line_p) {
+		/* Check DFS CAC time */
+		hits = sscanf(line_p, " (%u)", &dfs_cac_ms);
+		if (hits == 1)
+			reg_rule->dfs_cac_ms = dfs_cac_ms;
+
+		/* Check flags */
 		reg_rule->flags = reglib_parse_rule_flag(line_p);
+	}
 
 	return r;
 }
diff --git a/reglib.h b/reglib.h
index afd5ef6..77aa42a 100644
--- a/reglib.h
+++ b/reglib.h
@@ -28,6 +28,7 @@ struct ieee80211_reg_rule {
 	struct ieee80211_freq_range freq_range;
 	struct ieee80211_power_rule power_rule;
 	uint32_t flags;
+	uint32_t dfs_cac_ms;
 };
 
 struct ieee80211_regdomain {
-- 
1.7.9.5


_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] crda: db2rd, parse/print CAC time
  2014-07-02 12:02 ` [wireless-regdb] " Janusz Dziedzic
@ 2014-07-02 22:06   ` Luis R. Rodriguez
  -1 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2014-07-02 22:06 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: wireless-regdb, linux-wireless

On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> db2rd, parse and print DFS CAC time
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>


This doesn't print the DFS CAC if its a in a line like this:

(5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW

  Luis

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-02 22:06   ` Luis R. Rodriguez
  0 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2014-07-02 22:06 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless, wireless-regdb

On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> db2rd, parse and print DFS CAC time
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>


This doesn't print the DFS CAC if its a in a line like this:

(5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW

  Luis

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] crda: db2rd, parse/print CAC time
  2014-07-02 22:06   ` [wireless-regdb] " Luis R. Rodriguez
@ 2014-07-03  6:26     ` Janusz Dziedzic
  -1 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-03  6:26 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: wireless-regdb, linux-wireless

On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
> <janusz.dziedzic@tieto.com> wrote:
>> db2rd, parse and print DFS CAC time
>>
>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>
>
> This doesn't print the DFS CAC if its a in a line like this:
>
> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
>
will check this, BTW BW=0 is not allowed I think.

BR
Janusz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-03  6:26     ` Janusz Dziedzic
  0 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-03  6:26 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, wireless-regdb

On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
> <janusz.dziedzic@tieto.com> wrote:
>> db2rd, parse and print DFS CAC time
>>
>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>
>
> This doesn't print the DFS CAC if its a in a line like this:
>
> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
>
will check this, BTW BW=0 is not allowed I think.

BR
Janusz

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] crda: db2rd, parse/print CAC time
  2014-07-03  6:26     ` [wireless-regdb] " Janusz Dziedzic
@ 2014-07-03  6:34       ` Janusz Dziedzic
  -1 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-03  6:34 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: wireless-regdb, linux-wireless

On 3 July 2014 08:26, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
>> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
>> <janusz.dziedzic@tieto.com> wrote:
>>> db2rd, parse and print DFS CAC time
>>>
>>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>>
>>
>> This doesn't print the DFS CAC if its a in a line like this:
>>
>> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
>>
> will check this, BTW BW=0 is not allowed I think.
>

Did such test:
country AE: DFS-FCC
        (2402 - 2482 @ 40), (20)
        (5170 - 5250 @ 80), (17)
        (5250 - 5330 @ 0), (24), (60000), DFS, AUTO-BW
        (5490 - 5730 @ 80), (24), DFS
        (5735 - 5835 @ 80), (30)

And get:
./db2rd < db.txt

country AE: DFS-FCC
    (2402.000 - 2482.000 @ 40.000), (20.00), (N/A)
    (5170.000 - 5250.000 @ 80.000), (17.00), (N/A)
    (5250.000 - 5330.000 @ 0.000), (24.00), (60000), DFS, AUTO-BW
    (5490.000 - 5730.000 @ 80.000), (24.00), (N/A), DFS
    (5735.000 - 5835.000 @ 80.000), (30.00), (N/A)

Seems works fine. Did you install reglib, could be you are using old one?
I am using x86_64.

BR
Janusz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-03  6:34       ` Janusz Dziedzic
  0 siblings, 0 replies; 10+ messages in thread
From: Janusz Dziedzic @ 2014-07-03  6:34 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, wireless-regdb

On 3 July 2014 08:26, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
>> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
>> <janusz.dziedzic@tieto.com> wrote:
>>> db2rd, parse and print DFS CAC time
>>>
>>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>>
>>
>> This doesn't print the DFS CAC if its a in a line like this:
>>
>> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
>>
> will check this, BTW BW=0 is not allowed I think.
>

Did such test:
country AE: DFS-FCC
        (2402 - 2482 @ 40), (20)
        (5170 - 5250 @ 80), (17)
        (5250 - 5330 @ 0), (24), (60000), DFS, AUTO-BW
        (5490 - 5730 @ 80), (24), DFS
        (5735 - 5835 @ 80), (30)

And get:
./db2rd < db.txt

country AE: DFS-FCC
    (2402.000 - 2482.000 @ 40.000), (20.00), (N/A)
    (5170.000 - 5250.000 @ 80.000), (17.00), (N/A)
    (5250.000 - 5330.000 @ 0.000), (24.00), (60000), DFS, AUTO-BW
    (5490.000 - 5730.000 @ 80.000), (24.00), (N/A), DFS
    (5735.000 - 5835.000 @ 80.000), (30.00), (N/A)

Seems works fine. Did you install reglib, could be you are using old one?
I am using x86_64.

BR
Janusz

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
  2014-07-03  6:34       ` [wireless-regdb] " Janusz Dziedzic
@ 2014-07-03 15:35         ` Luis R. Rodriguez
  -1 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2014-07-03 15:35 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: Luis R. Rodriguez, linux-wireless, wireless-regdb

On Thu, Jul 03, 2014 at 08:34:37AM +0200, Janusz Dziedzic wrote:
> On 3 July 2014 08:26, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> > On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> >> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
> >> <janusz.dziedzic@tieto.com> wrote:
> >>> db2rd, parse and print DFS CAC time
> >>>
> >>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> >>
> >>
> >> This doesn't print the DFS CAC if its a in a line like this:
> >>
> >> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
> >>
> > will check this, BTW BW=0 is not allowed I think.
> >
> 
> Did such test:
> country AE: DFS-FCC
>         (2402 - 2482 @ 40), (20)
>         (5170 - 5250 @ 80), (17)
>         (5250 - 5330 @ 0), (24), (60000), DFS, AUTO-BW
>         (5490 - 5730 @ 80), (24), DFS
>         (5735 - 5835 @ 80), (30)
> 
> And get:
> ./db2rd < db.txt
> 
> country AE: DFS-FCC
>     (2402.000 - 2482.000 @ 40.000), (20.00), (N/A)
>     (5170.000 - 5250.000 @ 80.000), (17.00), (N/A)
>     (5250.000 - 5330.000 @ 0.000), (24.00), (60000), DFS, AUTO-BW
>     (5490.000 - 5730.000 @ 80.000), (24.00), (N/A), DFS
>     (5735.000 - 5835.000 @ 80.000), (30.00), (N/A)
> 
> Seems works fine. Did you install reglib, could be you are using old one?
> I am using x86_64.

Heh yeah that's the issue, sorry, patch pushed!

  Luis

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [wireless-regdb] [PATCH] crda: db2rd, parse/print CAC time
@ 2014-07-03 15:35         ` Luis R. Rodriguez
  0 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2014-07-03 15:35 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: wireless-regdb, linux-wireless, Luis R. Rodriguez

On Thu, Jul 03, 2014 at 08:34:37AM +0200, Janusz Dziedzic wrote:
> On 3 July 2014 08:26, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> > On 3 July 2014 00:06, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> >> On Wed, Jul 2, 2014 at 5:02 AM, Janusz Dziedzic
> >> <janusz.dziedzic@tieto.com> wrote:
> >>> db2rd, parse and print DFS CAC time
> >>>
> >>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> >>
> >>
> >> This doesn't print the DFS CAC if its a in a line like this:
> >>
> >> (5250 - 5330 @ 0), (20), (60000), DFS, AUTO-BW
> >>
> > will check this, BTW BW=0 is not allowed I think.
> >
> 
> Did such test:
> country AE: DFS-FCC
>         (2402 - 2482 @ 40), (20)
>         (5170 - 5250 @ 80), (17)
>         (5250 - 5330 @ 0), (24), (60000), DFS, AUTO-BW
>         (5490 - 5730 @ 80), (24), DFS
>         (5735 - 5835 @ 80), (30)
> 
> And get:
> ./db2rd < db.txt
> 
> country AE: DFS-FCC
>     (2402.000 - 2482.000 @ 40.000), (20.00), (N/A)
>     (5170.000 - 5250.000 @ 80.000), (17.00), (N/A)
>     (5250.000 - 5330.000 @ 0.000), (24.00), (60000), DFS, AUTO-BW
>     (5490.000 - 5730.000 @ 80.000), (24.00), (N/A), DFS
>     (5735.000 - 5835.000 @ 80.000), (30.00), (N/A)
> 
> Seems works fine. Did you install reglib, could be you are using old one?
> I am using x86_64.

Heh yeah that's the issue, sorry, patch pushed!

  Luis

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-03 15:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 12:02 [PATCH] crda: db2rd, parse/print CAC time Janusz Dziedzic
2014-07-02 12:02 ` [wireless-regdb] " Janusz Dziedzic
2014-07-02 22:06 ` Luis R. Rodriguez
2014-07-02 22:06   ` [wireless-regdb] " Luis R. Rodriguez
2014-07-03  6:26   ` Janusz Dziedzic
2014-07-03  6:26     ` [wireless-regdb] " Janusz Dziedzic
2014-07-03  6:34     ` Janusz Dziedzic
2014-07-03  6:34       ` [wireless-regdb] " Janusz Dziedzic
2014-07-03 15:35       ` Luis R. Rodriguez
2014-07-03 15:35         ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.