Skip to content

Instantly share code, notes, and snippets.

@Borromini
Last active March 4, 2022 17:25
Show Gist options
  • Save Borromini/115b08771fa06ed21a122479ef5e1ac5 to your computer and use it in GitHub Desktop.
Save Borromini/115b08771fa06ed21a122479ef5e1ac5 to your computer and use it in GitHub Desktop.
+diff --git a/mt7615/mcu.c b/mt7615/mcu.c
index 856ff36e..2c67abb6 100644
--- a/mt7615/mcu.c
+++ b/mt7615/mcu.c
@@ -750,6 +750,11 @@ mt7615_mcu_add_dev(struct mt7615_phy *phy, struct ieee80211_vif *vif,
&data, sizeof(data), true);
}
+static int
+__mt7615_mcu_add_sta(struct mt76_phy *phy, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, bool enable, int cmd,
+ bool offload_fw);
+
static int
mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
struct ieee80211_hw *hw,
@@ -815,6 +819,11 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
}
dev_kfree_skb(skb);
+ if (is_mt7663(&dev->mt76)) {
+ //hack to clear all pending packets
+ __mt7615_mcu_add_sta(dev->phy.mt76, vif, NULL, false, MCU_EXT_CMD_STA_REC_UPDATE, false);
+ __mt7615_mcu_add_sta(dev->phy.mt76, vif, NULL, true, MCU_EXT_CMD_STA_REC_UPDATE, true);
+ }
out:
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_BCN_OFFLOAD, &req,
sizeof(req), true);
@@ -1191,6 +1200,12 @@ static int
mt7615_mcu_add_sta(struct mt7615_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, bool enable)
+ {
+ if (is_mt7663(&phy->dev->mt76) && !enable) {
+ //hack to clear all pending packets
+ __mt7615_mcu_add_sta(phy->mt76, vif, sta, enable, MCU_EXT_CMD_STA_REC_UPDATE, false);
+ __mt7615_mcu_add_sta(phy->mt76, vif, NULL, false, MCU_EXT_CMD_STA_REC_UPDATE, false);
+ __mt7615_mcu_add_sta(phy->mt76, vif, NULL, true, MCU_EXT_CMD_STA_REC_UPDATE, true);
+ }
return __mt7615_mcu_add_sta(phy->mt76, vif, sta, enable,
MCU_EXT_CMD_STA_REC_UPDATE);
}
@ptpt52
Copy link

ptpt52 commented Mar 4, 2022

looks like you should never set offload_fw true for mt7663, use false always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment