]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/lp.4
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man4 / lp.4
CommitLineData
fea681da
MK
1'\" t
2.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), Sun Jan 15 19:16:33 1995
3.\"
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
8.\"
9.\" The GNU General Public License's references to "object code"
10.\" and "executables" are to be interpreted as the output of any
11.\" document formatting or typesetting system, including
12.\" intermediate and printed output.
13.\"
14.\" This manual is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public
20.\" License along with this manual; if not, write to the Free
21.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22.\" USA.
23.\"
24.\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
25.TH LP 4 1995-01-15 "Special files" "Linux Programmer's Manual"
26.SH NAME
27lp \- line printer devices
28.SH SYNOPSIS
29.B #include <linux/lp.h>
30.SH CONFIGURATION
31\fBlp\fP[0\(en2] are character devices for the parallel line printers;
c13182ef
MK
32they have major number 6 and minor number 0\(en2.
33The minor numbers
fea681da 34correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278.
c13182ef
MK
35Usually they have mode 220 and are owned by root and group lp.
36You can use printer ports either with polling or with interrupts.
37Interrupts are recommended when high traffic is expected, e.g.\& for laser
38printers.
39For usual dot matrix printers polling will usually be enough.
40The default is polling.
fea681da
MK
41.SH DESCRIPTION
42The following
43.BR ioctl (2)
44calls are supported:
45.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP"
46Sets the amount of time that the driver sleeps before rechecking the printer
c13182ef
MK
47when the printer's buffer appears to be filled to \fIarg\fP.
48If you have a fast printer, decrease this number;
49if you have a slow printer then increase it.
50This is in hundredths of a second, the default 2
51being 0.02 seconds.
52It only influences the polling driver.
fea681da
MK
53.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP"
54Sets the maximum number of busy-wait iterations which the polling driver does
55while waiting for the printer to get ready for receiving a character to
c13182ef
MK
56\fIarg\fP.
57If printing is too slow, increase this number; if the
58system gets too slow, decrease this number.
59The default is 1000.
fea681da
MK
60It only influences the polling driver.
61.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
62If \fIarg\fP is 0, the printer driver will retry on errors, otherwise
c13182ef
MK
63it will abort.
64The default is 0.
fea681da
MK
65.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
66If \fIarg\fP is 0,
67.BR open (2)
c13182ef
MK
68will be aborted on error, otherwise error will be ignored.
69The default is to ignore it.
fea681da
MK
70.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP"
71If \fIarg\fP is 0, then the out-of-paper, offline and error signals are
c13182ef
MK
72required to be false on all writes, otherwise they are ignored.
73The default is to ignore them.
fea681da
MK
74.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP"
75Sets the number of busy waiting iterations to wait before strobing the
76printer to accept a just-written character, and the number of iterations to
77wait before turning the strobe off again,
c13182ef
MK
78to \fIarg\fP.
79The specification says this time should be 0.5
fea681da 80microseconds, but experience has shown the delay caused by the code is
c13182ef
MK
81already enough.
82For that reason, the default value is 0.
83This is used for both the polling and the interrupt driver.
fea681da 84.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP"
c13182ef
MK
85This
86.BR ioctl ()
87requires superuser privileges.
88It takes an int containing the new IRQ as argument.
89As a side effect, the printer will be reset.
90When \fIarg\fP is 0, the polling driver will be used, which is also default.
fea681da
MK
91.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP"
92Stores the currently used IRQ in \fIarg\fP.
93.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP"
c13182ef
MK
94Stores the value of the status port in \fIarg\fP.
95The bits have the following meaning:
fea681da
MK
96.TS
97l l.
98LP_PBUSY inverted busy input, active high
99LP_PACK unchanged acknowledge input, active low
100LP_POUTPA unchanged out-of-paper input, active high
101LP_PSELECD unchanged selected input, active high
102LP_PERRORP unchanged error input, active low
103.TE
104.sp
105Refer to your printer manual for the meaning of the signals.
106Note that undocumented bits may also be set, depending on your printer.
107.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP"
c13182ef
MK
108Resets the printer.
109No argument is used.
fea681da
MK
110.SH FILES
111/dev/lp*
112.SH AUTHORS
113The printer driver was originally written by Jim Weigand and Linus
c13182ef
MK
114Torvalds.
115It was further improved by Michael K.\& Johnson.
116The interrupt code was written by Nigel Gamble.
117Alan Cox modularised it.
fea681da
MK
118LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.
119.SH "SEE ALSO"
120.BR chmod (1),
121.BR chown (1),
122.BR mknod (1),
123.BR lpcntl (8),
124.BR tunelp (8)