Fix for powering off a HP DJ950C during printing. As stated by Ian:

When the printer is turned off the pipe write will cause and error,
which causes lpd to close the device and reopen it to clear the error.
After a short while the device will disappear from the bus but lpd will
have opened the ulpt0 port by then. ulpt_status will check for status
without checking the sc->dying flag and panic the kernel when the device
finally disappears from the bus.

Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>
This commit is contained in:
Nick Hibma 2000-11-07 10:50:34 +00:00
parent 44b5247d95
commit 1d8068f94a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68435

View file

@ -427,6 +427,11 @@ ulptopen(dev, flag, mode, p)
sc->sc_state = 0;
return (error);
}
if (sc->sc_dying) {
sc->sc_state = 0;
return (ENXIO);
}
}
err = usbd_open_pipe(sc->sc_iface, sc->sc_bulk, 0, &sc->sc_bulkpipe);