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
10b922f0
Commit
10b922f0
authored
Mar 05, 2020
by
Jean-Claude BAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SNMP: Fix servo state mapping value for wrsPtpServoStateN
parent
e61524e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
wrsPtpDataTable.c
userspace/snmpd/wrsPtpDataTable.c
+18
-3
wrsPtpDataTable.h
userspace/snmpd/wrsPtpDataTable.h
+7
-1
No files found.
userspace/snmpd/wrsPtpDataTable.c
View file @
10b922f0
...
...
@@ -59,6 +59,14 @@ time_t wrsPtpDataTable_data_fill(unsigned int *n_rows)
struct
wr_servo_ext
*
wr_servo
;
struct
wrh_servo_t
*
wrh_servo
;
char
*
tmp_name
;
static
int
servoStateMapping
[]
=
{
[
WRH_UNINITIALIZED
]
=
PTP_SERVO_STATE_N_UNINTIALIZED
,
[
WRH_SYNC_NSEC
]
=
PTP_SERVO_STATE_N_SYNC_NSEC
,
[
WRH_SYNC_TAI
]
=
PTP_SERVO_STATE_N_SYNC_SEC
,
[
WRH_SYNC_PHASE
]
=
PTP_SERVO_STATE_N_SYNC_PHASE
,
[
WRH_TRACK_PHASE
]
=
PTP_SERVO_STATE_N_TRACK_PHASE
,
[
WRH_WAIT_OFFSET_STABLE
]
=
PTP_SERVO_STATE_N_WAIT_OFFSET_STABLE
,
};
/* number of rows does not change for wrsPortStatusTable */
if
(
n_rows
)
...
...
@@ -139,9 +147,16 @@ time_t wrsPtpDataTable_data_fill(unsigned int *n_rows)
sizeof
(
ppsi_servo
->
servo_state_name
));
/* wrsPtpServoStateN */
ptp_a
[
si
].
wrsPtpServoStateN
=
(
ppsi_i
->
extState
==
PP_EXSTATE_DISABLE
||
ppsi_i
->
extState
==
PP_EXSTATE_PTP
)
?
PTP_SERVO_STATE_N_STANDARD_PTP
:
ppsi_servo
->
state
;
if
(
ppsi_i
->
extState
==
PP_EXSTATE_DISABLE
||
ppsi_i
->
extState
==
PP_EXSTATE_PTP
)
{
ptp_a
[
si
].
wrsPtpServoStateN
=
PTP_SERVO_STATE_N_STANDARD_PTP
;
}
else
{
if
(
ppsi_servo
->
state
>=
0
&&
ppsi_servo
->
state
<
ARRAY_SIZE
(
servoStateMapping
)
)
{
ptp_a
[
si
].
wrsPtpServoStateN
=
servoStateMapping
[
ppsi_servo
->
state
];
}
else
{
ptp_a
[
si
].
wrsPtpServoStateN
=
ppsi_servo
->
state
;
}
}
/* wrsPtpClockOffsetPs */
ptp_a
[
si
].
wrsPtpClockOffsetPs
=
...
...
userspace/snmpd/wrsPtpDataTable.h
View file @
10b922f0
...
...
@@ -7,7 +7,13 @@
* when switchover is implemented */
#define WRS_MAX_N_SERVO_INSTANCES 1
#define PTP_SERVO_STATE_N_STANDARD_PTP 99
#define PTP_SERVO_STATE_N_UNINTIALIZED 0
#define PTP_SERVO_STATE_N_SYNC_NSEC 1
#define PTP_SERVO_STATE_N_SYNC_SEC 2
#define PTP_SERVO_STATE_N_SYNC_PHASE 3
#define PTP_SERVO_STATE_N_TRACK_PHASE 4
#define PTP_SERVO_STATE_N_WAIT_OFFSET_STABLE 5
#define PTP_SERVO_STATE_N_STANDARD_PTP 99
struct
wrsPtpDataTable_s
{
uint32_t
wrsPtpDataIndex
;
/* not reported, index fields has to be marked
...
...
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