From 1ee3e2f6c207de000a0f76f5742b6aad31a96cdf Mon Sep 17 00:00:00 2001 From: Kenneth Kasilag Date: Sat, 20 Jun 2026 01:38:50 +0000 Subject: [PATCH] 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 Link: https://patch.msgid.link/20260620013850.3949359-1-kenneth@kasilag.me Signed-off-by: Felix Fietkau --- mt7996/init.c | 3 +++ mt7996/mt7996.h | 1 + 2 files changed, 4 insertions(+) diff --git a/mt7996/init.c b/mt7996/init.c index 5b68e1a7..7f8a12d9 100644 --- a/mt7996/init.c +++ b/mt7996/init.c @@ -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 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h index a8a4fdec..7e71f02b 100644 --- a/mt7996/mt7996.h +++ b/mt7996/mt7996.h @@ -458,6 +458,7 @@ struct mt7996_dev { struct mt7996_phy *radio_phy[MT7996_MAX_RADIOS]; struct wiphy_radio radios[MT7996_MAX_RADIOS]; struct wiphy_radio_freq_range radio_freqs[MT7996_MAX_RADIOS]; + struct mac_address radio_addrs[MT7996_MAX_RADIOS]; struct mt7996_hif *hif2; struct mt7996_reg_desc reg;