Add support for the timescale management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-03-03 20:26:00 +01:00
parent 4dfcca733b
commit 2044d045b4
2 changed files with 12 additions and 1 deletions

View File

@ -234,6 +234,12 @@ static int clock_management_get_response(struct clock *c, struct port *p,
datalen = sizeof(*mtd); datalen = sizeof(*mtd);
respond = 1; respond = 1;
break; break;
case TIMESCALE_PROPERTIES:
mtd = (struct management_tlv_datum *) tlv->data;
mtd->val = c->tds.flags & PTP_TIMESCALE;
datalen = sizeof(*mtd);
respond = 1;
break;
case TIME_STATUS_NP: case TIME_STATUS_NP:
tsn = (struct time_status_np *) tlv->data; tsn = (struct time_status_np *) tlv->data;
tsn->master_offset = c->master_offset; tsn->master_offset = c->master_offset;

7
pmc.c
View File

@ -72,7 +72,7 @@ struct management_id idtab[] = {
{ "CLOCK_ACCURACY", CLOCK_ACCURACY, do_get_action }, { "CLOCK_ACCURACY", CLOCK_ACCURACY, do_get_action },
{ "UTC_PROPERTIES", UTC_PROPERTIES, not_supported }, { "UTC_PROPERTIES", UTC_PROPERTIES, not_supported },
{ "TRACEABILITY_PROPERTIES", TRACEABILITY_PROPERTIES, do_get_action }, { "TRACEABILITY_PROPERTIES", TRACEABILITY_PROPERTIES, do_get_action },
{ "TIMESCALE_PROPERTIES", TIMESCALE_PROPERTIES, not_supported }, { "TIMESCALE_PROPERTIES", TIMESCALE_PROPERTIES, do_get_action },
{ "PATH_TRACE_LIST", PATH_TRACE_LIST, not_supported }, { "PATH_TRACE_LIST", PATH_TRACE_LIST, not_supported },
{ "PATH_TRACE_ENABLE", PATH_TRACE_ENABLE, not_supported }, { "PATH_TRACE_ENABLE", PATH_TRACE_ENABLE, not_supported },
{ "GRANDMASTER_CLUSTER_TABLE", GRANDMASTER_CLUSTER_TABLE, not_supported }, { "GRANDMASTER_CLUSTER_TABLE", GRANDMASTER_CLUSTER_TABLE, not_supported },
@ -346,6 +346,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
mtd->val & TIME_TRACEABLE ? 1 : 0, mtd->val & TIME_TRACEABLE ? 1 : 0,
mtd->val & FREQ_TRACEABLE ? 1 : 0); mtd->val & FREQ_TRACEABLE ? 1 : 0);
break; break;
case TIMESCALE_PROPERTIES:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "TIMESCALE_PROPERTIES "
IFMT "ptpTimescale %d", mtd->val & PTP_TIMESCALE ? 1 : 0);
break;
case TIME_STATUS_NP: case TIME_STATUS_NP:
tsn = (struct time_status_np *) mgt->data; tsn = (struct time_status_np *) mgt->data;
fprintf(fp, "TIME_STATUS_NP " fprintf(fp, "TIME_STATUS_NP "