From: Izunna Otiji <izunna.otiji...@renesas.com>

Signed-off-by: Izunna Otiji <izunna.otiji...@renesas.com>
---
 clock.c      | 6 ++++++
 pmc_common.c | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/clock.c b/clock.c
index d37bb87..bd554a1 100644
--- a/clock.c
+++ b/clock.c
@@ -521,6 +521,12 @@ static int clock_management_set(struct clock *c, struct 
port *p,
                *changed = 1;
                respond = 1;
                break;
+       case MID_DOMAIN:
+               mtd = (struct management_tlv_datum *) tlv->data;
+               c->dds.domainNumber = mtd->val;
+               *changed = 1;
+               respond = 1;
+               break;
        case MID_GRANDMASTER_SETTINGS_NP:
                gsn = (struct grandmaster_settings_np *) tlv->data;
                c->dds.clockQuality = gsn->clockQuality;
diff --git a/pmc_common.c b/pmc_common.c
index 1dd89f6..a5a40e5 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -107,7 +107,7 @@ struct management_id idtab[] = {
        { "TIME_PROPERTIES_DATA_SET", MID_TIME_PROPERTIES_DATA_SET, 
do_get_action },
        { "PRIORITY1", MID_PRIORITY1, do_set_action },
        { "PRIORITY2", MID_PRIORITY2, do_set_action },
-       { "DOMAIN", MID_DOMAIN, do_get_action },
+       { "DOMAIN", MID_DOMAIN, do_set_action },
        { "SLAVE_ONLY", MID_SLAVE_ONLY, do_get_action },
        { "TIME", MID_TIME, not_supported },
        { "CLOCK_ACCURACY", MID_CLOCK_ACCURACY, do_get_action },
@@ -194,6 +194,7 @@ static void do_set_action(struct pmc *pmc, int action, int 
index, char *str)
        switch (code) {
        case MID_PRIORITY1:
        case MID_PRIORITY2:
+       case MID_DOMAIN:
                cnt = sscanf(str,  " %*s %*s %hhu", &mtd.val);
                if (cnt != 1) {
                        fprintf(stderr, "%s SET needs 1 value\n",
-- 
2.37.2


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

Reply via email to