Skip to content
Snippets Groups Projects
Commit 2e9312a5 authored by Ming Yen Hsieh's avatar Ming Yen Hsieh Committed by Oleksii Kutuzov
Browse files

FROMLIST: wifi: mt76: mt792x: add the illegal value check for mtcl table of acpi


The mtcl table provided regulatory information for 5.9/6Ghz channels and
configured by platform venders. So, sometimes vendors may write illegal
values, and therefore it is necessary to check and add corresponding
handling for such cases.

Signed-off-by: default avatarLeon Yen <leon.yen@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
(am from https://patchwork.kernel.org/patch/13516791/)
(also found at https://lore.kernel.org/r/20240111061856.16370-1-mingyen.hsieh@mediatek.com

)

BUG=b:178754244, b:288986622
UPSTREAM-TASK=b:319073641
TEST=build on cherry

Change-Id: I514f296edd41ac0734b4aea5e17e1767875f64de
Signed-off-by: default avatarSean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5190174


Reviewed-by: default avatarDavid Ruth <druth@chromium.org>
Commit-Queue: David Ruth <druth@chromium.org>
Tested-by: default avatarDavid Ruth <druth@chromium.org>
parent 8ea55e5c
No related branches found
No related tags found
1 merge request!11[UPSTREAM] Add WIFI-related patches from Mediatek's Release 24.0
......@@ -347,11 +347,15 @@ static u8
mt7921_acpi_get_mtcl_map(int row, int column, struct mt7921_asar_cl *cl)
{
u8 config = 0;
u8 mode_6g, mode_5g9;
if (cl->cl6g[row] & BIT(column))
config |= (cl->mode_6g & 0x3) << 2;
mode_6g = (cl->mode_6g > 0x02) ? 0 : cl->mode_6g;
mode_5g9 = (cl->mode_5g9 > 0x01) ? 0 : cl->mode_5g9;
if ((cl->cl6g[row] & BIT(column)) || cl->mode_6g == 0x02)
config |= (mode_6g & 0x3) << 2;
if (cl->version > 1 && cl->cl5g9[row] & BIT(column))
config |= (cl->mode_5g9 & 0x3);
config |= (mode_5g9 & 0x3);
return config;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment