From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Be more careful when changing channels.
Date: Fri, 28 Jan 2011 10:28:37 +0100 [thread overview]
Message-ID: <1296206917.4550.1.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1296194947-12017-1-git-send-email-greearb@candelatech.com>
On Thu, 2011-01-27 at 22:09 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> If we cannot set the channel type, set the channel back to the
> original.
>
> Don't update the driver hardware if nothing actually changed.
Good catch.
> + old_oper = local->oper_channel;
> local->oper_channel = chan;
>
> - if (!ieee80211_set_channel_type(local, sdata, channel_type))
> + old_oper_type = local->_oper_channel_type;
> + if (!ieee80211_set_channel_type(local, sdata, channel_type)) {
> + local->oper_channel = old_oper;
> return -EBUSY;
> + }
> +
> + if ((old_oper != local->oper_channel) ||
> + (old_oper_type != local->_oper_channel_type))
> + ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
>
> - ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
> - if (sdata && sdata->vif.type != NL80211_IFTYPE_MONITOR)
> + if ((sdata && sdata->vif.type != NL80211_IFTYPE_MONITOR) &&
> + old_vif_oper_type != sdata->vif.bss_conf.channel_type)
> ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
But why the complicated code? Couldn't you just swap the
set_channel_type() and oper_channel = chan around? set_channel_type()
doesn't need oper_channel set.
johannes
next prev parent reply other threads:[~2011-01-28 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-28 6:09 [PATCH] mac80211: Be more careful when changing channels greearb
2011-01-28 9:28 ` Johannes Berg [this message]
2011-01-28 17:15 ` Ben Greear
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=1296206917.4550.1.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 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.