clock: add a method to obtain the configuration.

This function allows the ports to read configuration variables without
changing the port method signatures.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-10 20:10:08 +02:00
parent 1579b7893b
commit b297f22a82
2 changed files with 12 additions and 0 deletions

View File

@ -755,6 +755,11 @@ UInteger8 clock_class(struct clock *c)
return c->dds.clockQuality.clockClass;
}
struct config *clock_config(struct clock *c)
{
return c->config;
}
static int clock_add_port(struct clock *c, int phc_index,
enum timestamp_type timestamping,
struct interface *iface)

View File

@ -57,6 +57,13 @@ struct port *clock_best_port(struct clock *c);
*/
UInteger8 clock_class(struct clock *c);
/**
* Obtains a reference to the configuration database.
* @param c The clock instance.
* @return A pointer to the configuration, without fail.
*/
struct config *clock_config(struct clock *c);
/**
* Create a clock instance. There can only be one clock in any system,
* so subsequent calls will destroy the previous clock instance.