189 lines
5.8 KiB
HTML
189 lines
5.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LP</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LP</H1>
|
|
Section: Linux Programmer's Manual (4)<BR>Updated: 1995-01-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
lp - line printer devices
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/linux/lp.h">linux/lp.h</A>></B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>CONFIGURATION</H2>
|
|
|
|
<B>lp</B>[0-2] are character devices for the parallel line printers;
|
|
they have major number 6 and minor number 0-2.
|
|
The minor numbers
|
|
correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278.
|
|
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, for example,
|
|
for laser printers.
|
|
For typical dot matrix printers, polling will usually be enough.
|
|
The default is polling.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The following
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
|
|
|
|
calls are supported:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>int ioctl(int </B><I>fd</I><B>, LPTIME, int </B><I>arg</I><B>)</B><DD>
|
|
Sets the amount of time that the driver sleeps before rechecking the printer
|
|
when the printer's buffer appears to be filled to
|
|
<I>arg</I>.
|
|
|
|
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 influences only the polling driver.
|
|
<DT id="2"><B>int ioctl(int </B><I>fd</I><B>, LPCHAR, int </B><I>arg</I><B>)</B><DD>
|
|
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
|
|
<I>arg</I>.
|
|
|
|
If printing is too slow, increase this number; if the
|
|
system gets too slow, decrease this number.
|
|
The default is 1000.
|
|
It influences only the polling driver.
|
|
<DT id="3"><B>int ioctl(int </B><I>fd</I><B>, LPABORT, int </B><I>arg</I><B>)</B><DD>
|
|
If
|
|
<I>arg</I>
|
|
|
|
is 0, the printer driver will retry on errors, otherwise
|
|
it will abort.
|
|
The default is 0.
|
|
<DT id="4"><B>int ioctl(int </B><I>fd</I><B>, LPABORTOPEN, int </B><I>arg</I><B>)</B><DD>
|
|
If
|
|
<I>arg</I>
|
|
|
|
is 0,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+open">open</A></B>(2)
|
|
|
|
will be aborted on error, otherwise error will be ignored.
|
|
The default is to ignore it.
|
|
<DT id="5"><B>int ioctl(int </B><I>fd</I><B>, LPCAREFUL, int </B><I>arg</I><B>)</B><DD>
|
|
If
|
|
<I>arg</I>
|
|
|
|
is 0, then the out-of-paper, offline, and error signals are
|
|
required to be false on all writes, otherwise they are ignored.
|
|
The default is to ignore them.
|
|
<DT id="6"><B>int ioctl(int </B><I>fd</I><B>, LPWAIT, int </B><I>arg</I><B>)</B><DD>
|
|
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,
|
|
to
|
|
<I>arg</I>.
|
|
|
|
The specification says this time should be 0.5
|
|
microseconds, but experience has shown the delay caused by the code is
|
|
already enough.
|
|
For that reason, the default value is 0.
|
|
|
|
This is used for both the polling and the interrupt driver.
|
|
<DT id="7"><B>int ioctl(int </B><I>fd</I><B>, LPSETIRQ, int </B><I>arg</I><B>)</B><DD>
|
|
This
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
|
|
|
|
requires superuser privileges.
|
|
It takes an
|
|
<I>int</I>
|
|
|
|
containing the new IRQ as argument.
|
|
As a side effect, the printer will be reset.
|
|
When
|
|
<I>arg</I>
|
|
|
|
is 0, the polling driver will be used, which is also default.
|
|
<DT id="8"><B>int ioctl(int </B><I>fd</I><B>, LPGETIRQ, int *</B><I>arg</I><B>)</B><DD>
|
|
Stores the currently used IRQ in
|
|
<I>arg</I>.
|
|
|
|
<DT id="9"><B>int ioctl(int </B><I>fd</I><B>, LPGETSTATUS, int *</B><I>arg</I><B>)</B><DD>
|
|
Stores the value of the status port in
|
|
<I>arg</I>.
|
|
|
|
The bits have the following meaning:
|
|
<TABLE>
|
|
<TR VALIGN=top><TD>LP_PBUSY</TD><TD>inverted busy input, active high<BR></TD></TR>
|
|
<TR VALIGN=top><TD>LP_PACK</TD><TD>unchanged acknowledge input, active low<BR></TD></TR>
|
|
<TR VALIGN=top><TD>LP_POUTPA</TD><TD>unchanged out-of-paper input, active high<BR></TD></TR>
|
|
<TR VALIGN=top><TD>LP_PSELECD</TD><TD>unchanged selected input, active high<BR></TD></TR>
|
|
<TR VALIGN=top><TD>LP_PERRORP</TD><TD>unchanged error input, active low<BR></TD></TR>
|
|
</TABLE>
|
|
|
|
<DT id="10"><DD>
|
|
Refer to your printer manual for the meaning of the signals.
|
|
Note that undocumented bits may also be set, depending on your printer.
|
|
<DT id="11"><B>int ioctl(int </B><I>fd</I><B>, LPRESET)</B><DD>
|
|
Resets the printer.
|
|
No argument is used.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<I>/dev/lp*</I>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chmod">chmod</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chown">chown</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+mknod">mknod</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+lpcntl">lpcntl</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tunelp">tunelp</A></B>(8)
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="14"><A HREF="#lbAD">CONFIGURATION</A><DD>
|
|
<DT id="15"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DT id="16"><A HREF="#lbAF">FILES</A><DD>
|
|
<DT id="17"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="18"><A HREF="#lbAH">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:02 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|