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.
This commit is contained in:
joe 2002-04-07 11:56:19 +00:00
parent 2432878dc3
commit 862c145a2f
2 changed files with 19 additions and 0 deletions

View File

@ -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)

View File

@ -177,6 +177,8 @@ usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor
usbd_status usbd_reload_device_desc(usbd_device_handle);
int usbd_ratecheck(struct timeval *last);
/*
* The usb_task structs form a queue of things to run in the USB event
* thread. Normally this is just device discovery when a connect/disconnect