Various pages: Use correct letter case in page titles (TH)
[man-pages.git] / man4 / lp.4
blob568bc37d47d357d1d29f067d8238946872db7f75
1 .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de),
2 .\"     Sun Jan 15 19:16:33 1995
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
7 .TH lp 4 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 lp \- line printer devices
10 .SH SYNOPSIS
11 .nf
12 .B #include <linux/lp.h>
13 .fi
14 .SH CONFIGURATION
15 \fBlp\fP[0\(en2] are character devices for the parallel line printers;
16 they have major number 6 and minor number 0\(en2.
17 The minor numbers
18 correspond to the printer port base addresses 0x03bc, 0x0378, and 0x0278.
19 Usually they have mode 220 and are owned by user
20 .I root
21 and group
22 .IR lp .
23 You can use printer ports either with polling or with interrupts.
24 Interrupts are recommended when high traffic is expected, for example,
25 for laser printers.
26 For typical dot matrix printers, polling will usually be enough.
27 The default is polling.
28 .SH DESCRIPTION
29 The following
30 .BR ioctl (2)
31 calls are supported:
32 .TP
33 .BR "int ioctl(int " fd ", LPTIME, int " arg )
34 Sets the amount of time that the driver sleeps before rechecking the printer
35 when the printer's buffer appears to be filled to
36 .IR arg .
37 If you have a fast printer, decrease this number;
38 if you have a slow printer, then increase it.
39 This is in hundredths of a second, the default 2
40 being 0.02 seconds.
41 It influences only the polling driver.
42 .TP
43 .BR "int ioctl(int " fd ", LPCHAR, int " arg )
44 Sets the maximum number of busy-wait iterations which the polling driver does
45 while waiting for the printer to get ready for receiving a character to
46 .IR arg .
47 If printing is too slow, increase this number; if the
48 system gets too slow, decrease this number.
49 The default is 1000.
50 It influences only the polling driver.
51 .TP
52 .BR "int ioctl(int " fd ", LPABORT, int " arg )
54 .I arg
55 is 0, the printer driver will retry on errors, otherwise
56 it will abort.
57 The default is 0.
58 .TP
59 .BR "int ioctl(int " fd ", LPABORTOPEN, int " arg )
61 .I arg
62 is 0,
63 .BR open (2)
64 will be aborted on error, otherwise error will be ignored.
65 The default is to ignore it.
66 .TP
67 .BR "int ioctl(int " fd ", LPCAREFUL, int " arg )
69 .I arg
70 is 0, then the out-of-paper, offline, and error signals are
71 required to be false on all writes, otherwise they are ignored.
72 The default is to ignore them.
73 .TP
74 .BR "int ioctl(int " fd ", LPWAIT, int " arg )
75 Sets the number of busy waiting iterations to wait before strobing the
76 printer to accept a just-written character, and the number of iterations to
77 wait before turning the strobe off again,
79 .IR arg .
80 The specification says this time should be 0.5
81 microseconds, but experience has shown the delay caused by the code is
82 already enough.
83 For that reason, the default value is 0.
84 .\" FIXME . Actually, since Linux 2.2, the default is 1
85 This is used for both the polling and the interrupt driver.
86 .TP
87 .BR "int ioctl(int " fd ", LPSETIRQ, int " arg )
88 This
89 .BR ioctl (2)
90 requires superuser privileges.
91 It takes an
92 .I int
93 containing the new IRQ as argument.
94 As a side effect, the printer will be reset.
95 When
96 .I arg
97 is 0, the polling driver will be used, which is also default.
98 .TP
99 .BR "int ioctl(int " fd ", LPGETIRQ, int *" arg )
100 Stores the currently used IRQ in
101 .IR arg .
103 .BR "int ioctl(int " fd ", LPGETSTATUS, int *" arg )
104 Stores the value of the status port in
105 .IR arg .
106 The bits have the following meaning:
108 l l.
109 LP_PBUSY        inverted busy input, active high
110 LP_PACK unchanged acknowledge input, active low
111 LP_POUTPA       unchanged out-of-paper input, active high
112 LP_PSELECD      unchanged selected input, active high
113 LP_PERRORP      unchanged error input, active low
116 Refer to your printer manual for the meaning of the signals.
117 Note that undocumented bits may also be set, depending on your printer.
119 .BR "int ioctl(int " fd ", LPRESET)"
120 Resets the printer.
121 No argument is used.
122 .SH FILES
123 .I /dev/lp*
124 .\" .SH AUTHORS
125 .\" The printer driver was originally written by Jim Weigand and Linus
126 .\" Torvalds.
127 .\" It was further improved by Michael K.\& Johnson.
128 .\" The interrupt code was written by Nigel Gamble.
129 .\" Alan Cox modularized it.
130 .\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.
131 .SH SEE ALSO
132 .BR chmod (1),
133 .BR chown (1),
134 .BR mknod (1),
135 .BR lpcntl (8),
136 .BR tunelp (8)