diff mbox

[v2,2/4] cfg80211: update missing fields in custom regulatory path

Message ID 1415895219-19848-2-git-send-email-arik@wizery.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arik Nemtsov Nov. 13, 2014, 4:13 p.m. UTC
From: Jonathan Doron <jond@wizery.com>

Some channels fields were not being updated in the custom regulatory
path. Update them according to the code in handle_channel().

Signed-off-by: Jonathan Doron <jonathanx.doron@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
---
 net/wireless/reg.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Luis Chamberlain Nov. 13, 2014, 10:55 p.m. UTC | #1
On Thu, Nov 13, 2014 at 06:13:37PM +0200, Arik Nemtsov wrote:
> From: Jonathan Doron <jond@wizery.com>
> 
> Some channels fields were not being updated in the custom regulatory
> path. Update them according to the code in handle_channel().
> 
> Signed-off-by: Jonathan Doron <jonathanx.doron@intel.com>
> Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
> ---
>  net/wireless/reg.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 6459ddd..174d8f82 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -1693,10 +1693,23 @@ static void handle_channel_custom(struct wiphy *wiphy,
>  	if (max_bandwidth_khz < MHZ_TO_KHZ(160))
>  		bw_flags |= IEEE80211_CHAN_NO_160MHZ;
>  
> +	chan->dfs_state = NL80211_DFS_USABLE;

NL80211_DFS_USABLE is 0 so this is not needed. Being explicit about it
is OK I suppose though.

> +	chan->dfs_state_entered = jiffies;

OK.

> +
> +	chan->beacon_found = false;

false is 0 so this is not needed but being explicit about it is OK.

>  	chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
>  	chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
>  	chan->max_reg_power = chan->max_power =
>  		(int) MBM_TO_DBM(power_rule->max_eirp);
> +
> +	if (chan->flags & IEEE80211_CHAN_RADAR) {
> +		if (reg_rule->dfs_cac_ms)
> +			chan->dfs_cac_ms = reg_rule->dfs_cac_ms;
> +		else
> +			chan->dfs_cac_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
> +	}
> +
> +	chan->max_power = chan->max_reg_power;
>  }

I rather you split this up into the stuff not required (things which
are good to be explicit about) Vs possible fixes, these last are
good fixes. Also put them as part of your first set of patches
and add my Acked-by so Johannes can already merge them. If you want
them merged faster just send them separately now.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arik Nemtsov Nov. 16, 2014, 11:01 a.m. UTC | #2
On Fri, Nov 14, 2014 at 12:55 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
> On Thu, Nov 13, 2014 at 06:13:37PM +0200, Arik Nemtsov wrote:
>> From: Jonathan Doron <jond@wizery.com>
>>
>> Some channels fields were not being updated in the custom regulatory
>> path. Update them according to the code in handle_channel().
>>
>> Signed-off-by: Jonathan Doron <jonathanx.doron@intel.com>
>> Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
>> ---
>>  net/wireless/reg.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
>> index 6459ddd..174d8f82 100644
>> --- a/net/wireless/reg.c
>> +++ b/net/wireless/reg.c
>> @@ -1693,10 +1693,23 @@ static void handle_channel_custom(struct wiphy *wiphy,
>>       if (max_bandwidth_khz < MHZ_TO_KHZ(160))
>>               bw_flags |= IEEE80211_CHAN_NO_160MHZ;
>>
>> +     chan->dfs_state = NL80211_DFS_USABLE;
>
> NL80211_DFS_USABLE is 0 so this is not needed. Being explicit about it
> is OK I suppose though.
>
>> +     chan->dfs_state_entered = jiffies;
>
> OK.
>
>> +
>> +     chan->beacon_found = false;
>
> false is 0 so this is not needed but being explicit about it is OK.
>
>>       chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
>>       chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
>>       chan->max_reg_power = chan->max_power =
>>               (int) MBM_TO_DBM(power_rule->max_eirp);
>> +
>> +     if (chan->flags & IEEE80211_CHAN_RADAR) {
>> +             if (reg_rule->dfs_cac_ms)
>> +                     chan->dfs_cac_ms = reg_rule->dfs_cac_ms;
>> +             else
>> +                     chan->dfs_cac_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
>> +     }
>> +
>> +     chan->max_power = chan->max_reg_power;
>>  }
>
> I rather you split this up into the stuff not required (things which
> are good to be explicit about) Vs possible fixes, these last are
> good fixes. Also put them as part of your first set of patches
> and add my Acked-by so Johannes can already merge them. If you want
> them merged faster just send them separately now.
>
> Acked-by: Luis R. Rodriguez <mcgrof@suse.com>

Thanks.

I'll split into 2 and send then.

Arik
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 6459ddd..174d8f82 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1693,10 +1693,23 @@  static void handle_channel_custom(struct wiphy *wiphy,
 	if (max_bandwidth_khz < MHZ_TO_KHZ(160))
 		bw_flags |= IEEE80211_CHAN_NO_160MHZ;
 
+	chan->dfs_state = NL80211_DFS_USABLE;
+	chan->dfs_state_entered = jiffies;
+
+	chan->beacon_found = false;
 	chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
 	chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
 	chan->max_reg_power = chan->max_power =
 		(int) MBM_TO_DBM(power_rule->max_eirp);
+
+	if (chan->flags & IEEE80211_CHAN_RADAR) {
+		if (reg_rule->dfs_cac_ms)
+			chan->dfs_cac_ms = reg_rule->dfs_cac_ms;
+		else
+			chan->dfs_cac_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
+	}
+
+	chan->max_power = chan->max_reg_power;
 }
 
 static void handle_band_custom(struct wiphy *wiphy,