2.2.1-7: Unable to print if printer in ON during boot

Serguei Miridonov (mirsev@cicese.mx)
Sat, 08 May 1999 19:08:28 -0700


This is a multi-part message in MIME format.
--------------9D1BE8C0FAEB4E75C8BD0B95
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The situation: If the printer (HP DeskJet 520) in ON during kernel
loading, the printing is impossible without some special means. If the
printer is OFF on Linux loading and is turned ON after that, everything
is OK.

Machine:

Pentium MMX 233/64M RAM
i430TX chipset
BIOS Parallel port settings: EPP1.9+SPP or EPP1.7+SPP.

I tried different combinations: parport_pc as module and builtin in the
kernel, the behavior is the same. Printing is not possible, reason: Out
of paper. If I turn the printer OFF and disconnect/reconnect the cable,
the problem disappears. Finally I wrote small and ugly program which
cleares the port and resets the printer (attached below). It cures the
problem, but I think that it would be better if something like this is
done in the parport_pc or lp driver.

Thanks.

--
Serguei Miridonov                CICESE, Research Center,
CICESE, Optics Dept.             Ensenada B.C., Mexico
PO Box 434944                    E-mail: mirsev@cicese.mx
San Diego, CA 92143-4944         FAX: +52 (61) 750553
U.S.A.

--------------9D1BE8C0FAEB4E75C8BD0B95 Content-Type: text/plain; charset=us-ascii; name="clrpp.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="clrpp.c"

#include <asm/io.h>

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/perm.h>

#define PPORT 0x378

#define ECONTROL 0x402 #define CONFIGB 0x401 #define CONFIGA 0x400 #define EPPDATA 0x4 #define EPPADDR 0x3 #define CONTROL 0x2 #define STATUS 0x1 #define DATA 0

static void getperm (int on_off) { if (ioperm(PPORT, EPPDATA-DATA+1, on_off)) { perror("Cannot access parallel port"); exit(1); } }

int main (int argc, char *argv) { getperm(1); outb (0xd9, PPORT+STATUS); usleep (1); outb (0xd8, PPORT+STATUS); usleep (100); outb (0x08, PPORT+CONTROL); usleep (1); outb (0x0c, PPORT+CONTROL); while ((inb(PPORT+STATUS) & 0x80) == 0) usleep(1000); outb (0xd9, PPORT+STATUS); usleep (1); outb (0xd8, PPORT+STATUS); usleep (1); return 0; }

--------------9D1BE8C0FAEB4E75C8BD0B95--

- 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/