From 43a7b5be5945dfa1db5318df9c616685740e4cb5 Mon Sep 17 00:00:00 2001 From: Marc Balmer Date: Mon, 12 Nov 2007 16:40:47 +0000 Subject: Don't use utc_off when using the hires timestamp. --- sys/dev/pci/mbg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/dev/pci/mbg.c b/sys/dev/pci/mbg.c index f91f2d5a3af..bf84eb27e02 100644 --- a/sys/dev/pci/mbg.c +++ b/sys/dev/pci/mbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbg.c,v 1.22 2007/11/11 15:30:26 mbalmer Exp $ */ +/* $OpenBSD: mbg.c,v 1.23 2007/11/12 16:40:46 mbalmer Exp $ */ /* * Copyright (c) 2006, 2007 Marc Balmer @@ -68,9 +68,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; }; @@ -351,7 +351,7 @@ mbg_task_hr(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); mbg_update_sensor(sc, &tstamp, tlocal - trecv, tframe.signal, -- cgit v1.2.3