Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH v3 5/8] wifi: wfx: simplify exclusion between scan and Rx filters
Date: Wed,  4 Oct 2023 19:28:40 +0200	[thread overview]
Message-ID: <20231004172843.195332-6-jerome.pouiller@silabs.com> (raw)
In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com>

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>
---
 drivers/net/wireless/silabs/wfx/sta.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c
index c58db2bcea87b..cb03a5cf7ffa4 100644
--- a/drivers/net/wireless/silabs/wfx/sta.c
+++ b/drivers/net/wireless/silabs/wfx/sta.c
@@ -96,10 +96,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
 	*total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS |
 			FIF_PROBE_REQ | FIF_PSPOLL;
 
+	/* Filters are ignored during the scan. No frames are filtered. */
+	if (mutex_is_locked(&wvif->scan_lock))
+		return;
+
 	mutex_lock(&wdev->conf_mutex);
 	while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
-		mutex_lock(&wvif->scan_lock);
-
 		/* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and
 		 * beacons from other BSS
 		 */
@@ -126,8 +128,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
 		else
 			filter_prbreq = true;
 		wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
-
-		mutex_unlock(&wvif->scan_lock);
 	}
 	mutex_unlock(&wdev->conf_mutex);
 }
-- 
2.39.2


  parent reply	other threads:[~2023-10-04 17:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 17:28 [PATCH v3 0/8] wfx: implement Remain On Channel Jérôme Pouiller
2023-10-04 17:28 ` [PATCH v3 1/8] wifi: wfx: fix power_save setting when AP is stopped Jérôme Pouiller
2023-10-09  6:53   ` Kalle Valo
2023-10-04 17:28 ` [PATCH v3 2/8] wifi: wfx: relocate wfx_rate_mask_to_hw() Jérôme Pouiller
2023-10-04 17:28 ` [PATCH v3 3/8] wifi: wfx: move wfx_skb_*() out of the header file Jérôme Pouiller
2023-10-04 17:28 ` [PATCH v3 4/8] wifi: wfx: introduce hif_scan_uniq() Jérôme Pouiller
2023-10-04 17:28 ` Jérôme Pouiller [this message]
2023-10-04 17:28 ` [PATCH v3 6/8] wifi: wfx: scan_lock is global to the device Jérôme Pouiller
2023-10-04 17:28 ` [PATCH v3 7/8] wifi: wfx: allow to send frames during ROC Jérôme Pouiller
2024-11-26  7:27   ` Sverdlin, Alexander
2024-11-26 14:45     ` Jérôme Pouiller
2024-11-26 15:41       ` Sverdlin, Alexander
2024-11-26 15:54       ` Sverdlin, Alexander
2024-11-27  9:18         ` Jérôme Pouiller
2023-10-04 17:28 ` [PATCH v3 8/8] wifi: wfx: implement wfx_remain_on_channel() Jérôme Pouiller

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=20231004172843.195332-6-jerome.pouiller@silabs.com \
    --to=jerome.pouiller@silabs.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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