Support configuration of the grand master settings.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-07-06 13:04:29 +02:00
parent 661d7a7716
commit 12ab15818c
1 changed files with 17 additions and 0 deletions

17
clock.c
View File

@ -308,7 +308,24 @@ static int clock_management_set(struct clock *c, struct port *p,
int id, struct ptp_message *req) int id, struct ptp_message *req)
{ {
int respond = 0; int respond = 0;
struct management_tlv *tlv;
struct grandmaster_settings_np *gsn;
tlv = (struct management_tlv *) req->management.suffix;
switch (id) { switch (id) {
case GRANDMASTER_SETTINGS_NP:
if (p != c->port[c->nports]) {
/* Sorry, only allowed on the UDS port. */
break;
}
gsn = (struct grandmaster_settings_np *) tlv->data;
c->dds.clockQuality = gsn->clockQuality;
c->utc_offset = gsn->utc_offset;
c->time_flags = gsn->time_flags;
c->time_source = gsn->time_source;
respond = 1;
break;
} }
if (respond && !clock_management_get_response(c, p, id, req)) if (respond && !clock_management_get_response(c, p, id, req))
pr_err("failed to send management set response"); pr_err("failed to send management set response");