summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
diff options
context:
space:
mode:
authorLorenzo Bianconi2018-10-15 11:33:11 +0200
committerFelix Fietkau2018-11-30 12:21:39 +0100
commit6250318694cad72f3dd6e5ead2bd612126383bb4 (patch)
treee27eb7b79910fef8a8f2e39de0d33dd96594a14b /drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
parentmt76x0: phy: improve code readability in initvals_phy.h (diff)
downloadkernel-qcow2-linux-6250318694cad72f3dd6e5ead2bd612126383bb4.tar.gz
kernel-qcow2-linux-6250318694cad72f3dd6e5ead2bd612126383bb4.tar.xz
kernel-qcow2-linux-6250318694cad72f3dd6e5ead2bd612126383bb4.zip
mt76x0: pci: add get_survey support
Move mt76x02_update_channel routine in mt76x02-lib module in order to be reused by mt76x0 driver adding get_survey support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
index 4b331ed14bb2..15620d4d425e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
@@ -137,30 +137,13 @@ void mt76x2_mac_set_beacon_enable(struct mt76x02_dev *dev,
mt76x02_irq_disable(dev, MT_INT_PRE_TBTT | MT_INT_TBTT);
}
-void mt76x2_update_channel(struct mt76_dev *mdev)
-{
- struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76);
- struct mt76_channel_state *state;
- u32 active, busy;
-
- state = mt76_channel_state(&dev->mt76, dev->mt76.chandef.chan);
-
- busy = mt76_rr(dev, MT_CH_BUSY);
- active = busy + mt76_rr(dev, MT_CH_IDLE);
-
- spin_lock_bh(&dev->mt76.cc_lock);
- state->cc_busy += busy;
- state->cc_active += active;
- spin_unlock_bh(&dev->mt76.cc_lock);
-}
-
void mt76x2_mac_work(struct work_struct *work)
{
struct mt76x02_dev *dev = container_of(work, struct mt76x02_dev,
mac_work.work);
int i, idx;
- mt76x2_update_channel(&dev->mt76);
+ mt76x02_update_channel(&dev->mt76);
for (i = 0, idx = 0; i < 16; i++) {
u32 val = mt76_rr(dev, MT_TX_AGG_CNT(i));