All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 07/12] iwlwifi: mvm: parse firmware alive message version 6
Date: Sat,  4 Dec 2021 08:35:50 +0200	[thread overview]
Message-ID: <iwlwifi.20211204083238.f856cb190a4e.I77e3ff5a92b1bcc3e81c1344b046dade0a8b6a24@changeid> (raw)
In-Reply-To: <20211204063555.769822-1-luca@coelho.fi>

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

There's a new version with some addition, we'll need to
do something with the additional data later, but for now
just parse it so we don't fail with the newer firmware.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/fw/api/alive.h   | 17 ++++++++++++++++-
 .../wireless/intel/iwlwifi/fw/api/commands.h    |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c     |  6 ++++--
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h b/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
index c840a97e6a62..7dd984fbe0f8 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018, 2020 Intel Corporation
+ * Copyright (C) 2012-2014, 2018, 2020-2021 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -97,6 +97,21 @@ struct iwl_alive_ntf_v5 {
 	struct iwl_sku_id sku_id;
 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_5 */
 
+struct iwl_imr_alive_info {
+	__le64 base_addr;
+	__le32 size;
+	__le32 enabled;
+} __packed; /* IMR_ALIVE_INFO_API_S_VER_1 */
+
+struct iwl_alive_ntf_v6 {
+	__le16 status;
+	__le16 flags;
+	struct iwl_lmac_alive lmac_data[2];
+	struct iwl_umac_alive umac_data;
+	struct iwl_sku_id sku_id;
+	struct iwl_imr_alive_info imr;
+} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_6 */
+
 /**
  * enum iwl_extended_cfg_flag - commands driver may send before
  *	finishing init flow
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
index ee6b5844a871..8a90acbd0db9 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
@@ -51,7 +51,7 @@ enum iwl_legacy_cmds {
 	 * @UCODE_ALIVE_NTFY:
 	 * Alive data from the firmware, as described in
 	 * &struct iwl_alive_ntf_v3 or &struct iwl_alive_ntf_v4 or
-	 * &struct iwl_alive_ntf_v5.
+	 * &struct iwl_alive_ntf_v5 or &struct iwl_alive_ntf_v6.
 	 */
 	UCODE_ALIVE_NTFY = 0x1,
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 6ce78c03e51f..7608b1e486c4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -123,13 +123,15 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
 	struct iwl_lmac_alive *lmac2 = NULL;
 	u16 status;
 	u32 lmac_error_event_table, umac_error_table;
+	u32 version = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
+					      UCODE_ALIVE_NTFY, 0);
 
 	/*
 	 * For v5 and above, we can check the version, for older
 	 * versions we need to check the size.
 	 */
-	if (iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
-				    UCODE_ALIVE_NTFY, 0) == 5) {
+	if (version == 5 || version == 6) {
+		/* v5 and v6 are compatible (only IMR addition) */
 		struct iwl_alive_ntf_v5 *palive;
 
 		if (pkt_len < sizeof(*palive))
-- 
2.33.1


  parent reply	other threads:[~2021-12-04  6:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04  6:35 [PATCH 00/12] iwlwifi: updates intended for v5.16 2021-12-04 part 1 Luca Coelho
2021-12-04  6:35 ` [PATCH 01/12] iwlwifi: mvm: fix delBA vs. NSSN queue sync race Luca Coelho
2021-12-04  6:35 ` [PATCH 02/12] iwlwifi: mvm: synchronize with FW after multicast commands Luca Coelho
2021-12-04  6:35 ` [PATCH 03/12] iwlwifi: properly support 4-bit MAC step Luca Coelho
2021-12-07 13:44   ` Kalle Valo
2021-12-07 13:49     ` Luca Coelho
2021-12-07 13:58       ` Kalle Valo
2021-12-07 14:05   ` [PATCH v2 03/12] iwlwifi: support 4-bits in MAC step value Luca Coelho
2021-12-04  6:35 ` [PATCH 04/12] iwlwifi: add support for Bz-Z HW Luca Coelho
2021-12-04  6:35 ` [PATCH 05/12] iwlwifi: mvm: d3: move GTK rekeys condition Luca Coelho
2021-12-04  6:35 ` [PATCH 06/12] iwlwifi: pcie: support Bz suspend/resume trigger Luca Coelho
2021-12-04  6:35 ` Luca Coelho [this message]
2021-12-04  6:35 ` [PATCH 08/12] iwlwifi: mvm: d3: support v12 wowlan status Luca Coelho
2021-12-04  6:35 ` [PATCH 09/12] iwlwifi: mvm: support RLC configuration command Luca Coelho
2021-12-04  6:35 ` [PATCH 10/12] iwlwifi: fw: api: add link to PHY context command struct v1 Luca Coelho
2021-12-04  6:35 ` [PATCH 11/12] iwlwifi: mvm: add support for PHY context command v4 Luca Coelho
2021-12-04  6:35 ` [PATCH 12/12] iwlwifi: remove unused iwlax210_2ax_cfg_so_hr_a0 structure Luca Coelho
2021-12-07 13:49 ` [PATCH 00/12] iwlwifi: updates intended for v5.16 2021-12-04 part 1 Kalle Valo

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=iwlwifi.20211204083238.f856cb190a4e.I77e3ff5a92b1bcc3e81c1344b046dade0a8b6a24@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.