blob: 2b7cf9e5fcb1339c0df6451729da6642f64a84bc [file] [log] [blame]
developer82d34062024-02-29 09:50:59 +08001From 3b720669cc45ecb1f165b79a23bc91ffc75f2fb4 Mon Sep 17 00:00:00 2001
developer68e1eb22022-05-09 17:02:12 +08002From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Thu, 14 Apr 2022 15:18:02 +0800
developer82d34062024-02-29 09:50:59 +08004Subject: [PATCH 1007/1049] wifi: mt76: mt7915: drop undefined action frame
developer68e1eb22022-05-09 17:02:12 +08005
6---
developer4721e252022-06-21 16:41:28 +08007 mt7915/mac.c | 6 ++++++
developer68e1eb22022-05-09 17:02:12 +08008 1 file changed, 6 insertions(+)
9
10diff --git a/mt7915/mac.c b/mt7915/mac.c
developer82d34062024-02-29 09:50:59 +080011index d851017b..746b71df 100644
developer68e1eb22022-05-09 17:02:12 +080012--- a/mt7915/mac.c
13+++ b/mt7915/mac.c
developer82d34062024-02-29 09:50:59 +080014@@ -744,6 +744,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
developer68e1eb22022-05-09 17:02:12 +080015 struct mt76_tx_info *tx_info)
16 {
17 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx_info->skb->data;
18+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)tx_info->skb->data;
19+ __le16 fc = hdr->frame_control;
20 struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
21 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_info->skb);
22 struct ieee80211_key_conf *key = info->control.hw_key;
developer82d34062024-02-29 09:50:59 +080023@@ -775,6 +777,10 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
developer68e1eb22022-05-09 17:02:12 +080024 t = (struct mt76_txwi_cache *)(txwi + mdev->drv->txwi_size);
25 t->skb = tx_info->skb;
26
27+ if (ieee80211_is_action(fc) &&
28+ mgmt->u.action.category == 0xff)
29+ return -1;
30+
developer82d34062024-02-29 09:50:59 +080031 id = mt76_token_consume(mdev, &t, phy_idx);
developer68e1eb22022-05-09 17:02:12 +080032 if (id < 0)
33 return id;
34--
developer0443cd32023-09-19 14:11:49 +0800352.18.0
developer68e1eb22022-05-09 17:02:12 +080036