Re: [PARPORT] Parallel port programming help


Tim Waugh (twaugh@redhat.com)
Thu, 18 Nov 1999 14:29:02 +0000 (GMT)


On Wed, 17 Nov 1999, Jason Fritz wrote:

> I was hoping to use ioctl() to set LPCAREFUL to false, since the lp.h
> header file seemed to indicate this might fix the problem. However, the
> header file also said that this command is obsolete. It appears that it is
> always TRUE now, from what I can tell from the port status.

Yes. If you are in a position to try out kernel patches, you might want
to try this one. Once I get it confirmed that it actually helps people
I'll send it to Alan (unless anyone has objections?).

Tim.
*/

--- linux-2.2.14pre6/drivers/char/lp.c.orig Wed Nov 17 11:47:09 1999
+++ linux-2.2.14pre6/drivers/char/lp.c Wed Nov 17 12:00:06 1999
@@ -424,7 +424,9 @@
 {
         unsigned int last = lp_table[minor].last_error;
         unsigned char status = r_str(minor);
- if (status & LP_PERRORP)
+ /* IEEE 1284 reckons that out-of-paper and off-line don't mean
+ anything unless nFault says so. Some printers disagree. */
+ if ((status & LP_PERRORP) && !(LP_F(minor) & LP_CAREFUL))
                 /* No error. */
                 last = 0;
         else if ((status & LP_POUTPA)) {
@@ -787,14 +789,14 @@
                         else
                                 LP_F(minor) &= ~LP_ABORTOPEN;
                         break;
-#ifdef OBSOLETED
+
                 case LPCAREFUL:
                         if (arg)
                                 LP_F(minor) |= LP_CAREFUL;
                         else
                                 LP_F(minor) &= ~LP_CAREFUL;
                         break;
-#endif
+
                 case LPTRUSTIRQ:
                         if (arg)
                                 LP_F(minor) |= LP_TRUST_IRQ;
--- linux-2.2.14pre6/include/linux/lp.h.orig Wed Nov 17 12:01:22 1999
+++ linux-2.2.14pre6/include/linux/lp.h Wed Nov 17 12:01:34 1999
@@ -19,7 +19,7 @@
 #define LP_NOPA 0x0010
 #define LP_ERR 0x0020
 #define LP_ABORT 0x0040
-#define LP_CAREFUL 0x0080 /* obsoleted -arca */
+#define LP_CAREFUL 0x0080
 #define LP_ABORTOPEN 0x0100
 #define LP_TRUST_IRQ 0x0200
 

-- 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 Thu 18 Nov 1999 - 09:32:57 EST