Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: wfx: simplify exclusion between scan and Rx filters

The device ignore the rx filters during the scan operation.
wfx_configure_filter() acquires scan_lock to reflect this restriction.
However, it is not really necessary since mac80211 don't try to
configure Rx filters during scan.

However, the things are changing. The scan operation is going to be used
to implement remain-on-channel. In this case, wfx_configure_filter() can
be called during the scan. Currently, this scenario generate a delay
that end with a timeout in the upper layers. For the final user, some
scenario of the EasyConnect specification end with a failure.

So, avoid acquiring the scan_lock and just return.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231004172843.195332-6-jerome.pouiller@silabs.com

authored by

Jérôme Pouiller and committed by
Kalle Valo
f091bcb6 fc5cb24f

+4 -4
+4 -4
drivers/net/wireless/silabs/wfx/sta.c
··· 96 96 *total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS | 97 97 FIF_PROBE_REQ | FIF_PSPOLL; 98 98 99 + /* Filters are ignored during the scan. No frames are filtered. */ 100 + if (mutex_is_locked(&wvif->scan_lock)) 101 + return; 102 + 99 103 mutex_lock(&wdev->conf_mutex); 100 104 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 101 - mutex_lock(&wvif->scan_lock); 102 - 103 105 /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and 104 106 * beacons from other BSS 105 107 */ ··· 128 126 else 129 127 filter_prbreq = true; 130 128 wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq); 131 - 132 - mutex_unlock(&wvif->scan_lock); 133 129 } 134 130 mutex_unlock(&wdev->conf_mutex); 135 131 }