summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-09-30 11:24:59 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-09-30 11:24:59 +0000
commit80298a8051041d2552d5796d7c5417e972a4db22 (patch)
treefde8f8a61be355651e1a8e4df8f892e84b84938e /sys
parentc34c37afb9af89729861a193922e6ff0fe04caf2 (diff)
Reset device on errors.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uow.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c
index 739c634d18b..9f7b42e1cae 100644
--- a/sys/dev/usb/uow.c
+++ b/sys/dev/usb/uow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uow.c,v 1.11 2006/09/30 10:54:55 grange Exp $ */
+/* $OpenBSD: uow.c,v 1.12 2006/09/30 11:24:58 grange Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -361,6 +361,8 @@ uow_cmd(struct uow_softc *sc, int type, int cmd, int param)
printf("%s: cmd failed, type 0x%02x, cmd 0x%04x, "
"param 0x%04x: %s\n", USBDEVNAME(sc->sc_dev), type, cmd,
param, usbd_errstr(error));
+ if (cmd != DS2490_CTL_RESET_DEVICE)
+ uow_reset(sc);
return (1);
}
@@ -409,6 +411,7 @@ uow_read(struct uow_softc *sc, void *buf, int len)
if ((error = usbd_sync_transfer(sc->sc_xfer)) != 0) {
printf("%s: read failed, len %d: %s\n",
USBDEVNAME(sc->sc_dev), len, usbd_errstr(error));
+ uow_reset(sc);
return (1);
}
@@ -432,6 +435,7 @@ uow_write(struct uow_softc *sc, const void *buf, int len)
if ((error = usbd_sync_transfer(sc->sc_xfer)) != 0) {
printf("%s: write failed, len %d: %s\n",
USBDEVNAME(sc->sc_dev), len, usbd_errstr(error));
+ uow_reset(sc);
return (1);
}