Commit 66ffcb9a authored by Chad Monroe's avatar Chad Monroe Committed by Felix Fietkau

wifi: mt76: mt7996: fix size of txpower MCU command

Fixes issues with scanning and low power output at some rates.

Fixes: f75e4779 ("wifi: mt76: mt7996: add txpower setting support")
Signed-off-by: default avatarChad Monroe <chad@monroe.io>
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent cb47c7be
...@@ -4464,7 +4464,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy) ...@@ -4464,7 +4464,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
u8 band_idx; u8 band_idx;
} __packed req = { } __packed req = {
.tag = cpu_to_le16(UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL), .tag = cpu_to_le16(UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL),
.len = cpu_to_le16(sizeof(req) + MT7996_SKU_RATE_NUM - 4), .len = cpu_to_le16(sizeof(req) + MT7996_SKU_PATH_NUM - 4),
.power_ctrl_id = UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL, .power_ctrl_id = UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL,
.power_limit_type = TX_POWER_LIMIT_TABLE_RATE, .power_limit_type = TX_POWER_LIMIT_TABLE_RATE,
.band_idx = phy->mt76->band_idx, .band_idx = phy->mt76->band_idx,
...@@ -4479,7 +4479,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy) ...@@ -4479,7 +4479,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
mphy->txpower_cur = tx_power; mphy->txpower_cur = tx_power;
skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, skb = mt76_mcu_msg_alloc(&dev->mt76, NULL,
sizeof(req) + MT7996_SKU_RATE_NUM); sizeof(req) + MT7996_SKU_PATH_NUM);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -4503,6 +4503,9 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy) ...@@ -4503,6 +4503,9 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
/* eht */ /* eht */
skb_put_data(skb, &la.eht[0], sizeof(la.eht)); skb_put_data(skb, &la.eht[0], sizeof(la.eht));
/* padding */
skb_put_zero(skb, MT7996_SKU_PATH_NUM - MT7996_SKU_RATE_NUM);
return mt76_mcu_skb_send_msg(&dev->mt76, skb, return mt76_mcu_skb_send_msg(&dev->mt76, skb,
MCU_WM_UNI_CMD(TXPOWER), true); MCU_WM_UNI_CMD(TXPOWER), true);
} }
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#define MT7996_CFEND_RATE_11B 0x03 /* 11B LP, 11M */ #define MT7996_CFEND_RATE_11B 0x03 /* 11B LP, 11M */
#define MT7996_SKU_RATE_NUM 417 #define MT7996_SKU_RATE_NUM 417
#define MT7996_SKU_PATH_NUM 494
#define MT7996_MAX_TWT_AGRT 16 #define MT7996_MAX_TWT_AGRT 16
#define MT7996_MAX_STA_TWT_AGRT 8 #define MT7996_MAX_STA_TWT_AGRT 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment