Commit 12615dab authored by Adam Wujek's avatar Adam Wujek

include/ppsi/ieee1588_types: add MECH_ prefix to ENDelayMechanism values

Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent f8cc9692
......@@ -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 */
......
......@@ -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;
......
......@@ -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) */
......
......@@ -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) {
......
......@@ -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,
};
......
......@@ -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
{},
};
......
......@@ -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;
......
......@@ -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,
......
......@@ -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) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment