Commit 38a45bea authored by Felix Fietkau's avatar Felix Fietkau
Browse files

wifi: mt76: remove dev->wcid_phy_mask

Explicitly check wcid->phy_idx instead. Reduces allocated data size.

Link: https://patch.msgid.link/20250102163508.52945-8-nbd@nbd.name


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 82334623
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1505,8 +1505,6 @@ mt76_sta_add(struct mt76_phy *phy, struct ieee80211_vif *vif,
	}

	ewma_signal_init(&wcid->rssi);
	if (phy->band_idx == MT_BAND1)
		mt76_wcid_mask_set(dev->wcid_phy_mask, wcid->idx);
	rcu_assign_pointer(dev->wcid[wcid->idx], wcid);
	phy->num_sta++;

@@ -1533,7 +1531,6 @@ void __mt76_sta_remove(struct mt76_phy *phy, struct ieee80211_vif *vif,
	mt76_wcid_cleanup(dev, wcid);

	mt76_wcid_mask_clear(dev->wcid_mask, idx);
	mt76_wcid_mask_clear(dev->wcid_phy_mask, idx);
	phy->num_sta--;
}
EXPORT_SYMBOL_GPL(__mt76_sta_remove);
+1 −2
Original line number Diff line number Diff line
@@ -909,7 +909,6 @@ struct mt76_dev {
	spinlock_t status_lock;

	u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
	u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];

	u64 vif_mask;

@@ -1474,7 +1473,7 @@ void __mt76_sta_remove(struct mt76_phy *phy, struct ieee80211_vif *vif,
void mt76_sta_pre_rcu_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			     struct ieee80211_sta *sta);

int mt76_get_min_avg_rssi(struct mt76_dev *dev, bool ext_phy);
int mt76_get_min_avg_rssi(struct mt76_dev *dev, u8 phy_idx);

int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		     unsigned int link_id, int *dbm);
+1 −1
Original line number Diff line number Diff line
@@ -1788,7 +1788,7 @@ mt7603_false_cca_check(struct mt7603_dev *dev)

	mt7603_cca_stats_reset(dev);

	min_signal = mt76_get_min_avg_rssi(&dev->mt76, false);
	min_signal = mt76_get_min_avg_rssi(&dev->mt76, 0);
	if (!min_signal) {
		dev->sensitivity = 0;
		dev->last_cca_adj = jiffies;
+1 −1
Original line number Diff line number Diff line
@@ -1071,7 +1071,7 @@ mt76x0_phy_update_channel_gain(struct mt76x02_dev *dev)
	u8 gain_delta;
	int low_gain;

	dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76, false);
	dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76, 0);
	if (!dev->cal.avg_rssi_all)
		dev->cal.avg_rssi_all = -75;

+1 −1
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ void mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev)
	int low_gain;
	u32 val;

	dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76, false);
	dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76, 0);
	if (!dev->cal.avg_rssi_all)
		dev->cal.avg_rssi_all = -75;

Loading