From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: sw@simonwunderlich.de, johannes@sipsolutions.net,
yeohchunyeow@gmail.com, yeohchunyeow@cozybit.com
Subject: Re: [PATCH v5 1/5] mac80211: refactor ieee80211_ibss_process_chanswitch()
Date: Thu, 14 Nov 2013 14:11:49 +0200 [thread overview]
Message-ID: <1384431109.16343.17.camel@porter.coelho.fi> (raw)
In-Reply-To: <1384430976-13708-1-git-send-email-luciano.coelho@intel.com>
Hi,
Just to clarify, these patches are now based on mac80211-next (thanks
Simon), so we don't need to apply anything manually (as with the
previous patch set that was based on wireless-testing).
Please review and test, especially the MESH and IBSS parts!
--
Cheers,
Luca.
On Thu, 2013-11-14 at 14:09 +0200, Luciano Coelho wrote:
> Refactor ieee80211_ibss_process_chanswitch() to use
> ieee80211_channel_switch() and avoid code duplication.
>
> Change-Id: I265a12c7f825dc20535bad1197a81437310d0086
> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
> ---
> net/mac80211/cfg.c | 4 ++--
> net/mac80211/ibss.c | 58 +++++++---------------------------------------
> net/mac80211/ieee80211_i.h | 2 ++
> 3 files changed, 12 insertions(+), 52 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 3bc92d0..a98dc6b 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -3035,8 +3035,8 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
> cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
> }
>
> -static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
> - struct cfg80211_csa_settings *params)
> +int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
> + struct cfg80211_csa_settings *params)
> {
> struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> struct ieee80211_local *local = sdata->local;
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index 0f1fb5d..3514aab 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -784,18 +784,10 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
> struct cfg80211_csa_settings params;
> struct ieee80211_csa_ie csa_ie;
> struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
> - struct ieee80211_chanctx_conf *chanctx_conf;
> - struct ieee80211_chanctx *chanctx;
> enum nl80211_channel_type ch_type;
> - int err, num_chanctx;
> + int err;
> u32 sta_flags;
>
> - if (sdata->vif.csa_active)
> - return true;
> -
> - if (!sdata->vif.bss_conf.ibss_joined)
> - return false;
> -
> sta_flags = IEEE80211_STA_DISABLE_VHT;
> switch (ifibss->chandef.width) {
> case NL80211_CHAN_WIDTH_5:
> @@ -826,9 +818,6 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
> params.count = csa_ie.count;
> params.chandef = csa_ie.chandef;
>
> - if (ifibss->chandef.chan->band != params.chandef.chan->band)
> - goto disconnect;
> -
> switch (ifibss->chandef.width) {
> case NL80211_CHAN_WIDTH_20_NOHT:
> case NL80211_CHAN_WIDTH_20:
> @@ -884,29 +873,6 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
> params.radar_required = true;
> }
>
> - rcu_read_lock();
> - chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> - if (!chanctx_conf) {
> - rcu_read_unlock();
> - goto disconnect;
> - }
> -
> - /* don't handle for multi-VIF cases */
> - chanctx = container_of(chanctx_conf, struct ieee80211_chanctx, conf);
> - if (chanctx->refcount > 1) {
> - rcu_read_unlock();
> - goto disconnect;
> - }
> - num_chanctx = 0;
> - list_for_each_entry_rcu(chanctx, &sdata->local->chanctx_list, list)
> - num_chanctx++;
> -
> - if (num_chanctx > 1) {
> - rcu_read_unlock();
> - goto disconnect;
> - }
> - rcu_read_unlock();
> -
> /* all checks done, now perform the channel switch. */
> ibss_dbg(sdata,
> "received channel switch announcement to go to channel %d MHz\n",
> @@ -914,19 +880,9 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
>
> params.block_tx = !!csa_ie.mode;
>
> - ieee80211_ibss_csa_beacon(sdata, ¶ms);
> - sdata->csa_radar_required = params.radar_required;
> -
> - if (params.block_tx)
> - ieee80211_stop_queues_by_reason(&sdata->local->hw,
> - IEEE80211_MAX_QUEUE_MAP,
> - IEEE80211_QUEUE_STOP_REASON_CSA);
> -
> - sdata->csa_chandef = params.chandef;
> - sdata->vif.csa_active = true;
> -
> - ieee80211_bss_info_change_notify(sdata, err);
> - drv_channel_switch_beacon(sdata, ¶ms.chandef);
> + if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev,
> + ¶ms))
> + goto disconnect;
>
> ieee80211_ibss_csa_mark_radar(sdata);
>
> @@ -962,7 +918,8 @@ ieee80211_rx_mgmt_spectrum_mgmt(struct ieee80211_sub_if_data *sdata,
> if (len < required_len)
> return;
>
> - ieee80211_ibss_process_chanswitch(sdata, elems, false);
> + if (!sdata->vif.csa_active)
> + ieee80211_ibss_process_chanswitch(sdata, elems, false);
> }
>
> static void ieee80211_rx_mgmt_deauth_ibss(struct ieee80211_sub_if_data *sdata,
> @@ -1143,7 +1100,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
> goto put_bss;
>
> /* process channel switch */
> - if (ieee80211_ibss_process_chanswitch(sdata, elems, true))
> + if (sdata->vif.csa_active ||
> + ieee80211_ibss_process_chanswitch(sdata, elems, true))
> goto put_bss;
>
> /* same BSSID */
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index 0edc1fb..3a77ed1 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -1412,6 +1412,8 @@ void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc);
>
> /* channel switch handling */
> void ieee80211_csa_finalize_work(struct work_struct *work);
> +int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
> + struct cfg80211_csa_settings *params);
>
> /* interface handling */
> int ieee80211_iface_init(void);
prev parent reply other threads:[~2013-11-14 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 12:09 [PATCH v5 1/5] mac80211: refactor ieee80211_ibss_process_chanswitch() Luciano Coelho
2013-11-14 12:09 ` [PATCH v5 2/5] mac80211: align ieee80211_ibss_csa_beacon() with ieee80211_csa_beacon() Luciano Coelho
2013-11-14 12:09 ` [PATCH v5 3/5] mac80211: refactor ieee80211_mesh_process_chanswitch() Luciano Coelho
2013-11-14 12:09 ` [PATCH v5 4/5] mac80211: align ieee80211_mesh_csa_beacon() with ieee80211_csa_beacon() Luciano Coelho
2013-11-14 12:09 ` [PATCH v5 5/5] mac80211: only set CSA beacon when at least one beacon must be transmitted Luciano Coelho
2013-11-14 14:53 ` Simon Wunderlich
2013-11-14 15:07 ` Coelho, Luciano
[not found] ` <CAEFj987dHiYcdX0+_FH9W4x9s1M9BGwGWdz-ik5r_KO7gxEY7A@mail.gmail.com>
2013-11-16 19:00 ` Coelho, Luciano
2013-11-14 12:11 ` Luca Coelho [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=1384431109.16343.17.camel@porter.coelho.fi \
--to=luca@coelho.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=sw@simonwunderlich.de \
--cc=yeohchunyeow@cozybit.com \
--cc=yeohchunyeow@gmail.com \
/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