2014-01-14 17:29:47

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 0/5] Implement DFS CAC time as regulatory param

Implement DFS CAC time inside regulatory.
Currently tested with internal regdb.

Changed way we check rule is correct in first patch - check
more rules if they are continous.
Added parsing DFS CAC to genregdb.awk script.
Last patch is only an example I tested for PL regd.
Implemented also iw patches for iw get regd/iw list

CRDA/wireless-regdb - this is still missing.
Please review.

Janusz Dziedzic (5):
cfg80211: regulatory rules, fix bw checking
cfg80211: regulatory, introduce DFS CAC time
cfg80211: parse DFS CAC time for internal regdb option
nl80211: add DFS CAC time option
cfg80211: setup CAC time in db.txt for PL

include/net/cfg80211.h | 2 +
include/net/regulatory.h | 12 +++++
include/uapi/linux/nl80211.h | 5 +++
net/wireless/db.txt | 6 ++-
net/wireless/genregdb.awk | 8 +++-
net/wireless/nl80211.c | 13 +++++-
net/wireless/reg.c | 100 ++++++++++++++++++++++++++++++++++++------
7 files changed, 128 insertions(+), 18 deletions(-)

--
1.7.9.5



2014-01-15 13:25:56

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 5/5] cfg80211: setup CAC time in db.txt for PL

On Tue, 2014-01-14 at 18:29 +0100, Janusz Dziedzic wrote:
> This is DFS CAC time setup for PL.
> We should do the same for all other
> countries that support DFS in wireless-regd.
> Here only as example, please don't merge.
>
> Signed-off-by: Janusz Dziedzic <[email protected]>
> ---
> net/wireless/db.txt | 6 ++++--

That file doesn't exist in the kernel tree anyway ...

johannes


2014-01-14 17:29:46

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 1/5] cfg80211: regulatory rules, fix bw checking

Allow BW cross over REG_RULES if rules continous.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
I am not sure about rule_intersect() here ...

net/wireless/reg.c | 68 +++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 59 insertions(+), 9 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 7d20d84..4414fa5 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -522,9 +522,55 @@ bool reg_is_valid_request(const char *alpha2)
return alpha2_equal(lr->alpha2, alpha2);
}

+static u32 get_frequency_diff(const struct ieee80211_reg_rule *rules,
+ unsigned int rule_no,
+ unsigned int rule_max)
+{
+ u32 start_freq, end_freq;
+ u32 no = rule_no;
+ const struct ieee80211_reg_rule *rule = &rules[rule_no];
+ const struct ieee80211_freq_range *freq_range = &rule->freq_range;
+ const struct ieee80211_freq_range *freq_range_tmp;
+
+ /* get start_freq */
+ while (no) {
+ rule = &rules[--no];
+ freq_range_tmp = &rule->freq_range;
+
+ if (freq_range_tmp->end_freq_khz != freq_range->start_freq_khz)
+ break;
+
+ freq_range = freq_range_tmp;
+ };
+
+ start_freq = freq_range->start_freq_khz;
+
+ /* get end_freq */
+ rule = &rules[rule_no];
+ freq_range = &rule->freq_range;
+ no = rule_no;
+
+ while (no < rule_max - 1) {
+ rule = &rules[++no];
+ freq_range_tmp = &rule->freq_range;
+
+ if (freq_range_tmp->start_freq_khz != freq_range->end_freq_khz)
+ break;
+
+ freq_range = freq_range_tmp;
+ }
+
+ end_freq = freq_range->end_freq_khz;
+
+ return end_freq - start_freq;
+}
+
/* Sanity check on a regulatory rule */
-static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
+static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rules,
+ unsigned int rule_no,
+ unsigned int rule_max)
{
+ const struct ieee80211_reg_rule *rule = &rules[rule_no];
const struct ieee80211_freq_range *freq_range = &rule->freq_range;
u32 freq_diff;

@@ -534,10 +580,17 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
if (freq_range->start_freq_khz > freq_range->end_freq_khz)
return false;

+ if (freq_range->end_freq_khz <= freq_range->start_freq_khz)
+ return false;
+
+ /* First do quick check */
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
+ if (freq_range->max_bandwidth_khz <= freq_diff)
+ return true;

- if (freq_range->end_freq_khz <= freq_range->start_freq_khz ||
- freq_range->max_bandwidth_khz > freq_diff)
+ /* Next check adjacent rules (if continous) */
+ freq_diff = get_frequency_diff(rules, rule_no, rule_max);
+ if (freq_range->max_bandwidth_khz > freq_diff)
return false;

return true;
@@ -545,7 +598,6 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)

static bool is_valid_rd(const struct ieee80211_regdomain *rd)
{
- const struct ieee80211_reg_rule *reg_rule = NULL;
unsigned int i;

if (!rd->n_reg_rules)
@@ -554,11 +606,9 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd)
if (WARN_ON(rd->n_reg_rules > NL80211_MAX_SUPP_REG_RULES))
return false;

- for (i = 0; i < rd->n_reg_rules; i++) {
- reg_rule = &rd->reg_rules[i];
- if (!is_valid_reg_rule(reg_rule))
+ for (i = 0; i < rd->n_reg_rules; i++)
+ if (!is_valid_reg_rule(rd->reg_rules, i, rd->n_reg_rules))
return false;
- }

return true;
}
@@ -666,7 +716,7 @@ static int reg_rules_intersect(const struct ieee80211_reg_rule *rule1,

intersected_rule->flags = rule1->flags | rule2->flags;

- if (!is_valid_reg_rule(intersected_rule))
+ if (!is_valid_reg_rule(intersected_rule, 0, 1))
return -EINVAL;

return 0;
--
1.7.9.5


2014-01-15 16:05:35

by Janusz Dziedzic

[permalink] [raw]
Subject: Re: [RFC 1/5] cfg80211: regulatory rules, fix bw checking

On 15 January 2014 14:23, Johannes Berg <[email protected]> wrote:
> On Tue, 2014-01-14 at 18:29 +0100, Janusz Dziedzic wrote:
>> Allow BW cross over REG_RULES if rules continous.
>>
>> Signed-off-by: Janusz Dziedzic <[email protected]>
>> ---
>> I am not sure about rule_intersect() here ...
>
> I'm not sure about the whole thing ...
>
> We did discuss something like this previously (and see our todo list on
> the wiki), but this isn't just some arbitrary internal change, it
> completely changes the interpretation of the regulatory database.
>

We need this because of such split DFS REG_RULE for ETSI:

- (5250 - 5330 @ 80), (N/A, 20), DFS
- (5490 - 5710 @ 80), (N/A, 27), DFS
+ (5250 - 5330 @ 80), (N/A, 20), (60), DFS
+ (5490 - 5590 @ 80), (N/A, 27), (60), DFS
+ (5590 - 5650 @ 80), (N/A, 27), (600), DFS // here different
CAC time but still 80MHz should be available
+ (5650 - 5710 @ 80), (N/A, 27), (60), DFS

In the future could be also usefull for 160MHz:
(5170 - 5250 @ 160), (N/A, 20)
(5250 - 5330 @ 160), (N/A, 20), DFS

eg. using channels 36 - 64 @ 160MHz (with current code this is not
possible, due to BW check per single rule)
I am not sure there is a card with 160MHz support on the market today,
but who knows?

We can implement CAC time as hardcoded (already send such patches some
time ago) one but seems this is close connected with regulatory
configuration and seems like good idea put this in regulatory db.

> At a minimum, that means you need a big commit log discussing the impact
> of the changes etc.
>
Because of that I send this RFC, I wasn't sure about all possible
problems with that.
I hope Luis could help here.

BR
Janusz

2014-01-24 23:32:14

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [RFC 0/5] Implement DFS CAC time as regulatory param

On Tue, Jan 14, 2014 at 9:29 AM, Janusz Dziedzic
<[email protected]> wrote:
> Implement DFS CAC time inside regulatory.
> Currently tested with internal regdb.
>
> Changed way we check rule is correct in first patch - check
> more rules if they are continous.
> Added parsing DFS CAC to genregdb.awk script.
> Last patch is only an example I tested for PL regd.
> Implemented also iw patches for iw get regd/iw list
>
> CRDA/wireless-regdb - this is still missing.
> Please review.

During review I had the questions as Johannes did. Otherwise looks
good like the right approach. Be sure to also submit as part of your
series the respective CRDA and wireless-regdb changes.

Luis

2014-01-14 17:29:48

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 3/5] cfg80211: parse DFS CAC time for internal regdb option

