From: Miri Korenblit Date: Mon, 11 May 2026 17:36:25 +0000 (+0300) Subject: wifi: iwlwifi: mld: allow NAN data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0bb915f7577a6432066b052cb764d0040405b11;p=thirdparty%2Fkernel%2Flinux.git wifi: iwlwifi: mld: allow NAN data Allow NAN_DATA interfaces when FW supports it. Link: https://patch.msgid.link/20260511203428.c47453e9329a.I4a250a0df0ca0d184eb6ac84a4a9fcc3491e9e66@changeid Signed-off-by: Miri Korenblit --- diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c index 4b5f50ff2b059..8856f96a97603 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c @@ -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; } diff --git a/drivers/net/wireless/intel/iwlwifi/mld/nan.c b/drivers/net/wireless/intel/iwlwifi/mld/nan.c index 59e85818b613c..cb7a3e01adb4f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/nan.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/nan.c @@ -18,8 +18,16 @@ 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,