diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-11-12 16:42:24 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-11-12 16:42:24 +0000 |
commit | bcf71d9542d48d30c2efd636c550eb0269823fcc (patch) | |
tree | 019a1837713aa2ae1d35b11bc7a27f5887667d4d | |
parent | 43a7b5be5945dfa1db5318df9c616685740e4cb5 (diff) |
Don't use utc_off, time is always reported in UTC.
-rw-r--r-- | sys/dev/usb/umbg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/umbg.c b/sys/dev/usb/umbg.c index fec55999dcc..7331c9fa2d4 100644 --- a/sys/dev/usb/umbg.c +++ b/sys/dev/usb/umbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umbg.c,v 1.3 2007/11/10 14:40:09 mbalmer Exp $ */ +/* $OpenBSD: umbg.c,v 1.4 2007/11/12 16:42:23 mbalmer Exp $ */ /* * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org> @@ -88,9 +88,9 @@ struct mbg_time { }; struct mbg_time_hr { - u_int32_t sec; /* seconds since the epoch */ + u_int32_t sec; /* always UTC */ u_int32_t frac; /* fractions of second */ - int32_t utc_off; /* UTC offset in seconds */ + int32_t utc_off; /* informal only, in seconds */ u_int16_t status; u_int8_t signal; }; @@ -380,7 +380,7 @@ umbg_task(void *arg) } tlocal = tstamp.tv_sec * NSECPERSEC + tstamp.tv_nsec; - trecv = (letoh32(tframe.sec) - letoh32(tframe.utc_off)) * NSECPERSEC + + trecv = letoh32(tframe.sec) * NSECPERSEC + (letoh32(tframe.frac) * NSECPERSEC >> 32); sc->sc_timedelta.value = tlocal - trecv; |