wifi: iwlwifi: mvm: Keep connection in case of missed beacons during RX
authorDaniel Amosi <amosi.daniel@intel.com>
Mon, 5 Feb 2024 19:21:07 +0000 (21:21 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 14:00:47 +0000 (15:00 +0100)
The client needs to disconnect from AP in case of more than 19 missed
beacons only if no data is coming from that AP, otherwise it needs to
stay connected.

Signed-off-by: Daniel Amosi <amosi.daniel@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240205211151.080195242c18.Ib166fc4e46666165a88e673a4a196cb8f18fdec4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index 7cb6bc97b26c4ca7461cdc420f5196bdf1d4f3e4..cc592e288188d07a95340828340d68aa6befeaa5 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
@@ -1626,8 +1626,16 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
         * TODO: the threshold should be adjusted based on latency conditions,
         * and/or in case of a CS flow on one of the other AP vifs.
         */
-       if (rx_missed_bcon > IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG) {
-               iwl_mvm_connection_loss(mvm, vif, "missed beacons");
+       if (rx_missed_bcon >= IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG) {
+               if (rx_missed_bcon_since_rx >= IWL_MVM_MISSED_BEACONS_SINCE_RX_THOLD) {
+                       iwl_mvm_connection_loss(mvm, vif, "missed beacons");
+               } else {
+                       IWL_WARN(mvm,
+                                "missed beacons exceeds threshold, but receiving data. Stay connected, Expect bugs.\n");
+                       IWL_WARN(mvm,
+                                "missed_beacons:%d, missed_beacons_since_rx:%d\n",
+                                rx_missed_bcon, rx_missed_bcon_since_rx);
+               }
        } else if (rx_missed_bcon_since_rx > IWL_MVM_MISSED_BEACONS_THRESHOLD) {
                if (!iwl_mvm_has_new_tx_api(mvm))
                        ieee80211_beacon_loss(vif);
index 37195cb5f70b07361a4ec5477d816aaf321bd417..937d0bd9c531d2ee97a0e065615c655327397fa6 100644 (file)
@@ -40,8 +40,9 @@
 #define IWL_MVM_MAX_ADDRESSES          5
 /* RSSI offset for WkP */
 #define IWL_RSSI_OFFSET 50
+#define IWL_MVM_MISSED_BEACONS_SINCE_RX_THOLD 4
 #define IWL_MVM_MISSED_BEACONS_THRESHOLD 8
-#define IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG 16
+#define IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG 19
 
 /* A TimeUnit is 1024 microsecond */
 #define MSEC_TO_TU(_msec)      (_msec*1000/1024)