Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
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
Software for White Rabbit PTP Core
Commits
f6a899e3
Commit
f6a899e3
authored
May 31, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netif: remove name (was almost unused)
parent
6d679d8b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
39 deletions
+34
-39
board.c
boards/afcz/board.c
+2
-2
board.c
boards/ertm14/board.c
+1
-1
board.c
boards/sis8300ku/board.c
+1
-1
board.c
boards/wr2rf-vme/board.c
+1
-1
netif.c
dev/netif.c
+5
-5
netif.h
include/dev/netif.h
+1
-2
monitor_ppsi.c
monitor/monitor_ppsi.c
+22
-26
wrc_main.c
wrc_main.c
+1
-1
No files found.
boards/afcz/board.c
View file @
f6a899e3
...
...
@@ -765,8 +765,8 @@ int wrc_board_early_init()
net_rst
();
ep_init
(
&
wrc_endpoint_dev
,
(
void
*
)
BASE_WR_ENDPOINT_MAIN
);
ep_init
(
&
board
.
ep_btrain
,
(
void
*
)
BASE_WR_ENDPOINT_BTRAIN
);
netif_register_device
(
"wru0"
,
&
wrc_endpoint_dev
);
netif_register_device
(
"wru1"
,
&
board
.
ep_btrain
);
netif_register_device
(
&
wrc_endpoint_dev
);
netif_register_device
(
&
board
.
ep_btrain
);
#if defined (CONFIG_TARGET_AFCZ_V1)
afczv1_read_persistent_mac
();
...
...
boards/ertm14/board.c
View file @
f6a899e3
...
...
@@ -2506,7 +2506,7 @@ int wrc_board_early_init()
/* reset the networking part of the WRCore and start the WR Endpoint */
ep_init
(
&
wrc_endpoint_dev
,
(
void
*
)
BASE_EP
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
ertm14_mac
);
netif_register_device
(
"wru0"
,
&
wrc_endpoint_dev
);
netif_register_device
(
&
wrc_endpoint_dev
);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
...
...
boards/sis8300ku/board.c
View file @
f6a899e3
...
...
@@ -95,7 +95,7 @@ int wrc_board_early_init()
ep_init
(
&
wrc_endpoint_dev
,
(
void
*
)
BASE_EP
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
board_mac_addr
);
netif_register_device
(
"wru0"
,
&
wrc_endpoint_dev
);
netif_register_device
(
&
wrc_endpoint_dev
);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
...
...
boards/wr2rf-vme/board.c
View file @
f6a899e3
...
...
@@ -118,7 +118,7 @@ int wrc_board_early_init(void)
ep_init
(
&
wrc_endpoint_dev
,
(
void
*
)
BASE_EP
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
board_mac_addr
);
netif_register_device
(
"wru0"
,
&
wrc_endpoint_dev
);
netif_register_device
(
&
wrc_endpoint_dev
);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
...
...
dev/netif.c
View file @
f6a899e3
...
...
@@ -22,19 +22,19 @@
static
unsigned
char
netif_n_count
=
0
;
static
struct
wrc_netif_device
netif_devs
[
WRC_NETIF_MAX_DEVICES
];
int
netif_register_device
(
const
char
*
name
,
struct
wr_endpoint_device
*
ep
)
int
netif_register_device
(
struct
wr_endpoint_device
*
ep
)
{
if
(
netif_n_count
>=
WRC_NETIF_MAX_DEVICES
)
return
-
1
;
struct
wrc_netif_device
*
ndev
=
&
netif_devs
[
netif_n_count
];
netif_n_count
++
;
struct
wrc_netif_device
*
ndev
=
&
netif_devs
[
netif_n_count
];
ndev
->
name
=
name
;
ndev
->
ep
=
ep
;
ndev
->
link_state
=
NETIF_LINK_DOWN
;
dev_dbg
(
"Registered network interface %s @ %p
\n
"
,
ndev
->
name
,
ndev
->
ep
->
base
);
dev_dbg
(
"Registered network interface %u @ %p
\n
"
,
netif_n_count
,
ndev
->
ep
->
base
);
netif_n_count
++
;
return
0
;
}
...
...
include/dev/netif.h
View file @
f6a899e3
...
...
@@ -17,12 +17,11 @@
struct
wrc_netif_device
{
const
char
*
name
;
struct
wr_endpoint_device
*
ep
;
unsigned
char
link_state
;
};
int
netif_register_device
(
const
char
*
name
,
struct
wr_endpoint_device
*
ep
);
int
netif_register_device
(
struct
wr_endpoint_device
*
ep
);
int
netif_get_device_count
(
void
);
struct
wrc_netif_device
*
netif_get_device
(
int
idx
);
int
netif_init
(
void
);
...
...
monitor/monitor_ppsi.c
View file @
f6a899e3
...
...
@@ -229,13 +229,13 @@ static void print_main_description(void)
ndevs
=
netif_get_device_count
();
/*show_ports */
cprintf
(
C_CYAN
,
"---
--
+-------------------+-------------------------+---------+---------+-----
\n
"
);
pp_printf
(
"
Itf
| MAC | IP (source) | RX | TX | VLAN
\n
"
);
pp_printf
(
"---
--
+-------------------+-------------------------+---------+---------+-----
\n
"
);
cprintf
(
C_CYAN
,
"---+-------------------+-------------------------+---------+---------+-----
\n
"
);
pp_printf
(
"
#
| MAC | IP (source) | RX | TX | VLAN
\n
"
);
pp_printf
(
"---+-------------------+-------------------------+---------+---------+-----
\n
"
);
for
(
i
=
0
;
i
<
ndevs
;
i
++
)
{
/* reuse the string above, strings between "|" will be overwritten anyway */
pp_printf
(
"
Itf
| MAC | IP (source) | RX | TX | VLAN
\n
"
);
pp_printf
(
"
#
| MAC | IP (source) | RX | TX | VLAN
\n
"
);
}
pp_printf
(
"
\n
--- HAL ---|------------- PPSI ------------------------------------------------
\n
"
);
...
...
@@ -281,13 +281,13 @@ static void print_port(unsigned i)
char
buf
[
20
];
if
(
port_up
)
{
pcprintf
(
7
,
1
,
C_GREEN
,
" %
s"
,
ndev
->
name
);
pcprintf
(
7
,
1
,
C_GREEN
,
" %
u"
,
i
);
}
else
{
pcprintf
(
7
,
1
,
C_RED
,
"*%
s"
,
ndev
->
name
);
pcprintf
(
7
,
1
,
C_RED
,
"*%
u"
,
i
);
}
format_mac
(
buf
,
ndev
->
ep
->
mac_addr
);
pcprintf
(
7
,
8
,
C_MAGENTA
,
"%s"
,
buf
);
pcprintf
(
7
,
6
,
C_MAGENTA
,
"%s"
,
buf
);
if
(
i
!=
0
)
/* FIXME: should be independent for each interface */
return
;
...
...
@@ -299,22 +299,22 @@ static void print_port(unsigned i)
format_ip
(
buf
,
ip
);
switch
(
ip_status
)
{
case
IP_TRAINING
:
pcprintf
(
7
,
2
8
,
C_RED
,
"BOOTP running "
);
pcprintf
(
7
,
2
6
,
C_RED
,
"BOOTP running "
);
break
;
case
IP_OK_BOOTP
:
pcprintf
(
7
,
2
8
,
C_GREEN
,
"%16s(BOOTP)"
,
buf
);
pcprintf
(
7
,
2
6
,
C_GREEN
,
"%16s(BOOTP)"
,
buf
);
break
;
case
IP_OK_STATIC
:
pcprintf
(
7
,
2
8
,
C_GREEN
,
"%15s(static)"
,
buf
);
pcprintf
(
7
,
2
6
,
C_GREEN
,
"%15s(static)"
,
buf
);
break
;
}
}
else
pcprintf
(
7
,
2
8
,
C_GREEN
,
" "
);
pcprintf
(
7
,
2
6
,
C_GREEN
,
" "
);
minic_get_stats
(
&
tx
,
&
rx
,
&
rx_err
);
pcprintf
(
7
,
5
4
,
C_MAGENTA
,
"%7d"
,
rx
);
pprintf
(
7
,
6
4
,
"%7d"
,
tx
);
pprintf
(
7
,
7
4
,
"%4d"
,
wrc_vlan_number
);
pcprintf
(
7
,
5
2
,
C_MAGENTA
,
"%7d"
,
rx
);
pprintf
(
7
,
6
2
,
"%7d"
,
tx
);
pprintf
(
7
,
7
2
,
"%4d"
,
wrc_vlan_number
);
}
static
void
print_state
(
unsigned
i
)
...
...
@@ -324,19 +324,7 @@ static void print_state(unsigned i)
int
locked
=
spll_check_lock
(
0
);
int
color
;
if
(
port_up
)
{
pcprintf
(
12
,
1
,
C_GREEN
,
" %s"
,
ndev
->
name
);
}
else
{
pcprintf
(
12
,
1
,
C_RED
,
"*%s"
,
ndev
->
name
);
}
pcprintf
(
12
,
8
,
C_GREEN
,
locked
?
"Lck"
:
" "
);
/* ----------------------------------------------------------------------------------------------------------------------- */
/*
* Actually, what is interesting is the PTP state.
* For this lookup, the port in ppsi shmem
*/
/* Assume one instance per port */
/* FIXME: add support of more ports */
// for (j = 0; j < ppg->nlinks; j++) {
...
...
@@ -351,6 +339,14 @@ static void print_state(unsigned i)
char
proto
;
char
mac_buf
[
20
];
if
(
port_up
)
{
pcprintf
(
12
,
1
,
C_GREEN
,
" %s"
,
ppi_pt
->
iface_name
);
}
else
{
pcprintf
(
12
,
1
,
C_RED
,
"*%s"
,
ppi_pt
->
iface_name
);
}
pcprintf
(
12
,
8
,
C_GREEN
,
locked
?
"Lck"
:
" "
);
// Evaluate the instance configuration
if
(
is_slaveOnly
(
ppg
->
defaultDS
))
{
str_config
=
"slaveOnly"
;
...
...
wrc_main.c
View file @
f6a899e3
...
...
@@ -115,7 +115,7 @@ static void wrc_initialize(void)
#ifndef BOARD_HAS_CUSTOM_NETWORK_INIT
net_rst
();
ep_init
(
&
wrc_endpoint_dev
,
(
void
*
)
BASE_EP
);
netif_register_device
(
"wr0"
,
&
wrc_endpoint_dev
);
netif_register_device
(
&
wrc_endpoint_dev
);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
timer_delay_ms
(
200
);
...
...
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