From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Sara Sharon <sara.sharon@intel.com>,
Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 7/8] iwlwifi: mvm: track changes in beacon count during channel switch
Date: Sat, 9 Mar 2019 11:22:36 +0200 [thread overview]
Message-ID: <20190309092237.10294-8-luca@coelho.fi> (raw)
In-Reply-To: <20190309092237.10294-1-luca@coelho.fi>
From: Sara Sharon <sara.sharon@intel.com>
There are some buggy APs that keeps changing the count while forcing
us to block TX. This eventually results in queue hang, assert, and
disconnection. Detect such APs and disconnect gracefully in advance.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 +++++++++++++++
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index af71e58bdd24..e18b57c84dd2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4662,6 +4662,9 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
iwl_mvm_schedule_csa_period(mvm, vif,
vif->bss_conf.beacon_int,
apply_time);
+
+ mvmvif->csa_count = chsw->count;
+ mvmvif->csa_misbehave = false;
break;
default:
break;
@@ -4700,6 +4703,18 @@ static void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw,
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY))
return;
+ if (chsw->count >= mvmvif->csa_count && chsw->block_tx) {
+ if (mvmvif->csa_misbehave) {
+ /* Second time, give up on this AP*/
+ iwl_mvm_abort_channel_switch(hw, vif);
+ ieee80211_chswitch_done(vif, false);
+ mvmvif->csa_misbehave = false;
+ return;
+ }
+ mvmvif->csa_misbehave = true;
+ }
+ mvmvif->csa_count = chsw->count;
+
IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d\n", mvmvif->id);
WARN_ON(iwl_mvm_send_cmd_pdu(mvm,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 79d7fcb95b6f..4e179e69fd32 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -490,6 +490,8 @@ struct iwl_mvm_vif {
bool csa_countdown;
bool csa_failed;
u16 csa_target_freq;
+ u16 csa_count;
+ u16 csa_misbehave;
struct delayed_work csa_work;
/* Indicates that we are waiting for a beacon on a new channel */
--
2.20.1
next prev parent reply other threads:[~2019-03-09 9:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 9:22 [PATCH 0/8] iwlwifi: updates intended for v5.2 2019-03-09 Luca Coelho
2019-03-09 9:22 ` [PATCH 1/8] iwlwifi: mvm: report delayed beacon count to FW Luca Coelho
2019-03-09 9:22 ` [PATCH 2/8] iwlwifi: mvm: implement CSA abort Luca Coelho
2019-03-09 9:22 ` [PATCH 3/8] iwlwifi: mvm: report all NO_DATA events to mac80211 Luca Coelho
2019-03-09 9:22 ` [PATCH 4/8] iwlwifi: mvm: track CSA beacons Luca Coelho
2019-03-09 9:22 ` [PATCH 5/8] iwlwifi: mvm: notify FW on quiet mode in CSA Luca Coelho
2019-03-09 9:22 ` [PATCH 6/8] iwlwifi: mvm: disconnect in case of bad channel switch parameters Luca Coelho
2019-03-09 9:22 ` Luca Coelho [this message]
2019-03-09 9:22 ` [PATCH 8/8] iwlwifi: mvm: support multiple BSSID Luca Coelho
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=20190309092237.10294-8-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=sara.sharon@intel.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