From 2318432b946070775e34b800240327e6f79879ab Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 17 Mar 2015 19:50:39 +0100 Subject: [PATCH] clock: support management SET of the priority attributes. This patch adds support for changing the priority1 and priority2 elements of the "default data set" at run time. Signed-off-by: Richard Cochran --- clock.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/clock.c b/clock.c index 3350b3d..9e9feba 100644 --- a/clock.c +++ b/clock.c @@ -482,12 +482,25 @@ static int clock_management_set(struct clock *c, struct port *p, { int respond = 0; struct management_tlv *tlv; + struct management_tlv_datum *mtd; struct grandmaster_settings_np *gsn; struct subscribe_events_np *sen; tlv = (struct management_tlv *) req->management.suffix; switch (id) { + case TLV_PRIORITY1: + mtd = (struct management_tlv_datum *) tlv->data; + c->dds.priority1 = mtd->val; + *changed = 1; + respond = 1; + break; + case TLV_PRIORITY2: + mtd = (struct management_tlv_datum *) tlv->data; + c->dds.priority2 = mtd->val; + *changed = 1; + respond = 1; + break; case TLV_GRANDMASTER_SETTINGS_NP: gsn = (struct grandmaster_settings_np *) tlv->data; c->dds.clockQuality = gsn->clockQuality;