Commit ed73728f authored by Johannes Berg's avatar Johannes Berg
Browse files

Merge tag 'mt76-next-2025-05-21' of https://github.com/nbd168/wireless



Felix Fietkau says:
===================
mt76 patches for 6.16

- fixes
- EHT improvements
- new device ids
===================

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parents 783e2a47 e54b8702
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -302,11 +302,13 @@ void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif,
			   struct mt76_vif_link *mlink)
{
	struct mt76_dev *dev = phy->dev;
	struct mt76_vif_data *mvif = mlink->mvif;
	struct mt76_vif_data *mvif;

	if (IS_ERR_OR_NULL(mlink) || !mlink->offchannel)
		return;

	mvif = mlink->mvif;

	rcu_assign_pointer(mvif->offchannel_link, NULL);
	dev->drv->vif_link_remove(phy, vif, &vif->bss_conf, mlink);
	kfree(mlink);
+6 −4
Original line number Diff line number Diff line
@@ -449,7 +449,9 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_AQL);

	if (!wiphy->available_antennas_tx)
		wiphy->available_antennas_tx = phy->antenna_mask;
	if (!wiphy->available_antennas_rx)
		wiphy->available_antennas_rx = phy->antenna_mask;

	wiphy->sar_capa = &mt76_sar_capa;
@@ -1703,7 +1705,7 @@ s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower)
	int n_chains = hweight16(phy->chainmask);

	txpower = mt76_get_sar_power(phy, phy->chandef.chan, txpower * 2);
	txpower -= mt76_tx_power_nss_delta(n_chains);
	txpower -= mt76_tx_power_path_delta(n_chains);

	return txpower;
}
@@ -1719,7 +1721,7 @@ int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		return -EINVAL;

	n_chains = hweight16(phy->chainmask);
	delta = mt76_tx_power_nss_delta(n_chains);
	delta = mt76_tx_power_path_delta(n_chains);
	*dbm = DIV_ROUND_UP(phy->txpower_cur + delta, 2);

	return 0;
+16 −4
Original line number Diff line number Diff line
@@ -162,6 +162,16 @@ enum mt76_dfs_state {
	MT_DFS_STATE_ACTIVE,
};

#define MT76_RNR_SCAN_MAX_BSSIDS       16
struct mt76_scan_rnr_param {
	u8 bssid[MT76_RNR_SCAN_MAX_BSSIDS][ETH_ALEN];
	u8 channel[MT76_RNR_SCAN_MAX_BSSIDS];
	u8 random_mac[ETH_ALEN];
	u8 seq_num;
	u8 bssid_num;
	u32 sreq_flag;
};

struct mt76_queue_buf {
	dma_addr_t addr;
	u16 len:15,
@@ -941,6 +951,8 @@ struct mt76_dev {
	char alpha2[3];
	enum nl80211_dfs_regions region;

	struct mt76_scan_rnr_param rnr;

	u32 debugfs_reg;

	u8 csa_complete;
@@ -1386,12 +1398,12 @@ static inline bool mt76_is_skb_pktid(u8 pktid)
	return pktid >= MT_PACKET_ID_FIRST;
}

static inline u8 mt76_tx_power_nss_delta(u8 nss)
static inline u8 mt76_tx_power_path_delta(u8 path)
{
	static const u8 nss_delta[4] = { 0, 6, 9, 12 };
	u8 idx = nss - 1;
	static const u8 path_delta[5] = { 0, 6, 9, 12, 14 };
	u8 idx = path - 1;

	return (idx < ARRAY_SIZE(nss_delta)) ? nss_delta[idx] : 0;
	return (idx < ARRAY_SIZE(path_delta)) ? path_delta[idx] : 0;
}

static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
+1 −1
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ void mt7615_init_txpower(struct mt7615_dev *dev,
			 struct ieee80211_supported_band *sband)
{
	int i, n_chains = hweight8(dev->mphy.antenna_mask), target_chains;
	int delta_idx, delta = mt76_tx_power_nss_delta(n_chains);
	int delta_idx, delta = mt76_tx_power_path_delta(n_chains);
	u8 *eep = (u8 *)dev->mt76.eeprom.data;
	enum nl80211_band band = sband->band;
	struct mt76_power_limits limits;
+3 −3
Original line number Diff line number Diff line
@@ -2067,7 +2067,7 @@ static void mt7615_mcu_set_txpower_sku(struct mt7615_phy *phy, u8 *sku)
	};

	tx_power = mt76_get_sar_power(mphy, mphy->chandef.chan, tx_power);
	tx_power -= mt76_tx_power_nss_delta(n_chains);
	tx_power -= mt76_tx_power_path_delta(n_chains);
	tx_power = mt76_get_rate_power_limits(mphy, mphy->chandef.chan,
					      &limits, tx_power);
	mphy->txpower_cur = tx_power;
@@ -2084,8 +2084,8 @@ static void mt7615_mcu_set_txpower_sku(struct mt7615_phy *phy, u8 *sku)
		int delta = 0;

		if (i < n_chains - 1)
			delta = mt76_tx_power_nss_delta(n_chains) -
				mt76_tx_power_nss_delta(i + 1);
			delta = mt76_tx_power_path_delta(n_chains) -
				mt76_tx_power_path_delta(i + 1);
		sku[MT_SKU_1SS_DELTA + i] = delta;
	}
}
Loading