diff options
author | Alfred Perlstein <alfred@FreeBSD.org> | 2009-07-30 00:16:06 +0000 |
---|---|---|
committer | Alfred Perlstein <alfred@FreeBSD.org> | 2009-07-30 00:16:06 +0000 |
commit | 4743e6da529476c70a4c17e30b8de3203eb18795 (patch) | |
tree | e339ab8dcaf7d8c93a11f93d6b9724540ccdcda0 /sys/dev/usb | |
parent | bd73b187141aae3e07333c211664612120f6e294 (diff) |
ULPT:
- add conditional printer status checking
- P4 ID: 166176
Submitted by: hps
Approved by: re
Notes
Notes:
svn path=/head/; revision=195964
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/serial/ulpt.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c index fd21a1d05ded..786452fb3de6 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); |