204 lines
4.6 KiB
C
204 lines
4.6 KiB
C
/* ipptp.h - Wind River PTP library */
|
|
|
|
/*
|
|
* Copyright (c) 2016-2017 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
|
|
--------------------
|
|
23feb17,xxy Fix Missing BMCA support (V7NET-1274)
|
|
15aug16,xxy Add PTP features.(F6696)
|
|
16feb02,h_l Init version.
|
|
*/
|
|
|
|
#ifndef IPPTP_H
|
|
#define IPPTP_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
* Public header file of PTP.
|
|
*/
|
|
|
|
/*
|
|
DESCRIPTION
|
|
This library contains the APIs provided by the WindRiver PTP.
|
|
INCLUDE FILES: None
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* release
|
|
*===========================================================================
|
|
*/
|
|
#define IPPTP_RELEASE 70001
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 PUBLIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ptpdAdd - bind ptpd to ethernet interface
|
|
*
|
|
* This routine is used to bind ptpd to a special ethernet phisical device.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <ethName>
|
|
* A pointer to the ethernet device name.
|
|
* \i <layer>
|
|
* transport layer PTP_DEVICE_LAYER_2 or PTP_DEVICE_LAYER_4.
|
|
* \i <slaveMaster>
|
|
* Act as master,slave or BCMA, 0=SLAVE, 1=MASTER, 2 (others)= BCMA.
|
|
* \i <delayMechanism>
|
|
* Mechanism of delay,PTP_DEVICE_E2E or PTP_DEVICE_P2P.
|
|
* \i <oneStepMode>
|
|
* One step clock or two step clock,PTP_DEVICE_TWO_STEP or PTP_DEVICE_ONE_STEP.
|
|
* \i <pri>
|
|
* PTP Priority When Configured as Master Clock.
|
|
* \i <PdelayReq>
|
|
* PTP Pdelay Request Interval,reciprocal of N times of power of 2,
|
|
* (1 ~ -4) means (0.5PPS ~ 16PPS).
|
|
* \i <profile>
|
|
* Select ptp profile PTP_802_1AS_PROFILE or PTP_DEFAULT_PROFILE.
|
|
* \ie
|
|
*
|
|
* RETURNS: \is
|
|
* \i 'PTP_OK'.
|
|
* successful.
|
|
* \i 'PTP_ERROR'
|
|
* unsuccessful.
|
|
* \ie
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
int ptpdAdd
|
|
(
|
|
char* ethName,
|
|
int layer,
|
|
int slaveMaster,
|
|
int delayMechanism,
|
|
int oneStepMode,
|
|
unsigned char pri,
|
|
char PdelayReq,
|
|
int profile
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ptpdStart - start all ptpd tasks
|
|
*
|
|
* This routine is to start all ptpd tasks.
|
|
*
|
|
* Parameters:
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
void ptpdStart();
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ptpdStartClock - start a ptpd task binded to a ethernet interface
|
|
*
|
|
* This routine is used to start a ptpd task binded to a ethernet interface.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <ethName>
|
|
* A pointer to the ethernet device name.
|
|
* \ie
|
|
*
|
|
* RETURNS: N/A
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
void ptpdStartClock
|
|
(
|
|
char *ethName
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ptpdStop - stop ptpd interface
|
|
*
|
|
* This routine is used to stop specified ptpd interface.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <ethName>
|
|
* A pointer to the ethernet device name.
|
|
* \ie
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
void ptpdStop
|
|
(
|
|
char *ethName
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ptpdClearAll - clear all ptpd attached ethernet interfaces
|
|
*
|
|
* This routine is used to clear all ptpd attached ethernet interfaces.
|
|
*
|
|
* Parameters:
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
void ptpdClearAll();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|