1 .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
2 .\" Sun Jan 15 19:16:33 1995
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
26 .TH LP 4 2021-03-22 "Linux" "Linux Programmer's Manual"
28 lp \- line printer devices
31 .B #include <linux/lp.h>
34 \fBlp\fP[0\(en2] are character devices for the parallel line printers;
35 they have major number 6 and minor number 0\(en2.
37 correspond to the printer port base addresses 0x03bc, 0x0378, and 0x0278.
38 Usually they have mode 220 and are owned by user
42 You can use printer ports either with polling or with interrupts.
43 Interrupts are recommended when high traffic is expected, for example,
45 For typical dot matrix printers, polling will usually be enough.
46 The default is polling.
51 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP"
52 Sets the amount of time that the driver sleeps before rechecking the printer
53 when the printer's buffer appears to be filled to
55 If you have a fast printer, decrease this number;
56 if you have a slow printer, then increase it.
57 This is in hundredths of a second, the default 2
59 It influences only the polling driver.
60 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP"
61 Sets the maximum number of busy-wait iterations which the polling driver does
62 while waiting for the printer to get ready for receiving a character to
64 If printing is too slow, increase this number; if the
65 system gets too slow, decrease this number.
67 It influences only the polling driver.
68 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
71 is 0, the printer driver will retry on errors, otherwise
74 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
79 will be aborted on error, otherwise error will be ignored.
80 The default is to ignore it.
81 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP"
84 is 0, then the out-of-paper, offline, and error signals are
85 required to be false on all writes, otherwise they are ignored.
86 The default is to ignore them.
87 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP"
88 Sets the number of busy waiting iterations to wait before strobing the
89 printer to accept a just-written character, and the number of iterations to
90 wait before turning the strobe off again,
93 The specification says this time should be 0.5
94 microseconds, but experience has shown the delay caused by the code is
96 For that reason, the default value is 0.
97 .\" FIXME . Actually, since Linux 2.2, the default is 1
98 This is used for both the polling and the interrupt driver.
99 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP"
102 requires superuser privileges.
105 containing the new IRQ as argument.
106 As a side effect, the printer will be reset.
109 is 0, the polling driver will be used, which is also default.
110 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP"
111 Stores the currently used IRQ in
113 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP"
114 Stores the value of the status port in
116 The bits have the following meaning:
119 LP_PBUSY inverted busy input, active high
120 LP_PACK unchanged acknowledge input, active low
121 LP_POUTPA unchanged out-of-paper input, active high
122 LP_PSELECD unchanged selected input, active high
123 LP_PERRORP unchanged error input, active low
126 Refer to your printer manual for the meaning of the signals.
127 Note that undocumented bits may also be set, depending on your printer.
128 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP"
134 .\" The printer driver was originally written by Jim Weigand and Linus
136 .\" It was further improved by Michael K.\& Johnson.
137 .\" The interrupt code was written by Nigel Gamble.
138 .\" Alan Cox modularized it.
139 .\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.