2004-11-03 13:51:07 +00:00
|
|
|
'\" t
|
|
|
|
.\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), Sun Jan 15 19:16:33 1995
|
|
|
|
.\"
|
|
|
|
.\" This is free documentation; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License as
|
|
|
|
.\" published by the Free Software Foundation; either version 2 of
|
|
|
|
.\" the License, or (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" The GNU General Public License's references to "object code"
|
|
|
|
.\" and "executables" are to be interpreted as the output of any
|
|
|
|
.\" document formatting or typesetting system, including
|
|
|
|
.\" intermediate and printed output.
|
|
|
|
.\"
|
|
|
|
.\" This manual is distributed in the hope that it will be useful,
|
|
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
.\" GNU General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public
|
|
|
|
.\" License along with this manual; if not, write to the Free
|
|
|
|
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
|
|
|
|
.\" USA.
|
|
|
|
.\"
|
|
|
|
.\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu
|
2007-05-18 10:09:18 +00:00
|
|
|
.TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
lp \- line printer devices
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <linux/lp.h>
|
|
|
|
.SH CONFIGURATION
|
|
|
|
\fBlp\fP[0\(en2] are character devices for the parallel line printers;
|
2007-04-12 22:42:49 +00:00
|
|
|
they have major number 6 and minor number 0\(en2.
|
|
|
|
The minor numbers
|
2004-11-03 13:51:07 +00:00
|
|
|
correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278.
|
2007-04-12 22:42:49 +00:00
|
|
|
Usually they have mode 220 and are owned by root and group lp.
|
|
|
|
You can use printer ports either with polling or with interrupts.
|
|
|
|
Interrupts are recommended when high traffic is expected, e.g.\& for laser
|
|
|
|
printers.
|
|
|
|
For usual dot matrix printers polling will usually be enough.
|
|
|
|
The default is polling.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The following
|
|
|
|
.BR ioctl (2)
|
|
|
|
calls are supported:
|
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
Sets the amount of time that the driver sleeps before rechecking the printer
|
2007-04-12 22:42:49 +00:00
|
|
|
when the printer's buffer appears to be filled to \fIarg\fP.
|
|
|
|
If you have a fast printer, decrease this number;
|
|
|
|
if you have a slow printer then increase it.
|
|
|
|
This is in hundredths of a second, the default 2
|
|
|
|
being 0.02 seconds.
|
|
|
|
It only influences the polling driver.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
Sets the maximum number of busy-wait iterations which the polling driver does
|
|
|
|
while waiting for the printer to get ready for receiving a character to
|
2007-04-12 22:42:49 +00:00
|
|
|
\fIarg\fP.
|
|
|
|
If printing is too slow, increase this number; if the
|
|
|
|
system gets too slow, decrease this number.
|
|
|
|
The default is 1000.
|
2004-11-03 13:51:07 +00:00
|
|
|
It only influences the polling driver.
|
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
If \fIarg\fP is 0, the printer driver will retry on errors, otherwise
|
2007-04-12 22:42:49 +00:00
|
|
|
it will abort.
|
|
|
|
The default is 0.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
If \fIarg\fP is 0,
|
|
|
|
.BR open (2)
|
2007-04-12 22:42:49 +00:00
|
|
|
will be aborted on error, otherwise error will be ignored.
|
|
|
|
The default is to ignore it.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
If \fIarg\fP is 0, then the out-of-paper, offline and error signals are
|
2007-04-12 22:42:49 +00:00
|
|
|
required to be false on all writes, otherwise they are ignored.
|
|
|
|
The default is to ignore them.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP"
|
|
|
|
Sets the number of busy waiting iterations to wait before strobing the
|
|
|
|
printer to accept a just-written character, and the number of iterations to
|
|
|
|
wait before turning the strobe off again,
|
2007-04-12 22:42:49 +00:00
|
|
|
to \fIarg\fP.
|
|
|
|
The specification says this time should be 0.5
|
2004-11-03 13:51:07 +00:00
|
|
|
microseconds, but experience has shown the delay caused by the code is
|
2007-04-12 22:42:49 +00:00
|
|
|
already enough.
|
|
|
|
For that reason, the default value is 0.
|
|
|
|
This is used for both the polling and the interrupt driver.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP"
|
2007-04-12 22:42:49 +00:00
|
|
|
This
|
2007-05-11 23:18:56 +00:00
|
|
|
.BR ioctl (2)
|
2007-04-12 22:42:49 +00:00
|
|
|
requires superuser privileges.
|
|
|
|
It takes an int containing the new IRQ as argument.
|
|
|
|
As a side effect, the printer will be reset.
|
|
|
|
When \fIarg\fP is 0, the polling driver will be used, which is also default.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP"
|
|
|
|
Stores the currently used IRQ in \fIarg\fP.
|
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP"
|
2007-04-12 22:42:49 +00:00
|
|
|
Stores the value of the status port in \fIarg\fP.
|
|
|
|
The bits have the following meaning:
|
2004-11-03 13:51:07 +00:00
|
|
|
.TS
|
|
|
|
l l.
|
|
|
|
LP_PBUSY inverted busy input, active high
|
|
|
|
LP_PACK unchanged acknowledge input, active low
|
|
|
|
LP_POUTPA unchanged out-of-paper input, active high
|
|
|
|
LP_PSELECD unchanged selected input, active high
|
|
|
|
LP_PERRORP unchanged error input, active low
|
|
|
|
.TE
|
|
|
|
.sp
|
|
|
|
Refer to your printer manual for the meaning of the signals.
|
|
|
|
Note that undocumented bits may also be set, depending on your printer.
|
|
|
|
.IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP"
|
2007-04-12 22:42:49 +00:00
|
|
|
Resets the printer.
|
|
|
|
No argument is used.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH FILES
|
|
|
|
/dev/lp*
|
|
|
|
.SH AUTHORS
|
|
|
|
The printer driver was originally written by Jim Weigand and Linus
|
2007-04-12 22:42:49 +00:00
|
|
|
Torvalds.
|
|
|
|
It was further improved by Michael K.\& Johnson.
|
|
|
|
The interrupt code was written by Nigel Gamble.
|
|
|
|
Alan Cox modularised it.
|
2004-11-03 13:51:07 +00:00
|
|
|
LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR chmod (1),
|
|
|
|
.BR chown (1),
|
|
|
|
.BR mknod (1),
|
|
|
|
.BR lpcntl (8),
|
|
|
|
.BR tunelp (8)
|