]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/tunelp.8
mount: use loop= option when mounting by /sbin/mount.<type>
[thirdparty/util-linux.git] / sys-utils / tunelp.8
CommitLineData
fd6b7a7f 1.\" This file Copyright (C) 1992-1997 Michael K. Johnson <johnsonm@redhat.com>
7eda085c 2.\" This file Copyright (C) 1998 Andrea Arcangeli <andrea@e-mind.com>
fd6b7a7f
KZ
3.\" It may be distributed under the terms of the GNU General Public License,
4.\" version 2, or any higher version. See section COPYING of the GNU General
5.\" Public license for conditions under which this file may be redistributed.
7eda085c
KZ
6.\"
7.\" Polished a bit - aeb
8.TH tunelp 8 "7 May 1999" "tunelp" "Linux Programmer's Manual"
6dbe3af9
KZ
9.SH NAME
10tunelp \- set various parameters for the lp device
11.SH SYNOPSIS
7eda085c 12\fBtunelp\fP \fI<device>\fP [-i \fI<IRQ>\fP | -t \fI<TIME>\fP | -c \fI<CHARS>\fP | -w \fI<WAIT>\fP | -a [on|off] | -o [on|off] | -C [on|off] | -r | -s | -q [on|off] | - T [on|off] ]
6dbe3af9
KZ
13.SH DESCRIPTION
14\fBtunelp\fP sets several parameters for the /dev/lp\fI?\fP devices, for better
15performance (or for any performance at all, if your printer won't work
7eda085c
KZ
16without it...) Without parameters, it tells whether the device is using
17interrupts, and if so, which one. With parameters, it sets the device
6dbe3af9
KZ
18characteristics accordingly. The parameters are as follows:
19
7eda085c
KZ
20.TP
21.BI \-i " <IRQ>"
22specifies the IRQ to use for the parallel port in question. If this
23is set to something non-zero, \-t and \-c have no effect. If your port
6dbe3af9 24does not use interrupts, this option will make printing stop.
7eda085c 25The command
6dbe3af9
KZ
26.B tunelp -i 0
27restores non-interrupt driven (polling) action, and your printer should
28work again. If your parallel port does support interrupts,
29interrupt-driven printing should be somewhat faster and efficient, and
7eda085c 30will probably be desirable.
6dbe3af9 31
7eda085c
KZ
32NOTE: This option will have no effect with kernel 2.1.131 or later since
33the irq is handled by the parport driver. You can change
34the parport irq for example via
35.IR /proc/parport/*/irq .
36Read
37.I /usr/src/linux/Documentation/parport.txt
38for more details on parport.
39
40.TP
41.BI \-t " <TIME>"
42is the amount of time in jiffies that the driver waits if the
6dbe3af9 43printer doesn't take a character for the number of tries dictated by
7eda085c 44the \-c parameter. 10 is the default value. If you want fastest
6dbe3af9
KZ
45possible printing, and don't care about system load, you may set this
46to 0. If you don't care how fast your printer goes, or are printing
47text on a slow printer with a buffer, then 500 (5 seconds) should be
48fine, and will give you very low system load. This value generally
49should be lower for printing graphics than text, by a factor of
50approximately 10, for best performance.
51
7eda085c
KZ
52.TP
53.BI \-c " <CHARS>"
54is the number of times to try to output a character to the
55printer before sleeping for \-t \fI<TIME>\fP. It is the number of times around
6dbe3af9 56a loop that tries to send a character to the printer. 120 appears to
7eda085c
KZ
57be a good value for most printers in polling mode. 1000 is the default,
58because there are some printers that become jerky otherwise, but you \fImust\fP
59set this to `1' to handle the maximal CPU efficiency if you are using
60interrupts. If you have a very fast printer, a value of 10 might make more
61sense even if in polling mode.
62If you have a \fIreally\fP old printer, you can increase this further.
6dbe3af9 63
7eda085c 64Setting \-t \fI<TIME>\fP to 0 is equivalent to setting \-c \fI<CHARS>\fP
6dbe3af9
KZ
65to infinity.
66
7eda085c
KZ
67.TP
68.BI \-w " <WAIT>"
69is the number of usec we wait while playing with the strobe signal.
70While most printers appear to be able to deal with an extremely
71short strobe, some printers demand a longer one. Increasing this from
72the default 1 may make it possible to print with those printers. This may also
73make it possible to use longer cables. It's also possible to decrease this
74value to 0 if your printer is fast enough or your machine is slow enough.
6dbe3af9 75
7eda085c
KZ
76.TP
77.B \-a [on|off]
78This is whether to abort on printer error - the default
6dbe3af9
KZ
79is not to. If you are sitting at your computer, you probably want to
80be able to see an error and fix it, and have the printer go on
81printing. On the other hand, if you aren't, you might rather that
82your printer spooler find out that the printer isn't ready, quit
83trying, and send you mail about it. The choice is yours.
84
7eda085c
KZ
85.TP
86.B \-o [on|off]
87This option is much like \-a. It makes any
88.I open()
89of this device check to see that the device is on-line and not reporting any
6dbe3af9
KZ
90out of paper or other errors. This is the correct setting for most
91versions of lpd.
92
7eda085c
KZ
93.TP
94.B \-C [on|off]
95This option adds extra ("careful") error checking. When
6dbe3af9
KZ
96this option is on, the printer driver will ensure that the printer is
97on-line and not reporting any out of paper or other errors before
98sending data. This is particularly useful for printers that normally
99appear to accept data when turned off.
100
7eda085c
KZ
101NOTE: This option is obsolete because it's the default in 2.1.131 kernel
102or later.
103
104.TP
105.B \-s
106This option returns the current printer status, both as a
6dbe3af9 107decimal number from 0..255, and as a list of active flags. When
7eda085c 108this option is specified, \-q off, turning off the display of the
6dbe3af9
KZ
109current IRQ, is implied.
110
7eda085c
KZ
111.TP
112.B \-T [on|off]
756bfd01
KZ
113This option is obsolete. It was added in Linux 2.1.131,
114and removed again in Linux 2.3.10. The below is for these
115old kernels only.
116
117This option tells the lp driver to trust or not the IRQ.
7eda085c
KZ
118This option makes sense only if you are using interrupts.
119If you tell the lp driver to trust the irq, then, when the lp driver will
120get an irq, it will send the next pending character to the printer
121unconditionally, even if the printer still claims to be BUSY.
122This is the only way to sleep on interrupt (and so the handle the irq
123printing efficiently) at least on Epson Stylus Color Printers.
124The lp driver automagically detects if you could get improved
125performance by setting this flag, and in such case it will warn you
126with a kernel message.
127
128NOTE: Trusting the irq is reported to corrupt the printing on some hardware,
129you must try to know if your printer will work or not...
6dbe3af9 130
7eda085c
KZ
131.TP
132.B \-r
133This option resets the port. It requires a Linux kernel version of
6dbe3af9
KZ
1341.1.80 or later.
135
7eda085c
KZ
136.TP
137.B \-q [on|off]
138This option sets printing the display of the current IRQ setting.
139
140
141.SH NOTES
142\-o, \-C, and \-s all require a Linux kernel version of 1.1.76 or later.
143
144\-C requires a Linux version prior to 2.1.131.
145
146\-T requires a Linux version of 2.1.131 or later.
147
148.SH BUGS
149By some unfortunate coincidence the ioctl LPSTRICT of 2.0.36 has the same
150number as the ioctl LPTRUSTIRQ introduced in 2.1.131. So, use of the \-T option
151on a 2.0.36 kernel with an tunelp compiled under 2.1.131 or later may have
152unexpected effects.
153
154.SH FILES
155.I /dev/lp?
156.br
157.I /proc/parport/*/*