Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
12615dab
Commit
12615dab
authored
Apr 21, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include/ppsi/ieee1588_types: add MECH_ prefix to ENDelayMechanism values
Signed-off-by:
Adam Wujek
<
adam.wujek@creotech.pl
>
parent
f8cc9692
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
unix-startup.c
arch-unix/unix-startup.c
+1
-1
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+3
-3
ieee1588_types.h
include/ppsi/ieee1588_types.h
+5
-5
ppsi.h
include/ppsi/ppsi.h
+2
-2
bare-startup.c
lib-bare/bare-startup.c
+1
-1
conf.c
lib/conf.c
+2
-2
common-fun-p2p.c
proto-standard/common-fun-p2p.c
+4
-4
open-close.c
proto-standard/open-close.c
+1
-1
state-master.c
proto-standard/state-master.c
+1
-1
No files found.
arch-unix/unix-startup.c
View file @
12615dab
...
...
@@ -68,7 +68,7 @@ int main(int argc, char **argv)
ppi
=
INST
(
ppg
,
i
);
ppi
->
proto
=
PP_DEFAULT_PROTO
;
ppi
->
role
=
PP_DEFAULT_ROLE
;
ppi
->
delayMechanism
=
E2E
;
ppi
->
delayMechanism
=
MECH_
E2E
;
}
/* Set offset here, so config parsing can override it */
...
...
arch-wrpc/wrc_ptp_ppsi.c
View file @
12615dab
...
...
@@ -83,7 +83,7 @@ struct pp_instance ppi_static = {
.
t_ops
=
&
wrpc_time_ops
,
.
vlans_array_len
=
CONFIG_VLAN_ARRAY_SIZE
,
.
proto
=
PP_DEFAULT_PROTO
,
.
delayMechanism
=
E2E
,
/* until changed by cfg */
.
delayMechanism
=
MECH_
E2E
,
/* until changed by cfg */
.
iface_name
=
"wr0"
,
.
port_name
=
"wr0"
,
.
__tx_buffer
=
__tx_buffer
,
...
...
@@ -227,8 +227,8 @@ int wrc_ptp_sync_mech(int e2e_p2p_qry)
return
ppi
->
delayMechanism
;
switch
(
e2e_p2p_qry
)
{
case
E2E
:
case
P2P
:
case
MECH_
E2E
:
case
MECH_
P2P
:
running
=
wrc_ptp_run
(
-
1
);
wrc_ptp_run
(
0
);
ppi
->
delayMechanism
=
e2e_p2p_qry
;
...
...
include/ppsi/ieee1588_types.h
View file @
12615dab
...
...
@@ -424,11 +424,11 @@ enum ENTimeSource {
/* Enumeration Delay mechanism (table 21, page 126) */
enum
ENDelayMechanism
{
E2E
=
1
,
P2P
=
2
,
COMMON_P2P
=
3
,
SPECIAL
=
4
,
NO_MECHANISM
=
0xFE
MECH_E2E
=
1
,
MECH_P2P
=
2
,
MECH_COMMON_P2P
=
3
,
MECH_SPECIAL
=
4
,
MECH_NO_MECHANISM
=
0xFE
};
/* clockAccuracy enumeration (table 5) */
...
...
include/ppsi/ppsi.h
View file @
12615dab
...
...
@@ -176,11 +176,11 @@ static inline int is_externalPortConfigurationEnabled (defaultDS_t *def) {
}
static
inline
int
is_delayMechanismP2P
(
struct
pp_instance
*
ppi
)
{
return
CONFIG_HAS_P2P
&&
ppi
->
delayMechanism
==
P2P
;
return
CONFIG_HAS_P2P
&&
ppi
->
delayMechanism
==
MECH_
P2P
;
}
static
inline
int
is_delayMechanismE2E
(
struct
pp_instance
*
ppi
)
{
return
CONFIG_HAS_P2P
==
0
||
ppi
->
delayMechanism
==
E2E
;
return
CONFIG_HAS_P2P
==
0
||
ppi
->
delayMechanism
==
MECH_
E2E
;
}
static
inline
int
is_slaveOnly
(
defaultDS_t
*
def
)
{
...
...
lib-bare/bare-startup.c
View file @
12615dab
...
...
@@ -43,7 +43,7 @@ static struct pp_instance ppi_static = {
.
port_name
=
"eth0"
,
.
vlans_array_len
=
CONFIG_VLAN_ARRAY_SIZE
,
.
proto
=
PP_DEFAULT_PROTO
,
.
delayMechanism
=
CONFIG_HAS_P2P
?
P2P
:
E2E
,
.
delayMechanism
=
CONFIG_HAS_P2P
?
MECH_P2P
:
MECH_
E2E
,
.
__tx_buffer
=
__tx_buffer
,
.
__rx_buffer
=
__rx_buffer
,
};
...
...
lib/conf.c
View file @
12615dab
...
...
@@ -310,9 +310,9 @@ static struct pp_argname arg_profile[] = {
{},
};
static
struct
pp_argname
arg_delayMechanism
[]
=
{
{
"request-response delay e2e"
,
E2E
},
{
"request-response delay e2e"
,
MECH_
E2E
},
#if CONFIG_HAS_P2P
{
"peer-delay pdelay p2p"
,
P2P
},
{
"peer-delay pdelay p2p"
,
MECH_
P2P
},
#endif
{},
};
...
...
proto-standard/common-fun-p2p.c
View file @
12615dab
...
...
@@ -43,7 +43,7 @@ int st_com_peer_handle_pres(struct pp_instance *ppi, void *buf,
int
e
=
0
;
/* if not in P2P mode, just return */
if
(
ppi
->
delayMechanism
!=
P2P
)
if
(
ppi
->
delayMechanism
!=
MECH_
P2P
)
return
0
;
msg_unpack_pdelay_resp
(
buf
,
&
resp
);
...
...
@@ -120,7 +120,7 @@ int st_com_peer_handle_pres_followup(struct pp_instance *ppi,
int
e
=
0
;
/* if not in P2P mode, just return */
if
(
ppi
->
delayMechanism
!=
P2P
)
if
(
ppi
->
delayMechanism
!=
MECH_
P2P
)
return
0
;
msg_unpack_pdelay_resp_follow_up
(
buf
,
&
respFllw
);
...
...
@@ -166,7 +166,7 @@ int st_com_peer_handle_preq(struct pp_instance *ppi, void *buf,
int
e
=
0
;
/* if not in P2P mode, just return */
if
(
ppi
->
delayMechanism
!=
P2P
)
if
(
ppi
->
delayMechanism
!=
MECH_
P2P
)
return
0
;
if
(
is_ext_hook_available
(
ppi
,
handle_preq
))
...
...
@@ -185,7 +185,7 @@ int st_com_peer_handle_preq(struct pp_instance *ppi, void *buf,
*/
void
update_meanDelay
(
struct
pp_instance
*
ppi
,
TimeInterval
meanDelay
)
{
/* clause 11.4.2.d.f : the <meanLinkDelay> shall be stored ... for the P2P port in the PTP SLAVE state in currentDS.meanDelay.*/
if
(
ppi
->
delayMechanism
==
P2P
)
{
if
(
ppi
->
delayMechanism
==
MECH_P2P
)
{
DSPOR
(
ppi
)
->
meanLinkDelay
=
meanDelay
;
if
(
ppi
->
state
!=
PPS_SLAVE
)
return
;
...
...
proto-standard/open-close.c
View file @
12615dab
...
...
@@ -40,7 +40,7 @@ struct pp_runtime_opts __pp_default_rt_opts = {
/* These parameters can be then overwritten with the config file ppsi.conf */
struct
pp_instance_cfg
__pp_default_instance_cfg
=
{
.
profile
=
PPSI_PROFILE_PTP
,
.
delayMechanism
=
E2E
,
.
delayMechanism
=
MECH_
E2E
,
.
announce_interval
=
PP_DEFAULT_ANNOUNCE_INTERVAL
,
.
announce_receipt_timeout
=
PP_DEFAULT_ANNOUNCE_RECEIPT_TIMEOUT
,
.
sync_interval
=
PP_DEFAULT_SYNC_INTERVAL
,
...
...
proto-standard/state-master.c
View file @
12615dab
...
...
@@ -52,7 +52,7 @@ static int master_handle_announce(struct pp_instance *ppi, void *buf, int len)
static
int
master_handle_delay_request
(
struct
pp_instance
*
ppi
,
void
*
buf
,
int
len
)
{
/* if not in E2E mode, just return */
/* if not in
MECH_
E2E mode, just return */
if
(
is_delayMechanismE2E
(
ppi
)
)
{
if
(
ppi
->
state
==
PPS_MASTER
)
{
/* not pre-master */
if
(
!
msg_issue_delay_resp
(
ppi
,
&
ppi
->
last_rcv_time
)
)
{
...
...
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