Add a method to remove a port from the clock's polling array.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
2ff091b14b
commit
39b10a5a16
14
clock.c
14
clock.c
|
@ -368,6 +368,20 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
|
||||||
pr_debug("path delay %10lld %10lld", c->path_delay, pd);
|
pr_debug("path delay %10lld %10lld", c->path_delay, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda)
|
||||||
|
{
|
||||||
|
int i, j, k;
|
||||||
|
for (i = 0; i < c->nports; i++) {
|
||||||
|
if (p == c->port[i])
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (j = 0; j < fda.cnt; j++) {
|
||||||
|
k = N_POLLFD * i + j;
|
||||||
|
c->pollfd[k].fd = -1;
|
||||||
|
c->pollfd[k].events = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int clock_slave_only(struct clock *c)
|
int clock_slave_only(struct clock *c)
|
||||||
{
|
{
|
||||||
return c->dds.slaveOnly;
|
return c->dds.slaveOnly;
|
||||||
|
|
8
clock.h
8
clock.h
|
@ -135,6 +135,14 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
|
||||||
*/
|
*/
|
||||||
int clock_poll(struct clock *c);
|
int clock_poll(struct clock *c);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a port's file descriptor array from its controlling clock.
|
||||||
|
* @param c The clock instance.
|
||||||
|
* @param p The port removing the array.
|
||||||
|
* @param fda The port's file decriptor array.
|
||||||
|
*/
|
||||||
|
void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the slave-only flag from a clock's default data set.
|
* Obtain the slave-only flag from a clock's default data set.
|
||||||
* @param c The clock instance.
|
* @param c The clock instance.
|
||||||
|
|
Loading…
Reference in New Issue