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