]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mld: allow NAN data
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Mon, 11 May 2026 17:36:25 +0000 (20:36 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 May 2026 12:17:10 +0000 (15:17 +0300)
Allow NAN_DATA interfaces when FW supports it.

Link: https://patch.msgid.link/20260511203428.c47453e9329a.I4a250a0df0ca0d184eb6ac84a4a9fcc3491e9e66@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
drivers/net/wireless/intel/iwlwifi/mld/nan.c

index 4b5f50ff2b0597bf0374506a3ea6d17c796c890c..8856f96a976039769ccb44f486781a3be20cf323 100644 (file)
@@ -62,13 +62,17 @@ static const struct ieee80211_iface_limit iwl_mld_limits_ap[] = {
 
 static const struct ieee80211_iface_limit iwl_mld_limits_nan[] = {
        {
-               .max = 2,
+               .max = 1,
                .types = BIT(NL80211_IFTYPE_STATION),
        },
        {
                .max = 1,
                .types = BIT(NL80211_IFTYPE_NAN),
        },
+       {
+               .max = 2,
+               .types = BIT(NL80211_IFTYPE_NAN_DATA),
+       },
 };
 
 static const struct ieee80211_iface_combination
@@ -87,8 +91,8 @@ iwl_mld_iface_combinations[] = {
        },
        /* NAN combination follow, this excludes P2P and AP */
        {
-               .num_different_channels = 2,
-               .max_interfaces = 3,
+               .num_different_channels = 3,
+               .max_interfaces = 4,
                .limits = iwl_mld_limits_nan,
                .n_limits = ARRAY_SIZE(iwl_mld_limits_nan),
        },
@@ -266,6 +270,7 @@ static void iwl_mld_hw_set_nan(struct iwl_mld *mld)
        struct ieee80211_hw *hw = mld->hw;
 
        hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_NAN);
+       hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_NAN_DATA);
 
        hw->wiphy->nan_supported_bands = BIT(NL80211_BAND_2GHZ);
        if (mld->nvm_data->bands[NL80211_BAND_5GHZ].n_channels)
@@ -363,7 +368,7 @@ static void iwl_mac_hw_set_wiphy(struct iwl_mld *mld)
                        ARRAY_SIZE(iwl_mld_iface_combinations);
                iwl_mld_hw_set_nan(mld);
        } else {
-               /* Do not include NAN combinations */
+               /* Do not include NAN combination */
                wiphy->n_iface_combinations =
                        ARRAY_SIZE(iwl_mld_iface_combinations) - 1;
        }
index 59e85818b613c568d254dfe868be8efc2d4b6fc1..cb7a3e01adb4f4ea24e78aa9015224aed4f68932 100644 (file)
 
 bool iwl_mld_nan_supported(struct iwl_mld *mld)
 {
-       return fw_has_capa(&mld->fw->ucode_capa,
-                          IWL_UCODE_TLV_CAPA_NAN_SYNC_SUPPORT);
+       const struct iwl_fw *fw = mld->fw;
+
+       if (fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_NAN_SYNC_SUPPORT) &&
+           iwl_fw_lookup_cmd_ver(fw, WIDE_ID(MAC_CONF_GROUP, NAN_SCHEDULE_CMD), 0) >= 1 &&
+           iwl_fw_lookup_cmd_ver(fw, WIDE_ID(MAC_CONF_GROUP, NAN_PEER_CMD), 0) >= 1 &&
+           iwl_fw_lookup_cmd_ver(fw, WIDE_ID(MAC_CONF_GROUP, STA_CONFIG_CMD), 0) >= 3 &&
+           iwl_fw_lookup_cmd_ver(fw, WIDE_ID(MAC_CONF_GROUP, MAC_CONFIG_CMD), 0) >= 4 &&
+           iwl_fw_lookup_cmd_ver(fw, WIDE_ID(DATA_PATH_GROUP, TLC_MNG_CONFIG_CMD), 0) >= 6)
+               return true;
+       return false;
 }
 
 static int iwl_mld_nan_send_config_cmd(struct iwl_mld *mld,