History

net: sched: pkt_cls: remove unused macros from uapi

Jamal points out that this header also contains kernel internal magic that cannot be used from userspace for anything meaningful. Lets remove what the kernel doesn't use anymore and wrap remainder with __KERNEL__.

Florian Westphal committed 11 years ago

Commit bd5850d1 parent 2efd0551 file · +5 −27Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/pkt_cls.h+5−27
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 #include <linux/types.h>
55 #include <linux/pkt_sched.h>
66
7+#ifdef __KERNEL__
78 /* I think i could have done better macros ; for now this is stolen from
89 * some arch/mips code - jhs
910 */
@@ -35,23 +36,6 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance · 25 unmodified lines
3536 *
3637 * */
3738
38−#ifndef __KERNEL__
39−/* backwards compat for userspace only */
40−#define TC_MUNGED _TC_MAKEMASK1(0)
41−#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
42−#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
43−
44−#define TC_OK2MUNGE _TC_MAKEMASK1(1)
45−#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
46−#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
47−
48−#define S_TC_VERD _TC_MAKE32(2)
49−#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
50−#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
51−#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
52−#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
53−#endif
54−
5539 #define S_TC_FROM _TC_MAKE32(6)
5640 #define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
5741 #define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
@@ -65,20 +49,16 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance · 7 unmodified lines
6549 #define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
6650 #define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
6751
68−#ifndef __KERNEL__
69−#define S_TC_RTTL _TC_MAKE32(9)
70−#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
71−#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
72−#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
73−#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
74−#endif
75−
7652 #define S_TC_AT _TC_MAKE32(12)
7753 #define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
7854 #define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
7955 #define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
8056 #define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
8157
58+#define MAX_REC_LOOP 4
59+#define MAX_RED_LOOP 4
60+#endif
61+
8262 /* Action attributes */
8363 enum {
8464 TCA_ACT_UNSPEC,
@@ -98,8 +78,6 @@ enum { · 13 unmodified lines
9878 #define TCA_ACT_NOUNBIND 0
9979 #define TCA_ACT_REPLACE 1
10080 #define TCA_ACT_NOREPLACE 0
101−#define MAX_REC_LOOP 4
102−#define MAX_RED_LOOP 4
10381
10482 #define TC_ACT_UNSPEC (-1)
10583 #define TC_ACT_OK 0