]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/lp.4
getauxval.3: grfix
[thirdparty/man-pages.git] / man4 / lp.4
CommitLineData
fea681da 1'\" t
3d54a910
MK
2.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
3.\" Sun Jan 15 19:16:33 1995
fea681da 4.\"
1dd72f9c 5.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
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.
10.\"
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.
15.\"
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.
20.\"
21.\" You should have received a copy of the GNU General Public
c715f741
MK
22.\" License along with this manual; if not, see
23.\" <http://www.gnu.org/licenses/>.
6a8d8745 24.\" %%%LICENSE_END
fea681da
MK
25.\"
26.\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
69289f8a 27.TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
28.SH NAME
29lp \- line printer devices
30.SH SYNOPSIS
31.B #include <linux/lp.h>
32.SH CONFIGURATION
33\fBlp\fP[0\(en2] are character devices for the parallel line printers;
c13182ef
MK
34they have major number 6 and minor number 0\(en2.
35The minor numbers
fea681da 36correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278.
c13182ef
MK
37Usually they have mode 220 and are owned by root and group lp.
38You can use printer ports either with polling or with interrupts.
75b94dc3
MK
39Interrupts are recommended when high traffic is expected, for example,
40for laser printers.
01e51a70 41For typical dot matrix printers, polling will usually be enough.
c13182ef 42The default is polling.
fea681da
MK
43.SH DESCRIPTION
44The following
45.BR ioctl (2)
46calls are supported:
47.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP"
48Sets the amount of time that the driver sleeps before rechecking the printer
35cfd378
MK
49when the printer's buffer appears to be filled to
50.IR arg .
c13182ef 51If you have a fast printer, decrease this number;
7f627874 52if you have a slow printer, then increase it.
c13182ef
MK
53This is in hundredths of a second, the default 2
54being 0.02 seconds.
02f47ea7 55It influences only the polling driver.
fea681da
MK
56.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP"
57Sets the maximum number of busy-wait iterations which the polling driver does
58while waiting for the printer to get ready for receiving a character to
35cfd378 59.IR arg .
c13182ef
MK
60If printing is too slow, increase this number; if the
61system gets too slow, decrease this number.
62The default is 1000.
02f47ea7 63It influences only the polling driver.
fea681da 64.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
35cfd378
MK
65If
66.I arg
67is 0, the printer driver will retry on errors, otherwise
c13182ef
MK
68it will abort.
69The default is 0.
fea681da 70.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
35cfd378
MK
71If
72.I arg
73is 0,
fea681da 74.BR open (2)
c13182ef
MK
75will be aborted on error, otherwise error will be ignored.
76The default is to ignore it.
fea681da 77.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP"
35cfd378
MK
78If
79.I arg
e05f3710 80is 0, then the out-of-paper, offline, and error signals are
c13182ef
MK
81required to be false on all writes, otherwise they are ignored.
82The default is to ignore them.
fea681da
MK
83.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP"
84Sets the number of busy waiting iterations to wait before strobing the
85printer to accept a just-written character, and the number of iterations to
86wait before turning the strobe off again,
35cfd378
MK
87to
88.IR arg .
c13182ef 89The specification says this time should be 0.5
fea681da 90microseconds, but experience has shown the delay caused by the code is
c13182ef
MK
91already enough.
92For that reason, the default value is 0.
86683c22 93.\" FIXME . Actually, since Linux 2.2, the default is 1
c13182ef 94This is used for both the polling and the interrupt driver.
fea681da 95.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP"
c13182ef 96This
5e21af3a 97.BR ioctl (2)
c13182ef 98requires superuser privileges.
f88233dd
MK
99It takes an
100.I int
101containing the new IRQ as argument.
c13182ef 102As a side effect, the printer will be reset.
35cfd378
MK
103When
104.I arg
105is 0, the polling driver will be used, which is also default.
fea681da 106.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP"
35cfd378
MK
107Stores the currently used IRQ in
108.IR arg .
fea681da 109.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP"
35cfd378
MK
110Stores the value of the status port in
111.IR arg .
c13182ef 112The bits have the following meaning:
fea681da
MK
113.TS
114l l.
115LP_PBUSY inverted busy input, active high
116LP_PACK unchanged acknowledge input, active low
117LP_POUTPA unchanged out-of-paper input, active high
118LP_PSELECD unchanged selected input, active high
119LP_PERRORP unchanged error input, active low
120.TE
602ecf86 121.IP
fea681da
MK
122Refer to your printer manual for the meaning of the signals.
123Note that undocumented bits may also be set, depending on your printer.
124.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP"
c13182ef
MK
125Resets the printer.
126No argument is used.
fea681da 127.SH FILES
fc70ff30 128.I /dev/lp*
d2dc6294
MK
129.\" .SH AUTHORS
130.\" The printer driver was originally written by Jim Weigand and Linus
131.\" Torvalds.
132.\" It was further improved by Michael K.\& Johnson.
133.\" The interrupt code was written by Nigel Gamble.
134.\" Alan Cox modularized it.
135.\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.
47297adb 136.SH SEE ALSO
fea681da
MK
137.BR chmod (1),
138.BR chown (1),
139.BR mknod (1),
140.BR lpcntl (8),
141.BR tunelp (8)