]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mwifiex: Fix interface type change
authorRafael Beims <rafael.beims@toradex.com>
Fri, 10 May 2024 11:04:58 +0000 (13:04 +0200)
committerKalle Valo <kvalo@kernel.org>
Fri, 17 May 2024 08:02:56 +0000 (11:02 +0300)
When changing the interface type we also need to update the bss_num, the
driver private data is searched based on a unique (bss_type, bss_num)
tuple, therefore every time bss_type changes, bss_num must also change.

This fixes for example an issue in which, after the mode changed, a
wireless scan on the changed interface would not finish, leading to
repeated -EBUSY messages to userspace when other scan requests were
sent.

Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
Cc: stable@vger.kernel.org
Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240510110458.15475-1-francesco@dolcini.it
drivers/net/wireless/marvell/mwifiex/cfg80211.c

index b909a7665e9cc17c21b4c29afd2aabac1f878291..155eb0fab12a48b568ab189c45819d8df7bd3045 100644 (file)
@@ -926,6 +926,8 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv,
                return -EOPNOTSUPP;
        }
 
+       priv->bss_num = mwifiex_get_unused_bss_num(adapter, priv->bss_type);
+
        spin_lock_irqsave(&adapter->main_proc_lock, flags);
        adapter->main_locked = false;
        spin_unlock_irqrestore(&adapter->main_proc_lock, flags);