linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 9/9] mt76: mt7921: add back connection monitor support
       [not found] <79633d77-a326-fb46-6356-65dddea9da44@nbd.name--annotate>
@ 2021-05-13  9:55 ` sean.wang
  0 siblings, 0 replies; 3+ messages in thread
From: sean.wang @ 2021-05-13  9:55 UTC (permalink / raw)
  To: nbd, lorenzo.bianconi
  Cc: sean.wang, Soul.Huang, YN.Chen, Leon.Yen, Deren.Wu, km.lin,
	robin.chiu, ch.yeh, posh.sun, Eric.Liang, Stella.Chang, jemele,
	yenlinlai, linux-wireless, linux-mediatek

From: Sean Wang <sean.wang@mediatek.com>

>On 2021-05-10 17:14, sean.wang@mediatek.com wrote:
>> From: Sean Wang <sean.wang@mediatek.com>
>>
>> Hw beacon cmd to the mt7921 firmware doesn't only filter out the
>> beacon, but also performs its own connection monitoring, including
>> periodic keep-alives to the AP and probing the AP on beacon loss. Will
>> indicate the host with the event when the firmware detects the connection is lost.
>>
>> Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support")
>> Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
>> Signed-off-by: YN Chen <yn.chen@mediatek.com>
>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>What happened to Patch 8?
>I don't see it on the list or patchwork.

I've sent again the patch 8. Please help take a look.
>
>
>- Felix

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

* Re: [PATCH 9/9] mt76: mt7921: add back connection monitor support
  2021-05-10 15:14 ` [PATCH 9/9] mt76: mt7921: add back connection monitor support sean.wang
@ 2021-05-13  7:45   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2021-05-13  7:45 UTC (permalink / raw)
  To: sean.wang, lorenzo.bianconi
  Cc: Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang, Deren.Wu, km.lin,
	robin.chiu, ch.yeh, posh.sun, Eric.Liang, Stella.Chang, jemele,
	yenlinlai, linux-wireless, linux-mediatek


On 2021-05-10 17:14, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> Hw beacon cmd to the mt7921 firmware doesn't only filter out the beacon,
> but also performs its own connection monitoring, including periodic
> keep-alives to the AP and probing the AP on beacon loss. Will indicate
> the host with the event when the firmware detects the connection is lost.
> 
> Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support")
> Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> Signed-off-by: YN Chen <yn.chen@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
What happened to Patch 8?
I don't see it on the list or patchwork.

- Felix

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

* [PATCH 9/9] mt76: mt7921: add back connection monitor support
  2021-05-10 15:14 [PATCH 1/9] mt76: mt7921: fix mt7921_wfsys_reset sequence sean.wang
