diff options
author | 2014-11-20 10:24:09 +0000 | |
---|---|---|
committer | 2014-11-20 10:24:09 +0000 | |
commit | 6205477f62362e2231a1e737615c91c01af8b768 (patch) | |
tree | b347e29e8a53c75a189b08d14e42dfa1c6da02e8 | |
parent | funky spacing. (diff) | |
download | wireguard-openbsd-6205477f62362e2231a1e737615c91c01af8b768.tar.xz wireguard-openbsd-6205477f62362e2231a1e737615c91c01af8b768.zip |
Force a status check of all the ports of a newly attached hub. In the
interrupt routine properly initialize a variable. Finally stop talking
about the "bus event handler thread". Our USB stack has only one thread
doing discovery for all buses.
Prompted by a report from Patrick Wildt.
-rw-r--r-- | sys/dev/usb/uhub.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 06d34cbceb5..46dc395f5f4 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.78 2014/11/11 20:57:27 mpi Exp $ */ +/* $OpenBSD: uhub.c,v 1.79 2014/11/20 10:24:09 mpi Exp $ */ /* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -324,6 +324,8 @@ uhub_attach(struct device *parent, struct device *self, void *aux) printf("%s: port %d power on failed, %s\n", sc->sc_dev.dv_xname, port, usbd_errstr(err)); + /* Make sure we check the port status at least once. */ + sc->sc_status |= (1 << port); } /* Wait for stable power. */ @@ -573,16 +575,15 @@ uhub_detach(struct device *self, int flags) } /* - * Hub interrupt. - * This an indication that some port has changed status. - * Notify the bus event handler thread that we need - * to be explored again. + * This is an indication that some port has changed status. Remember + * the ports that need attention and notify the USB task thread that + * we need to be explored again. */ void uhub_intr(struct usbd_xfer *xfer, void *addr, usbd_status status) { struct uhub_softc *sc = addr; - uint32_t stats; + uint32_t stats = 0; int i; if (usbd_is_dying(sc->sc_hub)) |