Re: parport driver broken in 2.1.127-pre7?

Andrea Arcangeli (andrea@e-mind.com)
Thu, 5 Nov 1998 13:46:03 +0100 (CET)


On Thu, 5 Nov 1998, Andrea Arcangeli wrote:

>I' ll send to you a patch ASAP that should fix your problem (I just know

Here the patch that should fix your problem:

Index: lp.c
===================================================================
RCS file: /var/cvs/linux/drivers/char/lp.c,v
retrieving revision 1.1.1.1.12.5
diff -u -r1.1.1.1.12.5 lp.c
--- lp.c 1998/11/04 13:28:23 1.1.1.1.12.5
+++ lp.c 1998/11/05 12:41:50
@@ -21,7 +21,9 @@
* Full efficient handling of printer with buggy irq handshake (now I have
* understood the meaning of the strange handshake). This is done sending new
* characters if the interrupt is just happened, even if the printer say to
- * be still BUSY. This is needed at least with Epson Stylus Color.
+ * be still BUSY. This is needed at least with Epson Stylus Color but
+ * to be safe you must #define LP_EPSON_STYLUS_COLOR by hand to take advantage
+ * of this.
* I also fixed the irq on the rising edge of the strobe problem.
* Andrea Arcangeli, 15 Oct 1998
*/
@@ -116,6 +118,7 @@

/* if you have more than 3 printers, remember to increase LP_NO */
#define LP_NO 3
+#undef LP_EPSON_STYLUS_COLOR

struct lp_struct lp_table[LP_NO] =
{
@@ -225,25 +228,32 @@
lp_yield(minor);

status = r_str(minor);
+#ifdef LP_EPSON_STYLUS_COLOR
/*
* On Epson Stylus Color we must continue even if LP_READY()
- * is false to be efficient. This way is backwards
- * compatible with old not-buggy printers. -arca
+ * is false to be efficient. This way _should_ be backwards
+ * compatible with old not-buggy printers but it isn' t. -arca
*/
if (LP_NO_ERROR(status) &&
((lp_table[minor].irq_detected && LP_NO_ACKING(status)) ||
LP_READY(status)))
break;
+ if (!LP_POLLED(minor) || ++count == LP_CHAR(minor))
+ return 0;
+#else
+ if (LP_NO_ERROR(status) && LP_READY(status))
+ break;
/*
* To have a chance to sleep on the interrupt we should break
* the polling loop ASAP. Unfortunately there seems to be
* some hardware that underperform so we leave this
* configurable at runtime. So when printing with irqs
- * `tunelp /dev/lp0 -c 1' is a must to take the full
+ * `tunelp /dev/lp0 -c 1' should be a must to take the full
* advantage of the irq. -arca
*/
if (++count == LP_CHAR(minor))
return 0;
+#endif
}

w_dtr(minor, lpchar);

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/