wifi: mt76: mt7915: fix chainmask handling for non-dbdc phys on band 1

On single-adie mt7986 the only phy is bound to band 1, but its chainmask
is stored unshifted, because dev->chainshift is still zero while the
eeprom is parsed for the main phy. mt7915_set_antenna() on the other
hand shifts by chainshift * band_idx, so the representation of the
chainmask changed as soon as the antenna configuration was touched.
Until then, mt7915_mcu_set_chan_info() passed rx_path = 0 to the
firmware, since shifting the unshifted mask down clears all bits.

Keep the unshifted form for that case and add helpers for the band local
chainmask, so that only the band 1 phy of a dbdc device uses the shifted
form.

Fixes: 3eb50cc90534 ("wifi: mt76: mt7915: rely on band_idx of mt76_phy")
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2026-08-25 11:55:59 +02:00
parent 074472e615
commit d1d977d7e8
5 changed files with 24 additions and 9 deletions
+18
View File
@@ -411,6 +411,24 @@ mt7915_ext_phy(struct mt7915_dev *dev)
return phy->priv;
}
/* without dbdc, the chainmask is stored unshifted, even if the phy is
* bound to band 1
*/
static inline u8 mt7915_band_chainshift(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
if (!dev->dbdc_support)
return 0;
return phy->mt76->band_idx * dev->chainshift;
}
static inline u16 mt7915_band_chainmask(struct mt7915_phy *phy)
{
return phy->mt76->chainmask >> mt7915_band_chainshift(phy);
}
static inline u32 mt7915_check_adie(struct mt7915_dev *dev, bool sku)
{
u32 mask = sku ? MT_CONNINFRA_SKU_MASK : MT_ADIE_TYPE_MASK;