mt76: move mt76x2_tx_complete routine in mt76x02-lib module
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Thu, 6 Sep 2018 09:18:18 +0000 (11:18 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Sep 2018 10:29:27 +0000 (12:29 +0200)
Move mt76x2_tx_complete routine in mt76x02-lib module and rename it in
mt76x02_tx_complete in order to be used in mt76x0 driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x02_util.c
drivers/net/wireless/mediatek/mt76/mt76x02_util.h
drivers/net/wireless/mediatek/mt76/mt76x2.h
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
drivers/net/wireless/mediatek/mt76/mt76x2u_core.c

index 7518c0b..d5af543 100644 (file)
@@ -377,4 +377,19 @@ void mt76x02_remove_hdr_pad(struct sk_buff *skb, int len)
 }
 EXPORT_SYMBOL_GPL(mt76x02_remove_hdr_pad);
 
+void mt76x02_tx_complete(struct mt76_dev *dev, struct sk_buff *skb)
+{
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+
+       if (info->flags & IEEE80211_TX_CTL_AMPDU) {
+               ieee80211_free_txskb(dev->hw, skb);
+       } else {
+               ieee80211_tx_info_clear_status(info);
+               info->status.rates[0].idx = -1;
+               info->flags |= IEEE80211_TX_STAT_ACK;
+               ieee80211_tx_status(dev->hw, skb);
+       }
+}
+EXPORT_SYMBOL_GPL(mt76x02_tx_complete);
+
 MODULE_LICENSE("Dual BSD/GPL");
index 953c4be..19fe42c 100644 (file)
@@ -45,4 +45,5 @@ void mt76x02_sta_rate_tbl_update(struct ieee80211_hw *hw,
                                struct ieee80211_sta *sta);
 int mt76x02_insert_hdr_pad(struct sk_buff *skb);
 void mt76x02_remove_hdr_pad(struct sk_buff *skb, int len);
+void mt76x02_tx_complete(struct mt76_dev *dev, struct sk_buff *skb);
 #endif
index 9f495d4..efed3c0 100644 (file)
@@ -215,7 +215,6 @@ int mt76x2_tx_queue_mcu(struct mt76x2_dev *dev, enum mt76_txq_id qid,
                        struct sk_buff *skb, int cmd, int seq);
 void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
               struct sk_buff *skb);
-void mt76x2_tx_complete(struct mt76_dev *dev, struct sk_buff *skb);
 int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi,
                          struct sk_buff *skb, struct mt76_queue *q,
                          struct mt76_wcid *wcid, struct ieee80211_sta *sta,
index db0cb4a..241ede9 100644 (file)
@@ -19,6 +19,7 @@
 #include "mt76x2_mcu.h"
 #include "mt76x2_eeprom.h"
 #include "mt76x2_trace.h"
+#include "mt76x02_util.h"
 
 void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr)
 {
@@ -73,7 +74,7 @@ mt76x2_mac_queue_txdone(struct mt76x2_dev *dev, struct sk_buff *skb,
        txi->wcid = txwi->wcid;
        txi->pktid = txwi->pktid;
        trace_mac_txdone_add(dev, txwi->wcid, txwi->pktid);
-       mt76x2_tx_complete(&dev->mt76, skb);
+       mt76x02_tx_complete(&dev->mt76, skb);
 }
 
 void mt76x2_mac_process_tx_status_fifo(struct mt76x2_dev *dev)
index 663229d..c3c06e0 100644 (file)
@@ -116,19 +116,3 @@ void mt76x2_tx_set_txpwr_auto(struct mt76x2_dev *dev, s8 txpwr)
                       MT_PROT_AUTO_TX_CFG_AUTO_PADJ, txpwr_adj);
 }
 EXPORT_SYMBOL_GPL(mt76x2_tx_set_txpwr_auto);
-
-void mt76x2_tx_complete(struct mt76_dev *dev, struct sk_buff *skb)
-{
-       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-
-       if (info->flags & IEEE80211_TX_CTL_AMPDU) {
-               ieee80211_free_txskb(dev->hw, skb);
-       } else {
-               ieee80211_tx_info_clear_status(info);
-               info->status.rates[0].idx = -1;
-               info->flags |= IEEE80211_TX_STAT_ACK;
-               ieee80211_tx_status(dev->hw, skb);
-       }
-}
-EXPORT_SYMBOL_GPL(mt76x2_tx_complete);
-
index e9fa126..7cadbce 100644 (file)
@@ -102,6 +102,6 @@ void mt76x2u_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q,
                             struct mt76_queue_entry *e, bool flush)
 {
        mt76x2u_remove_dma_hdr(e->skb);
-       mt76x2_tx_complete(mdev, e->skb);
+       mt76x02_tx_complete(mdev, e->skb);
 }