Skip to content

Commit

Permalink
mt76: add DBDC rxq handlings into mac_reset_work
Browse files Browse the repository at this point in the history
Enable/disable rx napi for DBDC.

Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Ryder Lee authored and Felix Fietkau committed Jul 11, 2022
1 parent 3685727 commit ef55564
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
14 changes: 7 additions & 7 deletions drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ void mt7615_mac_reset_work(struct work_struct *work)
struct mt76_phy *ext_phy;
struct mt7615_dev *dev;
unsigned long timeout;
int i;

dev = container_of(work, struct mt7615_dev, reset_work);
ext_phy = dev->mt76.phy2;
Expand Down Expand Up @@ -299,8 +300,8 @@ void mt7615_mac_reset_work(struct work_struct *work)
mt76_txq_schedule_all(ext_phy);

mt76_worker_disable(&dev->mt76.tx_worker);
napi_disable(&dev->mt76.napi[0]);
napi_disable(&dev->mt76.napi[1]);
mt76_for_each_q_rx(&dev->mt76, i)
napi_disable(&dev->mt76.napi[i]);
napi_disable(&dev->mt76.tx_napi);

mt7615_mutex_acquire(dev);
Expand Down Expand Up @@ -330,11 +331,10 @@ void mt7615_mac_reset_work(struct work_struct *work)
napi_enable(&dev->mt76.tx_napi);
napi_schedule(&dev->mt76.tx_napi);

napi_enable(&dev->mt76.napi[0]);
napi_schedule(&dev->mt76.napi[0]);

napi_enable(&dev->mt76.napi[1]);
napi_schedule(&dev->mt76.napi[1]);
mt76_for_each_q_rx(&dev->mt76, i) {
napi_enable(&dev->mt76.napi[i]);
napi_schedule(&dev->mt76.napi[i]);
}
local_bh_enable();

ieee80211_wake_queues(mt76_hw(dev));
Expand Down
18 changes: 7 additions & 11 deletions drivers/net/wireless/mediatek/mt76/mt7915/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
struct mt7915_phy *phy2;
struct mt76_phy *ext_phy;
struct mt7915_dev *dev;
int i;

dev = container_of(work, struct mt7915_dev, reset_work);
ext_phy = dev->mt76.phy2;
Expand All @@ -2145,9 +2146,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
cancel_delayed_work_sync(&phy2->mt76->mac_work);
}
mt76_worker_disable(&dev->mt76.tx_worker);
napi_disable(&dev->mt76.napi[0]);
napi_disable(&dev->mt76.napi[1]);
napi_disable(&dev->mt76.napi[2]);
mt76_for_each_q_rx(&dev->mt76, i)
napi_disable(&dev->mt76.napi[i]);
napi_disable(&dev->mt76.tx_napi);

mutex_lock(&dev->mt76.mutex);
Expand All @@ -2170,14 +2170,10 @@ void mt7915_mac_reset_work(struct work_struct *work)
clear_bit(MT76_RESET, &phy2->mt76->state);

local_bh_disable();
napi_enable(&dev->mt76.napi[0]);
napi_schedule(&dev->mt76.napi[0]);

napi_enable(&dev->mt76.napi[1]);
napi_schedule(&dev->mt76.napi[1]);

napi_enable(&dev->mt76.napi[2]);
napi_schedule(&dev->mt76.napi[2]);
mt76_for_each_q_rx(&dev->mt76, i) {
napi_enable(&dev->mt76.napi[i]);
napi_schedule(&dev->mt76.napi[i]);
}
local_bh_enable();

tasklet_schedule(&dev->irq_tasklet);
Expand Down

0 comments on commit ef55564

Please sign in to comment.