diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2022-06-19 23:42:41 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-07-11 14:40:02 +0300 |
commit | 2b25b8555d631c6d21d7d29f4f3d85a118f1e52d (patch) | |
tree | b97a6b7b64872dd4d17fd7ad925f25b2b6ebe43b /drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c | |
parent | 5e610f8e3115ca92a59d3721642185e15df1a065 (diff) |
mt76: connac: move mt7615_txp_skb_unmap in common code
Move mt7615_txp_skb_unmap in shared code and reuse it in mt7915e and
mt7921e driver.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c index 368f114dc60c..f6c605a59b81 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c @@ -54,37 +54,6 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, } static void -mt7921_txp_skb_unmap(struct mt76_dev *dev, struct mt76_txwi_cache *t) -{ - struct mt76_connac_txp_common *txp; - int i; - - txp = mt76_connac_txwi_to_txp(dev, t); - - for (i = 0; i < ARRAY_SIZE(txp->hw.ptr); i++) { - struct mt76_connac_txp_ptr *ptr = &txp->hw.ptr[i]; - bool last; - u16 len; - - len = le16_to_cpu(ptr->len0); - last = len & MT_TXD_LEN_LAST; - len &= MT_TXD_LEN_MASK; - dma_unmap_single(dev->dev, le32_to_cpu(ptr->buf0), len, - DMA_TO_DEVICE); - if (last) - break; - - len = le16_to_cpu(ptr->len1); - last = len & MT_TXD_LEN_LAST; - len &= MT_TXD_LEN_MASK; - dma_unmap_single(dev->dev, le32_to_cpu(ptr->buf1), len, - DMA_TO_DEVICE); - if (last) - break; - } -} - -static void mt7921_txwi_free(struct mt7921_dev *dev, struct mt76_txwi_cache *t, struct ieee80211_sta *sta, bool clear_status, struct list_head *free_list) @@ -93,7 +62,7 @@ mt7921_txwi_free(struct mt7921_dev *dev, struct mt76_txwi_cache *t, __le32 *txwi; u16 wcid_idx; - mt7921_txp_skb_unmap(mdev, t); + mt76_connac_txp_skb_unmap(mdev, t); if (!t->skb) goto out; |