From e036dfc6a10cd52b51a7ec9234f120bddbfa6dda Mon Sep 17 00:00:00 2001 From: n_hibma Date: Sun, 25 Jul 1999 18:54:22 +0000 Subject: Add comments, change variable names to make them consistent (r -> err, timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.) --- sys/dev/usb/usb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'sys/dev/usb/usb.c') diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 9165a4f..c6b825d 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -243,6 +243,7 @@ usbioctl(dev, cmd, data, flag, p) if (sc == 0 || !sc->sc_running) return (ENXIO); + switch (cmd) { #ifdef USB_DEBUG case USB_SETDEBUG: @@ -345,23 +346,23 @@ usbpoll(dev, events, p) int events; struct proc *p; { - int revents, s; + int revents = 0; + int s; + USB_GET_SC(usb, USBUNIT(dev), sc); - DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events)); s = splusb(); - revents = 0; + if (events & (POLLOUT | POLLWRNORM)) if (sc->sc_bus->needs_explore) revents |= events & (POLLOUT | POLLWRNORM); - DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents)); - if (revents == 0) { - if (events & (POLLOUT | POLLWRNORM)) { - DPRINTFN(2, ("usbpoll: selrecord\n")); + + if (revents == 0) + if (events & (POLLOUT | POLLWRNORM)) selrecord(p, &sc->sc_consel); - } - } + splx(s); + return (revents); } -- cgit v1.1