aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.c
diff options
context:
space:
mode:
authorJosef Karthauser <joe@FreeBSD.org>2002-04-07 11:56:19 +0000
committerJosef Karthauser <joe@FreeBSD.org>2002-04-07 11:56:19 +0000
commitdfdec0c69e92d6764ce5c30c80df6315576e3758 (patch)
treea6a1e0419e1240583456a51d68d01bca294738a5 /sys/dev/usb/usbdi.c
parent7f31496b8fc0d568d1136a273f12dc84726fae6c (diff)
downloadsrc-dfdec0c69e92d6764ce5c30c80df6315576e3758.tar.gz
src-dfdec0c69e92d6764ce5c30c80df6315576e3758.zip
MFNetBSD: usbdi.c (1.63), usbdi.h (1.41)
date: 2000/03/02 12:37:51; author: augustss; Use ratecheck() to limit error messages on disconnect. Break out some common functionality. We don't have ratecheck() in our kernel yet, so I've hardcoded usb_ratecheck() to return true always.
Notes
Notes: svn path=/head/; revision=94073
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r--sys/dev/usb/usbdi.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 966b8cec4b1c..fd65b30657a8 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1119,6 +1119,23 @@ usb_match_device(const struct usb_devno *tbl, u_int nentries, u_int sz,
return (NULL);
}
+/*
+ * usbd_ratecheck() can limit the number of error messages that occurs.
+ * When a device is unplugged it may take up to 0.25s for the hub driver
+ * to notice it. If the driver continuosly tries to do I/O operations
+ * this can generate a large number of messages.
+ */
+int
+usbd_ratecheck(struct timeval *last)
+{
+#if 0
+ static struct timeval errinterval = { 0, 2500000 }; /* 0.25 s*/
+
+ return (ratecheck(last, &errinterval));
+#endif
+ return (1);
+}
+
#if defined(__FreeBSD__)
int
usbd_driver_load(module_t mod, int what, void *arg)