]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mt76: mt7663: fix when beacon filter is being applied
authorSean Wang <sean.wang@mediatek.com>
Thu, 4 Mar 2021 13:25:21 +0000 (21:25 +0800)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:37 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 4bec61d9fb9629c21e60cd24a97235ea1f6020ec ]

HW beacon filter command is being applied until we're in associated state
because the command would rely on the associated access point's beacon
interval and DTIM information.

Fixes: 7124198ab1a4 ("mt76: mt7615: enable beacon filtering by default for offload fw")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/wireless/mediatek/mt76/mt7615/main.c

index a42b4d96860d508e64dd227672da5df47bd8cff2..0ec836af211c03b12c9e57b481c4631ce62beb07 100644 (file)
@@ -231,8 +231,6 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
        ret = mt7615_mcu_add_dev_info(dev, vif, true);
        if (ret)
                goto out;
-
-       mt7615_mac_set_beacon_filter(phy, vif, true);
 out:
        mt7615_mutex_release(dev);
 
@@ -258,7 +256,6 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,
 
        mt7615_free_pending_tx_skbs(dev, msta);
 
-       mt7615_mac_set_beacon_filter(phy, vif, false);
        mt7615_mcu_add_dev_info(dev, vif, false);
 
        rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
@@ -557,6 +554,9 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
        if (changed & BSS_CHANGED_ARP_FILTER)
                mt7615_mcu_update_arp_filter(hw, vif, info);
 
+       if (changed & BSS_CHANGED_ASSOC)
+               mt7615_mac_set_beacon_filter(phy, vif, info->assoc);
+
        mt7615_mutex_release(dev);
 }