diff options
author | Stefan Sørensen <stefan.sorensen@spectralink.com> | 2015-11-03 03:34:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-03 11:08:22 -0500 |
commit | 5f94c943d5dd4b51f3248193e622dd5fcdbb8b11 (patch) | |
tree | c773bfd331b79873c5f3ed9f1a44e00152ecb06f /net/core/ptp_classifier.c | |
parent | ccf6ee9a6980eff9ec0eeaa8f63c65bff34d9697 (diff) |
ptp: Change ptp_class to a proper bitmask
Change the definition of PTP_CLASS_L2 to not have any bits overlapping with
the other defined protocol values, allowing the PTP_CLASS_* definitions to
be for simple filtering on packet type.
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/ptp_classifier.c')
-rw-r--r-- | net/core/ptp_classifier.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/core/ptp_classifier.c b/net/core/ptp_classifier.c index 4eab4a94a59d..703cf76aa7c2 100644 --- a/net/core/ptp_classifier.c +++ b/net/core/ptp_classifier.c | |||
@@ -58,7 +58,7 @@ | |||
58 | * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these | 58 | * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these |
59 | * ldh [18] ; reload payload | 59 | * ldh [18] ; reload payload |
60 | * and #0xf ; mask PTP_CLASS_VMASK | 60 | * and #0xf ; mask PTP_CLASS_VMASK |
61 | * or #0x70 ; PTP_CLASS_VLAN|PTP_CLASS_L2 | 61 | * or #0xc0 ; PTP_CLASS_VLAN|PTP_CLASS_L2 |
62 | * ret a ; return PTP class | 62 | * ret a ; return PTP class |
63 | * | 63 | * |
64 | * ; PTP over UDP over IPv4 over 802.1Q over Ethernet | 64 | * ; PTP over UDP over IPv4 over 802.1Q over Ethernet |
@@ -73,7 +73,7 @@ | |||
73 | * jneq #319, drop_8021q_ipv4 ; is port PTP_EV_PORT ? | 73 | * jneq #319, drop_8021q_ipv4 ; is port PTP_EV_PORT ? |
74 | * ldh [x + 26] ; load payload | 74 | * ldh [x + 26] ; load payload |
75 | * and #0xf ; mask PTP_CLASS_VMASK | 75 | * and #0xf ; mask PTP_CLASS_VMASK |
76 | * or #0x50 ; PTP_CLASS_VLAN|PTP_CLASS_IPV4 | 76 | * or #0x90 ; PTP_CLASS_VLAN|PTP_CLASS_IPV4 |
77 | * ret a ; return PTP class | 77 | * ret a ; return PTP class |
78 | * drop_8021q_ipv4: ret #0x0 ; PTP_CLASS_NONE | 78 | * drop_8021q_ipv4: ret #0x0 ; PTP_CLASS_NONE |
79 | * | 79 | * |
@@ -86,7 +86,7 @@ | |||
86 | * jneq #319, drop_8021q_ipv6 ; is port PTP_EV_PORT ? | 86 | * jneq #319, drop_8021q_ipv6 ; is port PTP_EV_PORT ? |
87 | * ldh [66] ; load payload | 87 | * ldh [66] ; load payload |
88 | * and #0xf ; mask PTP_CLASS_VMASK | 88 | * and #0xf ; mask PTP_CLASS_VMASK |
89 | * or #0x60 ; PTP_CLASS_VLAN|PTP_CLASS_IPV6 | 89 | * or #0xa0 ; PTP_CLASS_VLAN|PTP_CLASS_IPV6 |
90 | * ret a ; return PTP class | 90 | * ret a ; return PTP class |
91 | * drop_8021q_ipv6: ret #0x0 ; PTP_CLASS_NONE | 91 | * drop_8021q_ipv6: ret #0x0 ; PTP_CLASS_NONE |
92 | * | 92 | * |
@@ -98,7 +98,7 @@ | |||
98 | * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these | 98 | * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these |
99 | * ldh [14] ; reload payload | 99 | * ldh [14] ; reload payload |
100 | * and #0xf ; mask PTP_CLASS_VMASK | 100 | * and #0xf ; mask PTP_CLASS_VMASK |
101 | * or #0x30 ; PTP_CLASS_L2 | 101 | * or #0x40 ; PTP_CLASS_L2 |
102 | * ret a ; return PTP class | 102 | * ret a ; return PTP class |
103 | * drop_ieee1588: ret #0x0 ; PTP_CLASS_NONE | 103 | * drop_ieee1588: ret #0x0 ; PTP_CLASS_NONE |
104 | */ | 104 | */ |
@@ -150,7 +150,7 @@ void __init ptp_classifier_init(void) | |||
150 | { 0x15, 0, 35, 0x00000000 }, | 150 | { 0x15, 0, 35, 0x00000000 }, |
151 | { 0x28, 0, 0, 0x00000012 }, | 151 | { 0x28, 0, 0, 0x00000012 }, |
152 | { 0x54, 0, 0, 0x0000000f }, | 152 | { 0x54, 0, 0, 0x0000000f }, |
153 | { 0x44, 0, 0, 0x00000070 }, | 153 | { 0x44, 0, 0, 0x000000c0 }, |
154 | { 0x16, 0, 0, 0x00000000 }, | 154 | { 0x16, 0, 0, 0x00000000 }, |
155 | { 0x15, 0, 12, 0x00000800 }, | 155 | { 0x15, 0, 12, 0x00000800 }, |
156 | { 0x30, 0, 0, 0x0000001b }, | 156 | { 0x30, 0, 0, 0x0000001b }, |
@@ -162,7 +162,7 @@ void __init ptp_classifier_init(void) | |||
162 | { 0x15, 0, 4, 0x0000013f }, | 162 | { 0x15, 0, 4, 0x0000013f }, |
163 | { 0x48, 0, 0, 0x0000001a }, | 163 | { 0x48, 0, 0, 0x0000001a }, |
164 | { 0x54, 0, 0, 0x0000000f }, | 164 | { 0x54, 0, 0, 0x0000000f }, |
165 | { 0x44, 0, 0, 0x00000050 }, | 165 | { 0x44, 0, 0, 0x00000090 }, |
166 | { 0x16, 0, 0, 0x00000000 }, | 166 | { 0x16, 0, 0, 0x00000000 }, |
167 | { 0x06, 0, 0, 0x00000000 }, | 167 | { 0x06, 0, 0, 0x00000000 }, |
168 | { 0x15, 0, 8, 0x000086dd }, | 168 | { 0x15, 0, 8, 0x000086dd }, |
@@ -172,7 +172,7 @@ void __init ptp_classifier_init(void) | |||
172 | { 0x15, 0, 4, 0x0000013f }, | 172 | { 0x15, 0, 4, 0x0000013f }, |
173 | { 0x28, 0, 0, 0x00000042 }, | 173 | { 0x28, 0, 0, 0x00000042 }, |
174 | { 0x54, 0, 0, 0x0000000f }, | 174 | { 0x54, 0, 0, 0x0000000f }, |
175 | { 0x44, 0, 0, 0x00000060 }, | 175 | { 0x44, 0, 0, 0x000000a0 }, |
176 | { 0x16, 0, 0, 0x00000000 }, | 176 | { 0x16, 0, 0, 0x00000000 }, |
177 | { 0x06, 0, 0, 0x00000000 }, | 177 | { 0x06, 0, 0, 0x00000000 }, |
178 | { 0x15, 0, 7, 0x000088f7 }, | 178 | { 0x15, 0, 7, 0x000088f7 }, |
@@ -181,7 +181,7 @@ void __init ptp_classifier_init(void) | |||
181 | { 0x15, 0, 4, 0x00000000 }, | 181 | { 0x15, 0, 4, 0x00000000 }, |
182 | { 0x28, 0, 0, 0x0000000e }, | 182 | { 0x28, 0, 0, 0x0000000e }, |
183 | { 0x54, 0, 0, 0x0000000f }, | 183 | { 0x54, 0, 0, 0x0000000f }, |
184 | { 0x44, 0, 0, 0x00000030 }, | 184 | { 0x44, 0, 0, 0x00000040 }, |
185 | { 0x16, 0, 0, 0x00000000 }, | 185 | { 0x16, 0, 0, 0x00000000 }, |
186 | { 0x06, 0, 0, 0x00000000 }, | 186 | { 0x06, 0, 0, 0x00000000 }, |
187 | }; | 187 | }; |