diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-09-12 12:06:35 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-11-20 15:23:48 +0300 |
commit | 7b37cce09d187fdc4a2e2a57adb1b2e170d1dfe6 (patch) | |
tree | 3397cb02862197998dea0c84903f847ceb5099bd /drivers/net/wireless/mediatek/mt76/mt76x2 | |
parent | 45971b2385d6a30b7d377c2e24728d680eae7553 (diff) | |
download | linux-7b37cce09d187fdc4a2e2a57adb1b2e170d1dfe6.tar.xz |
mt76: mt76x02: move mac_reset_counter in mt76x02_lib module
Unify mac_reset_counter routine and move it in mt76x02_lib module
since it is shared by all mt76x02 drivers (pci/usb)
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c | 12 |
2 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c index 343127f2d621..114e4fa4f4f6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c @@ -148,15 +148,7 @@ int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard) int mt76x2_mac_start(struct mt76x02_dev *dev) { - int i; - - for (i = 0; i < 16; i++) - mt76_rr(dev, MT_TX_AGG_CNT(i)); - - for (i = 0; i < 16; i++) - mt76_rr(dev, MT_TX_STAT_FIFO); - - memset(dev->aggr_stats, 0, sizeof(dev->aggr_stats)); + mt76x02_mac_reset_counters(dev); mt76x02_mac_start(dev); return 0; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c index e7fea3a6f1fd..95eb85653bbd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c @@ -6,16 +6,6 @@ #include "mt76x2u.h" #include "eeprom.h" -static void mt76x2u_mac_reset_counters(struct mt76x02_dev *dev) -{ - mt76_rr(dev, MT_RX_STAT_0); - mt76_rr(dev, MT_RX_STAT_1); - mt76_rr(dev, MT_RX_STAT_2); - mt76_rr(dev, MT_TX_STA_0); - mt76_rr(dev, MT_TX_STA_1); - mt76_rr(dev, MT_TX_STA_2); -} - static void mt76x2u_mac_fixup_xtal(struct mt76x02_dev *dev) { s8 offset = 0; @@ -104,7 +94,7 @@ int mt76x2u_mac_reset(struct mt76x02_dev *dev) int mt76x2u_mac_start(struct mt76x02_dev *dev) { - mt76x2u_mac_reset_counters(dev); + mt76x02_mac_reset_counters(dev); mt76_wr(dev, MT_MAC_SYS_CTRL, MT_MAC_SYS_CTRL_ENABLE_TX); mt76x02_wait_for_wpdma(&dev->mt76, 1000); |