Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
7a62875c
Commit
7a62875c
authored
Apr 20, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/wrsw_rtud: removed hardcoded NIC_PORT, use num_physical_ports from HAL instead
parent
8090998d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
rtu.h
userspace/wrsw_rtud/rtu.h
+1
-2
rtud.c
userspace/wrsw_rtud/rtud.c
+10
-6
No files found.
userspace/wrsw_rtud/rtu.h
View file @
7a62875c
...
...
@@ -48,8 +48,7 @@
#define ENTRY_WORDS 8
#define MIN_PORT 0
#define MAX_PORT 5
#define NIC_PORT 6
#define MAX_PORT 14
// Maximum number of supported VLANs
#define NUM_VLANS 4096
...
...
userspace/wrsw_rtud/rtud.c
View file @
7a62875c
...
...
@@ -63,18 +63,22 @@ static int rtu_create_static_entries()
int
i
,
err
;
uint32_t
enabled_port_mask
=
0
;
// packets addressed to WR card interfaces are forwarded to NIC virtual port
halexp_query_ports
(
&
plist
);
TRACE
(
TRACE_INFO
,
"Number of physical ports: %d, active ports: %d
\n
"
,
plist
.
num_physical_ports
,
plist
.
num_ports
);
// VLAN-aware Bridge reserved addresses (802.1Q-2005 Table 8.1)
TRACE
(
TRACE_INFO
,
"adding static routes for slow protocols..."
);
for
(
i
=
0
;
i
<
NUM_RESERVED_ADDR
;
i
++
)
{
slow_proto_mac
[
5
]
=
i
;
err
=
rtu_fd_create_entry
(
slow_proto_mac
,
0
,
(
1
<<
NIC_PORT
),
STATIC
);
err
=
rtu_fd_create_entry
(
slow_proto_mac
,
0
,
(
1
<<
plist
.
num_physical_ports
),
STATIC
);
if
(
err
)
return
err
;
}
// packets addressed to WR card interfaces are forwarded to NIC virtual port
halexp_query_ports
(
&
plist
);
for
(
i
=
0
;
i
<
plist
.
num_ports
;
i
++
)
{
halexp_get_port_state
(
&
pstate
,
plist
.
port_names
[
i
]);
enabled_port_mask
|=
(
1
<<
pstate
.
hw_index
);
...
...
@@ -85,15 +89,15 @@ static int rtu_create_static_entries()
pstate
.
hw_index
,
mac_to_string
(
pstate
.
hw_addr
)
);
err
=
rtu_fd_create_entry
(
pstate
.
hw_addr
,
0
,
(
1
<<
NIC_PORT
),
STATIC
);
err
=
rtu_fd_create_entry
(
pstate
.
hw_addr
,
0
,
(
1
<<
plist
.
num_physical_ports
),
STATIC
);
if
(
err
)
return
err
;
}
// Broadcast MAC
TRACE
(
TRACE_INFO
,
"adding static route for broadcast MAC..."
);
err
=
rtu_fd_create_entry
(
bcast_mac
,
0
,
enabled_port_mask
|
(
1
<<
NIC_PORT
),
STATIC
);
err
=
rtu_fd_create_entry
(
ptp_mcast_mac
,
0
,
(
1
<<
NIC_PORT
),
STATIC
);
err
=
rtu_fd_create_entry
(
bcast_mac
,
0
,
enabled_port_mask
|
(
1
<<
plist
.
num_physical_ports
),
STATIC
);
err
=
rtu_fd_create_entry
(
ptp_mcast_mac
,
0
,
(
1
<<
plist
.
num_physical_ports
),
STATIC
);
if
(
err
)
return
err
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment