Skip to content

Commit f910873

Browse files
cmonroeopsiff
authored andcommitted
wifi: mt76: mt7996: fix size of txpower MCU command
[ Upstream commit 66ffcb9 ] Fixes issues with scanning and low power output at some rates. Fixes: f75e477 ("wifi: mt76: mt7996: add txpower setting support") Signed-off-by: Chad Monroe <chad@monroe.io> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit c4c42152c97e410549db5724819d0fda559e9cf7)
1 parent bc0e70c commit f910873

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4483,7 +4483,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
44834483
u8 band_idx;
44844484
} __packed req = {
44854485
.tag = cpu_to_le16(UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL),
4486-
.len = cpu_to_le16(sizeof(req) + MT7996_SKU_RATE_NUM - 4),
4486+
.len = cpu_to_le16(sizeof(req) + MT7996_SKU_PATH_NUM - 4),
44874487
.power_ctrl_id = UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL,
44884488
.power_limit_type = TX_POWER_LIMIT_TABLE_RATE,
44894489
.band_idx = phy->mt76->band_idx,
@@ -4498,7 +4498,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
44984498
mphy->txpower_cur = tx_power;
44994499

45004500
skb = mt76_mcu_msg_alloc(&dev->mt76, NULL,
4501-
sizeof(req) + MT7996_SKU_RATE_NUM);
4501+
sizeof(req) + MT7996_SKU_PATH_NUM);
45024502
if (!skb)
45034503
return -ENOMEM;
45044504

@@ -4522,6 +4522,9 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
45224522
/* eht */
45234523
skb_put_data(skb, &la.eht[0], sizeof(la.eht));
45244524

4525+
/* padding */
4526+
skb_put_zero(skb, MT7996_SKU_PATH_NUM - MT7996_SKU_RATE_NUM);
4527+
45254528
return mt76_mcu_skb_send_msg(&dev->mt76, skb,
45264529
MCU_WM_UNI_CMD(TXPOWER), true);
45274530
}

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define MT7996_CFEND_RATE_11B 0x03 /* 11B LP, 11M */
5151

5252
#define MT7996_SKU_RATE_NUM 417
53+
#define MT7996_SKU_PATH_NUM 494
5354

5455
#define MT7996_MAX_TWT_AGRT 16
5556
#define MT7996_MAX_STA_TWT_AGRT 8

0 commit comments

Comments
 (0)