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/mt7915/mac.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/mt7915/mac.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 718025518bab..a66236ba60fd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -242,7 +242,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) memset(status, 0, sizeof(*status)); if ((rxd1 & MT_RXD1_NORMAL_BAND_IDX) && !phy->band_idx) { - mphy = dev->mt76.phy2; + mphy = dev->mt76.phys[MT_BAND1]; if (!mphy) return -EINVAL; @@ -668,8 +668,8 @@ void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi, struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct mt76_phy *mphy = &dev->phy; - if ((info->hw_queue & MT_TX_HW_QUEUE_EXT_PHY) && dev->phy2) - mphy = dev->phy2; + if ((info->hw_queue & MT_TX_HW_QUEUE_EXT_PHY) && dev->phys[MT_BAND1]) + mphy = dev->phys[MT_BAND1]; mt76_connac2_mac_write_txwi(dev, txwi, skb, wcid, key, pid, qid, changed); @@ -853,7 +853,7 @@ static void mt7915_mac_tx_free_prepare(struct mt7915_dev *dev) { struct mt76_dev *mdev = &dev->mt76; - struct mt76_phy *mphy_ext = mdev->phy2; + struct mt76_phy *mphy_ext = mdev->phys[MT_BAND1]; /* clean DMA queues and unmap buffers first */ mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_PSD], false); @@ -1275,22 +1275,24 @@ mt7915_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif) static void mt7915_update_beacons(struct mt7915_dev *dev) { + struct mt76_phy *mphy_ext = dev->mt76.phys[MT_BAND1]; + ieee80211_iterate_active_interfaces(dev->mt76.hw, IEEE80211_IFACE_ITER_RESUME_ALL, mt7915_update_vif_beacon, dev->mt76.hw); - if (!dev->mt76.phy2) + if (!mphy_ext) return; - ieee80211_iterate_active_interfaces(dev->mt76.phy2->hw, + ieee80211_iterate_active_interfaces(mphy_ext->hw, IEEE80211_IFACE_ITER_RESUME_ALL, - mt7915_update_vif_beacon, dev->mt76.phy2->hw); + mt7915_update_vif_beacon, mphy_ext->hw); } static void mt7915_dma_reset(struct mt7915_dev *dev) { - struct mt76_phy *mphy_ext = dev->mt76.phy2; + struct mt76_phy *mphy_ext = dev->mt76.phys[MT_BAND1]; u32 hif1_ofs = MT_WFDMA0_PCIE1(0) - MT_WFDMA0(0); int i; @@ -1377,7 +1379,7 @@ void mt7915_mac_reset_work(struct work_struct *work) int i; dev = container_of(work, struct mt7915_dev, reset_work); - ext_phy = dev->mt76.phy2; + ext_phy = dev->mt76.phys[MT_BAND1]; phy2 = ext_phy ? ext_phy->priv : NULL; if (!(READ_ONCE(dev->reset_state) & MT_MCU_CMD_STOP_DMA)) |