ioctl_tty.2: Note kernel version that added TCGETS2, TCSETS2, TCSETSW2, and TCSETSF2
[man-pages.git] / man4 / lp.4
blob8e89e507913c6819fbf8d33ccaf1000e6405b611
1 .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
2 .\"     Sun Jan 15 19:16:33 1995
3 .\"
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.
9 .\"
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.
14 .\"
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.
19 .\"
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/>.
23 .\" %%%LICENSE_END
24 .\"
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"
27 .SH NAME
28 lp \- line printer devices
29 .SH SYNOPSIS
30 .nf
31 .B #include <linux/lp.h>
32 .fi
33 .SH CONFIGURATION
34 \fBlp\fP[0\(en2] are character devices for the parallel line printers;
35 they have major number 6 and minor number 0\(en2.
36 The minor numbers
37 correspond to the printer port base addresses 0x03bc, 0x0378, and 0x0278.
38 Usually they have mode 220 and are owned by user
39 .I root
40 and group
41 .IR lp .
42 You can use printer ports either with polling or with interrupts.
43 Interrupts are recommended when high traffic is expected, for example,
44 for laser printers.
45 For typical dot matrix printers, polling will usually be enough.
46 The default is polling.
47 .SH DESCRIPTION
48 The following
49 .BR ioctl (2)
50 calls are supported:
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
54 .IR arg .
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
58 being 0.02 seconds.
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
63 .IR arg .
64 If printing is too slow, increase this number; if the
65 system gets too slow, decrease this number.
66 The default is 1000.
67 It influences only the polling driver.
68 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
70 .I arg
71 is 0, the printer driver will retry on errors, otherwise
72 it will abort.
73 The default is 0.
74 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
76 .I arg
77 is 0,
78 .BR open (2)
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"
83 .I arg
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,
92 .IR arg .
93 The specification says this time should be 0.5
94 microseconds, but experience has shown the delay caused by the code is
95 already enough.
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"
100 This
101 .BR ioctl (2)
102 requires superuser privileges.
103 It takes an
104 .I int
105 containing the new IRQ as argument.
106 As a side effect, the printer will be reset.
107 When
108 .I arg
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
112 .IR arg .
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
115 .IR arg .
116 The bits have the following meaning:
118 l l.
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"
129 Resets the printer.
130 No argument is used.
131 .SH FILES
132 .I /dev/lp*
133 .\" .SH AUTHORS
134 .\" The printer driver was originally written by Jim Weigand and Linus
135 .\" Torvalds.
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.
140 .SH SEE ALSO
141 .BR chmod (1),
142 .BR chown (1),
143 .BR mknod (1),
144 .BR lpcntl (8),
145 .BR tunelp (8)