diff --git a/userspace/snmpd/WR-SWITCH-MIB.txt b/userspace/snmpd/WR-SWITCH-MIB.txt index f5b692f777e3f37e3f1fa7cb19f1f579e03b51fb..ad03bc92c7d00f3a15da22749ca2cea7f6de3fea 100644 --- a/userspace/snmpd/WR-SWITCH-MIB.txt +++ b/userspace/snmpd/WR-SWITCH-MIB.txt @@ -40,6 +40,8 @@ wrSwitchMIB MODULE-IDENTITY - wrsPtpDelayCoefficientStr - wrsPtpIngressLatency - wrsPtpEgressLatency + Change enumeration values of: + - wrsPtpInstanceProfile (renamed value 2, removed value 3) Improved description of: - wrsPtpRTT - wrsPtpLinkLength @@ -3179,14 +3181,15 @@ wrsPtpInstanceProfile OBJECT-TYPE SYNTAX INTEGER { -- ppsi/include/ppsi/ppsi.h na(0), defaultPTP(1), -- PPSI_PROFILE_PTP - whiteRabbit(2), -- PPSI_PROFILE_WR - highAccuracy(3), -- PPSI_PROFILE_HA + highAccuracyWhiteRabbit(2), -- PPSI_PROFILE_HA_WR + highAccuracy(3), -- obsolete custom(4) -- PPSI_PROFILE_CUSTOM } MAX-ACCESS read-only STATUS current DESCRIPTION - "Profile/Extension configured on a PTP Instance" + "Profile configured on a PTP Instance. Please note that + High Accuracy and White Rabbit use the same profile." ::= { wrsPtpInstanceEntry 11 } wrsPtpInstanceExtension OBJECT-TYPE diff --git a/userspace/snmpd/wrsPtpInstanceTable.c b/userspace/snmpd/wrsPtpInstanceTable.c index 069b2b86565ea47ee5084a73b3cac1150ecaf595..94cf6b225ffee6a1ad3e7930d7c9015ef17c9494 100644 --- a/userspace/snmpd/wrsPtpInstanceTable.c +++ b/userspace/snmpd/wrsPtpInstanceTable.c @@ -46,6 +46,20 @@ static struct pickinfo wrsPtpInstanceTable_pickinfo[] = { static char *slog_obj_name; static char *wrsPtpInstanceStatusError_str = "wrsPtpInstanceStatusError"; +static int get_profile_val(int profile) +{ + switch(profile) { + case PPSI_PROFILE_PTP: + return WRS_PTP_INSTANCE_PROFILE_PTP; + case PPSI_PROFILE_HA_WR: + return WRS_PTP_INSTANCE_PROFILE_HA_WR; + case PPSI_PROFILE_CUSTOM: + return WRS_PTP_INSTANCE_PROFILE_CUSTOM; + default: + return WRS_PTP_INSTANCE_PROFILE_NA; + } +} + static inline struct hal_port_state *pp_wrs_lookup_port(char *name) { int i; @@ -155,7 +169,7 @@ time_t wrsPtpInstanceTable_data_fill(unsigned int *n_rows) pit->wrsPtpInstanceExtPortCfgDesSt = ppsi_i->externalPortConfigurationPortDS.desiredState; pit->wrsPtpInstanceMechanism = ppsi_i->delayMechanism; - pit->wrsPtpInstanceProfile = ppsi_i->cfg.profile + 1; + pit->wrsPtpInstanceProfile = get_profile_val(ppsi_i->cfg.profile); pit->wrsPtpInstanceExtension = ppsi_i->protocol_extension+1; pit->wrsPtpInstanceAsymEnabled = ppsi_i->asymmetryCorrectionPortDS.enable + 1; pit->wrsPtpInstanceAsymConstAsymPS = interval_to_picos(ppsi_i->asymmetryCorrectionPortDS.constantAsymmetry); diff --git a/userspace/snmpd/wrsPtpInstanceTable.h b/userspace/snmpd/wrsPtpInstanceTable.h index 2c4920d88779c79e70067d27c51ceaf3724564d3..9fe28695c135abc8fbfbdb76bdcb31abd8f86fb0 100644 --- a/userspace/snmpd/wrsPtpInstanceTable.h +++ b/userspace/snmpd/wrsPtpInstanceTable.h @@ -17,6 +17,12 @@ #define WRS_PTP_INSTANCE_EXTENSION_CFG_HAWRAUTONEGOTIATION 4 +#define WRS_PTP_INSTANCE_PROFILE_NA 0 +#define WRS_PTP_INSTANCE_PROFILE_PTP 1 +#define WRS_PTP_INSTANCE_PROFILE_HA_WR 2 +/* 3 is obsolete */ +#define WRS_PTP_INSTANCE_PROFILE_CUSTOM 4 + struct wrsPtpInstanceTable_s { uint32_t wrsPtpInstancePortIndex; /* not reported, index fields has t o be marked