summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormglocker <mglocker@openbsd.org>2008-08-10 10:01:25 +0000
committermglocker <mglocker@openbsd.org>2008-08-10 10:01:25 +0000
commitdb186c4fc5835b85a4cd23bdbf996111506ebc7a (patch)
tree1381b7c24494a454fb4e9569f0e692fa782dbb54
parentDon't assume the first LAPIC in the table corresponds to the boot processor. (diff)
downloadwireguard-openbsd-db186c4fc5835b85a4cd23bdbf996111506ebc7a.tar.xz
wireguard-openbsd-db186c4fc5835b85a4cd23bdbf996111506ebc7a.zip
Prepare for ehci:
- Remove GET_DEF request for negotation. It doesn't help, instead keep breaking devices. - On device close first switch back to default interface 0 before abort/close the isoc pipe. This fixes IOERRORs on device re-open.
-rw-r--r--sys/dev/usb/uvideo.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index f0c8eaa522f..d4542dbb576 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.77 2008/08/09 08:42:03 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.78 2008/08/10 10:01:25 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -1033,12 +1033,9 @@ uvideo_vs_negotiation(struct uvideo_softc *sc, int commit)
/* get probe */
bzero(probe_data, sizeof(probe_data));
- error = uvideo_vs_get_probe(sc, probe_data, GET_DEF);
- if (error != USBD_NORMAL_COMPLETION) {
- error = uvideo_vs_get_probe(sc, probe_data, GET_CUR);
- if (error != USBD_NORMAL_COMPLETION)
- return (error);
- }
+ error = uvideo_vs_get_probe(sc, probe_data, GET_CUR);
+ if (error != USBD_NORMAL_COMPLETION)
+ return (error);
/* set probe */
pc->bFormatIndex = sc->sc_fmtgrp_cur->format->bFormatIndex;
@@ -1134,10 +1131,8 @@ uvideo_vs_get_probe(struct uvideo_softc *sc, uint8_t *probe_data,
err = usbd_do_request(sc->sc_udev, &req, probe_data);
if (err) {
- if (request != GET_DEF) {
- printf("%s: could not GET probe request: %s\n",
- DEVNAME(sc), usbd_errstr(err));
- }
+ printf("%s: could not GET probe request: %s\n",
+ DEVNAME(sc), usbd_errstr(err));
return (USBD_INVAL);
}
DPRINTF(1, "%s: GET probe request successfully\n", DEVNAME(sc));
@@ -1341,14 +1336,14 @@ uvideo_vs_open(struct uvideo_softc *sc)
void
uvideo_vs_close(struct uvideo_softc *sc)
{
+ /* switch back to default interface (turns off cam LED) */
+ (void)usbd_set_interface(sc->sc_vs_curr->ifaceh, 0);
+
if (sc->sc_vs_curr->pipeh) {
usbd_abort_pipe(sc->sc_vs_curr->pipeh);
usbd_close_pipe(sc->sc_vs_curr->pipeh);
sc->sc_vs_curr->pipeh = NULL;
}
-
- /* switch back to default interface (turns off cam LED) */
- (void)usbd_set_interface(sc->sc_vs_curr->ifaceh, 0);
}
usbd_status