[PATCH] wifi: mt76: mt7921: truncate the MTCL config to u8 explicitly

JB Tsai jb.tsai at mediatek.com
Wed Nov 11 23:30:14 PST 2026


From: Charlie-cy Wu <Charlie-cy.Wu at mediatek.com>

mt792x_acpi_get_mtcl_conf() now returns a u32 and
MT792X_ACPI_MTCL_INVALID is 0xffffffff, but req.mtcl_conf in
__mt7921_mcu_set_clc() is still a u8, so the value is truncated
implicitly when there is no valid MTCL table.

Mask the value with 0xff to make the truncation explicit. The firmware
still gets 0xff for MT792X_ACPI_MTCL_INVALID, and valid MTCL configs
only use the low 6 bits, so there is no functional change.

Signed-off-by: Charlie-cy Wu <Charlie-cy.Wu at mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 25b9437250f7..be0f1a063622 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1330,7 +1330,8 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
 		.env = env_cap,
 		.env_6g = dev->phy.power_type,
 		.acpi_conf = mt792x_acpi_get_flags(&dev->phy),
-		.mtcl_conf = mt792x_acpi_get_mtcl_conf(&dev->phy, alpha2),
+		/* MT792X_ACPI_MTCL_INVALID is sent to the FW as 0xff */
+		.mtcl_conf = mt792x_acpi_get_mtcl_conf(&dev->phy, alpha2) & 0xff,
 	};
 	int ret, valid_cnt = 0;
 	u32 buf_len = 0;
-- 
2.18.0




More information about the Linux-mediatek mailing list