Deleted Added
full compact
pps.c (41591) pps.c (43433)
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * $Id: pps.c,v 1.11 1998/08/24 16:31:27 phk Exp $
9 * $Id: pps.c,v 1.12 1998/12/07 21:58:16 archie Exp $
10 *
11 * This driver implements a draft-mogul-pps-api-02.txt PPS source.
12 *
13 * The input pin is pin#10
14 * The echo output pin is pin#14
15 *
16 */
17
18#include "opt_devfs.h"
10 *
11 * This driver implements a draft-mogul-pps-api-02.txt PPS source.
12 *
13 * The input pin is pin#10
14 * The echo output pin is pin#14
15 *
16 */
17
18#include "opt_devfs.h"
19#include "opt_ntp.h"
19
20#include <sys/param.h>
21#include <sys/kernel.h>
22#include <sys/systm.h>
23#include <sys/conf.h>
24#include <sys/timepps.h>
25#ifdef DEVFS
26#include <sys/devfsext.h>

--- 101 unchanged lines hidden (view full) ---

128 if ((unit >= npps))
129 return (ENXIO);
130
131 sc = softc[unit];
132
133 if (ppb_request_bus(&sc->pps_dev, PPB_WAIT|PPB_INTR))
134 return (EINTR);
135
20
21#include <sys/param.h>
22#include <sys/kernel.h>
23#include <sys/systm.h>
24#include <sys/conf.h>
25#include <sys/timepps.h>
26#ifdef DEVFS
27#include <sys/devfsext.h>

--- 101 unchanged lines hidden (view full) ---

129 if ((unit >= npps))
130 return (ENXIO);
131
132 sc = softc[unit];
133
134 if (ppb_request_bus(&sc->pps_dev, PPB_WAIT|PPB_INTR))
135 return (EINTR);
136
137 ppb_wctr(&sc->pps_dev, 0);
136 ppb_wctr(&sc->pps_dev, IRQENABLE);
137
138 return(0);
139}
140
141static int
142ppsclose(dev_t dev, int flags, int fmt, struct proc *p)
143{
144 struct pps_data *sc = softc[minor(dev)];
145
146 sc->ppsparam.mode = 0;
138 ppb_wctr(&sc->pps_dev, IRQENABLE);
139
140 return(0);
141}
142
143static int
144ppsclose(dev_t dev, int flags, int fmt, struct proc *p)
145{
146 struct pps_data *sc = softc[minor(dev)];
147
148 sc->ppsparam.mode = 0;
149
150 ppb_wdtr(&sc->pps_dev, 0);
151 ppb_wctr(&sc->pps_dev, 0);
152
147 ppb_release_bus(&sc->pps_dev);
148 return(0);
149}
150
151static void
152ppsintr(int unit)
153{
154 struct pps_data *sc = softc[unit];

--- 52 unchanged lines hidden ---
153 ppb_release_bus(&sc->pps_dev);
154 return(0);
155}
156
157static void
158ppsintr(int unit)
159{
160 struct pps_data *sc = softc[unit];

--- 52 unchanged lines hidden ---