]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: support a TLV indicating num of mgmt mcast keys
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 12 May 2026 05:23:01 +0000 (08:23 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 May 2026 12:17:10 +0000 (15:17 +0300)
FW has a limitation of how many multicast management keys it supports.
Until today we just assumed this limitation. But now as it is changing,
due to NAN, we need a clear indication from the FW so we know how many
we can install.

Read and store this indication from the FW's TLV.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20260512082114.f171962abd2e.Ic678616c7d574de257e5923d56258043a5261674@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/fw/img.h
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/mld/key.c

index e6f9abdfa546d97439915e3c023c935eac45d6b6..3e62a458b131bb33fddac5616be0caa01776f73f 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018-2021, 2023, 2025 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2021, 2023, 2025-2026 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -191,7 +191,6 @@ enum iwl_sta_sleep_flag {
 #define STA_KEY_IDX_INVALID (0xff)
 #define STA_KEY_MAX_DATA_KEY_NUM (4)
 #define IWL_MAX_GLOBAL_KEYS (4)
-#define IWL_MAX_NUM_IGTKS 2
 #define STA_KEY_LEN_WEP40 (5)
 #define STA_KEY_LEN_WEP104 (13)
 
index f7a6f21267e9d148b16c364f8b68698275ec62f5..68ddd99a9f7de88dc1b33b405de374b78564b586 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2008-2014, 2018-2024 Intel Corporation
+ * Copyright (C) 2008-2014, 2018-2024, 2026 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -111,6 +111,7 @@ enum iwl_ucode_tlv_type {
        IWL_UCODE_TLV_FW_NUM_STATIONS           = IWL_UCODE_TLV_CONST_BASE + 0,
        IWL_UCODE_TLV_FW_NUM_LINKS              = IWL_UCODE_TLV_CONST_BASE + 1,
        IWL_UCODE_TLV_FW_NUM_BEACONS            = IWL_UCODE_TLV_CONST_BASE + 2,
+       IWL_UCODE_TLV_FW_NUM_MCAST_KEY_ENTRIES  = IWL_UCODE_TLV_CONST_BASE + 3,
 
        IWL_UCODE_TLV_TYPE_DEBUG_INFO           = IWL_UCODE_TLV_DEBUG_BASE + 0,
        IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION    = IWL_UCODE_TLV_DEBUG_BASE + 1,
index 94113d1db8e13273715c4be557c3edb8f3df60e6..75b1344f6cbe0931f292d45ea0a6e3b5699728a6 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2005-2014, 2018-2024 Intel Corporation
+ * Copyright (C) 2005-2014, 2018-2024, 2026 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016 Intel Deutschland GmbH
  */
@@ -53,6 +53,7 @@ struct iwl_ucode_capabilities {
        u32 num_stations;
        u32 num_links;
        u32 num_beacons;
+       u32 num_mcast_key_entries;
        DECLARE_BITMAP(_api, NUM_IWL_UCODE_TLV_API);
        DECLARE_BITMAP(_capa, NUM_IWL_UCODE_TLV_CAPA);
 
index 83a63be90e46d5243e53d7bed7812bf2b85c1fc7..4885245295380ea09e6418321bfe003c50b057bb 100644 (file)
@@ -1331,6 +1331,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
                        capa->num_beacons =
                                le32_to_cpup((const __le32 *)tlv_data);
                        break;
+               case IWL_UCODE_TLV_FW_NUM_MCAST_KEY_ENTRIES:
+                       if (tlv_len != sizeof(u32))
+                               goto invalid_tlv_len;
+                       capa->num_mcast_key_entries =
+                               le32_to_cpup((const __le32 *)tlv_data);
+                       break;
                case IWL_UCODE_TLV_UMAC_DEBUG_ADDRS: {
                        const struct iwl_umac_debug_addrs *dbg_ptrs =
                                (const void *)tlv_data;
@@ -1641,6 +1647,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
        fw->ucode_capa.n_scan_channels = IWL_DEFAULT_SCAN_CHANNELS;
        fw->ucode_capa.num_stations = IWL_STATION_COUNT_MAX;
        fw->ucode_capa.num_beacons = 1;
+       fw->ucode_capa.num_mcast_key_entries = 2;
        /* dump all fw memory areas by default */
        fw->dbg.dump_mask = 0xffffffff;
 
index 944d5487c110ebffcc23066a694acf9066d7cde6..151e35b851f7de8af8052e5fa9998be9ce5358a7 100644 (file)
@@ -259,7 +259,7 @@ int iwl_mld_add_key(struct iwl_mld *mld,
 
        igtk_ptr = iwl_mld_get_igtk_ptr(vif, sta, key);
        if (igtk_ptr) {
-               if (mld->num_igtks == IWL_MAX_NUM_IGTKS)
+               if (mld->num_igtks == mld->fw->ucode_capa.num_mcast_key_entries)
                        return -EOPNOTSUPP;
 
                if (*igtk_ptr) {