xref: /linux/include/net/dropreason.h (revision baa951a1)
1071c0fc6SJohannes Berg /* SPDX-License-Identifier: GPL-2.0-or-later */
2071c0fc6SJohannes Berg 
3071c0fc6SJohannes Berg #ifndef _LINUX_DROPREASON_H
4071c0fc6SJohannes Berg #define _LINUX_DROPREASON_H
5071c0fc6SJohannes Berg #include <net/dropreason-core.h>
6071c0fc6SJohannes Berg 
7071c0fc6SJohannes Berg /**
8071c0fc6SJohannes Berg  * enum skb_drop_reason_subsys - subsystem tag for (extended) drop reasons
9071c0fc6SJohannes Berg  */
10071c0fc6SJohannes Berg enum skb_drop_reason_subsys {
11071c0fc6SJohannes Berg 	/** @SKB_DROP_REASON_SUBSYS_CORE: core drop reasons defined above */
12071c0fc6SJohannes Berg 	SKB_DROP_REASON_SUBSYS_CORE,
13071c0fc6SJohannes Berg 
14*baa951a1SJohannes Berg 	/**
15*baa951a1SJohannes Berg 	 * @SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE: mac80211 drop reasons
16*baa951a1SJohannes Berg 	 * for unusable frames, see net/mac80211/drop.h
17*baa951a1SJohannes Berg 	 */
18*baa951a1SJohannes Berg 	SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,
19*baa951a1SJohannes Berg 
20*baa951a1SJohannes Berg 	/**
21*baa951a1SJohannes Berg 	 * @SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR: mac80211 drop reasons
22*baa951a1SJohannes Berg 	 * for frames still going to monitor, see net/mac80211/drop.h
23*baa951a1SJohannes Berg 	 */
24*baa951a1SJohannes Berg 	SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR,
25*baa951a1SJohannes Berg 
26071c0fc6SJohannes Berg 	/** @SKB_DROP_REASON_SUBSYS_NUM: number of subsystems defined */
27071c0fc6SJohannes Berg 	SKB_DROP_REASON_SUBSYS_NUM
28071c0fc6SJohannes Berg };
29071c0fc6SJohannes Berg 
30071c0fc6SJohannes Berg struct drop_reason_list {
31071c0fc6SJohannes Berg 	const char * const *reasons;
32071c0fc6SJohannes Berg 	size_t n_reasons;
33071c0fc6SJohannes Berg };
34071c0fc6SJohannes Berg 
35071c0fc6SJohannes Berg /* Note: due to dynamic registrations, access must be under RCU */
36071c0fc6SJohannes Berg extern const struct drop_reason_list __rcu *
37071c0fc6SJohannes Berg drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM];
38071c0fc6SJohannes Berg 
39071c0fc6SJohannes Berg void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,
40071c0fc6SJohannes Berg 				  const struct drop_reason_list *list);
41071c0fc6SJohannes Berg void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys);
42071c0fc6SJohannes Berg 
43071c0fc6SJohannes Berg #endif
44