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
4cd066de
Commit
4cd066de
authored
11 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
dev/ep_pfilter: class 5 for Etherbone frame, needed for wr-nic project
parent
c60d7a5c
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
+12
-2
12 additions, 2 deletions
dev/ep_pfilter.c
with
12 additions
and
2 deletions
dev/ep_pfilter.c
+
12
−
2
View file @
4cd066de
...
@@ -245,14 +245,24 @@ void pfilter_init_default()
...
@@ -245,14 +245,24 @@ void pfilter_init_default()
pfilter_logic3
(
15
,
10
,
AND
,
7
,
OR
,
14
);
/* r15 = ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
pfilter_logic3
(
15
,
10
,
AND
,
7
,
OR
,
14
);
/* r15 = ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
/* Ethernet = 14 bytes, IPv4 = 20 bytes, offset to dport: 2 = 36/2 = 18 */
/* Ethernet = 14 bytes, IPv4 = 20 bytes, offset to dport: 2 = 36/2 = 18 */
pfilter_cmp
(
18
,
0xebd0
,
0xffff
,
MOV
,
14
);
pfilter_logic2
(
16
,
14
,
OR
,
0
);
/* r16 = 1 when dport = ETHERBONE */
/* pfilter_cmp is able to move values only up to register 15, that's why I use
* here temporarily register 14 and then move value to register 16 using
* pfilter_logic2 */
pfilter_cmp
(
18
,
0x0044
,
0xffff
,
MOV
,
14
);
/* r14 = 1 when dport = BOOTPC */
pfilter_cmp
(
18
,
0x0044
,
0xffff
,
MOV
,
14
);
/* r14 = 1 when dport = BOOTPC */
pfilter_logic3
(
14
,
14
,
AND
,
8
,
AND
,
11
);
/* r14 = BOOTP/UDP/IP(unicast|broadcast) */
pfilter_logic3
(
14
,
14
,
AND
,
8
,
AND
,
11
);
/* r14 = BOOTP/UDP/IP(unicast|broadcast) */
pfilter_logic2
(
15
,
14
,
OR
,
15
);
/* r15 = BOOTP/UDP/IP(unicast|broadcast) or ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
pfilter_logic2
(
15
,
14
,
OR
,
15
);
/* r15 = BOOTP/UDP/IP(unicast|broadcast) or ICMP/IP(unicast) or ARP(broadcast) or PTPv2 */
pfilter_logic2
(
17
,
15
,
OR
,
16
);
/* r17 = r15 or Etherbone */
pfilter_logic3
(
20
,
11
,
AND
,
8
,
OR
,
1
5
);
/* r16 = Something we accept */
pfilter_logic3
(
20
,
11
,
AND
,
8
,
OR
,
1
7
);
/* r16 = Something we accept */
pfilter_logic3
(
R_DROP
,
20
,
OR
,
9
,
NOT
,
0
);
/* None match? drop */
pfilter_logic3
(
R_DROP
,
20
,
OR
,
9
,
NOT
,
0
);
/* None match? drop */
pfilter_logic2
(
R_CLASS
(
5
),
16
,
OR
,
0
);
/* class 5: Etherbone packet => Etherbone Core */
pfilter_logic2
(
R_CLASS
(
7
),
11
,
AND
,
8
);
/* class 7: UDP/IP(unicast|broadcast) => external fabric */
pfilter_logic2
(
R_CLASS
(
7
),
11
,
AND
,
8
);
/* class 7: UDP/IP(unicast|broadcast) => external fabric */
pfilter_logic2
(
R_CLASS
(
6
),
1
,
AND
,
9
);
/* class 6: streamer broadcasts => external fabric */
pfilter_logic2
(
R_CLASS
(
6
),
1
,
AND
,
9
);
/* class 6: streamer broadcasts => external fabric */
pfilter_logic2
(
R_CLASS
(
0
),
15
,
MOV
,
0
);
/* class 0: ICMP/IP(unicast) or ARP(broadcast) or PTPv2 => PTP LM32 core */
pfilter_logic2
(
R_CLASS
(
0
),
15
,
MOV
,
0
);
/* class 0: ICMP/IP(unicast) or ARP(broadcast) or PTPv2 => PTP LM32 core */
...
@@ -267,7 +277,7 @@ void pfilter_init_default()
...
@@ -267,7 +277,7 @@ void pfilter_init_default()
pfilter_logic2
(
R_CLASS
(
6
),
11
,
MOV
,
0
);
/* class 6: streamer broadcasts =>
pfilter_logic2
(
R_CLASS
(
6
),
11
,
MOV
,
0
);
/* class 6: streamer broadcasts =>
external fabric */
external fabric */
pfilter_logic2
(
R_CLASS
(
0
),
10
,
MOV
,
0
);
/* class 0: PTP frames => LM32 */
pfilter_logic2
(
R_CLASS
(
0
),
10
,
MOV
,
0
);
/* class 0: PTP frames => LM32 */
#endif
#endif
pfilter_load
();
pfilter_load
();
...
...
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