On 2021-12-17 18:48, Lorenzo Bianconi wrote:
Rely on mt76_connac_mcu_alloc_wtbl_req routine and remove
duplicated code.
Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
---
.../wireless/mediatek/mt76/mt76_connac_mcu.c | 8 +++-
.../net/wireless/mediatek/mt76/mt7915/mcu.c | 43 ++++---------------
2 files changed, 15 insertions(+), 36 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
index fc5c870da420..ee512651d9f1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
@@ -309,8 +309,12 @@ mt76_connac_mcu_alloc_wtbl_req(struct mt76_dev *dev, struct mt76_wcid *wcid,
*skb = nskb;
}
- if (sta_hdr)
- sta_hdr->len = cpu_to_le16(sizeof(hdr));
+ if (sta_hdr) {
+ if (is_mt7915(dev))
+ le16_add_cpu(&sta_hdr->len, sizeof(hdr));
+ else
+ sta_hdr->len = cpu_to_le16(sizeof(hdr));
+ }
return skb_put_data(nskb, &hdr, sizeof(hdr));
}
The change from the len assignment to addition was done as a bugfix in
mt7915. I think it's likely that the assignment is buggy in the connac
code as well and should be changed to match mt7915.
- Felix