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