diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2022-07-04 10:02:20 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-07-11 14:40:03 +0300 |
commit | dc44c45c8cd062292c45626b5c941397a0ff5ead (patch) | |
tree | feef5432075eafb8fd60bc263173e9962de2c306 /drivers/net/wireless/mediatek/mt76/tx.c | |
parent | 128c9b7d6235b960e367944cad352790f76862eb (diff) | |
download | linux-dc44c45c8cd062292c45626b5c941397a0ff5ead.tar.xz |
mt76: introduce phys array in mt76_dev structure
Introduce phys array in mt76_dev structure to reference mt76_phy
supported by the chipset. This is a preliminary patch to introduce
newer chipset support.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/tx.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/tx.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 13c5e78dd39d..6d26e872d4ba 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -585,15 +585,25 @@ EXPORT_SYMBOL_GPL(mt76_txq_schedule_all); void mt76_tx_worker_run(struct mt76_dev *dev) { - mt76_txq_schedule_all(&dev->phy); - if (dev->phy2) - mt76_txq_schedule_all(dev->phy2); + struct mt76_phy *phy; + int i; + + for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { + phy = dev->phys[i]; + if (!phy) + continue; + + mt76_txq_schedule_all(phy); + } #ifdef CONFIG_NL80211_TESTMODE - if (dev->phy.test.tx_pending) - mt76_testmode_tx_pending(&dev->phy); - if (dev->phy2 && dev->phy2->test.tx_pending) - mt76_testmode_tx_pending(dev->phy2); + for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { + phy = dev->phys[i]; + if (!phy || !phy->test.tx_pending) + continue; + + mt76_testmode_tx_pending(phy); + } #endif } EXPORT_SYMBOL_GPL(mt76_tx_worker_run); @@ -696,17 +706,23 @@ EXPORT_SYMBOL_GPL(mt76_queue_tx_complete); void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked) { - struct mt76_phy *phy = &dev->phy, *phy2 = dev->phy2; - struct mt76_queue *q, *q2 = NULL; + struct mt76_phy *phy = &dev->phy; + struct mt76_queue *q = phy->q_tx[0]; - q = phy->q_tx[0]; if (blocked == q->blocked) return; q->blocked = blocked; - if (phy2) { - q2 = phy2->q_tx[0]; - q2->blocked = blocked; + + phy = dev->phys[MT_BAND1]; + if (phy) { + q = phy->q_tx[0]; + q->blocked = blocked; + } + phy = dev->phys[MT_BAND2]; + if (phy) { + q = phy->q_tx[0]; + q->blocked = blocked; } if (!blocked) |