Skip to content

Commit 1b9ba30

Browse files
LorenzoBianconinbd168
authored andcommitted
wifi: mt76: mt7615: rely on mt7615_phy in mt7615_mac_reset_counters
This is a preliminary patch to move aggr_stats array in mt76_phy structure. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 028b4f2 commit 1b9ba30

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

drivers/net/wireless/mediatek/mt76/mt7615/mac.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ static struct mt76_wcid *mt7615_rx_get_wcid(struct mt7615_dev *dev,
107107
return &sta->vif->sta.wcid;
108108
}
109109

110-
void mt7615_mac_reset_counters(struct mt7615_dev *dev)
110+
void mt7615_mac_reset_counters(struct mt7615_phy *phy)
111111
{
112-
struct mt76_phy *mphy_ext = dev->mt76.phys[MT_BAND1];
112+
struct mt7615_dev *dev = phy->dev;
113113
int i;
114114

115115
for (i = 0; i < 4; i++) {
@@ -118,9 +118,7 @@ void mt7615_mac_reset_counters(struct mt7615_dev *dev)
118118
}
119119

120120
memset(dev->mt76.aggr_stats, 0, sizeof(dev->mt76.aggr_stats));
121-
dev->mt76.phy.survey_time = ktime_get_boottime();
122-
if (mphy_ext)
123-
mphy_ext->survey_time = ktime_get_boottime();
121+
phy->mt76->survey_time = ktime_get_boottime();
124122

125123
/* reset airtime counters */
126124
mt76_rr(dev, MT_MIB_SDR9(0));

drivers/net/wireless/mediatek/mt76/mt7615/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int mt7615_start(struct ieee80211_hw *hw)
8383
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work, timeout);
8484

8585
if (!running)
86-
mt7615_mac_reset_counters(dev);
86+
mt7615_mac_reset_counters(phy);
8787

8888
out:
8989
mt7615_mutex_release(dev);
@@ -320,7 +320,7 @@ int mt7615_set_channel(struct mt7615_phy *phy)
320320
if (ret)
321321
goto out;
322322

323-
mt7615_mac_reset_counters(dev);
323+
mt7615_mac_reset_counters(phy);
324324
phy->noise = 0;
325325
phy->chfreq = mt76_rr(dev, MT_CHFREQ(ext_phy));
326326

drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ void mt7615_init_work(struct mt7615_dev *dev);
469469
int mt7615_mcu_restart(struct mt76_dev *dev);
470470
void mt7615_update_channel(struct mt76_phy *mphy);
471471
bool mt7615_mac_wtbl_update(struct mt7615_dev *dev, int idx, u32 mask);
472-
void mt7615_mac_reset_counters(struct mt7615_dev *dev);
472+
void mt7615_mac_reset_counters(struct mt7615_phy *phy);
473473
void mt7615_mac_cca_stats_reset(struct mt7615_phy *phy);
474474
void mt7615_mac_set_scs(struct mt7615_phy *phy, bool enable);
475475
void mt7615_mac_enable_nf(struct mt7615_dev *dev, bool ext_phy);

0 commit comments

Comments
 (0)