};
u8 qid;
+ u8 phy_idx;
};
struct mt76_rx_tid {
struct list_head tx_list;
struct mt76_queue *q_tx[__MT_TXQ_MAX];
+ atomic_t mgmt_tx_pending;
+
struct cfg80211_chan_def chandef;
struct cfg80211_chan_def main_chandef;
bool offchannel;
}
spin_unlock_bh(&dev->token_lock);
idr_destroy(&dev->token);
+
+ for (id = 0; id < __MT_MAX_BAND; id++) {
+ struct mt76_phy *phy = dev->phys[id];
+ if (phy)
+ atomic_set(&phy->mgmt_tx_pending, 0);
+ }
}
EXPORT_SYMBOL_GPL(mt76_connac2_tx_token_put);
}
spin_unlock_bh(&dev->mt76.token_lock);
idr_destroy(&dev->mt76.token);
+
+ for (id = 0; id < __MT_MAX_BAND; id++) {
+ struct mt76_phy *phy = dev->mt76.phys[id];
+ if (phy)
+ atomic_set(&phy->mgmt_tx_pending, 0);
+ }
}
static int
token = idr_alloc(&dev->token, *ptxwi, dev->token_start,
dev->token_start + dev->token_size,
GFP_ATOMIC);
- if (token >= dev->token_start)
+ if (token >= dev->token_start) {
dev->token_count++;
+ if ((*ptxwi)->qid == MT_TXQ_PSD) {
+ struct mt76_phy *mphy = mt76_dev_phy(dev, (*ptxwi)->phy_idx);
+ atomic_inc(&mphy->mgmt_tx_pending);
+ }
+ }
+
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
if (mtk_wed_device_active(&dev->mmio.wed) &&
token >= dev->mmio.wed.wlan.token_start)
if (txwi) {
dev->token_count--;
+ if (txwi->qid == MT_TXQ_PSD) {
+ struct mt76_phy *mphy = mt76_dev_phy(dev, txwi->phy_idx);
+ if (atomic_dec_and_test(&mphy->mgmt_tx_pending))
+ wake_up(&dev->tx_wait);
+ }
+
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
if (mtk_wed_device_active(&dev->mmio.wed) &&
token >= dev->mmio.wed.wlan.token_start &&