summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/pps.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-06-13 09:30:26 +0000
committerphk <phk@FreeBSD.org>1998-06-13 09:30:26 +0000
commit885f9e9d51aad3937cd0b5958dc4547208187eb3 (patch)
tree37d60610268d012ff6fd0d03e72fcee6d7cbde9d /sys/dev/ppbus/pps.c
parent98ec89f1825fc700e6d9bce147a026b4036af855 (diff)
downloadFreeBSD-src-885f9e9d51aad3937cd0b5958dc4547208187eb3.zip
FreeBSD-src-885f9e9d51aad3937cd0b5958dc4547208187eb3.tar.gz
Introduce std_pps_ioctl() to automagically DTRT.
Add scaling capability to timex.offset, ntpd-4.0.73 will support this.
Diffstat (limited to 'sys/dev/ppbus/pps.c')
-rw-r--r--sys/dev/ppbus/pps.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index 74bcf0c..4a17eb161 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: pps.c,v 1.6 1998/06/08 02:43:12 bde Exp $
+ * $Id: pps.c,v 1.7 1998/06/12 23:15:53 phk Exp $
*
* This driver implements a draft-mogul-pps-api-02.txt PPS source.
*
@@ -180,40 +180,10 @@ static int
ppsioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
struct pps_data *sc = softc[minor(dev)];
- pps_params_t *pp;
- pps_info_t *pi;
- switch (cmd) {
- case PPS_IOC_CREATE:
- return (0);
- case PPS_IOC_DESTROY:
- return (0);
- case PPS_IOC_SETPARAMS:
- pp = (pps_params_t *)data;
- if (pp->mode & ~ppscap)
- return (EINVAL);
- sc->ppsparam = *pp;
- return (0);
- case PPS_IOC_GETPARAMS:
- pp = (pps_params_t *)data;
- *pp = sc->ppsparam;
- return (0);
- case PPS_IOC_GETCAP:
- *(int*)data = ppscap;
- return (0);
- case PPS_IOC_FETCH:
- pi = (pps_info_t *)data;
- *pi = sc->ppsinfo;
- pi->current_mode = sc->ppsparam.mode;
- return (0);
- case PPS_IOC_WAIT:
- return (EOPNOTSUPP);
- default:
- return (ENODEV);
- }
+ return (std_pps_ioctl(cmd, data, &sc->ppsparam, &sc->ppsinfo, ppscap));
}
-
static pps_devsw_installed = 0;
static void
OpenPOWER on IntegriCloud