mt76x0: run vco calibration for each channel configuration
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fri, 7 Sep 2018 21:13:12 +0000 (23:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Sep 2018 10:31:16 +0000 (12:31 +0200)
According to vendor sdk, vco calibration has to be executed
for each channel configuration whereas mcu calibration has to be
performed during channel scanning. This patch fixes the mt76x0
monitor mode issue since in that configuration vco calibration
was never executed

Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Tested-by: Sid Hayn <sidhayn@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c

index af30885..1176a28 100644 (file)
@@ -757,10 +757,10 @@ __mt76x0_phy_set_channel(struct mt76x0_dev *dev,
        /* Vendor driver don't do it */
        /* mt76x0_phy_set_tx_power(dev, channel, rf_bw_band); */
 
+       mt76x0_vco_cal(dev, channel);
        if (scan)
-               mt76x0_vco_cal(dev, channel);
+               mt76x0_mcu_calibrate(dev, MCU_CAL_RXDCOC, 1);
 
-       mt76x0_mcu_calibrate(dev, MCU_CAL_RXDCOC, 1);
        mt76x0_phy_set_chan_pwr(dev, channel);
 
        dev->mt76.chandef = *chandef;