mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: fix country count limitation for CLC
Due to the increase in the number of power tables for 6Ghz on CLC, the variable nr_country is no longer sufficient to represent the total quantity. Therefore, we have switched to calculating the length of clc buf to obtain the correct power table. Cc: [email protected] Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Ming Yen Hsieh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
29f0ad5a43
commit
5eab65bb54
+3
-2
@@ -3164,13 +3164,14 @@ __mt7925_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
|
||||
.acpi_conf = mt792x_acpi_get_flags(&dev->phy),
|
||||
};
|
||||
int ret, valid_cnt = 0;
|
||||
u8 i, *pos;
|
||||
u8 *pos, *last_pos;
|
||||
|
||||
if (!clc)
|
||||
return 0;
|
||||
|
||||
pos = clc->data + sizeof(*seg) * clc->nr_seg;
|
||||
for (i = 0; i < clc->nr_country; i++) {
|
||||
last_pos = clc->data + le32_to_cpu(*(__le32 *)(clc->data + 4));
|
||||
while (pos < last_pos) {
|
||||
struct mt7925_clc_rule *rule = (struct mt7925_clc_rule *)pos;
|
||||
|
||||
pos += sizeof(*rule);
|
||||
|
||||
Reference in New Issue
Block a user