1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * mac80211 drop reason list 3 * mac80211 drop reason list 4 * 4 * 5 * Copyright (C) 2023-2024 Intel Corporation !! 5 * Copyright (C) 2023 Intel Corporation 6 */ 6 */ 7 7 8 #ifndef MAC80211_DROP_H 8 #ifndef MAC80211_DROP_H 9 #define MAC80211_DROP_H 9 #define MAC80211_DROP_H 10 #include <net/dropreason.h> 10 #include <net/dropreason.h> 11 11 12 typedef unsigned int __bitwise ieee80211_rx_re 12 typedef unsigned int __bitwise ieee80211_rx_result; 13 13 14 #define MAC80211_DROP_REASONS_MONITOR(R) 14 #define MAC80211_DROP_REASONS_MONITOR(R) \ 15 R(RX_DROP_M_UNEXPECTED_4ADDR_FRAME) 15 R(RX_DROP_M_UNEXPECTED_4ADDR_FRAME) \ 16 R(RX_DROP_M_BAD_BCN_KEYIDX) 16 R(RX_DROP_M_BAD_BCN_KEYIDX) \ 17 R(RX_DROP_M_BAD_MGMT_KEYIDX) 17 R(RX_DROP_M_BAD_MGMT_KEYIDX) \ 18 /* this line for the trailing \ - add before t 18 /* this line for the trailing \ - add before this */ 19 19 20 #define MAC80211_DROP_REASONS_UNUSABLE(R) 20 #define MAC80211_DROP_REASONS_UNUSABLE(R) \ 21 /* 0x00 == ___RX_DROP_UNUSABLE */ 21 /* 0x00 == ___RX_DROP_UNUSABLE */ \ 22 R(RX_DROP_U_MIC_FAIL) 22 R(RX_DROP_U_MIC_FAIL) \ 23 R(RX_DROP_U_REPLAY) 23 R(RX_DROP_U_REPLAY) \ 24 R(RX_DROP_U_BAD_MMIE) 24 R(RX_DROP_U_BAD_MMIE) \ 25 R(RX_DROP_U_DUP) 25 R(RX_DROP_U_DUP) \ 26 R(RX_DROP_U_SPURIOUS) 26 R(RX_DROP_U_SPURIOUS) \ 27 R(RX_DROP_U_DECRYPT_FAIL) 27 R(RX_DROP_U_DECRYPT_FAIL) \ 28 R(RX_DROP_U_NO_KEY_ID) 28 R(RX_DROP_U_NO_KEY_ID) \ 29 R(RX_DROP_U_BAD_CIPHER) 29 R(RX_DROP_U_BAD_CIPHER) \ 30 R(RX_DROP_U_OOM) 30 R(RX_DROP_U_OOM) \ 31 R(RX_DROP_U_NONSEQ_PN) 31 R(RX_DROP_U_NONSEQ_PN) \ 32 R(RX_DROP_U_BAD_KEY_COLOR) 32 R(RX_DROP_U_BAD_KEY_COLOR) \ 33 R(RX_DROP_U_BAD_4ADDR) 33 R(RX_DROP_U_BAD_4ADDR) \ 34 R(RX_DROP_U_BAD_AMSDU) 34 R(RX_DROP_U_BAD_AMSDU) \ 35 R(RX_DROP_U_BAD_AMSDU_CIPHER) 35 R(RX_DROP_U_BAD_AMSDU_CIPHER) \ 36 R(RX_DROP_U_INVALID_8023) 36 R(RX_DROP_U_INVALID_8023) \ 37 /* 0x10 */ 37 /* 0x10 */ \ 38 R(RX_DROP_U_RUNT_ACTION) 38 R(RX_DROP_U_RUNT_ACTION) \ 39 R(RX_DROP_U_UNPROT_ACTION) 39 R(RX_DROP_U_UNPROT_ACTION) \ 40 R(RX_DROP_U_UNPROT_DUAL) 40 R(RX_DROP_U_UNPROT_DUAL) \ 41 R(RX_DROP_U_UNPROT_UCAST_MGMT) 41 R(RX_DROP_U_UNPROT_UCAST_MGMT) \ 42 R(RX_DROP_U_UNPROT_MCAST_MGMT) 42 R(RX_DROP_U_UNPROT_MCAST_MGMT) \ 43 R(RX_DROP_U_UNPROT_BEACON) 43 R(RX_DROP_U_UNPROT_BEACON) \ 44 R(RX_DROP_U_UNPROT_UNICAST_PUB_ACTION) 44 R(RX_DROP_U_UNPROT_UNICAST_PUB_ACTION) \ 45 R(RX_DROP_U_UNPROT_ROBUST_ACTION) 45 R(RX_DROP_U_UNPROT_ROBUST_ACTION) \ 46 R(RX_DROP_U_ACTION_UNKNOWN_SRC) 46 R(RX_DROP_U_ACTION_UNKNOWN_SRC) \ 47 R(RX_DROP_U_REJECTED_ACTION_RESPONSE) 47 R(RX_DROP_U_REJECTED_ACTION_RESPONSE) \ 48 R(RX_DROP_U_EXPECT_DEFRAG_PROT) 48 R(RX_DROP_U_EXPECT_DEFRAG_PROT) \ 49 R(RX_DROP_U_WEP_DEC_FAIL) 49 R(RX_DROP_U_WEP_DEC_FAIL) \ 50 R(RX_DROP_U_NO_IV) 50 R(RX_DROP_U_NO_IV) \ 51 R(RX_DROP_U_NO_ICV) 51 R(RX_DROP_U_NO_ICV) \ 52 R(RX_DROP_U_AP_RX_GROUPCAST) 52 R(RX_DROP_U_AP_RX_GROUPCAST) \ 53 R(RX_DROP_U_SHORT_MMIC) 53 R(RX_DROP_U_SHORT_MMIC) \ 54 /* 0x20 */ 54 /* 0x20 */ \ 55 R(RX_DROP_U_MMIC_FAIL) 55 R(RX_DROP_U_MMIC_FAIL) \ 56 R(RX_DROP_U_SHORT_TKIP) 56 R(RX_DROP_U_SHORT_TKIP) \ 57 R(RX_DROP_U_TKIP_FAIL) 57 R(RX_DROP_U_TKIP_FAIL) \ 58 R(RX_DROP_U_SHORT_CCMP) 58 R(RX_DROP_U_SHORT_CCMP) \ 59 R(RX_DROP_U_SHORT_CCMP_MIC) 59 R(RX_DROP_U_SHORT_CCMP_MIC) \ 60 R(RX_DROP_U_SHORT_GCMP) 60 R(RX_DROP_U_SHORT_GCMP) \ 61 R(RX_DROP_U_SHORT_GCMP_MIC) 61 R(RX_DROP_U_SHORT_GCMP_MIC) \ 62 R(RX_DROP_U_SHORT_CMAC) 62 R(RX_DROP_U_SHORT_CMAC) \ 63 R(RX_DROP_U_SHORT_CMAC256) 63 R(RX_DROP_U_SHORT_CMAC256) \ 64 R(RX_DROP_U_SHORT_GMAC) 64 R(RX_DROP_U_SHORT_GMAC) \ 65 R(RX_DROP_U_UNEXPECTED_VLAN_4ADDR) 65 R(RX_DROP_U_UNEXPECTED_VLAN_4ADDR) \ 66 R(RX_DROP_U_UNEXPECTED_STA_4ADDR) 66 R(RX_DROP_U_UNEXPECTED_STA_4ADDR) \ 67 R(RX_DROP_U_UNEXPECTED_VLAN_MCAST) 67 R(RX_DROP_U_UNEXPECTED_VLAN_MCAST) \ 68 R(RX_DROP_U_NOT_PORT_CONTROL) 68 R(RX_DROP_U_NOT_PORT_CONTROL) \ 69 R(RX_DROP_U_UNKNOWN_ACTION_REJECTED) << 70 /* this line for the trailing \ - add before t 69 /* this line for the trailing \ - add before this */ 71 70 72 /* having two enums allows for checking ieee80 71 /* having two enums allows for checking ieee80211_rx_result use with sparse */ 73 enum ___mac80211_drop_reason { 72 enum ___mac80211_drop_reason { 74 /* if we get to the end of handlers with RX_CO 73 /* if we get to the end of handlers with RX_CONTINUE this will be the reason */ 75 ___RX_CONTINUE = SKB_CONSUMED, 74 ___RX_CONTINUE = SKB_CONSUMED, 76 75 77 /* this never gets used as an argument to kfre 76 /* this never gets used as an argument to kfree_skb_reason() */ 78 ___RX_QUEUED = SKB_NOT_DROPPED_YET, 77 ___RX_QUEUED = SKB_NOT_DROPPED_YET, 79 78 80 #define ENUM(x) ___ ## x, 79 #define ENUM(x) ___ ## x, 81 ___RX_DROP_MONITOR = SKB_DROP_REASON_S 80 ___RX_DROP_MONITOR = SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR << 82 SKB_DROP_REASON_SUBSYS_SHIFT, 81 SKB_DROP_REASON_SUBSYS_SHIFT, 83 MAC80211_DROP_REASONS_MONITOR(ENUM) 82 MAC80211_DROP_REASONS_MONITOR(ENUM) 84 83 85 ___RX_DROP_UNUSABLE = SKB_DROP_REASON_ 84 ___RX_DROP_UNUSABLE = SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE << 86 SKB_DROP_REASON_SUBSYS_SHIFT, 85 SKB_DROP_REASON_SUBSYS_SHIFT, 87 MAC80211_DROP_REASONS_UNUSABLE(ENUM) 86 MAC80211_DROP_REASONS_UNUSABLE(ENUM) 88 #undef ENUM 87 #undef ENUM 89 }; 88 }; 90 89 91 enum mac80211_drop_reason { 90 enum mac80211_drop_reason { 92 RX_CONTINUE = (__force ieee80211_ 91 RX_CONTINUE = (__force ieee80211_rx_result)___RX_CONTINUE, 93 RX_QUEUED = (__force ieee80211_ 92 RX_QUEUED = (__force ieee80211_rx_result)___RX_QUEUED, 94 RX_DROP_MONITOR = (__force ieee80211_ 93 RX_DROP_MONITOR = (__force ieee80211_rx_result)___RX_DROP_MONITOR, 95 #define DEF(x) x = (__force ieee80211_rx_resul 94 #define DEF(x) x = (__force ieee80211_rx_result)___ ## x, 96 MAC80211_DROP_REASONS_MONITOR(DEF) 95 MAC80211_DROP_REASONS_MONITOR(DEF) 97 MAC80211_DROP_REASONS_UNUSABLE(DEF) 96 MAC80211_DROP_REASONS_UNUSABLE(DEF) 98 #undef DEF 97 #undef DEF 99 }; 98 }; 100 99 101 #define RX_RES_IS_UNUSABLE(result) \ 100 #define RX_RES_IS_UNUSABLE(result) \ 102 (((__force u32)(result) & SKB_DROP_REA 101 (((__force u32)(result) & SKB_DROP_REASON_SUBSYS_MASK) == ___RX_DROP_UNUSABLE) 103 102 104 #endif /* MAC80211_DROP_H */ 103 #endif /* MAC80211_DROP_H */ 105 104
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.