Commit d9f0f83f authored by Aurelio Colosimo's avatar Aurelio Colosimo

trivial: proto-ext-whiterabbit/wr_constants.h cleanup

No changes in src; only comments, code alignment and white spaces cleanup.
Doxygen style comments were removed, since their usage is not uniform in the
code.
parent a6f82fe1
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Aurelio Colosimo for CERN, 2012 -- GNU LGPL v2.1 or later
* Based on ptp-noposix
*/
/** \name White Rabbit staff
Here comes all the constants needed in White Rabbit extension
.*/
/**\{*/
/*White Rabbit staff*/
/*
* if this defined, WR uses new implementation of timeouts (not using interrupt)
*/
//#define IRQ_LESS_TIMER
/* White Rabbit stuff
* if this defined, WR uses new implementation of timeouts (not using interrupt)
*/
#define WR_NODE 0x80
#define WR_IS_CALIBRATED 0x04
......@@ -22,21 +15,20 @@
# define WR_TLV_TYPE 0x2004
#define WR_MASTER_PRIORITY1 6
#define WR_DEFAULT_CAL_PERIOD 3000 //[us]
#define WR_DEFAULT_CAL_PATTERN 0x3E0 //1111100000
#define WR_DEFAULT_CAL_PATTERN_LEN 0xA //10 bits
#define WR_DEFAULT_CAL_PERIOD 3000 /* [us] */
#define WR_DEFAULT_CAL_PATTERN 0x3E0 /* 1111100000 */
#define WR_DEFAULT_CAL_PATTERN_LEN 0xA /* 10 bits */
#define WR_DEFAULT_STATE_TIMEOUT_MS 300 //[ms]
#define WR_DEFAULT_STATE_TIMEOUT_MS 300 /* [ms] */
#define WR_DEFAULT_STATE_REPEAT 3
#define WR_DEFAULT_INIT_REPEAT 3
/*White Rabbit package Size*/
/* White Rabbit package Size */
#define WR_ANNOUNCE_TLV_LENGTH 0x0A
#define WR_ANNOUNCE_LENGTH (PP_ANNOUNCE_LENGTH + WR_ANNOUNCE_TLV_LENGTH + 4)
#define WR_ANNOUNCE_LENGTH (PP_ANNOUNCE_LENGTH + WR_ANNOUNCE_TLV_LENGTH + 4)
#define WR_MANAGEMENT_TLV_LENGTH 6
#define WR_MANAGEMENT_LENGTH (MANAGEMENT_LENGTH + WR_MANAGEMENT_TLV_LENGTH)
#define WR_MANAGEMENT_LENGTH (MANAGEMENT_LENGTH + WR_MANAGEMENT_TLV_LENGTH)
/* memory footprint tweak for WRPC */
#ifdef WRPC_EXTRA_SLIM
......@@ -54,9 +46,9 @@
#define WR_MASTER_ONLY_CLOCK_CLASS 70
///// new staff for WRPTPv2
/* new stuff for WRPTPv2 */
#define TLV_TYPE_ORG_EXTENSION 0x0003 //organization specific
#define TLV_TYPE_ORG_EXTENSION 0x0003 /* organization specific */
#define WR_PRIORITY1 64
......@@ -64,60 +56,52 @@
#define WR_TLV_MAGIC_NUMBER 0xDEAD
#define WR_TLV_WR_VERSION_NUMBER 0x01
#define WR_SIGNALING_MSG_BASE_LENGTH 48 //=length( header ) + lenght( targetPortId ) + length (tlvType) + lenght(lenghtField)
// 34 + 10 + 2 + 2
/* WR_SIGNALING_MSG_BASE_LENGTH Computation:
* = LEN(header) + LEN(targetPortId) + LEN(tlvType) + LEN(lenghtField)
* 34 + 10 + 2 + 2 */
#define WR_SIGNALING_MSG_BASE_LENGTH 48
#define WR_DEFAULT_PHY_CALIBRATION_REQUIRED FALSE
#define SEND_CALIBRATION_PATTERN 0X0001
#define NOT_SEND_CALIBRATION_PATTERN 0X0000
/**
* \brief Indicates if a port is configured as White Rabbit, and what kind (master/slave) [White Rabbit]
*/
/*White Rabbit node */
enum{
/* Indicates if a port is configured as White Rabbit, and what kind
* (master/slave) */
enum {
NON_WR = 0x0,
WR_S_ONLY = 0x2,
WR_M_ONLY = 0x1,
WR_M_AND_S = 0x3,
WR_MODE_AUTO= 0x4, // only for ptpx - not in the spec
WR_MODE_AUTO= 0x4, /* only for ptpx - not in the spec */
};
/**
* \brief Indicate current White Rabbit mode of a given port (non wr/wr master/wr slave) [White Rabbit]
*/
/*White Rabbit node */
/* White Rabbit node */
enum{
WR_SLAVE = 2,
WR_MASTER = 1,
};
/**
* \brief Values of Management Actions (extended for WR), see table 38 [White Rabbit]
/* Values of Management Actions (extended for WR), see table 38
*/
enum{
enum {
GET,
SET,
RESPONSE,
COMMAND,
ACKNOWLEDGE,
WR_CMD, //White Rabbit
WR_CMD, /* White Rabbit */
};
/**
* \brief WR PTP states (new, single FSM) [White Rabbit]
*/
/* brief WR PTP states (new, single FSM) */
enum {
/* WR states start from 16 in order not to be confused with PTP states,
* since our application FSM is flat */
WRS_PRESENT = 16, WRS_S_LOCK, WRS_M_LOCK, WRS_LOCKED,
WRS_CALIBRATION, WRS_CALIBRATED, WRS_RESP_CALIB_REQ ,WRS_WR_LINK_ON,
/*
each WR main state (except IDLE) has an associated timetout
we use state names to manage timeouts as well
*/
WR_TIMER_ARRAY_SIZE, //number of states which has timeouts
/* Each WR main state (except IDLE) has an associated timetout
* we use state names to manage timeouts as well */
WR_TIMER_ARRAY_SIZE, /* number of states which has timeouts */
WRS_IDLE,
/* here are substates*/
WRS_S_LOCK_1,
......@@ -133,13 +117,10 @@ enum {
WRS_RESP_CALIB_REQ_1,
WRS_RESP_CALIB_REQ_2,
WRS_RESP_CALIB_REQ_3,
};
/**
* \brief White Rabbit commands (for new implementation, single FSM), see table 38 [White Rabbit]
*/
enum{
/* White Rabbit commands (for new implementation, single FSM), see table 38 */
enum {
NULL_WR_TLV = 0x0000,
SLAVE_PRESENT = 0x1000,
......@@ -151,21 +132,15 @@ enum{
ANN_SUFIX = 0x2000,
};
/**
* \brief White Rabbit slave port's role
*/
enum{
/* White Rabbit slave port's role */
enum {
NON_SLAVE = 0x0,
PRIMARY_SLAVE ,
SECONDARY_SLAVE ,
};
/**
* \brief White Rabbit data initialization mode
*/
enum{
/* White Rabbit data initialization mode */
enum {
INIT,
RE_INIT,
};
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