Add support for parsing DFS CAC time when internal
regulatory database is used.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
net/wireless/genregdb.awk | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk
index 9a8217d..d48f881 100644
--- a/net/wireless/genregdb.awk
+++ b/net/wireless/genregdb.awk
@@ -66,6 +66,7 @@ function parse_reg_rule()
units = $8
sub(/\)/, "", units)
sub(/,/, "", units)
+ dfs_cac = $9
if (units == "mW") {
if (power == 100) {
power = 20
@@ -78,7 +79,12 @@ function parse_reg_rule()
} else {
print "Unknown power value in database!"
}
+ } else {
+ dfs_cac = $8
}
+ sub(/,/, "", dfs_cac)
+ sub(/\(/, "", dfs_cac)
+ sub(/\)/, "", dfs_cac)
flagstr = ""
for (i=8; i<=NF; i++)
flagstr = flagstr $i
@@ -109,7 +115,7 @@ function parse_reg_rule()

}
flags = flags "0"
- printf "\t\tREG_RULE(%d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, flags
+ printf "\t\tREG_RULE_DFS(%d, %d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, dfs_cac, flags
rules++
}

--
1.7.9.5


2014-01-14 17:29:47

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 2/5] cfg80211: regulatory, introduce DFS CAC time

Introduce DFS CAC time as a regd param, configured
per REG_RULE and set per channel in cfg80211.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
include/net/cfg80211.h | 2 ++
include/net/regulatory.h | 12 ++++++++++++
net/wireless/reg.c | 32 +++++++++++++++++++++++++++-----
3 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b1f84b0..64d7964 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -151,6 +151,7 @@ enum ieee80211_channel_flags {
* @dfs_state: current state of this channel. Only relevant if radar is required
* on this channel.
* @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
+ * @dfs_cac_ms: DFS CAC time in miliseconds
*/
struct ieee80211_channel {
enum ieee80211_band band;
@@ -165,6 +166,7 @@ struct ieee80211_channel {
int orig_mag, orig_mpwr;
enum nl80211_dfs_state dfs_state;
unsigned long dfs_state_entered;
+ unsigned int dfs_cac_ms;
};

/**
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index c96a0b8..3819d1f 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -151,6 +151,7 @@ struct ieee80211_reg_rule {
struct ieee80211_freq_range freq_range;
struct ieee80211_power_rule power_rule;
u32 flags;
+ u32 dfs_cac_time;
};

struct ieee80211_regdomain {
@@ -178,4 +179,15 @@ struct ieee80211_regdomain {
.flags = reg_flags, \
}

+#define REG_RULE_DFS(start, end, bw, gain, eirp, dfs_cac, reg_flags) \
+{ \
+ .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
+ .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
+ .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
+ .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \
+ .power_rule.max_eirp = DBM_TO_MBM(eirp), \
+ .flags = reg_flags, \
+ .dfs_cac_time = dfs_cac, \
+}
+
#endif
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4414fa5..eafd17c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -716,6 +716,11 @@ static int reg_rules_intersect(const struct ieee80211_reg_rule *rule1,

intersected_rule->flags = rule1->flags | rule2->flags;

+ if (rule1->dfs_cac_time > rule2->dfs_cac_time)
+ intersected_rule->dfs_cac_time = rule1->dfs_cac_time;
+ else
+ intersected_rule->dfs_cac_time = rule2->dfs_cac_time;
+
if (!is_valid_reg_rule(intersected_rule, 0, 1))
return -EINVAL;

@@ -1027,6 +1032,14 @@ static void handle_channel(struct wiphy *wiphy,
min_t(int, chan->orig_mag,
MBI_TO_DBI(power_rule->max_antenna_gain));
chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
+
+ if (chan->flags & IEEE80211_CHAN_RADAR) {
+ if (reg_rule->dfs_cac_time)
+ chan->dfs_cac_ms = reg_rule->dfs_cac_time * 1000;
+ else
+ chan->dfs_cac_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
+ }
+
if (chan->orig_mpwr) {
/*
* Devices that use REGULATORY_COUNTRY_IE_FOLLOW_POWER
@@ -2195,31 +2208,40 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
const struct ieee80211_reg_rule *reg_rule = NULL;
const struct ieee80211_freq_range *freq_range = NULL;
const struct ieee80211_power_rule *power_rule = NULL;
+ const int size = 20;
+ char cac_time[size];

- pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");
+ pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)\n");

for (i = 0; i < rd->n_reg_rules; i++) {
reg_rule = &rd->reg_rules[i];
freq_range = &reg_rule->freq_range;
power_rule = &reg_rule->power_rule;

+ if (reg_rule->flags & NL80211_RRF_DFS)
+ scnprintf(cac_time, size, "(%u sec)",
+ reg_rule->dfs_cac_time);
+ else
+ scnprintf(cac_time, size, "(N/A)");
/*
* There may not be documentation for max antenna gain
* in certain regions
*/
if (power_rule->max_antenna_gain)
- pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
+ pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm), %s\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
power_rule->max_antenna_gain,
- power_rule->max_eirp);
+ power_rule->max_eirp,
+ cac_time);
else
- pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
+ pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm), %s\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
- power_rule->max_eirp);
+ power_rule->max_eirp,
+ cac_time);
}
}

