Search Linux Wireless

Re: [PATCH] wl12xx: disable 11a channels when regulatory changes if 11a is not supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2010-11-26 at 14:43 +0200, luciano.coelho@xxxxxxxxx wrote:
> From: Luciano Coelho <luciano.coelho@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> Signed-off-by: Luciano Coelho <luciano.coelho@xxxxxxxxx>
> ---
>  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@xxxxxxxxx>

-Juuso

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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux