** Confidential **

Dear Erez,
Dear All,

I think that the value should  be stored into config also, because after
a fault the complete configuration is reloaded.


ciao

luigi








Luigi Mantellini
Senior Software Developer
Tel. (+39) 342 182 3893
luigi.mantell...@sm-optics.com



SM-Optics
SIAE Microelettronica Group


Via Michelangelo Buonarroti, 1
20093 Cologno Monzese, Milano
ITALY
Tel. (+39) 02 273 251
Fax (+39) 02 253 91585
https://www.sm-optics.com/
>>> Erez Geva <erez.geva....@siemens.com> 24/05/21 1.25 >>>
- Add support in the pmc tool
- Add the TLV in port module.

Signed-off-by: Erez Geva <erez.geva....@siemens.com>
---
 pmc.c        | 5 +++++
 pmc_common.c | 2 ++
 port.c       | 6 ++++++
 3 files changed, 13 insertions(+)

diff --git a/pmc.c b/pmc.c
index a767c8a..00d6014 100644
--- a/pmc.c
+++ b/pmc.c
@@ -335,6 +335,11 @@ static void pmc_show(struct ptp_message *msg, FILE
*fp)
         fprintf(fp, "TIMESCALE_PROPERTIES "
             IFMT "ptpTimescale %d", mtd->val & PTP_TIMESCALE ? 1 : 0);
         break;
+    case TLV_MASTER_ONLY:
+        mtd = (struct management_tlv_datum *) mgt->data;
+        fprintf(fp, "MASTER_ONLY "
+            IFMT "masterOnly %d", mtd->val);
+        break;
     case TLV_TIME_STATUS_NP:
         tsn = (struct time_status_np *) mgt->data;
         fprintf(fp, "TIME_STATUS_NP "
diff --git a/pmc_common.c b/pmc_common.c
index c5cd992..101df55 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -104,6 +104,7 @@ struct management_id idtab[] = {
     { "ALTERNATE_TIME_OFFSET_NAME", TLV_ALTERNATE_TIME_OFFSET_NAME,
not_supported },
     { "ALTERNATE_TIME_OFFSET_MAX_KEY",
TLV_ALTERNATE_TIME_OFFSET_MAX_KEY, not_supported },
     { "ALTERNATE_TIME_OFFSET_PROPERTIES",
TLV_ALTERNATE_TIME_OFFSET_PROPERTIES, not_supported },
+    { "MASTER_ONLY", TLV_MASTER_ONLY, do_get_action },
     { "TRANSPARENT_CLOCK_DEFAULT_DATA_SET",
TLV_TRANSPARENT_CLOCK_DEFAULT_DATA_SET, not_supported },
     { "PRIMARY_DOMAIN", TLV_PRIMARY_DOMAIN, not_supported },
     { "TIME_STATUS_NP", TLV_TIME_STATUS_NP, do_get_action },
@@ -510,6 +511,7 @@ static int pmc_tlv_datalen(struct pmc *pmc, int id)
     case TLV_CLOCK_ACCURACY:
     case TLV_TRACEABILITY_PROPERTIES:
     case TLV_TIMESCALE_PROPERTIES:
+    case TLV_MASTER_ONLY:
         len += sizeof(struct management_tlv_datum);
         break;
     case TLV_TIME_STATUS_NP:
diff --git a/port.c b/port.c
index 10bb9e1..250d46d 100644
--- a/port.c
+++ b/port.c
@@ -924,6 +924,11 @@ static int port_management_fill_response(struct
port *target,
         mtd->val = target->versionNumber;
         datalen = sizeof(*mtd);
         break;
+    case TLV_MASTER_ONLY:
+        mtd = (struct management_tlv_datum *) tlv->data;
+        mtd->val = target->master_only;
+        datalen = sizeof(*mtd);
+        break;
     case TLV_DELAY_MECHANISM:
         mtd = (struct management_tlv_datum *) tlv->data;
         if (target->delayMechanism)
@@ -2898,6 +2903,7 @@ int port_manage(struct port *p, struct port
*ingress, struct ptp_message *msg)
     case TLV_UNICAST_MASTER_MAX_TABLE_SIZE:
     case TLV_ACCEPTABLE_MASTER_TABLE_ENABLED:
     case TLV_ALTERNATE_MASTER:
+    case TLV_MASTER_ONLY:
     case TLV_TRANSPARENT_CLOCK_PORT_DATA_SET:
     case TLV_DELAY_MECHANISM:
     case TLV_LOG_MIN_PDELAY_REQ_INTERVAL:
-- 
2.20.1



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to