Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
f14462b0
Commit
f14462b0
authored
12 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Plain Diff
Merge branch 'eb_pfilter_fix'
parents
d8be9e5b
f7bd54f8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/ep_pfilter.c
+21
-1
21 additions, 1 deletion
dev/ep_pfilter.c
with
21 additions
and
1 deletion
dev/ep_pfilter.c
+
21
−
1
View file @
f14462b0
...
...
@@ -223,6 +223,8 @@ void pfilter_init_default()
{
pfilter_new
();
pfilter_nop
();
#if WITH_ETHERBONE != 0
pfilter_cmp
(
0
,
0xffff
,
0xffff
,
MOV
,
1
);
pfilter_cmp
(
1
,
0xffff
,
0xffff
,
AND
,
1
);
pfilter_cmp
(
2
,
0xffff
,
0xffff
,
AND
,
1
);
/* r1 = 1 when dst mac is broadcast */
...
...
@@ -257,6 +259,24 @@ void pfilter_init_default()
pfilter_logic2
(
R_CLASS
(
7
),
11
,
AND
,
8
);
/* class 7: UDP/IP(unicast|broadcast) => external fabric */
pfilter_logic2
(
R_CLASS
(
0
),
15
,
MOV
,
0
);
/* class 0: ICMP/IP(unicast) or ARP(broadcast) or PTPv2 => PTP LM32 core */
pfilter_load
();
pfilter_load
();
#else
pfilter_new
();
pfilter_nop
();
pfilter_cmp
(
0
,
0xffff
,
0xffff
,
MOV
,
1
);
pfilter_cmp
(
1
,
0xffff
,
0xffff
,
AND
,
1
);
pfilter_cmp
(
2
,
0xffff
,
0xffff
,
AND
,
1
);
/* r1 = 1 when dst mac is broadcast */
pfilter_cmp
(
0
,
0x011b
,
0xffff
,
MOV
,
2
);
pfilter_cmp
(
1
,
0x1900
,
0xffff
,
AND
,
2
);
pfilter_cmp
(
2
,
0x0000
,
0xffff
,
AND
,
2
);
/* r2 = 1 when dst mac is PTP multicast (01:1b:19:00:00:00) */
pfilter_cmp
(
0
,
EP
->
MACH
&
0xffff
,
0xffff
,
MOV
,
3
);
pfilter_cmp
(
1
,
EP
->
MACL
>>
16
,
0xffff
,
AND
,
3
);
pfilter_cmp
(
2
,
EP
->
MACL
&
0xffff
,
0xffff
,
AND
,
3
);
/* r3 = 1 when the packet is unicast to our own MAC */
pfilter_cmp
(
6
,
0x88f7
,
0xffff
,
MOV
,
5
);
/* r5 = 1 when ethertype = PTPv2 */
pfilter_logic3
(
6
,
3
,
OR
,
2
,
AND
,
5
);
/* r6 = PTPv2(multicast or unicast) */
pfilter_logic2
(
R_CLASS
(
7
),
6
,
NOT
,
0
);
/* class 7: not PTP => external fabric */
pfilter_logic2
(
R_CLASS
(
0
),
6
,
MOV
,
0
);
/* class 0: PTPv2 => PTP LM32 core */
pfilter_load
();
#endif
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment