OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man4 / lp.4
1 '\" t
2 .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
3 .\"     Sun Jan 15 19:16:33 1995
4 .\"
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.
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
22 .\" License along with this manual; if not, see
23 .\" <http://www.gnu.org/licenses/>.
24 .\" %%%LICENSE_END
25 .\"
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"
28 .SH NAME
29 lp \- 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;
34 they have major number 6 and minor number 0\(en2.
35 The minor numbers
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,
40 for laser printers.
41 For usual dot matrix printers polling will usually be enough.
42 The default is polling.
43 .SH DESCRIPTION
44 The following
45 .BR ioctl (2)
46 calls are supported:
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
50 .IR arg .
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
54 being 0.02 seconds.
55 It only influences 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
59 .IR arg .
60 If printing is too slow, increase this number; if the
61 system gets too slow, decrease this number.
62 The default is 1000.
63 It only influences the polling driver.
64 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
65 If
66 .I arg
67 is 0, the printer driver will retry on errors, otherwise
68 it will abort.
69 The default is 0.
70 .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
71 If
72 .I arg
73 is 0,
74 .BR open (2)
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"
78 If
79 .I arg
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,
87 to
88 .IR arg .
89 The specification says this time should be 0.5
90 microseconds, but experience has shown the delay caused by the code is
91 already enough.
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"
95 This
96 .BR ioctl (2)
97 requires superuser privileges.
98 It takes an
99 .I int
100 containing the new IRQ as argument.
101 As a side effect, the printer will be reset.
102 When
103 .I arg
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
107 .IR arg .
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
110 .IR arg .
111 The bits have the following meaning:
112 .TS
113 l l.
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
119 .TE
120 .sp
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"
124 Resets the printer.
125 No argument is used.
126 .SH FILES
127 /dev/lp*
128 .\" .SH AUTHORS
129 .\" The printer driver was originally written by Jim Weigand and Linus
130 .\" Torvalds.
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.
135 .SH SEE ALSO
136 .BR chmod (1),
137 .BR chown (1),
138 .BR mknod (1),
139 .BR lpcntl (8),
140 .BR tunelp (8)
141 .SH COLOPHON
142 This page is part of release 3.79 of the Linux
143 .I man-pages
144 project.
145 A description of the project,
146 information about reporting bugs,
147 and the latest version of this page,
148 can be found at
149 \%http://www.kernel.org/doc/man\-pages/.