--
1.7.9.5


2014-01-15 20:17:37

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 1/5] cfg80211: regulatory rules, fix bw checking

On Wed, 2014-01-15 at 17:05 +0100, Janusz Dziedzic wrote:

> > We did discuss something like this previously (and see our todo list on
> > the wiki), but this isn't just some arbitrary internal change, it
> > completely changes the interpretation of the regulatory database.
> >
>
> We need this because of such split DFS REG_RULE for ETSI:

In general, I totally think what you're proposing makes sense, and I
also think we should take it further like here:
http://wireless.kernel.org/en/developers/todo-list/regulatory

However I do think that should be considered carefully in terms of the
userspace impact/change.

> - (5250 - 5330 @ 80), (N/A, 20), DFS
> - (5490 - 5710 @ 80), (N/A, 27), DFS
> + (5250 - 5330 @ 80), (N/A, 20), (60), DFS
> + (5490 - 5590 @ 80), (N/A, 27), (60), DFS
> + (5590 - 5650 @ 80), (N/A, 27), (600), DFS // here different
> CAC time but still 80MHz should be available
> + (5650 - 5710 @ 80), (N/A, 27), (60), DFS
>
> In the future could be also usefull for 160MHz:
> (5170 - 5250 @ 160), (N/A, 20)
> (5250 - 5330 @ 160), (N/A, 20), DFS

Yes, the whole @xyz thing is a bit superfluous, I believe it should
really be @unlimited (meaning only restriction is that it fits) for most
countries.

> We can implement CAC time as hardcoded (already send such patches some
> time ago) one but seems this is close connected with regulatory
> configuration and seems like good idea put this in regulatory db.

I totally agree, this is a good idea.

johannes


2014-01-14 17:29:50

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 4/5] nl80211: add DFS CAC time option

Pass DFS CAC time to user mode (mainly
for iw reg get/iw list/iw info).
Allow setting DFS CAC time via CRDA.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
include/uapi/linux/nl80211.h | 5 +++++
net/wireless/nl80211.c | 13 ++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 91054fd..65081e8 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2304,6 +2304,7 @@ enum nl80211_band_attr {
* @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
* using this channel as the primary or any of the secondary channels
* isn't possible
+ * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in sec
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -2322,6 +2323,7 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
NL80211_FREQUENCY_ATTR_NO_80MHZ,
NL80211_FREQUENCY_ATTR_NO_160MHZ,
+ NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,

/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -2418,6 +2420,7 @@ enum nl80211_reg_type {
* If you don't have one then don't send this.
* @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
* a given frequency range. The value is in mBm (100 * dBm).
+ * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in seconds.
* @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
* currently defined
* @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
@@ -2433,6 +2436,8 @@ enum nl80211_reg_rule_attr {
NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
NL80211_ATTR_POWER_RULE_MAX_EIRP,

+ NL80211_ATTR_DFS_CAC_TIME,
+
/* keep last */
__NL80211_REG_RULE_ATTR_AFTER_LAST,
NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d0afd82..2d2dbe0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -592,6 +592,10 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME,
time))
goto nla_put_failure;
+ if (nla_put_u32(msg,
+ NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
+ chan->dfs_cac_ms/1000))
+ goto nla_put_failure;
}
}

@@ -4617,6 +4621,7 @@ static const struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] =
[NL80211_ATTR_FREQ_RANGE_MAX_BW] = { .type = NLA_U32 },
[NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN] = { .type = NLA_U32 },
[NL80211_ATTR_POWER_RULE_MAX_EIRP] = { .type = NLA_U32 },
+ [NL80211_ATTR_DFS_CAC_TIME] = { .type = NLA_U32 },
};

static int parse_reg_rule(struct nlattr *tb[],
@@ -4652,6 +4657,10 @@ static int parse_reg_rule(struct nlattr *tb[],
power_rule->max_antenna_gain =
nla_get_u32(tb[NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN]);

+ if (tb[NL80211_ATTR_DFS_CAC_TIME])
+ reg_rule->dfs_cac_time =
+ nla_get_u32(tb[NL80211_ATTR_DFS_CAC_TIME]);
+
return 0;
}

@@ -5133,7 +5142,9 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info)
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))
+ power_rule->max_eirp) ||
+ nla_put_u32(msg, NL80211_ATTR_DFS_CAC_TIME,
+ reg_rule->dfs_cac_time))
goto nla_put_failure_rcu;

nla_nest_end(msg, nl_reg_rule);
--
1.7.9.5


2014-01-15 13:23:52

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 1/5] cfg80211: regulatory rules, fix bw checking

On Tue, 2014-01-14 at 18:29 +0100, Janusz Dziedzic wrote:
> Allow BW cross over REG_RULES if rules continous.
>
> Signed-off-by: Janusz Dziedzic <[email protected]>
> ---
> I am not sure about rule_intersect() here ...

I'm not sure about the whole thing ...

We did discuss something like this previously (and see our todo list on
the wiki), but this isn't just some arbitrary internal change, it
completely changes the interpretation of the regulatory database.

At a minimum, that means you need a big commit log discussing the impact
of the changes etc.

johannes


2014-01-15 13:24:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 2/5] cfg80211: regulatory, introduce DFS CAC time

On Tue, 2014-01-14 at 18:29 +0100, Janusz Dziedzic wrote:
> Introduce DFS CAC time as a regd param, configured
> per REG_RULE and set per channel in cfg80211.

Why? :)

> + * @dfs_cac_ms: DFS CAC time in miliseconds

milli

johannes


2014-01-15 13:25:32

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 4/5] nl80211: add DFS CAC time option

On Tue, 2014-01-14 at 18:29 +0100, Janusz Dziedzic wrote:
> Pass DFS CAC time to user mode (mainly
> for iw reg get/iw list/iw info).
> Allow setting DFS CAC time via CRDA.
>
> Signed-off-by: Janusz Dziedzic <[email protected]>
> ---
> include/uapi/linux/nl80211.h | 5 +++++
> net/wireless/nl80211.c | 13 ++++++++++++-
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 91054fd..65081e8 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -2304,6 +2304,7 @@ enum nl80211_band_attr {
> * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
> * using this channel as the primary or any of the secondary channels
> * isn't possible
> + * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in sec

Why bother with seconds vs. milliseconds? It'd be easier to use the same
units ...

johannes


2014-01-14 17:29:51

by Janusz Dziedzic

[permalink] [raw]
Subject: [RFC 5/5] cfg80211: setup CAC time in db.txt for PL

This is DFS CAC time setup for PL.
We should do the same for all other
countries that support DFS in wireless-regd.
Here only as example, please don't merge.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
net/wireless/db.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/wireless/db.txt b/net/wireless/db.txt
index 811eb5c..f3813a2 100644
--- a/net/wireless/db.txt
+++ b/net/wireless/db.txt
@@ -632,8 +632,10 @@ country PK:
country PL: DFS-ETSI
(2402 - 2482 @ 40), (N/A, 20)
(5170 - 5250 @ 80), (N/A, 20)
- (5250 - 5330 @ 80), (N/A, 20), DFS
- (5490 - 5710 @ 80), (N/A, 27), DFS
+ (5250 - 5330 @ 80), (N/A, 20), (60), DFS
+ (5490 - 5590 @ 80), (N/A, 27), (60), DFS
+ (5590 - 5650 @ 80), (N/A, 27), (600), DFS
+ (5650 - 5710 @ 80), (N/A, 27), (60), DFS
# 60 gHz band channels 1-4, ref: Etsi En 302 567
(57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR

--
1.7.9.5