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
35f2267e
Commit
35f2267e
authored
Oct 07, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes to rest of WRPC sw after merging LLRF stuff
parent
8ba6a5bf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
16 deletions
+18
-16
board.c
boards/generic/board.c
+1
-1
board.c
boards/pxie-fmc/board.c
+1
-1
board.c
boards/sis8300ku/board.c
+1
-1
arp.c
lib/arp.c
+1
-1
bootp.c
lib/bootp.c
+3
-3
ipv4.c
lib/ipv4.c
+2
-1
lldp.c
lib/lldp.c
+3
-3
snmp.c
lib/snmp.c
+1
-1
syslog.c
lib/syslog.c
+4
-3
wrc_main_sim.c
wrc_main_sim.c
+1
-1
No files found.
boards/generic/board.c
View file @
35f2267e
...
...
@@ -72,7 +72,7 @@ int wrc_board_early_init()
mac_addr
[
4
]
=
0x66
;
mac_addr
[
5
]
=
0x77
;
}
ep_set_mac_addr
(
mac_addr
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
mac_addr
);
return
0
;
}
...
...
boards/pxie-fmc/board.c
View file @
35f2267e
...
...
@@ -60,7 +60,7 @@ int wrc_board_early_init()
mac_addr
[
4
]
=
0x66
;
mac_addr
[
5
]
=
0x77
;
}
ep_set_mac_addr
(
mac_addr
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
mac_addr
);
return
0
;
}
...
...
boards/sis8300ku/board.c
View file @
35f2267e
...
...
@@ -65,7 +65,7 @@ int wrc_board_early_init()
board_dbg
(
"Board MAC Address: %02x:%02x:%02x:%02x:%02x:%02x
\n
"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
]);
ep_set_mac_addr
(
mac
);
ep_set_mac_addr
(
&
wrc_endpoint_dev
,
mac
);
spll_set_aux_mode
(
0
,
SPLL_AUX_MODE_TRACKING_SOURCE
);
spll_set_aux_mode
(
1
,
SPLL_AUX_MODE_TRACKING_SOURCE
);
...
...
lib/arp.c
View file @
35f2267e
...
...
@@ -77,7 +77,7 @@ static int process_arp(uint8_t * buf, int len)
buf
[
ARP_OPER
+
0
]
=
0
;
buf
[
ARP_OPER
+
1
]
=
2
;
// my MAC+IP
ep_get_mac_addr
(
buf
+
ARP_SHA
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
buf
+
ARP_SHA
);
memcpy
(
buf
+
ARP_SPA
,
myIP
,
4
);
// his MAC+IP
memcpy
(
buf
+
ARP_THA
,
hisMAC
,
6
);
...
...
lib/bootp.c
View file @
35f2267e
...
...
@@ -40,7 +40,7 @@ int prepare_bootp(struct wr_sockaddr *addr, uint8_t * buf, int retry)
buf
[
BOOTP_HOPS
]
=
0
;
/* A unique identifier for the request !!! FIXME */
ep_get_mac_addr
(
buf
+
BOOTP_XID
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
buf
+
BOOTP_XID
);
buf
[
BOOTP_XID
+
0
]
^=
buf
[
BOOTP_XID
+
4
];
buf
[
BOOTP_XID
+
1
]
^=
buf
[
BOOTP_XID
+
5
];
buf
[
BOOTP_XID
+
2
]
^=
(
retry
>>
8
)
&
0xFF
;
...
...
@@ -56,7 +56,7 @@ int prepare_bootp(struct wr_sockaddr *addr, uint8_t * buf, int retry)
memset
(
buf
+
BOOTP_GIADDR
,
0
,
4
);
memset
(
buf
+
BOOTP_CHADDR
,
0
,
16
);
ep_get_mac_addr
(
buf
+
BOOTP_CHADDR
);
/* own MAC address */
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
buf
+
BOOTP_CHADDR
);
/* own MAC address */
memset
(
buf
+
BOOTP_SNAME
,
0
,
64
);
/* desired BOOTP server */
memset
(
buf
+
BOOTP_FILE
,
0
,
128
);
/* desired BOOTP file */
...
...
@@ -81,7 +81,7 @@ int process_bootp(uint8_t * buf, int len)
uint8_t
mac
[
6
];
uint8_t
ip
[
4
];
ep_get_mac_addr
(
mac
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
mac
);
if
(
len
!=
BOOTP_END
)
return
0
;
...
...
lib/ipv4.c
View file @
35f2267e
...
...
@@ -14,6 +14,7 @@
#include "ipv4.h"
#include "ptpd_netif.h"
#include "dev/pps_gen.h"
#include "dev/netif.h"
#include "hw/etherbone-config.h"
enum
ip_status
ip_status
=
IP_TRAINING
;
...
...
@@ -172,7 +173,7 @@ int ipv4_poll(void)
{
int
ret
=
0
;
if
(
link_status
==
LINK_WENT_UP
&&
ip_status
==
IP_OK_BOOTP
)
if
(
link_status
==
NETIF_
LINK_WENT_UP
&&
ip_status
==
IP_OK_BOOTP
)
ip_status
=
IP_TRAINING
;
ret
=
bootp_poll
();
...
...
lib/lldp.c
View file @
35f2267e
...
...
@@ -48,7 +48,7 @@ static void fill_mac(uint8_t *tlv, uint8_t type)
{
*
tlv
=
type
;
/* write MAC after subtype byte */
ep_get_mac_addr
(
tlv
+
LLDP_SUBTYPE
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
tlv
+
LLDP_SUBTYPE
);
}
static
void
lldp_add_tlv
(
int
tlv_type
)
{
...
...
@@ -119,7 +119,7 @@ static void lldp_add_tlv(int tlv_type) {
(
char
*
)
buf
);
}
else
{
/* NOTE: no subtype */
ep_get_mac_addr
(
mac
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
mac
);
pp_sprintf
(
buf
,
"%02x:%02x:%02x:%02x:%02x:%02x"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
...
...
@@ -251,7 +251,7 @@ int lldp_poll(void)
/* periodic tasks */
if
(
ticks
>
LLDP_TX_TICK_INTERVAL
)
{
ep_get_mac_addr
(
new_mac
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
new_mac
);
if
(
HAS_IP
)
{
getIP
(
&
new_ipWR
);
}
...
...
lib/snmp.c
View file @
35f2267e
...
...
@@ -934,7 +934,7 @@ static int get_port(uint8_t *buf, struct snmp_oid *obj)
switch
((
int
)
obj
->
p
)
{
case
(
int
)
PORT_LINK_STATUS
:
/* overkill, since we need the link to be up to use SNMP */
tmp_int32
=
1
+
ep_link_up
(
NULL
);
tmp_int32
=
1
+
ep_link_up
(
&
wrc_endpoint_dev
,
NULL
);
return
get_value
(
buf
,
obj
->
asn
,
&
tmp_int32
);
default:
break
;
...
...
lib/syslog.c
View file @
35f2267e
...
...
@@ -6,6 +6,7 @@
#include "dev/minic.h"
#include "shell.h"
#include "dev/pps_gen.h"
#include "dev/netif.h"
#include "ipv4.h"
...
...
@@ -130,7 +131,7 @@ int syslog_poll(void)
if
(
!
tics
)
{
/* first time ever, or new syslog server */
tics
=
now
-
1
;
ep_get_mac_addr
(
mac
);
ep_get_mac_addr
(
&
wrc_endpoint_dev
,
mac
);
len
=
syslog_header
(
buf
,
SYSLOG_DEFAULT_LEVEL
,
ip
);
len
+=
pp_sprintf
(
buf
+
len
,
"(%s) Node up "
"since %i seconds"
,
format_mac
(
b
,
mac
),
...
...
@@ -138,9 +139,9 @@ int syslog_poll(void)
goto
send
;
}
if
(
link_status
==
LINK_WENT_DOWN
)
if
(
link_status
==
NETIF_
LINK_WENT_DOWN
)
down_tics
=
now
;
if
(
link_status
==
LINK_UP
&&
down_tics
)
{
if
(
link_status
==
NETIF_
LINK_UP
&&
down_tics
)
{
down_tics
=
now
-
down_tics
;
len
=
syslog_header
(
buf
,
SYSLOG_DEFAULT_LEVEL
,
ip
);
len
+=
pp_sprintf
(
buf
+
len
,
"Link up after %i.%03i s"
,
...
...
wrc_main_sim.c
View file @
35f2267e
...
...
@@ -110,7 +110,7 @@ static void wrc_sim_initialize(void)
shw_pps_gen_init
();
spll_very_init
();
/* wait for link up before enabling tm_time_valid_o */
while
(
ep_link_up
(
NULL
)
==
0
)
{}
while
(
ep_link_up
(
&
wrc_endpoint_dev
,
NULL
)
==
0
)
{}
shw_pps_gen_enable_output
(
1
);
}
/*
...
...
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