diff options
author | wollman <wollman@FreeBSD.org> | 1993-12-21 18:36:48 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1993-12-21 18:36:48 +0000 |
commit | 8e51e9f1429efc498f923bce8b25b20f47d7c075 (patch) | |
tree | 9db10264d45dc397a38276190303093a450d769e /usr.sbin/xntpd/include/sys | |
download | FreeBSD-src-8e51e9f1429efc498f923bce8b25b20f47d7c075.zip FreeBSD-src-8e51e9f1429efc498f923bce8b25b20f47d7c075.tar.gz |
xntpd 3.3b from UDel
Diffstat (limited to 'usr.sbin/xntpd/include/sys')
-rw-r--r-- | usr.sbin/xntpd/include/sys/bsd_audioirig.h | 101 | ||||
-rw-r--r-- | usr.sbin/xntpd/include/sys/chudefs.h | 22 | ||||
-rw-r--r-- | usr.sbin/xntpd/include/sys/clkdefs.h | 31 | ||||
-rw-r--r-- | usr.sbin/xntpd/include/sys/parsestreams.h | 66 | ||||
-rw-r--r-- | usr.sbin/xntpd/include/sys/ppsclock.h | 59 | ||||
-rw-r--r-- | usr.sbin/xntpd/include/sys/tpro.h | 34 |
6 files changed, 313 insertions, 0 deletions
diff --git a/usr.sbin/xntpd/include/sys/bsd_audioirig.h b/usr.sbin/xntpd/include/sys/bsd_audioirig.h new file mode 100644 index 0000000..1daeec7 --- /dev/null +++ b/usr.sbin/xntpd/include/sys/bsd_audioirig.h @@ -0,0 +1,101 @@ +/* + * $Header: bsd_audioirig.h,v 1.0 93/08/02 12:42:00 + */ + +#ifndef _BSD_AUDIOIRIG_H_ +#define _BSD_AUDIOIRIG_H_ + +#include <sys/time.h> + +/********************************************************************/ +/* user interface */ + +/* + * irig ioctls + */ +#if (defined(sun) || defined(ibm032)) && !defined(__GNUC__) +#define AUDIO_IRIG_OPEN _IO(A, 50) +#define AUDIO_IRIG_CLOSE _IO(A, 51) +#define AUDIO_IRIG_SETFORMAT _IOWR(A, 52, int) +#else +#define AUDIO_IRIG_OPEN _IO('A', 50) +#define AUDIO_IRIG_CLOSE _IO('A', 51) +#define AUDIO_IRIG_SETFORMAT _IOWR('A', 52, int) +#endif + +/* + * irig error codes + */ +#define AUDIO_IRIG_BADSIGNAL 0x01 +#define AUDIO_IRIG_BADDATA 0x02 +#define AUDIO_IRIG_BADSYNC 0x04 +#define AUDIO_IRIG_BADCLOCK 0x08 +#define AUDIO_IRIG_OLDDATA 0x10 + +/********************************************************************/ + +/* + * auib definitions + */ +#define AUIB_SIZE (0x0040) +#define AUIB_INC (0x0008) +#define AUIB_MOD(k) ((k) & 0x0038) +#define AUIB_INIT(ib) ((ib)->ib_head = (ib)->ib_tail = (ib)->ib_lock = \ + (ib)->phase = (ib)->shi = (ib)->slo = (ib)->high = \ + (ib)->level0 = (ib)->level1 = \ + (ib)->shift[0] = (ib)->shift[1] = (ib)->shift[2] = \ + (ib)->shift[3] = (ib)->sdata[0] = (ib)->sdata[1] = \ + (ib)->sdata[2] = (ib)->sdata[3] = (ib)->err = 0) +#define AUIB_EMPTY(ib) ((ib)->ib_head == (ib)->ib_tail) +#define AUIB_LEN(ib) (AUIB_MOD((ib)->ib_tail - (ib)->ib_head)) +#define AUIB_LEFT(ib) (AUIB_MOD((ib)->ib_head - (ib)->ib_tail - 1)) +#define IRIGDELAY 3 +#define IRIGLEVEL 1355 + +#ifndef LOCORE +/* + * irig_time holds IRIG data for one second + */ +struct irig_time { + struct timeval stamp; /* timestamp */ + u_char bits[13]; /* 100 irig data bits */ + u_char status; /* status byte */ + char time[14]; /* time string */ +}; + +/* + * auib's are used for IRIG data communication between the trap + * handler and the software interrupt. + */ +struct auib { + /* driver variables */ + u_short active; /* 0=inactive, else=active */ + u_short format; /* time output format */ + struct irig_time timestr; /* time structure */ + char buffer[14]; /* output formation buffer */ + + /* hardware interrupt variables */ + struct timeval tv1,tv2,tv3; /* time stamps (median filter) */ + int level0,level1; /* lo/hi input levels */ + int level; /* decision level */ + int high; /* recent largest sample */ + int sl0,sl1; /* recent sample levels */ + int lasts; /* last sample value */ + u_short scount; /* sample count */ + u_long eacc; /* 10-bit element accumulator */ + u_long ebit; /* current bit in element */ + u_char r_level,mmr1; /* recording level 0-255 */ + int shi,slo,phase; /* AGC variables */ + u_long err; /* error status bits */ + int ecount; /* count of elements this second */ + long shift[4]; /* shift register of pos ident */ + long sdata[4]; /* shift register of symbols */ + + int ib_head; /* queue head */ + int ib_tail; /* queue tail */ + u_short ib_lock; /* queue head lock */ + u_long ib_data[AUIB_SIZE]; /* data buffer */ +}; +#endif + +#endif /* _BSD_AUDIOIRIG_H_ */ diff --git a/usr.sbin/xntpd/include/sys/chudefs.h b/usr.sbin/xntpd/include/sys/chudefs.h new file mode 100644 index 0000000..50f8252 --- /dev/null +++ b/usr.sbin/xntpd/include/sys/chudefs.h @@ -0,0 +1,22 @@ +/* chudefs.h,v 3.1 1993/07/06 01:07:11 jbj Exp + * Definitions for the CHU line discipline v2.0 + */ + +/* + * The CHU time code consists of 10 BCD digits and is repeated + * twice for a total of 10 characters. A time is taken after + * the arrival of each character. The following structure is + * used to return this stuff. + */ +#define NCHUCHARS (10) + +struct chucode { + u_char codechars[NCHUCHARS]; /* code characters */ + u_char ncodechars; /* number of code characters */ + u_char chutype; /* packet type */ + struct timeval codetimes[NCHUCHARS]; /* arrival times */ +}; + +#define CHU_TIME 0 /* second half is equal to first half */ +#define CHU_YEAR 1 /* second half is one's complement */ + diff --git a/usr.sbin/xntpd/include/sys/clkdefs.h b/usr.sbin/xntpd/include/sys/clkdefs.h new file mode 100644 index 0000000..b2596e1 --- /dev/null +++ b/usr.sbin/xntpd/include/sys/clkdefs.h @@ -0,0 +1,31 @@ +/* clkdefs.h,v 3.1 1993/07/06 01:07:12 jbj Exp + * Defines for the "clk" timestamping STREAMS module + */ + +#include <sys/ioccom.h> + +/* + * First, we need to define the maximum size of the set of + * characters to timestamp. 32 is MORE than enough. + */ + +#define CLK_MAXSTRSIZE 32 + +/* + * ioctl(fd, CLK_SETSTR, (char*)c ); + * + * will tell the driver that any char in the null-terminated + * string c should be timestamped. It is possible, though + * unlikely that this ioctl number could collide with an + * existing one on your system. If so, change the 'K' + * to some other letter. However, once you've compiled + * the kernel with this include file, you should NOT + * change this file. + */ + +#if __STDC__ +#define CLK_SETSTR _IOWN('K',01,CLK_MAXSTRSIZE) +#else +#define CLK_SETSTR _IOWN(K,01,CLK_MAXSTRSIZE) +#endif + diff --git a/usr.sbin/xntpd/include/sys/parsestreams.h b/usr.sbin/xntpd/include/sys/parsestreams.h new file mode 100644 index 0000000..91786c1 --- /dev/null +++ b/usr.sbin/xntpd/include/sys/parsestreams.h @@ -0,0 +1,66 @@ +/* + * /src/NTP/REPOSITORY/v3/include/sys/parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp + * + * parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp + * + * Copyright (c) 1989,1990,1991,1992,1993 + * Frank Kardel Friedrich-Alexander Universitaet Erlangen-Nuernberg + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#if !(defined(lint) || defined(__GNUC__)) + static char parse77hrcsid[]="parsestreams.h,v 3.9 1993/11/01 19:59:57 kardel Exp"; +#endif + +#undef PARSEKERNEL +#if defined(KERNEL) || defined(_KERNEL) +#ifndef PARSESTREAM +#define PARSESTREAM +#endif +#endif +#if defined(PARSESTREAM) && defined(STREAM) +#define PARSEKERNEL +#include <sys/ppsclock.h> + +struct parsestream /* parse module local data */ +{ + queue_t *parse_queue; /* read stream for this channel */ + queue_t *parse_dqueue; /* driver queue entry (PPS support) */ + unsigned long parse_status; /* operation flags */ + void *parse_data; /* local data space (PPS support) */ + parse_t parse_io; /* io structure */ + struct ppsclockev parse_ppsclockev; /* copy of last pps event */ +}; + +typedef struct parsestream parsestream_t; + +#define PARSE_ENABLE 0x0001 + +/*--------------- debugging support ---------------------------------*/ + +#ifdef DEBUG_DCF + +extern int parsedebug; + +#define DD_OPEN 0x00000001 +#define DD_CLOSE 0x00000002 +#define DD_RPUT 0x00000004 +#define DD_WPUT 0x00000008 +#define DD_RSVC 0x00000010 +#define DD_PARSE 0x00000020 +#define DD_INSTALL 0x00000040 +#define DD_ISR 0x00000080 +#define DD_RAWDCF 0x00000100 + +#define parseprintf(X, Y) if ((X) & parsedebug) printf Y + +#else + +#define parseprintf(X, Y) + +#endif +#endif diff --git a/usr.sbin/xntpd/include/sys/ppsclock.h b/usr.sbin/xntpd/include/sys/ppsclock.h new file mode 100644 index 0000000..952a57b --- /dev/null +++ b/usr.sbin/xntpd/include/sys/ppsclock.h @@ -0,0 +1,59 @@ +/* ppsclock.h,v 3.1 1993/07/06 01:07:14 jbj Exp */ +/* + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66. + * + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory. + * 4. The name of the University may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define PPSCLOCKSTR "ppsclock" + +struct ppsclockev { + struct timeval tv; + u_int serial; +}; + +#if defined(__STDC__) || defined(SYS_HPUX) +#ifdef _IOR +#define CIOGETEV _IOR('C', 0, struct ppsclockev) /* get last pps event */ +#else /* XXX SOLARIS is different */ +#define CIO ('C'<<8) +#define CIOGETEV (CIO|0) /* get last pps event */ +#endif /* _IOR */ +#else /* __STDC__ */ +#ifdef _IOR +#define CIOGETEV _IOR(C, 0, struct ppsclockev) /* get last pps event */ +#else /* XXX SOLARIS is different */ +#define CIO ('C'<<8) +#define CIOGETEV (CIO|0) /* get last pps event */ +#endif /* _IOR */ +#endif /* __STDC__ */ diff --git a/usr.sbin/xntpd/include/sys/tpro.h b/usr.sbin/xntpd/include/sys/tpro.h new file mode 100644 index 0000000..1cdaf9c --- /dev/null +++ b/usr.sbin/xntpd/include/sys/tpro.h @@ -0,0 +1,34 @@ +/* tpro.h,v 3.1 1993/07/06 01:07:07 jbj Exp + * Structure for the KSI/Odetics TPRO-S data returned in reponse to a + * read() call. Note that these are driver-specific and not dependent on + * 32/64-bit architecture. + */ +struct tproval { + u_short day100; /* days * 100 */ + u_short day10; /* days * 10 */ + u_short day1; /* days * 1 */ + u_short hour10; /* hours * 10 */ + u_short hour1; /* hours * 1 */ + u_short min10; /* minutes * 10 */ + u_short min1; /* minutes * 1 */ + u_short sec10; /* seconds * 10 */ + u_short sec1; /* seconds * 1*/ + u_short ms100; /* milliseconds * 100 */ + u_short ms10; /* milliseconds * 10 */ + u_short ms1; /* milliseconds * 1 */ + u_short usec100; /* microseconds * 100 */ + u_short usec10; /* microseconds * 10 */ + u_short usec1; /* microseconds * 1 */ + long tv_sec; /* seconds */ + long tv_usec; /* microseconds */ + u_short status; /* status register */ +}; + +/* + * Status register bits + */ +#define TIMEAVAIL 0x0001 /* time available */ +#define NOSIGNAL 0x0002 /* insufficient IRIG-B signal */ +#define NOSYNC 0x0004 /* local oscillator not synchronized */ + +/* end of tpro.h */ |