developer | 047bc18 | 2022-11-16 12:20:48 +0800 | [diff] [blame] | 1 | From 6a6b3db016a9279fed1a0bf82ca22c8da4372f36 Mon Sep 17 00:00:00 2001 |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Thu, 14 Apr 2022 15:18:02 +0800 |
developer | ec56711 | 2022-10-11 11:02:55 +0800 | [diff] [blame] | 4 | Subject: [PATCH 3/3] mt76: mt7915: drop undefined action frame |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 5 | |
| 6 | --- |
| 7 | mt7915/mac.c | 6 ++++++ |
| 8 | 1 file changed, 6 insertions(+) |
| 9 | |
| 10 | diff --git a/mt7915/mac.c b/mt7915/mac.c |
developer | 047bc18 | 2022-11-16 12:20:48 +0800 | [diff] [blame] | 11 | index 99123e77..3e4033e7 100644 |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 12 | --- a/mt7915/mac.c |
| 13 | +++ b/mt7915/mac.c |
developer | 047bc18 | 2022-11-16 12:20:48 +0800 | [diff] [blame] | 14 | @@ -717,6 +717,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 15 | 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; |
developer | 047bc18 | 2022-11-16 12:20:48 +0800 | [diff] [blame] | 23 | @@ -747,6 +749,10 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 24 | 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 | + |
| 31 | id = mt76_token_consume(mdev, &t); |
| 32 | if (id < 0) |
| 33 | return id; |
| 34 | -- |
developer | 047bc18 | 2022-11-16 12:20:48 +0800 | [diff] [blame] | 35 | 2.18.0 |
developer | d68e00e | 2022-06-01 10:59:24 +0800 | [diff] [blame] | 36 | |