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
parent
1579b7893b
commit
b297f22a82
5
clock.c
5
clock.c
|
@ -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)
|
||||
|
|
7
clock.h
7
clock.h
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue