diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2006-05-30 22:51:54 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2006-05-30 22:51:54 +0000 |
commit | 46196309614bc3b746024663aa7112a2ce3cbdd3 (patch) | |
tree | 76758a0cbae3707e24f07a090c8c02c7d6fb98c1 /sys/dev | |
parent | 4c50e1b084dffdaa58fb93825124c7357f099e19 (diff) |
Give up trying to communicate after 10 consecutive errors - the device
is most likely not coming back.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/if_cdce.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index a3fa9747bab..16d443052c3 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdce.c,v 1.17 2006/05/27 21:47:55 pascoe Exp $ */ +/* $OpenBSD: if_cdce.c,v 1.18 2006/05/30 22:51:53 pascoe Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -638,7 +638,12 @@ cdce_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) if (status == USBD_STALLED) usbd_clear_endpoint_stall_async(sc->cdce_bulkin_pipe); DELAY(sc->cdce_rxeof_errors * 10000); - sc->cdce_rxeof_errors++; + if (sc->cdce_rxeof_errors++ > 10) { + printf("%s: too many errors, disabling\n", + USBDEVNAME(sc->cdce_dev)); + sc->cdce_dying = 1; + return; + } goto done; } |