Skip to contentSkip to conversation

mt76: mt7921: fix UC entry is being overwritten

PATCH In review [email protected] 3 participants 3 messages May 20, 2021 – May 24, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author reviewer
#0 lore raw

PATCH 1/1 mt76: mt7921: fix UC entry is being overwritten

From: Deren Wu <[email protected]>

Fix UC entry is being overwritten by BC entry

Fixes 36fcc8cff592 ("mt76: mt7921: introduce mt7921_mcu_sta_add routine")
---
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +7 -4
index 73359defa176..f3decc59a6fe 100644
@@ -875,10 +875,13 @@ int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy,
 	if (IS_ERR(skb))
 		return PTR_ERR(skb);
 
-	mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta, info->enable);
-	if (info->enable && info->sta)
-		mt76_connac_mcu_sta_tlv(phy, skb, info->sta, info->vif,
-					info->rcpi);
+	if (info->sta) {
+		mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta,
+					      info->enable);
+		if (info->enable)
+			mt76_connac_mcu_sta_tlv(phy, skb, info->sta,
+						info->vif, info->rcpi);
+	}
 
 	sta_wtbl = mt76_connac_mcu_add_tlv(skb, STA_REC_WTBL,
 					   sizeof(struct tlv));
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 21 lines

From: Deren Wu <[email protected]>

Fix UC entry is being overwritten by BC entry

Fixes 36fcc8cff592 ("mt76: mt7921: introduce mt7921_mcu_sta_add routine")
---
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +0 -1
index 73359defa176..f3decc59a6fe 100644
@@ -875,10 +875,13 @@ int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy,
 	if (IS_ERR(skb))
 		return PTR_ERR(skb);
 
-	mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta, info->enable);

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy, · line 884

Quoted 10 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +7 -3
-	if (info->enable && info->sta)
-		mt76_connac_mcu_sta_tlv(phy, skb, info->sta, info->vif,
-					info->rcpi);
+	if (info->sta) {
+		mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta,
+					      info->enable);
+		if (info->enable)
+			mt76_connac_mcu_sta_tlv(phy, skb, info->sta,
+						info->vif, info->rcpi);
+	}

with this patch we are changing the mt7663 behaviour since we run mt76_connac_mcu_add_sta_cmd() in mt7615_remove_interface() with enable = false and sta = NULL. Can you please confirm you are not introducing any regression in mt7663?

Regards,
Lorenzo

Quoted 6 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +0 -0
 	sta_wtbl = mt76_connac_mcu_add_tlv(skb, STA_REC_WTBL,
 					   sizeof(struct tlv));
Signature · 1 line
2.25.1
maintainer
#2 lore raw
Quoted 20 lines · Lorenzo Bianconi
Quoted 20 lines

From: Deren Wu <[email protected]>

Fix UC entry is being overwritten by BC entry

Fixes 36fcc8cff592 ("mt76: mt7921: introduce mt7921_mcu_sta_add routine")
---
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +0 -0
index 73359defa176..f3decc59a6fe 100644
@@ -875,10 +875,13 @@ int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy,
 	if (IS_ERR(skb))
 		return PTR_ERR(skb);
 
Quoted 16 lines

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy, · line 884

Quoted 11 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +7 -4
-	mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta, info->enable);
-	if (info->enable && info->sta)
-		mt76_connac_mcu_sta_tlv(phy, skb, info->sta, info->vif,
-					info->rcpi);
+	if (info->sta) {
+		mt76_connac_mcu_sta_basic_tlv(skb, info->vif, info->sta,
+					      info->enable);
+		if (info->enable)
+			mt76_connac_mcu_sta_tlv(phy, skb, info->sta,
+						info->vif, info->rcpi);
+	}

with this patch we are changing the mt7663 behaviour since we run mt76_connac_mcu_add_sta_cmd() in mt7615_remove_interface() with enable = false and sta = NULL. Can you please confirm you are not introducing any regression in mt7663?

I think this also breaks mt7622, so please double check.

Quoted 13 lines

Regards,
Lorenzo

Quoted 6 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +0 -0
 	sta_wtbl = mt76_connac_mcu_add_tlv(skb, STA_REC_WTBL,
 					   sizeof(struct tlv));
Signature · 1 line
2.25.1

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek