summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2009-07-30 00:16:06 +0000
committeralfred <alfred@FreeBSD.org>2009-07-30 00:16:06 +0000
commit37a79960ccc95d350c6439bd5074a57e94fe5442 (patch)
treee339ab8dcaf7d8c93a11f93d6b9724540ccdcda0
parentec456e3a3b32ea50f5c8e3b3a05352e989c10967 (diff)
downloadFreeBSD-src-37a79960ccc95d350c6439bd5074a57e94fe5442.zip
FreeBSD-src-37a79960ccc95d350c6439bd5074a57e94fe5442.tar.gz
ULPT:
- add conditional printer status checking - P4 ID: 166176 Submitted by: hps Approved by: re
-rw-r--r--sys/dev/usb/serial/ulpt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c
index fd21a1d..786452f 100644
--- a/sys/dev/usb/serial/ulpt.c
+++ b/sys/dev/usb/serial/ulpt.c
@@ -426,6 +426,9 @@ ulpt_open(struct usb_fifo *fifo, int fflags)
/* 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);
OpenPOWER on IntegriCloud