blob: 5ccaf1e24c358e96b08c618d67cecdf38ebaadcb [file] [log] [blame]
developer1bc2ce22023-03-25 00:47:41 +08001From 0c30c9dd897963c3524105599fa611aa5369b34e Mon Sep 17 00:00:00 2001
developer483388c2023-03-08 13:52:15 +08002From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 13 Feb 2023 14:48:10 +0800
developer1bc2ce22023-03-25 00:47:41 +08004Subject: [PATCH 03/29] wifi: mt76: mt7996: fix pointer calculation in ie
developer483388c2023-03-08 13:52:15 +08005 countdown event
6
7Fix the tail and data pointers. The rxd->len in mt7996_mcu_rxd does not
8include the length of general rxd. It only includes the length of
9firmware event rxd. Use the skb->length to get the correct length.
10
11Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
12Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
13Change-Id: I832194559e63e6b49b7ee00dc9c606b6106d8669
14---
15 mt7996/mcu.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/mt7996/mcu.c b/mt7996/mcu.c
19index dbe10576..2e25572a 100644
20--- a/mt7996/mcu.c
21+++ b/mt7996/mcu.c
22@@ -422,7 +422,8 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
23 if (hdr->band && dev->mt76.phys[hdr->band])
24 mphy = dev->mt76.phys[hdr->band];
25
26- tail = skb->data + le16_to_cpu(rxd->len);
27+ tail = skb->data + skb->len;
28+ data += sizeof(struct header);
29 while (data + sizeof(struct tlv) < tail && le16_to_cpu(tlv->len)) {
30 switch (le16_to_cpu(tlv->tag)) {
31 case UNI_EVENT_IE_COUNTDOWN_CSA:
32--
332.39.2
34