summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gabay <daniel.gabay@intel.com>2024-03-10 21:52:11 +0200
committeriwlwifi publisher <>2024-04-17 13:11:20 +0000
commitfaa294a262564c18d6209dc42398abda480d86ed (patch)
tree640decfaa1cb316abf5607754f073435c81d0b23
parent9ca1efcf6d365dd15b9e47d386bb9b31193d8710 (diff)
downloadbackport-iwlwifi-faa294a262564c18d6209dc42398abda480d86ed.tar.gz
wifi: iwlwifi: Print ESR states name
This is useful for debug instead of looking for the hex value. type=feature ticket=none Signed-off-by: Daniel Gabay <daniel.gabay@intel.com> Change-Id: Ic086b6b2132ffe249b3c4bdd24c673ce7fd1b614 Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/98275 tested: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com> Tested-by: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> x-iwlwifi-stack-dev: 012a459afcbdac0efc950dcc9818c8fb8eaafc8e
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/link.c56
-rw-r--r--versions2
2 files changed, 48 insertions, 10 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index a5f542a655..9f6da138e8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -5,6 +5,33 @@
#include "mvm.h"
#include "time-event.h"
+#define HANDLE_ESR_REASONS(HOW) \
+ HOW(BLOCKED_PREVENTION) \
+ HOW(BLOCKED_WOWLAN) \
+ HOW(BLOCKED_TPT) \
+ HOW(BLOCKED_FW) \
+ HOW(EXIT_MISSED_BEACON) \
+ HOW(EXIT_LOW_RSSI) \
+ HOW(EXIT_COEX) \
+ HOW(EXIT_BANDWIDTH) \
+ HOW(EXIT_CSA)
+
+static const char *const iwl_mvm_esr_states_names[] = {
+#define NAME_ENTRY(x) [ilog2(IWL_MVM_ESR_##x)] = #x,
+ HANDLE_ESR_REASONS(NAME_ENTRY)
+};
+
+static const char *iwl_get_esr_state_string(enum iwl_mvm_esr_state state)
+{
+ int offs = ilog2(state);
+
+ if (offs >= ARRAY_SIZE(iwl_mvm_esr_states_names) ||
+ !iwl_mvm_esr_states_names[offs])
+ return "UNKNOWN";
+
+ return iwl_mvm_esr_states_names[offs];
+}
+
static u32 iwl_mvm_get_free_fw_link_id(struct iwl_mvm *mvm,
struct iwl_mvm_vif *mvm_vif)
{
@@ -684,10 +711,16 @@ iwl_mvm_esr_disallowed_with_link(struct ieee80211_vif *vif,
if (conf->csa_active)
ret |= IWL_MVM_ESR_EXIT_CSA;
+#define NAME_FMT(x) "%s"
+#define NAME_PR(x) (ret & IWL_MVM_ESR_##x) ? "[" #x "]" : "",
+
if (ret)
IWL_DEBUG_INFO(mvm,
- "Link %d is not allowed for esr. Reason: 0x%x\n",
- link->link_id, ret);
+ "Link %d is not allowed for esr. reason = "
+ HANDLE_ESR_REASONS(NAME_FMT) " (0x%x)\n",
+ link->link_id,
+ HANDLE_ESR_REASONS(NAME_PR)
+ ret);
return ret;
}
@@ -907,8 +940,9 @@ static bool iwl_mvm_check_esr_prevention(struct iwl_mvm *mvm,
IWL_MVM_ESR_PREVENT_LONG;
IWL_DEBUG_INFO(mvm,
- "Preventing EMLSR for %ld seconds due to %u exits with the reason 0x%x\n",
- delay / HZ, mvmvif->exit_same_reason_count, reason);
+ "Preventing EMLSR for %ld seconds due to %u exits with the reason = %s (0x%x)\n",
+ delay / HZ, mvmvif->exit_same_reason_count,
+ iwl_get_esr_state_string(reason), reason);
wiphy_delayed_work_queue(mvm->hw->wiphy,
&mvmvif->prevent_esr_done_wk, delay);
@@ -940,8 +974,9 @@ void iwl_mvm_exit_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
new_active_links = BIT(link_to_keep);
IWL_DEBUG_INFO(mvm,
- "Exiting EMLSR. Reason = 0x%x. Current active links=0x%x, new active links = 0x%x\n",
- reason, vif->active_links, new_active_links);
+ "Exiting EMLSR. reason = %s (0x%x). Current active links=0x%x, new active links = 0x%x\n",
+ iwl_get_esr_state_string(reason), reason,
+ vif->active_links, new_active_links);
ieee80211_set_active_links_async(vif, new_active_links);
@@ -979,8 +1014,9 @@ void iwl_mvm_block_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
return;
if (!(mvmvif->esr_disable_reason & reason))
- IWL_DEBUG_INFO(mvm, "Blocking EMLSR mode. reason = 0x%x\n",
- reason);
+ IWL_DEBUG_INFO(mvm,
+ "Blocking EMLSR mode. reason = %s (0x%x)\n",
+ iwl_get_esr_state_string(reason), reason);
mvmvif->esr_disable_reason |= reason;
@@ -1039,7 +1075,9 @@ void iwl_mvm_unblock_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (!(mvmvif->esr_disable_reason & reason))
return;
- IWL_DEBUG_INFO(mvm, "Unblocking EMLSR mode. reason = 0x%x\n", reason);
+ IWL_DEBUG_INFO(mvm,
+ "Unblocking EMLSR mode. reason = %s (0x%x)\n",
+ iwl_get_esr_state_string(reason), reason);
mvmvif->esr_disable_reason &= ~reason;
diff --git a/versions b/versions
index 3ab20d36e3..50e0d23c57 100644
--- a/versions
+++ b/versions
@@ -2,4 +2,4 @@ BACKPORTS_VERSION="(see git)"
BACKPORTED_KERNEL_VERSION="(see git)"
BACKPORTED_KERNEL_NAME="iwlwifi"
BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__
-BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:12007:97ca6a2f"
+BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:12008:012a459a"