@ 2021-05-10 15:14 ` sean.wang
  2021-05-13  7:45   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: sean.wang @ 2021-05-10 15:14 UTC (permalink / raw)
  To: nbd, lorenzo.bianconi
  Cc: sean.wang, Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang,
	Deren.Wu, km.lin, robin.chiu, ch.yeh, posh.sun, Eric.Liang,
	Stella.Chang, jemele, yenlinlai, linux-wireless, linux-mediatek,
	Deren Wu, YN Chen

From: Sean Wang <sean.wang@mediatek.com>

Hw beacon cmd to the mt7921 firmware doesn't only filter out the beacon,
but also performs its own connection monitoring, including periodic
keep-alives to the AP and probing the AP on beacon loss. Will indicate
the host with the event when the firmware detects the connection is lost.

Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support")
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: YN Chen <yn.chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 .../net/wireless/mediatek/mt76/mt7921/init.c  |  4 +++
 .../net/wireless/mediatek/mt76/mt7921/mcu.c   | 32 +++++++++++++------
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index cd68721314fa..cbb1d432a591 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -73,6 +73,7 @@ static void
 mt7921_init_wiphy(struct ieee80211_hw *hw)
 {
 	struct mt7921_phy *phy = mt7921_hw_phy(hw);
+	struct mt7921_dev *dev = phy->dev;
 	struct wiphy *wiphy = hw->wiphy;
 
 	hw->queues = 4;
@@ -112,6 +113,9 @@ mt7921_init_wiphy(struct ieee80211_hw *hw)
 	ieee80211_hw_set(hw, SUPPORTS_PS);
 	ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
 
+	if (dev->pm.enable)
+		ieee80211_hw_set(hw, CONNECTION_MONITOR);
+
 	hw->max_tx_fragments = 4;
 }
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 67dc4b4cc094..7c68182cad55 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -450,22 +450,33 @@ mt7921_mcu_scan_event(struct mt7921_dev *dev, struct sk_buff *skb)
 }
 
 static void
-mt7921_mcu_beacon_loss_event(struct mt7921_dev *dev, struct sk_buff *skb)
+mt7921_mcu_connection_loss_iter(void *priv, u8 *mac,
+				struct ieee80211_vif *vif)
+{
+	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+	struct mt76_connac_beacon_loss_event *event = priv;
+
+	if (mvif->idx != event->bss_idx)
+		return;
+
+	if (!(vif->driver_flags & IEEE80211_VIF_BEACON_FILTER))
+		return;
+
+	ieee80211_connection_loss(vif);
+}
+
+static void
+mt7921_mcu_connection_loss_event(struct mt7921_dev *dev, struct sk_buff *skb)
 {
 	struct mt76_connac_beacon_loss_event *event;
-	struct mt76_phy *mphy;
-	u8 band_idx = 0; /* DBDC support */
+	struct mt76_phy *mphy = &dev->mt76.phy;
 
 	skb_pull(skb, sizeof(struct mt7921_mcu_rxd));
 	event = (struct mt76_connac_beacon_loss_event *)skb->data;
-	if (band_idx && dev->mt76.phy2)
-		mphy = dev->mt76.phy2;
-	else
-		mphy = &dev->mt76.phy;
 
 	ieee80211_iterate_active_interfaces_atomic(mphy->hw,
 					IEEE80211_IFACE_ITER_RESUME_ALL,
-					mt76_connac_mcu_beacon_loss_iter, event);
+					mt7921_mcu_connection_loss_iter, event);
 }
 
 static void
@@ -530,7 +541,7 @@ mt7921_mcu_rx_unsolicited_event(struct mt7921_dev *dev, struct sk_buff *skb)
 
 	switch (rxd->eid) {
 	case MCU_EVENT_BSS_BEACON_LOSS:
-		mt7921_mcu_beacon_loss_event(dev, skb);
+		mt7921_mcu_connection_loss_event(dev, skb);
 		break;
 	case MCU_EVENT_SCHED_SCAN_DONE:
 	case MCU_EVENT_SCAN_DONE:
@@ -1368,6 +1379,7 @@ mt7921_pm_interface_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
 {
 	struct mt7921_phy *phy = priv;
 	struct mt7921_dev *dev = phy->dev;
+	struct ieee80211_hw *hw = mt76_hw(dev);
 	int ret;
 
 	if (dev->pm.enable)
@@ -1380,9 +1392,11 @@ mt7921_pm_interface_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
 
 	if (dev->pm.enable) {
 		vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER;
+		ieee80211_hw_set(hw, CONNECTION_MONITOR);
 		mt76_set(dev, MT_WF_RFCR(0), MT_WF_RFCR_DROP_OTHER_BEACON);
 	} else {
 		vif->driver_flags &= ~IEEE80211_VIF_BEACON_FILTER;
+		__clear_bit(IEEE80211_HW_CONNECTION_MONITOR, hw->flags);
 		mt76_clear(dev, MT_WF_RFCR(0), MT_WF_RFCR_DROP_OTHER_BEACON);
 	}
 }
-- 
2.25.1


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

end of thread, other threads:[~2021-05-13  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <79633d77-a326-fb46-6356-65dddea9da44@nbd.name--annotate>
2021-05-13  9:55 ` [PATCH 9/9] mt76: mt7921: add back connection monitor support sean.wang
2021-05-10 15:14 [PATCH 1/9] mt76: mt7921: fix mt7921_wfsys_reset sequence sean.wang
2021-05-10 15:14 ` [PATCH 9/9] mt76: mt7921: add back connection monitor support sean.wang
2021-05-13  7:45   ` Felix Fietkau

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).