Lines Matching +full:per +full:- +full:device
2 * refclock_atom - clock driver for 1-pps signals
25 * This driver furnishes an interface for pulse-per-second (PPS) signals
33 * within +-0.4 s by another means, such as a radio clock or NTP
37 * may require a one-shot flipflop to lengthen the pulse. The other is
41 * This driver requires the Pulse-per-Second API for Unix-like Operating
42 * Systems, Version 1.0, RFC-2783 (PPSAPI). Implementations are
45 * the API with multiple PPS drivers and multiple handles per driver. If
74 * miscellaneous device driver and OS delays.
79 #define DEVICE "/dev/pps%d" /* device name and unit */ macro
80 #define PRECISION (-20) /* precision assumed (about 1 us) */
110 atom_timer, /* called once per second */
115 * atom_start - initialize data for processing
125 char device[80]; in atom_start() local
130 pp = peer->procptr; in atom_start()
131 peer->precision = PRECISION; in atom_start()
132 pp->clockdesc = DESCRIPTION; in atom_start()
133 pp->stratum = STRATUM_UNSPEC; in atom_start()
134 memcpy((char *)&pp->refid, REFID, 4); in atom_start()
137 pp->unitptr = up; in atom_start()
140 * Open PPS device. This can be any serial or parallel port and in atom_start()
143 snprintf(device, sizeof(device), DEVICE, unit); in atom_start()
144 up->fddev = tty_open(device, O_RDWR, 0777); in atom_start()
145 if (up->fddev <= 0) { in atom_start()
147 "refclock_atom: %s: %m", device); in atom_start()
154 return (refclock_ppsapi(up->fddev, &up->atom)); in atom_start()
159 * atom_shutdown - shut down the clock
170 pp = peer->procptr; in atom_shutdown()
171 up = pp->unitptr; in atom_shutdown()
172 if (up->fddev > 0) in atom_shutdown()
173 close(up->fddev); in atom_shutdown()
178 * atom_timer - called once per second
190 pp = peer->procptr; in atom_timer()
191 up = pp->unitptr; in atom_timer()
192 if (refclock_pps(peer, &up->atom, pp->sloppyclockflag) <= 0) in atom_timer()
195 peer->flags |= FLAG_PPS; in atom_timer()
201 if (pp->sloppyclockflag & CLK_FLAG4) { in atom_timer()
203 pp->filter[pp->coderecv]); in atom_timer()
204 record_clock_stats(&peer->srcadr, tbuf); in atom_timer()
210 * atom_poll - called by the transmit procedure
227 pp = peer->procptr; in atom_poll()
228 pp->polls++; in atom_poll()
229 if (pp->codeproc == pp->coderecv) { in atom_poll()
230 peer->flags &= ~FLAG_PPS; in atom_poll()
234 pp->lastref = pp->lastrec; in atom_poll()