public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH iwlwifi-next 07/15] wifi: iwlwifi: mld: always assign a fw id to a vif
Date: Sat, 21 Mar 2026 19:29:14 +0200	[thread overview]
Message-ID: <20260321192637.f3b5cc59098f.I3d1dbe66bd224cbb786c2b0ab3d1c9f7ec9003e4@changeid> (raw)
In-Reply-To: <20260321172922.3938740-1-miriam.rachel.korenblit@intel.com>

We used to have a fw id assignment in iwl_mld_init_vif since all interface
types that were added to the driver was immediately added to the FW as
well.
Since NAN was introduced, this is no longer the case - the NAN interface
is not added to the fw until a local schedule is configured.

For this vif we don't assign a fw id so it is 0 by default.
But later, when the vif is removed from the driver, we think that it has
a valid fw id (0) and we point fw_id_to_vif[0] to NULL.
fw_id_to_vif[0] might actually point to another vif with a valid fw id
0. In this case, we end up messing fw_id_to_vif.

Fix this by initializing a vif with a special invalid fw id, and by
exiting iwl_mld_rm_vif early for NAN interfaces.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mld/iface.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mld/iface.c b/drivers/net/wireless/intel/iwlwifi/mld/iface.c
index d3b850259569..5c435d6ffa90 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/iface.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/iface.c
@@ -445,6 +445,7 @@ iwl_mld_init_vif(struct iwl_mld *mld, struct ieee80211_vif *vif)
 	lockdep_assert_wiphy(mld->wiphy);
 
 	mld_vif->mld = mld;
+	mld_vif->fw_id = IWL_MLD_INVALID_FW_ID;
 	mld_vif->roc_activity = ROC_NUM_ACTIVITIES;
 
 	if (!mld->fw_status.in_hw_restart) {
@@ -492,6 +493,10 @@ void iwl_mld_rm_vif(struct iwl_mld *mld, struct ieee80211_vif *vif)
 
 	lockdep_assert_wiphy(mld->wiphy);
 
+	/* NAN interface type is not known to FW */
+	if (vif->type == NL80211_IFTYPE_NAN)
+		return;
+
 	iwl_mld_mac_fw_action(mld, vif, FW_CTXT_ACTION_REMOVE);
 
 	if (WARN_ON(mld_vif->fw_id >= ARRAY_SIZE(mld->fw_id_to_vif)))
-- 
2.34.1


  parent reply	other threads:[~2026-03-21 17:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 17:29 [PATCH iwlwifi-next 00/15] wifi: iwlwifi: updates - 2026-03-21 Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 01/15] wifi: iwlwifi: mld: rename iwl_mld_phy_from_mac80211() argument Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 02/15] wifi: iwlwifi: mld: make alloc functions not forced static Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 03/15] wifi: iwlwifi: mld: add double-include guards to nan.h Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 04/15] wifi: iwlwifi: handle NULL/ERR returns from ptp_clock_register() Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 05/15] wifi: iwlwifi: add MAC context command version 4 Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 06/15] wifi: iwlwifi: mld: use the dedicated helper to extract a link Miri Korenblit
2026-03-21 17:29 ` Miri Korenblit [this message]
2026-03-21 17:29 ` [PATCH iwlwifi-next 08/15] wifi: iwlwifi: add a macro for max FW links Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 09/15] wifi: iwlwifi: mld: update the TLC when we deactivate a link Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 10/15] wifi: iwlwifi: TLC_MNG_CONFIG_CMD can use several structures Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 11/15] wifi: iwlwifi: mld: block EMLSR during TDLS connections Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 12/15] wifi: iwlwifi: mld: introduce iwl_mld_vif_fw_id_valid Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 13/15] wifi: iwlwifi: fix the description of SESSION_PROTECTION_CMD Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 14/15] wifi: iwlwifi: reduce the number of prints upon firmware crash Miri Korenblit
2026-03-21 17:29 ` [PATCH iwlwifi-next 15/15] wifi: iwlwifi: mld: set RX_FLAG_RADIOTAP_TLV_AT_END generically Miri Korenblit

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=20260321192637.f3b5cc59098f.I3d1dbe66bd224cbb786c2b0ab3d1c9f7ec9003e4@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox