svn commit: r195964 - head/sys/dev/usb/serial
Alfred Perlstein
alfred at FreeBSD.org
Thu Jul 30 00:16:07 UTC 2009
Author: alfred
Date: Thu Jul 30 00:16:06 2009
New Revision: 195964
URL: http://svn.freebsd.org/changeset/base/195964
Log:
ULPT:
- add conditional printer status checking
- P4 ID: 166176
Submitted by: hps
Approved by: re
Modified:
head/sys/dev/usb/serial/ulpt.c
Modified: head/sys/dev/usb/serial/ulpt.c
==============================================================================
--- head/sys/dev/usb/serial/ulpt.c Thu Jul 30 00:15:50 2009 (r195963)
+++ head/sys/dev/usb/serial/ulpt.c Thu Jul 30 00:16:06 2009 (r195964)
@@ -426,6 +426,9 @@ ulpt_open(struct usb_fifo *fifo, int ffl
/* we assume that open is a serial process */
if (sc->sc_fflags == 0) {
+
+ /* reset USB paralell port */
+
ulpt_reset(sc);
}
return (unlpt_open(fifo, fflags));
@@ -720,7 +723,12 @@ ulpt_watchdog(void *arg)
mtx_assert(&sc->sc_mtx, MA_OWNED);
- usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]);
+ /*
+ * Only read status while the device is not opened, due to
+ * possible hardware or firmware bug in some printers.
+ */
+ if (sc->sc_fflags == 0)
+ usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]);
usb_callout_reset(&sc->sc_watchdog,
hz, &ulpt_watchdog, sc);
More information about the svn-src-head
mailing list