wifi: mt76: mt7996: expose per-band MAC addresses to cfg80211

mt7996/mt7992 are single-wiphy, multi-band devices. The driver assigns
each band its own MAC address from a per-band EEPROM entry, or derives
it from the primary band's address when that entry is empty, however
only the primary band's is published as perm_addr. The per-band
addresses are not exposed to cfg80211, so consumers usually fall back
to deriving one from perm_addr.

Store each band's address in wiphy->addresses[], indexed by radio, so
cfg80211 exposes the address the hardware actually uses for that radio.
addresses[0] is the primary band and matches perm_addr, as cfg80211
requires.

Link: https://github.com/openwrt/openwrt/issues/23578
Tested-on: Gemtek W1700K (MT7996)
Signed-off-by: Kenneth Kasilag <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Kenneth Kasilag
2026-07-21 12:39:16 +02:00
committed by Felix Fietkau
parent 76c38706bb
commit 1ee3e2f6c2
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -464,6 +464,8 @@ mt7996_init_wiphy_band(struct ieee80211_hw *hw, struct mt7996_phy *phy)
radio->n_freq_range = 1;
radio->iface_combinations = &if_comb;
radio->n_iface_combinations = 1;
memcpy(dev->radio_addrs[n_radios].addr, phy->mt76->macaddr, ETH_ALEN);
hw->wiphy->n_addresses++;
hw->wiphy->n_radio++;
wiphy->available_antennas_rx |= phy->mt76->chainmask;
@@ -506,6 +508,7 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
wiphy->n_iface_combinations = 1;
wiphy->radio = dev->radios;
wiphy->addresses = dev->radio_addrs;
wiphy->reg_notifier = mt7996_regd_notifier;
wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH |