diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-05-19 18:45:43 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-05-19 18:45:43 +0000 |
commit | d4a5144b42a537d28be2bfc68f3e3cf0980ede7a (patch) | |
tree | ea16f480b2e398f7df14d31c6a18f7559484430a | |
parent | a8b069c328baa11c735f172e928f37ea4931f5f1 (diff) |
Provide a correct timeout behaviour, fixes some panics people had been
experienting.
Discussed and brought to this shape by art@, drahn@ and myself.
-rw-r--r-- | sys/dev/usb/usb_port.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 1031618e4ab..70e08be1137 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_port.h,v 1.38 2002/05/09 15:06:29 nate Exp $ */ +/* $OpenBSD: usb_port.h,v 1.39 2002/05/19 18:45:42 miod Exp $ */ /* $NetBSD: usb_port.h,v 1.44 2001/05/14 20:35:29 bouyer Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -301,9 +301,13 @@ typedef struct device *device_ptr_t; } usb_dma_t typedef struct timeout usb_callout_t; -#define usb_callout_init(h) +#define usb_callout_init(h) timeout_set(&(h), NULL, NULL) #define usb_callout(h, t, f, d) \ - { timeout_set(&(h), (f), (d)); timeout_add(&(h), (t)); } + do { \ + timeout_del(&(h)); \ + timeout_set(&(h), (f), (d)); \ + timeout_add(&(h), (t)); \ + } while (0) #define usb_uncallout(h, f, d) timeout_del(&(h)) #define usb_lockmgr(l, f, sl, p) lockmgr((l), (f), (sl), (p)) |