Skip to content

Commit

Permalink
Support configuration of the grand master settings.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Jul 14, 2013
1 parent 661d7a7 commit 12ab158
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,24 @@ static int clock_management_set(struct clock *c, struct port *p,
int id, struct ptp_message *req)
{
int respond = 0;
struct management_tlv *tlv;
struct grandmaster_settings_np *gsn;

tlv = (struct management_tlv *) req->management.suffix;

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))
pr_err("failed to send management set response");
Expand Down

0 comments on commit 12ab158

Please sign in to comment.