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