All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported
@ 2010-11-26 12:43 luciano.coelho
  2010-11-26 13:03 ` Juuso Oikarinen
  2010-11-26 13:14 ` Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: luciano.coelho @ 2010-11-26 12:43 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Juuso Oikarinen

From: Luciano Coelho <luciano.coelho@nokia.com>

Instead of simply not scanning for the 11a channels when not supported by the
hardware, disable the channels in reg_notify.  This centralizes the decision
on whether to scan 5GHz channel in one place and allows userspace to know
exactly which channels are in use.

Based on Juuso Oikarinen's idea.

Cc: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
 drivers/net/wireless/wl12xx/main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 35cfcf6..97eb186 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -336,7 +336,9 @@ out:
 }
 
 static int wl1271_reg_notify(struct wiphy *wiphy,
-			     struct regulatory_request *request) {
+			     struct regulatory_request *request)
+{
+	struct wl1271 *wl = wiphy_to_ieee80211_hw(wiphy)->priv;
 	struct ieee80211_supported_band *band;
 	struct ieee80211_channel *ch;
 	int i;
@@ -347,6 +349,11 @@ static int wl1271_reg_notify(struct wiphy *wiphy,
 		if (ch->flags & IEEE80211_CHAN_DISABLED)
 			continue;
 
+		if (!wl->enable_11a) {
+			ch->flags |= IEEE80211_CHAN_DISABLED;
+			continue;
+		}
+
 		if (ch->flags & IEEE80211_CHAN_RADAR)
 			ch->flags |= IEEE80211_CHAN_NO_IBSS |
 				     IEEE80211_CHAN_PASSIVE_SCAN;
-- 
1.7.0.4


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

* Re: [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported
  2010-11-26 12:43 [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported luciano.coelho
@ 2010-11-26 13:03 ` Juuso Oikarinen
  2010-11-26 13:08   ` Luciano Coelho
  2010-11-26 13:14 ` Johannes Berg
  1 sibling, 1 reply; 5+ messages in thread
From: Juuso Oikarinen @ 2010-11-26 13:03 UTC (permalink / raw)
  To: luciano.coelho; +Cc: linux-wireless

On Fri, 2010-11-26 at 14:43 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
> 
> Instead of simply not scanning for the 11a channels when not supported by the
> hardware, disable the channels in reg_notify.  This centralizes the decision
> on whether to scan 5GHz channel in one place and allows userspace to know
> exactly which channels are in use.
> 
> Based on Juuso Oikarinen's idea.
> 
> Cc: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> ---
>  drivers/net/wireless/wl12xx/main.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
> index 35cfcf6..97eb186 100644
> --- a/drivers/net/wireless/wl12xx/main.c
> +++ b/drivers/net/wireless/wl12xx/main.c
> @@ -336,7 +336,9 @@ out:
>  }
>  
>  static int wl1271_reg_notify(struct wiphy *wiphy,
> -			     struct regulatory_request *request) {
> +			     struct regulatory_request *request)
> +{
> +	struct wl1271 *wl = wiphy_to_ieee80211_hw(wiphy)->priv;
>  	struct ieee80211_supported_band *band;
>  	struct ieee80211_channel *ch;
>  	int i;
> @@ -347,6 +349,11 @@ static int wl1271_reg_notify(struct wiphy *wiphy,
>  		if (ch->flags & IEEE80211_CHAN_DISABLED)
>  			continue;
>  
> +		if (!wl->enable_11a) {
> +			ch->flags |= IEEE80211_CHAN_DISABLED;
> +			continue;
> +		}
> +
>  		if (ch->flags & IEEE80211_CHAN_RADAR)
>  			ch->flags |= IEEE80211_CHAN_NO_IBSS |
>  				     IEEE80211_CHAN_PASSIVE_SCAN;

I think this is more verbose towards user-space this way.

Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>

-Juuso


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

* Re: [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported
  2010-11-26 13:03 ` Juuso Oikarinen
@ 2010-11-26 13:08   ` Luciano Coelho
  0 siblings, 0 replies; 5+ messages in thread
From: Luciano Coelho @ 2010-11-26 13:08 UTC (permalink / raw)
  To: Juuso Oikarinen; +Cc: linux-wireless

On Fri, 2010-11-26 at 15:03 +0200, Juuso Oikarinen wrote:
> On Fri, 2010-11-26 at 14:43 +0200, luciano.coelho@nokia.com wrote:
> > From: Luciano Coelho <luciano.coelho@nokia.com>
> > 
> > Instead of simply not scanning for the 11a channels when not supported by the
> > hardware, disable the channels in reg_notify.  This centralizes the decision
> > on whether to scan 5GHz channel in one place and allows userspace to know
> > exactly which channels are in use.
> > 
> > Based on Juuso Oikarinen's idea.
> > 
> > Cc: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> > Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> > ---

[...]

> I think this is more verbose towards user-space this way.

Yeah, and will help with the sched_scan code too.

> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>

Thanks! Applied and pushed to wl12xx.

-- 
Cheers,
Luca.


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

* Re: [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported
  2010-11-26 12:43 [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported luciano.coelho
  2010-11-26 13:03 ` Juuso Oikarinen
@ 2010-11-26 13:14 ` Johannes Berg
  2010-11-26 13:18   ` Luciano Coelho
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2010-11-26 13:14 UTC (permalink / raw)
  To: luciano.coelho; +Cc: linux-wireless, Juuso Oikarinen

On Fri, 2010-11-26 at 14:43 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
> 
> Instead of simply not scanning for the 11a channels when not supported by the
> hardware, disable the channels in reg_notify.  This centralizes the decision
> on whether to scan 5GHz channel in one place and allows userspace to know
> exactly which channels are in use.

Why are you advertising them to start with though?

johannes


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

* Re: [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported
  2010-11-26 13:14 ` Johannes Berg
@ 2010-11-26 13:18   ` Luciano Coelho
  0 siblings, 0 replies; 5+ messages in thread
From: Luciano Coelho @ 2010-11-26 13:18 UTC (permalink / raw)
  To: ext Johannes Berg; +Cc: linux-wireless, Juuso Oikarinen

On Fri, 2010-11-26 at 14:14 +0100, ext Johannes Berg wrote:
> On Fri, 2010-11-26 at 14:43 +0200, luciano.coelho@nokia.com wrote:
> > From: Luciano Coelho <luciano.coelho@nokia.com>
> > 
> > Instead of simply not scanning for the 11a channels when not supported by the
> > hardware, disable the channels in reg_notify.  This centralizes the decision
> > on whether to scan 5GHz channel in one place and allows userspace to know
> > exactly which channels are in use.
> 
> Why are you advertising them to start with though?

Because the driver support chips with and without 11a (namely wl1273 and
wl1271).  When we register the channels with mac80211, we don't know
whether the chip supports 11a or not, so we need to decide at runtime.

-- 
Cheers,
Luca.


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

end of thread, other threads:[~2010-11-26 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-26 12:43 [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported luciano.coelho
2010-11-26 13:03 ` Juuso Oikarinen
2010-11-26 13:08   ` Luciano Coelho
2010-11-26 13:14 ` Johannes Berg
2010-11-26 13:18   ` Luciano Coelho

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.