Commit 9c28ead0 authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg

wifi: iwlwifi: mvm: get periodic statistics in EMLSR

In EMLSR we need to track the RSSI of both links, and exit if the RSSI of
one of the links got too low.
For that request the FW to send statistics every 5 seconds when in EMLSR.
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240416134215.6e19d596d77f.Ica2a75a031b1bced0dc2e18c5d365b5eb0d3ec07@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a9bf72d8
...@@ -3987,6 +3987,10 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm, ...@@ -3987,6 +3987,10 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm,
wiphy_delayed_work_cancel(mvm->hw->wiphy, wiphy_delayed_work_cancel(mvm->hw->wiphy,
&mvmvif->prevent_esr_done_wk); &mvmvif->prevent_esr_done_wk);
/* No need for the periodic statistics anymore */
if (ieee80211_vif_is_mld(vif) && mvmvif->esr_active)
iwl_mvm_request_periodic_system_statistics(mvm, false);
} }
return 0; return 0;
......
...@@ -240,6 +240,9 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm, ...@@ -240,6 +240,9 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
else else
mvmvif->primary_link = __ffs(vif->active_links); mvmvif->primary_link = __ffs(vif->active_links);
/* Needed for tracking RSSI */
iwl_mvm_request_periodic_system_statistics(mvm, true);
return ret; return ret;
} }
...@@ -283,6 +286,7 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, ...@@ -283,6 +286,7 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
ret = iwl_mvm_esr_mode_active(mvm, vif); ret = iwl_mvm_esr_mode_active(mvm, vif);
if (ret) { if (ret) {
IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret); IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
iwl_mvm_request_periodic_system_statistics(mvm, false);
goto out; goto out;
} }
} }
...@@ -406,6 +410,8 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm, ...@@ -406,6 +410,8 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
break; break;
} }
iwl_mvm_request_periodic_system_statistics(mvm, false);
return ret; return ret;
} }
......
...@@ -1776,6 +1776,8 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm, ...@@ -1776,6 +1776,8 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm,
void iwl_mvm_rx_statistics(struct iwl_mvm *mvm, void iwl_mvm_rx_statistics(struct iwl_mvm *mvm,
struct iwl_rx_cmd_buffer *rxb); struct iwl_rx_cmd_buffer *rxb);
int iwl_mvm_request_statistics(struct iwl_mvm *mvm, bool clear); int iwl_mvm_request_statistics(struct iwl_mvm *mvm, bool clear);
int iwl_mvm_request_periodic_system_statistics(struct iwl_mvm *mvm,
bool enable);
void iwl_mvm_accu_radio_stats(struct iwl_mvm *mvm); void iwl_mvm_accu_radio_stats(struct iwl_mvm *mvm);
/* NVM */ /* NVM */
......
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // 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) 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2015-2017 Intel Deutschland GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH
*/ */
...@@ -344,6 +344,26 @@ static bool iwl_wait_stats_complete(struct iwl_notif_wait_data *notif_wait, ...@@ -344,6 +344,26 @@ static bool iwl_wait_stats_complete(struct iwl_notif_wait_data *notif_wait,
return true; return true;
} }
#define PERIODIC_STAT_RATE 5
int iwl_mvm_request_periodic_system_statistics(struct iwl_mvm *mvm, bool enable)
{
u32 flags = enable ? 0 : IWL_STATS_CFG_FLG_DISABLE_NTFY_MSK;
u32 type = enable ? (IWL_STATS_NTFY_TYPE_ID_OPER |
IWL_STATS_NTFY_TYPE_ID_OPER_PART1) : 0;
struct iwl_system_statistics_cmd system_cmd = {
.cfg_mask = cpu_to_le32(flags),
.config_time_sec = cpu_to_le32(enable ?
PERIODIC_STAT_RATE : 0),
.type_id_mask = cpu_to_le32(type),
};
return iwl_mvm_send_cmd_pdu(mvm,
WIDE_ID(SYSTEM_GROUP,
SYSTEM_STATISTICS_CMD),
0, sizeof(system_cmd), &system_cmd);
}
static int iwl_mvm_request_system_statistics(struct iwl_mvm *mvm, bool clear, static int iwl_mvm_request_system_statistics(struct iwl_mvm *mvm, bool clear,
u8 cmd_ver) u8 cmd_ver)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment