linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: Do not report beacon loss if beacon filtering enabled
@ 2020-06-18  9:17 Loic Poulain
  2020-06-18  9:17 ` [PATCH 2/2] wcn36xx: Advertise beacon filtering support in bmps Loic Poulain
  0 siblings, 1 reply; 3+ messages in thread
From: Loic Poulain @ 2020-06-18  9:17 UTC (permalink / raw)
  To: kvalo, johannes; +Cc: wcn36xx, linux-wireless, Loic Poulain

mac80211.h says: Beacon filter support is advertised with the
IEEE80211_VIF_BEACON_FILTER interface capability. The driver needs to
enable beacon filter support whenever power save is enabled, that is
IEEE80211_CONF_PS is set. When power save is enabled, the stack will
not check for beacon loss and the driver needs to notify about loss
of beacons with ieee80211_beacon_loss().

Some controllers may want to dynamically enable the beacon filter
capabilities on power save entry (CONF_PS) and disable it on exit.
This is the case for the wcn36xx driver which only supports beacon
filtering in PS mode (no CONNECTION_MONITOR support).

When the mac80211 beacon monitor timer expires, the beacon filter
flag must be checked again in case it as been changed in between
(e.g. vif moved to PS mode).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 net/mac80211/mlme.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 16d75da..1f7dfaa 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4494,6 +4494,9 @@ static void ieee80211_sta_bcn_mon_timer(struct timer_list *t)
 	if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
 		return;
 
+	if (sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER)
+		return;
+
 	sdata->u.mgd.connection_loss = false;
 	ieee80211_queue_work(&sdata->local->hw,
 			     &sdata->u.mgd.beacon_connection_loss_work);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] wcn36xx: Advertise beacon filtering support in bmps
  2020-06-18  9:17 [PATCH 1/2] mac80211: Do not report beacon loss if beacon filtering enabled Loic Poulain
@ 2020-06-18  9:17 ` Loic Poulain
  2020-10-01 19:34   ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Loic Poulain @ 2020-06-18  9:17 UTC (permalink / raw)
  To: kvalo, johannes; +Cc: wcn36xx, linux-wireless, Loic Poulain

In bmps mode, beacons are filtered, and firmware is in charge
of monitoring the beacons and report changes or loss.

mac80211 must be advertised about such change to prevent it's
internal timer based beacon monitor to report beacon loss.

Fix that by setting/clearing the IEEE80211_VIF_BEACON_FILTER
vif flag on bmps entry/exit.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/pmc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/pmc.c b/drivers/net/wireless/ath/wcn36xx/pmc.c
index 1976b80..2936aaf 100644
--- a/drivers/net/wireless/ath/wcn36xx/pmc.c
+++ b/drivers/net/wireless/ath/wcn36xx/pmc.c
@@ -28,6 +28,7 @@ int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn,
 	if (!ret) {
 		wcn36xx_dbg(WCN36XX_DBG_PMC, "Entered BMPS\n");
 		vif_priv->pw_state = WCN36XX_BMPS;
+		vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER;
 	} else {
 		/*
 		 * One of the reasons why HW will not enter BMPS is because
@@ -52,6 +53,7 @@ int wcn36xx_pmc_exit_bmps_state(struct wcn36xx *wcn,
 	}
 	wcn36xx_smd_exit_bmps(wcn, vif);
 	vif_priv->pw_state = WCN36XX_FULL_POWER;
+	vif->driver_flags &= ~IEEE80211_VIF_BEACON_FILTER;
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] wcn36xx: Advertise beacon filtering support in bmps
  2020-06-18  9:17 ` [PATCH 2/2] wcn36xx: Advertise beacon filtering support in bmps Loic Poulain
@ 2020-10-01 19:34   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-10-01 19:34 UTC (permalink / raw)
  To: Loic Poulain; +Cc: johannes, wcn36xx, linux-wireless, Loic Poulain

Loic Poulain <loic.poulain@linaro.org> wrote:

> In bmps mode, beacons are filtered, and firmware is in charge
> of monitoring the beacons and report changes or loss.
> 
> mac80211 must be advertised about such change to prevent it's
> internal timer based beacon monitor to report beacon loss.
> 
> Fix that by setting/clearing the IEEE80211_VIF_BEACON_FILTER
> vif flag on bmps entry/exit.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

fd5ad4d1e980 wcn36xx: Advertise beacon filtering support in bmps

-- 
https://patchwork.kernel.org/patch/11611661/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-01 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18  9:17 [PATCH 1/2] mac80211: Do not report beacon loss if beacon filtering enabled Loic Poulain
2020-06-18  9:17 ` [PATCH 2/2] wcn36xx: Advertise beacon filtering support in bmps Loic Poulain
2020-10-01 19:34   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).