1 .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
2 .\" Sun Jan 15 19:16:33 1995
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
7 .TH lp 4 (date) "Linux man-pages (unreleased)"
9 lp \- line printer devices
12 .B #include <linux/lp.h>
15 \fBlp\fP[0\(en2] are character devices for the parallel line printers;
16 they have major number 6 and minor number 0\(en2.
18 correspond to the printer port base addresses 0x03bc, 0x0378, and 0x0278.
19 Usually they have mode 220 and are owned by user
23 You can use printer ports either with polling or with interrupts.
24 Interrupts are recommended when high traffic is expected, for example,
26 For typical dot matrix printers, polling will usually be enough.
27 The default is polling.
33 .BR "int ioctl(int " fd ", LPTIME, int " arg )
34 Sets the amount of time that the driver sleeps before rechecking the printer
35 when the printer's buffer appears to be filled to
37 If you have a fast printer, decrease this number;
38 if you have a slow printer, then increase it.
39 This is in hundredths of a second, the default 2
41 It influences only the polling driver.
43 .BR "int ioctl(int " fd ", LPCHAR, int " arg )
44 Sets the maximum number of busy-wait iterations which the polling driver does
45 while waiting for the printer to get ready for receiving a character to
47 If printing is too slow, increase this number; if the
48 system gets too slow, decrease this number.
50 It influences only the polling driver.
52 .BR "int ioctl(int " fd ", LPABORT, int " arg )
55 is 0, the printer driver will retry on errors, otherwise
59 .BR "int ioctl(int " fd ", LPABORTOPEN, int " arg )
64 will be aborted on error, otherwise error will be ignored.
65 The default is to ignore it.
67 .BR "int ioctl(int " fd ", LPCAREFUL, int " arg )
70 is 0, then the out-of-paper, offline, and error signals are
71 required to be false on all writes, otherwise they are ignored.
72 The default is to ignore them.
74 .BR "int ioctl(int " fd ", LPWAIT, int " arg )
75 Sets the number of busy waiting iterations to wait before strobing the
76 printer to accept a just-written character, and the number of iterations to
77 wait before turning the strobe off again,
80 The specification says this time should be 0.5
81 microseconds, but experience has shown the delay caused by the code is
83 For that reason, the default value is 0.
84 .\" FIXME . Actually, since Linux 2.2, the default is 1
85 This is used for both the polling and the interrupt driver.
87 .BR "int ioctl(int " fd ", LPSETIRQ, int " arg )
90 requires superuser privileges.
93 containing the new IRQ as argument.
94 As a side effect, the printer will be reset.
97 is 0, the polling driver will be used, which is also default.
99 .BR "int ioctl(int " fd ", LPGETIRQ, int *" arg )
100 Stores the currently used IRQ in
103 .BR "int ioctl(int " fd ", LPGETSTATUS, int *" arg )
104 Stores the value of the status port in
106 The bits have the following meaning:
109 LP_PBUSY inverted busy input, active high
110 LP_PACK unchanged acknowledge input, active low
111 LP_POUTPA unchanged out-of-paper input, active high
112 LP_PSELECD unchanged selected input, active high
113 LP_PERRORP unchanged error input, active low
116 Refer to your printer manual for the meaning of the signals.
117 Note that undocumented bits may also be set, depending on your printer.
119 .BR "int ioctl(int " fd ", LPRESET)"
125 .\" The printer driver was originally written by Jim Weigand and Linus
127 .\" It was further improved by Michael K.\& Johnson.
128 .\" The interrupt code was written by Nigel Gamble.
129 .\" Alan Cox modularized it.
130 .\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.