summaryrefslogtreecommitdiff
path: root/sys/net/if_strip.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>2004-06-21 23:50:39 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>2004-06-21 23:50:39 +0000
commitee05a750df8c3f9f5d686affb4df7e316507797a (patch)
tree887af571215b85d480946bb169aafa0605c786db /sys/net/if_strip.c
parente84c5b85eb5d0fc9af7eb3cdcc77a22eb07dec74 (diff)
First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
Diffstat (limited to 'sys/net/if_strip.c')
-rw-r--r--sys/net/if_strip.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/net/if_strip.c b/sys/net/if_strip.c
index 34984c4a50a..c7f27a6d256 100644
--- a/sys/net/if_strip.c
+++ b/sys/net/if_strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_strip.c,v 1.28 2004/04/25 18:50:01 henning Exp $ */
+/* $OpenBSD: if_strip.c,v 1.29 2004/06/21 23:50:36 tholo Exp $ */
/* $NetBSD: if_strip.c,v 1.2.4.3 1996/08/03 00:58:32 jtc Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
@@ -315,7 +315,7 @@ void strip_timeout(void *x);
#define CLEAR_RESET_TIMER(sc) \
do {\
(sc)->sc_state = ST_ALIVE; \
- (sc)->sc_statetimo = time.tv_sec + ST_PROBE_INTERVAL; \
+ (sc)->sc_statetimo = time_second + ST_PROBE_INTERVAL; \
} while (0)
/*
@@ -324,13 +324,13 @@ void strip_timeout(void *x);
*/
#define FORCE_RESET(sc) \
do {\
- (sc)->sc_statetimo = time.tv_sec - 1; \
+ (sc)->sc_statetimo = time_second - 1; \
(sc)->sc_state = ST_DEAD; \
/*(sc)->sc_if.if_timer = 0;*/ \
} while (0)
#define RADIO_PROBE_TIMEOUT(sc) \
- ((sc)-> sc_statetimo > time.tv_sec)
+ ((sc)-> sc_statetimo > time_second)
@@ -424,7 +424,7 @@ stripinit(sc)
/* Initialize radio probe/reset state machine */
sc->sc_state = ST_DEAD; /* assumet the worst. */
- sc->sc_statetimo = time.tv_sec; /* do reset immediately */
+ sc->sc_statetimo = time_second; /* do reset immediately */
return (1);
}
@@ -686,7 +686,7 @@ strip_send(sc, m0)
* If a radio probe is due now, append it to this packet rather
* than waiting until the watchdog routine next runs.
*/
- if (time.tv_sec >= sc->sc_statetimo && sc->sc_state == ST_ALIVE)
+ if (time_second >= sc->sc_statetimo && sc->sc_state == ST_ALIVE)
strip_proberadio(sc, tp);
return (m0);
@@ -1385,7 +1385,7 @@ strip_resetradio(sc, tp)
*/
sc->sc_state = ST_DEAD;
sc->sc_lastpacket = time;
- sc->sc_statetimo = time.tv_sec + STRIP_RESET_INTERVAL;
+ sc->sc_statetimo = time_second + STRIP_RESET_INTERVAL;
/*
* XXX Does calling the tty output routine now help resets?
@@ -1428,7 +1428,7 @@ strip_proberadio(sc, tp)
sc->sc_if.if_xname);
/* Go to probe-sent state, set timeout accordingly. */
sc->sc_state = ST_PROBE_SENT;
- sc->sc_statetimo = time.tv_sec + ST_PROBERESPONSE_INTERVAL;
+ sc->sc_statetimo = time_second + ST_PROBERESPONSE_INTERVAL;
} else {
addlog("%s: incomplete probe, tty queue %d bytes overfull\n",
sc->sc_if.if_xname, overflow);
@@ -1498,13 +1498,13 @@ strip_watchdog(ifp)
ifp->if_xname,
((unsigned) sc->sc_state < 3) ?
strip_statenames[sc->sc_state] : "<<illegal state>>",
- sc->sc_statetimo - time.tv_sec);
+ sc->sc_statetimo - time_second);
#endif
/*
* If time in this state hasn't yet expired, return.
*/
- if ((ifp->if_flags & IFF_UP) == 0 || sc->sc_statetimo > time.tv_sec) {
+ if ((ifp->if_flags & IFF_UP) == 0 || sc->sc_statetimo > time_second) {
goto done;
}