wifi: iwlwifi: add support for ALIVE v8
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 30 Apr 2025 12:57:16 +0000 (15:57 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 6 May 2025 17:23:27 +0000 (20:23 +0300)
The firmware added a field to describe the platform Id.
Just print it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.dc387ae36e0f.Iafd364c6b23749597b658015be97295ad0c1730d@changeid
drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
drivers/net/wireless/intel/iwlwifi/mld/fw.c
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index 42360a8f23aafa00c2346e0326d99d4b9c1a689d..3ce477c248cecbaa77ef2dddc581f429d197a588 100644 (file)
@@ -112,6 +112,16 @@ struct iwl_alive_ntf_v6 {
        struct iwl_imr_alive_info imr;
 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_6 */
 
+struct iwl_alive_ntf {
+       __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;
+       __le64 platform_id;
+} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_8 */
+
 /**
  * enum iwl_extended_cfg_flags - commands driver may send before
  *     finishing init flow
index 238e8ad8ba82a6f9d550486cc92eae0eaaa38c7e..268ff7eceb47140ca4782dbafb0a87d58d1c93f2 100644 (file)
@@ -103,12 +103,13 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
                         struct iwl_rx_packet *pkt, void *data)
 {
        unsigned int pkt_len = iwl_rx_packet_payload_len(pkt);
+       unsigned int expected_sz;
        struct iwl_mld *mld =
                container_of(notif_wait, struct iwl_mld, notif_wait);
        struct iwl_trans *trans = mld->trans;
        u32 version = iwl_fw_lookup_notif_ver(mld->fw, LEGACY_GROUP,
                                              UCODE_ALIVE_NTFY, 0);
-       struct iwl_alive_ntf_v6 *palive;
+       struct iwl_alive_ntf *palive;
        bool *alive_valid = data;
        struct iwl_umac_alive *umac;
        struct iwl_lmac_alive *lmac1;
@@ -117,7 +118,19 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
        u32 umac_error_table;
        u16 status;
 
-       if (version < 6 || version > 7 || pkt_len != sizeof(*palive))
+       switch (version) {
+       case 6:
+       case 7:
+               expected_sz = sizeof(struct iwl_alive_ntf_v6);
+               break;
+       case 8:
+               expected_sz = sizeof(struct iwl_alive_ntf);
+               break;
+       default:
+               return false;
+       }
+
+       if (pkt_len != expected_sz)
                return false;
 
        palive = (void *)pkt->data;
@@ -171,6 +184,10 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
                IWL_DEBUG_FW(mld, "FW alive flags 0x%x\n",
                             le16_to_cpu(palive->flags));
 
+       if (version >= 8)
+               IWL_DEBUG_FW(mld, "platform_id 0x%llx\n",
+                            le64_to_cpu(palive->platform_id));
+
        iwl_fwrt_update_fw_versions(&mld->fwrt, lmac1, umac);
 
        return true;
index 5bdd35b433e8808c199b18f3875ee36aac809eb6..d955f7c4ab8aa1fa09eac2a24eb6794e091e4d87 100644 (file)
@@ -114,7 +114,7 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
        u32 i;
 
 
-       if (version == 6) {
+       if (version >= 6) {
                struct iwl_alive_ntf_v6 *palive;
 
                if (pkt_len < sizeof(*palive))
@@ -157,6 +157,17 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
                                }
                        }
                }
+
+               if (version >= 8) {
+                       const struct iwl_alive_ntf *palive_v8 =
+                               (void *)pkt->data;
+
+                       if (pkt_len < sizeof(*palive_v8))
+                               return false;
+
+                       IWL_DEBUG_FW(mvm, "platform id: 0x%llx\n",
+                                    palive_v8->platform_id);
+               }
        }
 
        if (version >= 5) {