]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: iwlwifi: mld: Fix primary link selection logic
authorNidhish A N <nidhish.a.n@intel.com>
Sun, 11 Jan 2026 17:39:14 +0000 (19:39 +0200)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 21 Jan 2026 12:23:02 +0000 (14:23 +0200)
commit7a749db26cab2334d5b356ac31e6f1147c7682da
tree104a8fea94da103a79459569c8272d45744c5855
parent4f042e3bb907fc33c1a42676fbbf15ae679f87e8
wifi: iwlwifi: mld: Fix primary link selection logic

When assigning emlsr.primary with emlsr.selected_primary
we are checking if BIT(mld_vif->emlsr.selected_links) are
a part of vif->active_links. This is incorrect as
emlsr.selected_links is a bitmap of possibly two selected links.
Therefore, performing the BIT() operation on it does not
yield any meaningful result and almost always leads to
incorrect primary link selection.

Additionally, we cannot rely on vif->active_links at this
stage of the link switch flow because it contains both the
removed links and also the newly added links.
For example, if we had selected links in the past (0x11)
and we now select links because of TTLM/debugfs (0x100),
vif->active_links will now be (0x111) and primary link
will be 0, while 0 is not even an active link. Thus,
we create our own bitmap of final active links.

Signed-off-by: Nidhish A N <nidhish.a.n@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260111193638.38b2e14e3a20.Ie81a88dfff0c5d2becedabab8398702808f6b1bf@changeid
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c