linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 3/7] mac80211: ignore CSA to same channel
Date: Thu, 12 Mar 2015 08:53:26 +0200	[thread overview]
Message-ID: <1426143210-25635-3-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1426143210-25635-1-git-send-email-emmanuel.grumbach@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

If the AP is confused and starts doing a CSA to the same channel,
just ignore that request instead of trying to act it out since it
was likely sent in error anyway.

In the case of the bug I was investigating the GO was misbehaving
and sending out a beacon with CSA IEs still included after having
actually done the channel switch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h |  1 +
 net/mac80211/mlme.c        | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 0266c57..994d1b3 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -453,6 +453,7 @@ struct ieee80211_if_managed {
 	unsigned int flags;
 
 	bool csa_waiting_bcn;
+	bool csa_ignored_same_chan;
 
 	bool beacon_crc_valid;
 	u32 beacon_crc;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1999bc0..6205206 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1150,6 +1150,17 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
 		return;
 	}
 
+	if (cfg80211_chandef_identical(&csa_ie.chandef,
+				       &sdata->vif.bss_conf.chandef)) {
+		if (ifmgd->csa_ignored_same_chan)
+			return;
+		sdata_info(sdata,
+			   "AP %pM tries to chanswitch to same channel, ignore\n",
+			   ifmgd->associated->bssid);
+		ifmgd->csa_ignored_same_chan = true;
+		return;
+	}
+
 	mutex_lock(&local->mtx);
 	mutex_lock(&local->chanctx_mtx);
 	conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
@@ -1194,6 +1205,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
 	sdata->vif.csa_active = true;
 	sdata->csa_chandef = csa_ie.chandef;
 	sdata->csa_block_tx = csa_ie.mode;
+	ifmgd->csa_ignored_same_chan = false;
 
 	if (sdata->csa_block_tx)
 		ieee80211_stop_vif_queues(local, sdata,
@@ -2076,6 +2088,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
 	sdata->vif.csa_active = false;
 	ifmgd->csa_waiting_bcn = false;
+	ifmgd->csa_ignored_same_chan = false;
 	if (sdata->csa_block_tx) {
 		ieee80211_wake_vif_queues(local, sdata,
 					  IEEE80211_QUEUE_STOP_REASON_CSA);
-- 
1.9.1


  parent reply	other threads:[~2015-03-12  6:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  6:53 [PATCH 1/7] mac80211: allow to get wireless_dev structure from ieee80211_vif Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 2/7] mac80211: refactor drop connection/unlock in CSA processing Emmanuel Grumbach
2015-03-12  6:53 ` Emmanuel Grumbach [this message]
2015-03-12  6:53 ` [PATCH 4/7] nl80211: ignore HT/VHT capabilities without QoS/WMM Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 5/7] mac80211: Adjust chan_ctx when assigning reserved vif Emmanuel Grumbach
2015-03-16  8:33   ` Johannes Berg
2015-04-21  8:53   ` [PATCH v2 " andrei.otc
2015-04-24 10:41     ` Johannes Berg
2015-04-26  8:13       ` Andrei Otcheretianski
2015-05-06 12:50         ` Johannes Berg
2015-05-06 15:30           ` [PATCH v3 5/7] mac80211: Adjust reserved chan_ctx when assigned to vif andrei.otc
2015-05-07 12:25             ` Johannes Berg
2015-03-12  6:53 ` [PATCH 6/7] mac80211: ask for ECSA IE to be considered for beacon parse CRC Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 7/7] mac80211: Count correctly interface types Emmanuel Grumbach
2015-04-01  6:06   ` Janusz Dziedzic
2015-04-01  7:12     ` Johannes Berg
2015-04-01  8:36       ` Arend van Spriel
2015-04-01  8:44         ` Johannes Berg
2015-04-01  9:15           ` Arend van Spriel
2015-04-01  9:50             ` Peer, Ilan

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=1426143210-25635-3-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --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).