Debian Codegraph @

upstream/debian-trixie/man4/lp.4

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