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
18d1b7e0
Commit
18d1b7e0
authored
Apr 11, 2022
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move wrc_hw_name to wrc_global_link, constify wrc_global
parent
2282fd2e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
12 deletions
+9
-12
dump-info.c
dump-info.c
+1
-1
wrc_global.h
include/wrc_global.h
+2
-5
lldp.c
lib/lldp.c
+2
-2
snmp.c
lib/snmp.c
+1
-1
monitor_ppsi.c
monitor/monitor_ppsi.c
+1
-1
wrc_main.c
wrc_main.c
+2
-2
No files found.
dump-info.c
View file @
18d1b7e0
...
...
@@ -17,7 +17,6 @@ struct dump_info dump_wrpc_info[] = {
DUMP_HEADER
(
"wrc_global"
),
DUMP_FIELD
(
uint32_t
,
magic
),
DUMP_FIELD
(
uint32_t
,
version
),
DUMP_FIELD_SIZE
(
char
,
wrc_hw_name
,
HW_NAME_LENGTH
),
DUMP_FIELD
(
pointer
,
link_status
),
DUMP_FIELD
(
int
,
task_list_max
),
DUMP_FIELD
(
pointer
,
task_list
),
...
...
@@ -32,6 +31,7 @@ struct dump_info dump_wrpc_info[] = {
#define DUMP_STRUCT struct wrc_global_link
DUMP_HEADER
(
"wrc_global_link"
),
DUMP_FIELD
(
uint32_t
,
version
),
DUMP_FIELD_SIZE
(
char
,
wrc_hw_name
,
HW_NAME_LENGTH
),
DUMP_FIELD
(
link_up_status
,
link_up
),
DUMP_FIELD
(
int
,
vlan
),
DUMP_FIELD
(
ip_addr_status
,
ip_status
),
...
...
include/wrc_global.h
View file @
18d1b7e0
...
...
@@ -10,6 +10,7 @@
struct
wrc_global_link
{
uint32_t
version
;
char
wrc_hw_name
[
HW_NAME_LENGTH
];
int
link_up
;
int
vlan
;
enum
ip_status
ip_status
;
...
...
@@ -20,7 +21,6 @@ struct wrc_global_link {
struct
wrc_global
{
uint32_t
magic
;
uint32_t
version
;
char
wrc_hw_name
[
HW_NAME_LENGTH
];
struct
wrc_global_link
*
link_status
;
int
task_list_max
;
struct
wrc_task
*
task_list
;
...
...
@@ -30,12 +30,9 @@ struct wrc_global {
struct
spll_fifo_log
*
pll_fifo
;
struct
sfp_info
*
sfp_info
;
void
*
config
;
/* Pointer to the board specific data. Use wrc_hw_name to identify
* a board */
void
*
board_specific
;
};
extern
struct
wrc_global_link
wrc_global_link
;
extern
struct
wrc_global
wrc_global
;
extern
const
struct
wrc_global
wrc_global
;
#endif
lib/lldp.c
View file @
18d1b7e0
...
...
@@ -138,8 +138,8 @@ static void lldp_add_tlv(int tlv_type) {
pdu_p
=
&
lldpdu
[
lldpdu_len
+
LLDP_HEADER
];
/* TLV Info srting */
strncpy
((
char
*
)(
pdu_p
),
wrc_global
.
wrc_hw_name
,
HW_NAME_LENGTH
-
1
);
pdu_p
+=
strnlen
(
wrc_global
.
wrc_hw_name
,
HW_NAME_LENGTH
-
1
);
strncpy
((
char
*
)(
pdu_p
),
wrc_global
_link
.
wrc_hw_name
,
HW_NAME_LENGTH
-
1
);
pdu_p
+=
strnlen
(
wrc_global
_link
.
wrc_hw_name
,
HW_NAME_LENGTH
-
1
);
strcpy
((
char
*
)(
pdu_p
),
": "
);
pdu_p
+=
2
;
/* length of ": " */
strncpy
((
char
*
)(
pdu_p
),
build_revision
,
32
);
...
...
lib/snmp.c
View file @
18d1b7e0
...
...
@@ -437,7 +437,7 @@ static const uint8_t oid_wrpcShellCmdReturnCode[] = {4,0};
OIDs */
/* wrpcVersionGroup */
static
const
struct
snmp_oid
oid_array_wrpcVersionGroup
[]
=
{
OID_FIELD_VAR
(
oid_wrpcVersionHwType
,
get_p
,
NO_SET
,
ASN_OCTET_STR
,
(
void
*
)
&
wrc_global
.
wrc_hw_name
),
OID_FIELD_VAR
(
oid_wrpcVersionHwType
,
get_p
,
NO_SET
,
ASN_OCTET_STR
,
(
void
*
)
&
wrc_global
_link
.
wrc_hw_name
),
OID_FIELD_VAR
(
oid_wrpcVersionSwVersion
,
get_pp
,
NO_SET
,
ASN_OCTET_STR
,
(
void
*
)
&
build_revision
),
OID_FIELD_VAR
(
oid_wrpcVersionSwBuildBy
,
get_pp
,
NO_SET
,
ASN_OCTET_STR
,
(
void
*
)
&
build_by
),
OID_FIELD_VAR
(
oid_wrpcVersionSwBuildDate
,
get_p
,
NO_SET
,
ASN_OCTET_STR
,
(
void
*
)
&
snmp_build_date
),
...
...
monitor/monitor_ppsi.c
View file @
18d1b7e0
...
...
@@ -240,7 +240,7 @@ static void print_main_description(void)
int
ndevs
;
pcprintf
(
1
,
1
,
C_BLUE
,
"%s WR PTP Core Sync Monitor %s"
,
wrc_global
.
wrc_hw_name
,
build_revision
);
wrc_global_link
.
wrc_hw_name
,
build_revision
);
cprintf
(
C_MAGENTA
,
"
\n
Esc or q = exit; r = redraw GUI"
);
cprintf
(
C_BLUE
,
"
\n\n
TAI Time:%22sUTC offset:"
,
""
);
...
...
wrc_main.c
View file @
18d1b7e0
...
...
@@ -77,7 +77,7 @@ struct wrc_global_link wrc_global_link = {
.
ip_status
=
IP_TRAINING
,
};
struct
wrc_global
wrc_global
=
{
const
struct
wrc_global
wrc_global
=
{
.
magic
=
WRC_G_MAGIC
,
.
version
=
WRC_G_VERSION
,
.
link_status
=
&
wrc_global_link
,
...
...
@@ -111,7 +111,7 @@ static void wrc_initialize(void)
wdiags_init
();
pp_printf
(
"WR Core: starting up...
\n
"
);
get_hw_name
(
wrc_global
.
wrc_hw_name
);
get_hw_name
(
wrc_global
_link
.
wrc_hw_name
);
#ifndef BOARD_HAS_CUSTOM_NETWORK_INIT
net_rst
();
...
...
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