Files
2026-07-30 11:19:44 +05:30

126 lines
3.5 KiB
C

/*
* Copyright (c) 2016 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
15aug16,xxy Add PTP features.(F6696)
26jan16,h_l written
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* PTP configuration
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include "ipptp_config.h"
#include "ipptp.h"
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
/*
*===========================================================================
* SYSVAR CONFIGURATION
*===========================================================================
*/
/*
****************************************************************************
* 9 PUBLIC FUNCTIONS
****************************************************************************
*/
/*****************************************************************************
*
* usrPtpOrdinaryClockInit - init PTP ordinary clock
*
* This function initializes PTP ordinary clock
*
* RETURNS: OK
*
* ERRNO: none
*/
STATUS usrPtpOrdinaryClockInit (void)
{
#ifdef IPPTP_802_1AS_PROFILE
if (ptpdAdd(PTP_ORDINARY_IF_NAME, 2,
PTP_ORDINARY_MASTER_MODE, 1,
PTP_ORDINARY_ONE_STEP_MODE, PTP_ORDINARY_PRIORITY,
PTP_ORDINARY_PDELAY_REQ_INTERVAL, 1) == 0)
#elif defined(IPPTP_DEFAULT_PROFILE)
if (ptpdAdd(PTP_ORDINARY_IF_NAME, PTP_ORDINARY_TRANSPORT_LAYER,
PTP_ORDINARY_MASTER_MODE, PTP_ORDINARY_DELAY_MECHANISM,
PTP_ORDINARY_ONE_STEP_MODE, PTP_ORDINARY_PRIORITY,
PTP_ORDINARY_PDELAY_REQ_INTERVAL, 0) == 0)
#else
#error Must select a profile of XXXX
#endif
{
ptpdSetDebugLevel(PTP_ORDINARY_IF_NAME, PTP_ORDINARY_DEBUG_LEVEL);
ptpdStartClock(PTP_ORDINARY_IF_NAME);
}
return OK;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/