linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mac80211:  Recalculate channel-type on iface removal.
Date: Tue, 01 Feb 2011 14:55:16 +0100	[thread overview]
Message-ID: <1296568516.3989.5.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1296502209-32533-1-git-send-email-greearb@candelatech.com>

On Mon, 2011-01-31 at 11:30 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> When a vif goes away, it could cause the super-chan
> to be recalculated differently, so do that calculation
> on iface removal.

Seems fine to me.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> v2:  Just deal with channel-change calc, not the WARN_ON_ONCE
>   stuff.  Will get that later in separate patch.
> 
> :100644 100644 605c222... abf5f8e... M	net/mac80211/iface.c
>  net/mac80211/iface.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 605c222..abf5f8e 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -382,6 +382,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  	struct sk_buff *skb, *tmp;
>  	u32 hw_reconf_flags = 0;
>  	int i;
> +	enum nl80211_channel_type orig_ct;
>  
>  	if (local->scan_sdata == sdata)
>  		ieee80211_scan_cancel(local);
> @@ -542,8 +543,14 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  		hw_reconf_flags = 0;
>  	}
>  
> +	/* Re-calculate channel-type, in case there are multiple vifs
> +	 * on different channel types.
> +	 */
> +	orig_ct = local->_oper_channel_type;
> +	ieee80211_set_channel_type(local, NULL, NL80211_CHAN_NO_HT);
> +
>  	/* do after stop to avoid reconfiguring when we stop anyway */
> -	if (hw_reconf_flags)
> +	if (hw_reconf_flags || (orig_ct != local->_oper_channel_type))
>  		ieee80211_hw_config(local, hw_reconf_flags);
>  
>  	spin_lock_irqsave(&local->queue_stop_reason_lock, flags);



      reply	other threads:[~2011-02-01 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 19:30 [PATCH v2] mac80211: Recalculate channel-type on iface removal greearb
2011-02-01 13:55 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296568516.3989.5.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).