mt76: mt7603: move survey_time in mt76_dev
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 5 Aug 2019 06:55:52 +0000 (08:55 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:31 +0000 (17:42 +0200)
Move survey_time field in mt76_dev in order to be reused adding survey
support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7603/mac.c
drivers/net/wireless/mediatek/mt76/mt7603/main.c
drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h

index 95ba6e98afa241420a92882ec2d35eab95f07301..afcd2f26671634a17898f6ae71c1924fe1440834 100644 (file)
@@ -490,6 +490,8 @@ struct mt76_dev {
 
        u8 csa_complete;
 
+       ktime_t survey_time;
+
        u32 rxfilter;
 
        union {
index a532676a1175071ab1abbb08faf9600ed22ac8c3..c328192307c48d89db91495172c79d7abb9d04bb 100644 (file)
@@ -1473,8 +1473,9 @@ void mt7603_update_channel(struct mt76_dev *mdev)
        spin_lock_bh(&dev->mt76.cc_lock);
        cur_time = ktime_get_boottime();
        state->cc_busy += busy;
-       state->cc_active += ktime_to_us(ktime_sub(cur_time, dev->survey_time));
-       dev->survey_time = cur_time;
+       state->cc_active += ktime_to_us(ktime_sub(cur_time,
+                                                 dev->mt76.survey_time));
+       dev->mt76.survey_time = cur_time;
        spin_unlock_bh(&dev->mt76.cc_lock);
 }
 
index cc3ccb49276f0c1cd48325941c63fbb305ac342a..7adf2f8cd2b044b159b07f46ce7ff22a0153c962 100644 (file)
@@ -14,7 +14,7 @@ mt7603_start(struct ieee80211_hw *hw)
        struct mt7603_dev *dev = hw->priv;
 
        mt7603_mac_start(dev);
-       dev->survey_time = ktime_get_boottime();
+       dev->mt76.survey_time = ktime_get_boottime();
        set_bit(MT76_STATE_RUNNING, &dev->mt76.state);
        mt7603_mac_work(&dev->mt76.mac_work.work);
 
@@ -182,7 +182,7 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def)
        mt76_rr(dev, MT_MIB_STAT_PSCCA);
        mt7603_cca_stats_reset(dev);
 
-       dev->survey_time = ktime_get_boottime();
+       dev->mt76.survey_time = ktime_get_boottime();
 
        mt7603_init_edcca(dev);
 
index 2c6f7b4cf0e9f5d1d5264c66765eb2305a21d0d3..257300fec4f809293094d3329205170abb1451c4 100644 (file)
@@ -116,7 +116,6 @@ struct mt7603_dev {
 
        s8 tx_power_limit;
 
-       ktime_t survey_time;
        ktime_t ed_time;
 
        struct mt76_queue q_rx;