[PARPORT] Re: Need careless option in lp.c


Andrea Arcangeli (andrea@e-mind.com)
Mon, 10 May 1999 02:28:59 +0200 (CEST)


Hi Daniel. Are you still in touch with the user who was getting troubles
with the not-careful behaviour of lp in 2.2.x kernels? Could you try this
patch against 2.2.7 developed by Tim Waugh and check if it will help?

--- linux/drivers/char/lp.c~ Wed Mar 24 01:42:57 1999
+++ linux/drivers/char/lp.c Sun May 2 20:18:39 1999
@@ -202,9 +202,7 @@
 /* Test if the printer is not acking the strobe */
 #define LP_NO_ACKING(status) ((status) & LP_PACK)
 /* Test if the printer has error conditions */
-#define LP_NO_ERROR(status) \
- (((status) & (LP_POUTPA|LP_PSELECD|LP_PERRORP)) == \
- (LP_PSELECD|LP_PERRORP))
+#define LP_NO_ERROR(status) ((status) & LP_PERRORP)
 
 #undef LP_DEBUG
 #undef LP_READ_DEBUG
@@ -424,7 +422,10 @@
 {
         unsigned int last = lp_table[minor].last_error;
         unsigned char status = r_str(minor);
- if ((status & LP_POUTPA)) {
+ if (status & LP_PERRORP)
+ /* No error. */
+ last = 0;
+ else if ((status & LP_POUTPA)) {
                 if (last != LP_POUTPA) {
                         last = LP_POUTPA;
                         printk(KERN_INFO "lp%d out of paper\n", minor);
@@ -434,13 +435,12 @@
                         last = LP_PSELECD;
                         printk(KERN_INFO "lp%d off-line\n", minor);
                 }
- } else if (!(status & LP_PERRORP)) {
+ } else {
                 if (last != LP_PERRORP) {
                         last = LP_PERRORP;
                         printk(KERN_INFO "lp%d on fire!\n", minor);
                 }
         }
- else last = 0;
 
         lp_table[minor].last_error = last;
 

Many thanks.

Andrea Arcangeli

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Sun 09 May 1999 - 20:20:39 EDT