Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2009 00:16:06 +0000 (UTC)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195964 - head/sys/dev/usb/serial
Message-ID:  <200907300016.n6U0G6H8086547@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907300016.n6U0G6H8086547>