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 <richardcochran@gmail.com>
master
Richard Cochran 2015-03-17 19:50:39 +01:00
parent 572438b85e
commit 2318432b94
1 changed files with 13 additions and 0 deletions

13
clock.c
View File

@ -482,12 +482,25 @@ static int clock_management_set(struct clock *c, struct port *p,
{ {
int respond = 0; int respond = 0;
struct management_tlv *tlv; struct management_tlv *tlv;
struct management_tlv_datum *mtd;
struct grandmaster_settings_np *gsn; struct grandmaster_settings_np *gsn;
struct subscribe_events_np *sen; struct subscribe_events_np *sen;
tlv = (struct management_tlv *) req->management.suffix; tlv = (struct management_tlv *) req->management.suffix;
switch (id) { 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: case TLV_GRANDMASTER_SETTINGS_NP:
gsn = (struct grandmaster_settings_np *) tlv->data; gsn = (struct grandmaster_settings_np *) tlv->data;
c->dds.clockQuality = gsn->clockQuality; c->dds.clockQuality = gsn->clockQuality;