Lines Matching defs:unit
72 /* clock unit control structure */
74 short unit; /* NTP refclock unit number */
94 int unit,
102 if (unit < 0 || unit > 1) { /* support units 0 and 1 */
103 msyslog(LOG_ERR, "psc_start: bad unit: %d", unit);
108 msyslog(LOG_ERR, "psc_start: unit: %d, emalloc: %m", unit);
113 sprintf(buf, DEVICE, unit); /* dev file name */
114 fd[unit] = open(buf, O_RDONLY); /* open device file */
115 if (fd[unit] < 0) {
116 msyslog(LOG_ERR, "psc_start: unit: %d, open failed. %m", unit);
121 if (ioctl(fd[unit], PSC_REGS, ®p[unit]) < 0) {
122 msyslog(LOG_ERR, "psc_start: unit: %d, ioctl failed. %m", unit);
137 up->unit = unit;
148 int unit,
153 close(fd[unit]);
159 int unit,
169 tlo = regp[unit]->low_time; /* latch and read first 4 bytes */
170 thi = regp[unit]->high_time; /* read 4 higher order bytes */
171 status = regp[unit]->device_status; /* read device status byte */
175 if (!up->msg_flag[unit]) { /* write once to system log */
177 "SYNCHRONIZATION LOST on unit %1d, status %02x\n",
178 status, unit);
179 up->msg_flag[unit] = 1;
217 check_leap_sec(pp, unit);
231 check_leap_sec(struct refclockproc *pp, int unit)
236 regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY10DAY1;
238 dlo = regp[unit]->dp_ram_data;
239 regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY1000DAY100;
241 dhi = regp[unit]->dp_ram_data;