Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PTP noposix stack
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
PTP noposix stack
Commits
c9c5dca0
Commit
c9c5dca0
authored
Apr 24, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ptpd: disable port (go to PTP_DISABLED state) if WR link setup fails
parent
b71700e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
constants.h
PTPWRd/constants.h
+1
-0
datatypes.h
PTPWRd/datatypes.h
+1
-0
startup.c
PTPWRd/dep/startup.c
+4
-1
ptpd.c
PTPWRd/ptpd.c
+1
-0
wr_protocol.c
PTPWRd/wr_protocol.c
+8
-4
No files found.
PTPWRd/constants.h
View file @
c9c5dca0
...
...
@@ -59,6 +59,7 @@
#endif
#define DEFAULT_PARENTS_STATS FALSE
#define DEFAULT_DISABLE_FALLBACK_WHEN_WR_FAILS TRUE
/* features, only change to refelect changes in implementation */
#define NUMBER_PORTS 2
...
...
PTPWRd/datatypes.h
View file @
c9c5dca0
...
...
@@ -707,6 +707,7 @@ typedef struct {
Boolean
autoPortDiscovery
;
Boolean
primarySource
;
Boolean
masterOnly
;
Boolean
disableFallbackIfWRFails
;
}
RunTimeOpts
;
#endif
/*DATATYPES_H_*/
PTPWRd/dep/startup.c
View file @
c9c5dca0
...
...
@@ -65,7 +65,7 @@ PtpPortDS * ptpdStartup(int argc, char **argv, Integer16 *ret, RunTimeOpts *rtOp
int
startupMode
=
DEFAULT_STARTUP_MODE
;
//1=> daemon, 0=>nondaemon
/* parse command line arguments */
while
(
(
c
=
getopt
(
argc
,
argv
,
"?cf:dDABMSNPxta:w:M:b:1:2:3:u:l:o:n:y:m:gv:r:s:p:q:i:eh"
))
!=
-
1
)
{
while
(
(
c
=
getopt
(
argc
,
argv
,
"?cf:dDABMSNPxta:w:M:b:1:2:3:u:l:o:n:y:m:g
:
v:r:s:p:q:i:eh"
))
!=
-
1
)
{
switch
(
c
)
{
case
'?'
:
printf
(
...
...
@@ -85,6 +85,7 @@ PtpPortDS * ptpdStartup(int argc, char **argv, Integer16 *ret, RunTimeOpts *rtOp
"-r NUMBER specify system clock accuracy
\n
"
"-v NUMBER specify system clock class
\n
"
"-p NUMBER specify priority1 attribute
\n
"
"-g [0/1] enable/disable fallback to standard PTP mode in case of WR initialization failure
\n
"
"-d run in daemon mode !!!
\n
"
"-c run in non-daemon mode
\n
"
"-A WR: hands free - multiport mode, autodetection of ports and interfaces ,"
...
...
@@ -194,6 +195,8 @@ PtpPortDS * ptpdStartup(int argc, char **argv, Integer16 *ret, RunTimeOpts *rtOp
// break;
case
'g'
:
rtOpts
->
disableFallbackIfWRFails
=
strtol
(
optarg
,
0
,
0
)
?
TRUE
:
FALSE
;
break
;
// case 's':
...
...
PTPWRd/ptpd.c
View file @
c9c5dca0
...
...
@@ -39,6 +39,7 @@ RunTimeOpts rtOpts = {
.
wrStateTimeout
=
WR_DEFAULT_STATE_TIMEOUT_MS
,
.
phyCalibrationRequired
=
WR_DEFAULT_PHY_CALIBRATION_REQUIRED
,
.
masterOnly
=
FALSE
,
.
disableFallbackIfWRFails
=
DEFAULT_DISABLE_FALLBACK_WHEN_WR_FAILS
/********************************************************/
};
...
...
PTPWRd/wr_protocol.c
View file @
c9c5dca0
...
...
@@ -206,16 +206,20 @@ void wrTimerExpired(UInteger8 currentState, RunTimeOpts *rtOpts, PtpPortDS *ptpP
}
else
{
PTPD_TRACE
(
TRACE_WR_PROTO
,
ptpPortDS
,
"WR_Slave_TIMEOUT: state[=%d] timeout, repeated %d times, going to Standard PTP
\n
"
,
\
//
PTPD_TRACE(TRACE_WR_PROTO, ptpPortDS,"WR_Slave_TIMEOUT: state[=%d] timeout, repeated %d times, going to Standard PTP\n", \
currentState
,
ptpPortDS
->
currentWRstateCnt
);
ptpPortDS
->
wrModeON
=
FALSE
;
toWRState
(
WRS_IDLE
,
rtOpts
,
ptpPortDS
);
if
(
wrMode
==
WR_MASTER
)
if
(
rtOpts
->
disableFallbackIfWRFails
)
{
PTPD_TRACE
(
TRACE_WR_PROTO
,
ptpPortDS
,
"WR_Slave_TIMEOUT: state[=%d] timeout, disabling port (standard PTP fallback OFF).
\n
"
,
currentState
);
toState
(
PTP_DISABLED
,
rtOpts
,
ptpPortDS
);
}
else
if
(
wrMode
==
WR_MASTER
)
toState
(
PTP_MASTER
,
rtOpts
,
ptpPortDS
);
else
toState
(
PTP_SLAVE
,
rtOpts
,
ptpPortDS
);
else
toState
(
PTP_SLAVE
,
rtOpts
,
ptpPortDS
);
/*
* RE-INITIALIZATION OF White Rabbit Data Sets
* (chapter (Re-)Initialization of wrspec
...
...
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