wifi: mt76: mt7925: fix NAN start failure

mt7925_start_nan() called mt7925_nan_set_nmi_addr(), which makes NAN
start fail. The NMI address is not managed here, so drop the call.

Also track dev->nan_vif only in add/remove_interface and fold the
single BSS rollback into an inline error check.

Fixes: 0f3605e4f8de ("wifi: mt76: mt7925: wire up NAN operations")
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stella Liu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Stella Liu
2026-08-25 11:25:29 +02:00
committed by Felix Fietkau
parent d905a72527
commit b2081f2a03
3 changed files with 1 additions and 50 deletions
-15
View File
@@ -2592,20 +2592,8 @@ static int mt7925_start_nan(struct ieee80211_hw *hw,
if (err < 0)
goto out;
dev->nan_vif = vif;
err = mt7925_nan_set_nmi_addr(dev, vif->addr);
if (err)
goto rollback_bss;
err = mt7925_nan_enable(vif, dev, conf);
if (err)
goto rollback_bss;
goto out;
rollback_bss:
dev->nan_vif = NULL;
mt7925_mcu_add_bss_info(&dev->phy, NULL, link_conf, NULL, false);
out:
@@ -2630,9 +2618,6 @@ static int mt7925_stop_nan(struct ieee80211_hw *hw,
if (!err)
err = ret;
if (dev->nan_vif == vif)
dev->nan_vif = NULL;
mt792x_mutex_release(dev);
return err;
-32
View File
@@ -144,38 +144,6 @@ mt7925_nan_update_conf(struct mt792x_vif *mvif,
memcpy(mvif->nan.conf.cluster_id, conf->cluster_id, ETH_ALEN);
}
int mt7925_nan_set_nmi_addr(struct mt792x_dev *dev, const u8 *addr)
{
struct mt76_dev *mdev;
struct {
u8 rsv[4];
struct mt7925_nan_nmi_addr_tlv nmi_addr_tlv;
} nmi_cmd = {
.rsv = { 0 },
.nmi_addr_tlv = {
.tag = cpu_to_le16(NAN_UNI_CMD_CHANGE_NMI_ADDRESS),
.len = cpu_to_le16(sizeof(struct mt7925_nan_nmi_addr_tlv)),
},
};
int ret;
if (!dev || !addr)
return -EINVAL;
if (is_zero_ether_addr(addr) || is_multicast_ether_addr(addr)) {
dev_err(dev->mt76.dev, "NAN: invalid NMI address %pM\n", addr);
return -EINVAL;
}
mdev = &dev->mt76;
memcpy(nmi_cmd.nmi_addr_tlv.nmi_addr, addr, ETH_ALEN);
ret = mt76_mcu_send_msg(mdev, MCU_UNI_CMD(NAN), &nmi_cmd,
sizeof(nmi_cmd), true);
return ret;
}
int mt7925_nan_enable(struct ieee80211_vif *vif,
struct mt792x_dev *dev,
struct cfg80211_nan_conf *conf)
-2
View File
@@ -405,8 +405,6 @@ int mt7925_nan_change_configure(struct ieee80211_vif *vif,
void mt7925_nan_mcu_event(struct mt792x_dev *dev, struct sk_buff *skb);
int mt7925_nan_set_nmi_addr(struct mt792x_dev *dev, const u8 *addr);
void mt7925_nan_local_sched_changed(struct mt792x_dev *dev,
struct ieee80211_vif *vif);