All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: allow beaconing after CAC
@ 2013-10-29  6:15 Janusz Dziedzic
  2013-10-29 10:25 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Janusz Dziedzic @ 2013-10-29  6:15 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Janusz Dziedzic

After going throught the Channel Availability Check (CAC)
required by DFS enable beaconing. Channels that have gone
through a CAC will be in the NL80211_DFS_AVAILABLE.
Without this change APs don't start beaconing after
successful CAC.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
One flag could be used in the future IEEE80211_CHAN_NO_IR.

 net/wireless/chan.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index a6f5c4c..205acf2 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -432,6 +432,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 {
 	struct ieee80211_channel *c;
 	u32 freq, start_freq, end_freq;
+	u32 ignore_flags;
 
 	start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
 	end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
@@ -441,13 +442,24 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 		if (!c)
 			return false;
 
+		ignore_flags = IEEE80211_CHAN_RADAR;
+
 		/* check for radar flags */
-		if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
-		    (c->dfs_state != NL80211_DFS_AVAILABLE))
-			return false;
+		if (prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) {
+			if (c->dfs_state != NL80211_DFS_AVAILABLE)
+				return false;
+			/*
+			 * If DFS is required we should check only
+			 * c->dfs_state == NL80211_DFS_AVAILABLE and
+			 * ignore IEEE80211_CHAN_NO_IBSS and
+			 * IEEE80211_CHAN_PASSIVE_SCAN flags
+			 */
+			ignore_flags |= IEEE80211_CHAN_NO_IBSS |
+					IEEE80211_CHAN_PASSIVE_SCAN;
+		}
 
 		/* check for the other flags */
-		if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
+		if (c->flags & prohibited_flags & ~ignore_flags)
 			return false;
 	}
 
-- 
1.7.9.5


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

* Re: [PATCH] cfg80211: allow beaconing after CAC
  2013-10-29  6:15 [PATCH] cfg80211: allow beaconing after CAC Janusz Dziedzic
@ 2013-10-29 10:25 ` Luis R. Rodriguez
  2013-10-29 10:32   ` Janusz Dziedzic
  0 siblings, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2013-10-29 10:25 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless, Johannes Berg

On Tue, Oct 29, 2013 at 7:15 AM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> After going throught the Channel Availability Check (CAC)
> required by DFS enable beaconing. Channels that have gone
> through a CAC will be in the NL80211_DFS_AVAILABLE.
> Without this change APs don't start beaconing after
> successful CAC.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> ---
> One flag could be used in the future IEEE80211_CHAN_NO_IR.
>
>  net/wireless/chan.c |   20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index a6f5c4c..205acf2 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -432,6 +432,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
>  {
>         struct ieee80211_channel *c;
>         u32 freq, start_freq, end_freq;
> +       u32 ignore_flags;
>
>         start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
>         end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
> @@ -441,13 +442,24 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
>                 if (!c)
>                         return false;
>
> +               ignore_flags = IEEE80211_CHAN_RADAR;
> +
>                 /* check for radar flags */
> -               if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
> -                   (c->dfs_state != NL80211_DFS_AVAILABLE))
> -                       return false;
> +               if (prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) {
> +                       if (c->dfs_state != NL80211_DFS_AVAILABLE)
> +                               return false;
> +                       /*
> +                        * If DFS is required we should check only
> +                        * c->dfs_state == NL80211_DFS_AVAILABLE and
> +                        * ignore IEEE80211_CHAN_NO_IBSS and
> +                        * IEEE80211_CHAN_PASSIVE_SCAN flags
> +                        */
> +                       ignore_flags |= IEEE80211_CHAN_NO_IBSS |
> +                                       IEEE80211_CHAN_PASSIVE_SCAN;
> +               }
>
>                 /* check for the other flags */
> -               if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
> +               if (c->flags & prohibited_flags & ~ignore_flags)
>                         return false;
>         }

How do we know that prohibited_flags won't have IEEE80211_CHAN_RADAR
or IEEE80211_CHAN_NO_IBSS set?

Also why is IEEE80211_CHAN_NO_IBSS used and not IEEE80211_CHAN_NO_IR
instead? I sent patches to help clarify this situation around usage of
both no-ibss and active scan flags, by merging them to no-ir. I'm not
sure of the status of those patches going in.

  Luis

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

* Re: [PATCH] cfg80211: allow beaconing after CAC
  2013-10-29 10:25 ` Luis R. Rodriguez
@ 2013-10-29 10:32   ` Janusz Dziedzic
  2013-10-29 10:45     ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Janusz Dziedzic @ 2013-10-29 10:32 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, Johannes Berg

