diff mbox series

[v3,4/4] brcmfmac: Fix authentication latency caused by OBSS stats survey

Message ID 20220929012527.4152-5-ian.lin@infineon.com (mailing list archive)
State Accepted
Commit 62ccb2e6f208ea754f62883be5a775f00bd559ab
Delegated to: Kalle Valo
Headers show
Series brcmfmac: Add dump_survey cfg80211 ops series | expand

Commit Message

Ian Lin Sept. 29, 2022, 1:25 a.m. UTC
From: Ramesh Rangavittal <ramesh.rangavittal@infineon.com>

Auto Channel Select feature of HostAP uses dump_survey to fetch
OBSS statistics. When the device is in the middle of an authentication
sequence or just at the end of authentication completion, running
dump_survey would trigger a channel change. The channel change in-turn
can cause packet loss, resulting in authentication delay. With this change,
dump_survey won't be run when authentication or association is in progress,
hence resolving the issue.

Signed-off-by: Ramesh Rangavittal <ramesh.rangavittal@infineon.com>
Signed-off-by: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
Signed-off-by: Ian Lin <ian.lin@infineon.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Arend Van Spriel Oct. 10, 2022, 10:16 a.m. UTC | #1
On 9/29/2022 3:25 AM, Ian Lin wrote:
> From: Ramesh Rangavittal <ramesh.rangavittal@infineon.com>
> 
> Auto Channel Select feature of HostAP uses dump_survey to fetch
> OBSS statistics. When the device is in the middle of an authentication
> sequence or just at the end of authentication completion, running
> dump_survey would trigger a channel change. The channel change in-turn
> can cause packet loss, resulting in authentication delay. With this change,
> dump_survey won't be run when authentication or association is in progress,
> hence resolving the issue.

It does a bit more than that. It only allows survey when not connected. 
The description above suggests that it is possible when connection is 
completed, but the condition checked below is saying something else.

Regards,
Arend

> Signed-off-by: Ramesh Rangavittal <ramesh.rangavittal@infineon.com>
> Signed-off-by: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>
> Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
> Signed-off-by: Ian Lin <ian.lin@infineon.com>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index c13c4c559e6e..362d8fd0af4e 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -7697,6 +7697,12 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev,
>   
>   	brcmf_dbg(TRACE, "Enter: channel idx=%d\n", idx);
>   
> +	/* Do not run survey when VIF in CONNECTING / CONNECTED states */
> +	if ((test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) ||
> +	    (test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state))) {
> +		return -EBUSY;
> +	}
> +
>   	band = wiphy->bands[NL80211_BAND_2GHZ];
>   	if (band && idx >= band->n_channels) {
>   		idx -= band->n_channels;
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index c13c4c559e6e..362d8fd0af4e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -7697,6 +7697,12 @@  brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev,
 
 	brcmf_dbg(TRACE, "Enter: channel idx=%d\n", idx);
 
+	/* Do not run survey when VIF in CONNECTING / CONNECTED states */
+	if ((test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) ||
+	    (test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state))) {
+		return -EBUSY;
+	}
+
 	band = wiphy->bands[NL80211_BAND_2GHZ];
 	if (band && idx >= band->n_channels) {
 		idx -= band->n_channels;