From: Luca Coelho <luca@coelho.fi>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Subject: Re: [PATCH v2 4/4] mac80211: disconnect iface if CSA unexpectedly fails
Date: Mon, 24 Mar 2014 16:55:43 +0200 [thread overview]
Message-ID: <1395672943.4515.66.camel@dubbel> (raw)
In-Reply-To: <1395408675-26013-5-git-send-email-michal.kazior@tieto.com>
On Fri, 2014-03-21 at 14:31 +0100, Michal Kazior wrote:
> It doesn't make much sense to leave a cripled
> interface running.
>
> As a side effect this will unblock tx queues with
> CSA reason immediately after failure instead of
> until after userspace requests interface to stop.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
> net/mac80211/cfg.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 65768ef..64e152d 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -3088,7 +3088,7 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
> return 0;
> }
>
> -static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
> +static int ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
> {
> struct ieee80211_local *local = sdata->local;
> u32 changed = 0;
> @@ -3100,7 +3100,7 @@ static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
> sdata->radar_required = sdata->csa_radar_required;
> err = ieee80211_vif_change_channel(sdata, &changed);
> if (WARN_ON(err < 0))
> - return;
> + return err;
Now you propagate the error up, do we still need the WARN_ON here?
[...]
> @@ -3123,6 +3125,7 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
> container_of(work, struct ieee80211_sub_if_data,
> csa_finalize_work);
> struct ieee80211_local *local = sdata->local;
> + int err;
>
> sdata_lock(sdata);
> mutex_lock(&local->mtx);
> @@ -3134,7 +3137,13 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
> if (!ieee80211_sdata_running(sdata))
> goto unlock;
>
> - ieee80211_csa_finalize(sdata);
> + err = ieee80211_csa_finalize(sdata);
> + if (err) {
> + sdata_info(sdata, "failed to finalize CSA, disconnecting\n");
> + cfg80211_stop_iface(local->hw.wiphy, &sdata->wdev);
> + goto unlock;
> + }
> +
This is neat. :) Maybe it's possible to do the same thing in mlme.c and
get rid of the connection_drop_work?
--
Luca.
next prev parent reply other threads:[~2014-03-24 14:55 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 14:26 [PATCH 0/4] mac80211/cfg80211: CSA fixes/cleanups Michal Kazior
2014-03-05 14:27 ` [PATCH 1/4] mac80211: fix CSA tx queue locking Michal Kazior
2014-03-10 16:27 ` Johannes Berg
2014-03-11 7:20 ` Michal Kazior
2014-03-11 13:19 ` Johannes Berg
2014-03-05 14:27 ` [PATCH 2/4] mac80211: split CSA finalize function Michal Kazior
2014-03-05 14:27 ` [PATCH 3/4] cfg80211: export interface stopping function Michal Kazior
2014-03-05 14:27 ` [PATCH 4/4] mac80211: disconnect iface if CSA unexpectedly fails Michal Kazior
2014-03-21 13:31 ` [PATCH v2 0/4] mac80211/cfg80211: CSA fixes/cleanups Michal Kazior
2014-03-21 13:31 ` [PATCH v2 1/4] mac80211: fix CSA tx queue locking Michal Kazior
2014-03-24 12:25 ` Luca Coelho
2014-03-24 12:58 ` Michal Kazior
2014-03-24 13:14 ` Luca Coelho
2014-03-21 13:31 ` [PATCH v2 2/4] mac80211: split CSA finalize function Michal Kazior
2014-03-21 13:31 ` [PATCH v2 3/4] cfg80211: export interface stopping function Michal Kazior
2014-03-24 13:56 ` Luca Coelho
2014-03-24 14:02 ` Michal Kazior
2014-03-24 14:32 ` Arend van Spriel
2014-03-24 14:52 ` Michal Kazior
2014-03-21 13:31 ` [PATCH v2 4/4] mac80211: disconnect iface if CSA unexpectedly fails Michal Kazior
2014-03-24 14:55 ` Luca Coelho [this message]
2014-03-25 7:46 ` Michal Kazior
2014-03-28 9:52 ` [PATCH v2 0/4] mac80211/cfg80211: CSA fixes/cleanups Johannes Berg
2014-03-31 9:57 ` [PATCH v3 " Michal Kazior
2014-03-31 9:57 ` [PATCH v3 1/4] mac80211: fix CSA tx queue locking Michal Kazior
2014-03-31 11:06 ` Luca Coelho
2014-03-31 11:40 ` Michal Kazior
2014-04-08 9:57 ` Johannes Berg
2014-03-31 9:57 ` [PATCH v3 2/4] mac80211: split CSA finalize function Michal Kazior
2014-03-31 11:20 ` Luca Coelho
2014-03-31 9:57 ` [PATCH v3 3/4] cfg80211: export interface stopping function Michal Kazior
2014-03-31 11:42 ` Luca Coelho
2014-03-31 9:57 ` [PATCH v3 4/4] mac80211: disconnect iface if CSA unexpectedly fails Michal Kazior
2014-03-31 11:45 ` Luca Coelho
2014-03-31 11:49 ` Michal Kazior
2014-04-08 10:02 ` Johannes Berg
2014-04-09 13:10 ` [PATCH v4 0/4] mac80211/cfg80211: CSA fixes/cleanups Michal Kazior
2014-04-09 13:10 ` [PATCH v4 1/4] mac80211: fix CSA tx queue locking Michal Kazior
2014-04-09 13:22 ` Luca Coelho
2014-04-09 13:25 ` Michal Kazior
2014-04-09 13:11 ` [PATCH v4 2/4] mac80211: split CSA finalize function Michal Kazior
2014-04-09 13:11 ` [PATCH v4 3/4] cfg80211: export interface stopping function Michal Kazior
2014-04-09 13:11 ` [PATCH v4 4/4] mac80211: disconnect iface if CSA unexpectedly fails Michal Kazior
2014-05-08 7:10 ` [PATCH v5] " Michal Kazior
2014-05-08 9:57 ` Johannes Berg
2014-05-06 13:15 ` [PATCH v4 0/4] mac80211/cfg80211: CSA fixes/cleanups Johannes Berg
2014-05-07 7:04 ` Michal Kazior
2014-05-07 8:59 ` Johannes Berg
2014-05-07 9:10 ` Michal Kazior
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=1395672943.4515.66.camel@dubbel \
--to=luca@coelho.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.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;
as well as URLs for NNTP newsgroup(s).