On 29 October 2013 11:25, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> On Tue, Oct 29, 2013 at 7:15 AM, Janusz Dziedzic
> <janusz.dziedzic@tieto.com> wrote:
>> After going throught the Channel Availability Check (CAC)
>> required by DFS enable beaconing. Channels that have gone
>> through a CAC will be in the NL80211_DFS_AVAILABLE.
>> Without this change APs don't start beaconing after
>> successful CAC.
>>
>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>> ---
>> One flag could be used in the future IEEE80211_CHAN_NO_IR.
>>
>>  net/wireless/chan.c |   20 ++++++++++++++++----
>>  1 file changed, 16 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
>> index a6f5c4c..205acf2 100644
>> --- a/net/wireless/chan.c
>> +++ b/net/wireless/chan.c
>> @@ -432,6 +432,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
>>  {
>>         struct ieee80211_channel *c;
>>         u32 freq, start_freq, end_freq;
>> +       u32 ignore_flags;
>>
>>         start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
>>         end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
>> @@ -441,13 +442,24 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
>>                 if (!c)
>>                         return false;
>>
>> +               ignore_flags = IEEE80211_CHAN_RADAR;
>> +
>>                 /* check for radar flags */
>> -               if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
>> -                   (c->dfs_state != NL80211_DFS_AVAILABLE))
>> -                       return false;
>> +               if (prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) {
>> +                       if (c->dfs_state != NL80211_DFS_AVAILABLE)
>> +                               return false;
>> +                       /*
>> +                        * If DFS is required we should check only
>> +                        * c->dfs_state == NL80211_DFS_AVAILABLE and
>> +                        * ignore IEEE80211_CHAN_NO_IBSS and
>> +                        * IEEE80211_CHAN_PASSIVE_SCAN flags
>> +                        */
>> +                       ignore_flags |= IEEE80211_CHAN_NO_IBSS |
>> +                                       IEEE80211_CHAN_PASSIVE_SCAN;
>> +               }
>>
>>                 /* check for the other flags */
>> -               if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
>> +               if (c->flags & prohibited_flags & ~ignore_flags)
>>                         return false;
>>         }
>
> How do we know that prohibited_flags won't have IEEE80211_CHAN_RADAR
> or IEEE80211_CHAN_NO_IBSS set?
>
> Also why is IEEE80211_CHAN_NO_IBSS used and not IEEE80211_CHAN_NO_IR
> instead? I sent patches to help clarify this situation around usage of
> both no-ibss and active scan flags, by merging them to no-ir. I'm not
> sure of the status of those patches going in.
>

I am not sure. Even without my patch seems  IEEE80211_CHAN_RADAR is
added to prohibited_flags and have different meaning (I think).
In orginal code we have:

if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)

So, we skiping CHAN_RADAR anyway? I am not sure we should change
prohibited_flags to different name or stop skiping CHAN_RADAR and
modify upper layer - cfg80211_reg_can_beacon() in such case.

BR
Janusz

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

* Re: [PATCH] cfg80211: allow beaconing after CAC
  2013-10-29 10:32   ` Janusz Dziedzic
@ 2013-10-29 10:45     ` Luis R. Rodriguez
  0 siblings, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2013-10-29 10:45 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless, Johannes Berg

On Tue, Oct 29, 2013 at 11:32 AM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> On 29 October 2013 11:25, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
>> How do we know that prohibited_flags won't have IEEE80211_CHAN_RADAR
>> or IEEE80211_CHAN_NO_IBSS set?
>>
>> Also why is IEEE80211_CHAN_NO_IBSS used and not IEEE80211_CHAN_NO_IR
>> instead? I sent patches to help clarify this situation around usage of
>> both no-ibss and active scan flags, by merging them to no-ir. I'm not
>> sure of the status of those patches going in.
>>
>
> I am not sure.

OK please try to be for changes like these.

> Even without my patch seems  IEEE80211_CHAN_RADAR is
> added to prohibited_flags and have different meaning (I think).

IEEE80211_CHAN_RADAR has only one meaning, its not subjective.

> In orginal code we have:
>
> if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
>
> So, we skiping CHAN_RADAR anyway? I am not sure we should change
> prohibited_flags to different name or stop skiping CHAN_RADAR and
> modify upper layer - cfg80211_reg_can_beacon() in such case.

I took a look and I'd prefer that this be dealt with elsewhere, in
particular you are right that cfg80211_reg_can_beacon() seems like a
much more suitable place for this check now.

  Luis

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

end of thread, other threads:[~2013-10-29 10:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29  6:15 [PATCH] cfg80211: allow beaconing after CAC Janusz Dziedzic
2013-10-29 10:25 ` Luis R. Rodriguez
2013-10-29 10:32   ` Janusz Dziedzic
2013-10-29 10:45     ` 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.