1tunelp(8)                  Linux Programmer's Manual                 tunelp(8)
2
3
4

NAME

6       tunelp - set various parameters for the lp device
7

SYNOPSIS

9       tunelp device [-i IRQ] [-t TIME] [-c CHARS] [-w WAIT] [-a {on|off}] [-o
10       {on|off}] [-C {on|off}] [-r] [-s] [-q {on|off}] [-T {on|off}]
11

DESCRIPTION

13       tunelp sets several parameters for the  /dev/lp?  devices,  for  better
14       performance  (or for any performance at all, if your printer won't work
15       without it...)  Without parameters, it  tells  whether  the  device  is
16       using  interrupts,  and if so, which one.  With parameters, it sets the
17       device characteristics accordingly.  The parameters are as follows:
18
19
20       -i IRQ specifies the IRQ to use for the parallel port in question.   If
21              this is set to something non-zero, -t and -c have no effect.  If
22              your port does not use interrupts, this option will make  print‐
23              ing stop.  The command tunelp -i 0 restores non-interrupt driven
24              (polling) action, and your printer should work again.   If  your
25              parallel port does support interrupts, interrupt-driven printing
26              should be somewhat faster and efficient, and  will  probably  be
27              desirable.
28
29              NOTE:  This  option  will  have no effect with kernel 2.1.131 or
30              later since the irq is handled by the parport  driver.  You  can
31              change  the  parport  irq  for  example via /proc/parport/*/irq.
32              Read /usr/src/linux/Documentation/parport.txt for  more  details
33              on parport.
34
35
36       -t TIME
37              is  the  amount  of time in jiffies that the driver waits if the
38              printer doesn't take a character for the number  of  tries  dic‐
39              tated  by  the  -c  parameter.  10 is the default value.  If you
40              want fastest possible printing,  and  don't  care  about  system
41              load,  you  may  set this to 0.  If you don't care how fast your
42              printer goes, or are printing text on a slow printer with a buf‐
43              fer, then 500 (5 seconds) should be fine, and will give you very
44              low system load.  This  value  generally  should  be  lower  for
45              printing  graphics  than  text, by a factor of approximately 10,
46              for best performance.
47
48
49       -c CHARS
50              is the number of times to try  to  output  a  character  to  the
51              printer  before sleeping for -t TIME.  It is the number of times
52              around a loop that tries to send a  character  to  the  printer.
53              120  appears  to  be  a  good value for most printers in polling
54              mode.  1000 is the default, because there are some printers that
55              become  jerky  otherwise, but you must set this to `1' to handle
56              the maximal CPU efficiency if you are using interrupts.  If  you
57              have  a  very  fast printer, a value of 10 might make more sense
58              even if in polling mode.  If you have a really old printer,  you
59              can increase this further.
60
61              Setting -t TIME to 0 is equivalent to setting -c CHARS to infin‐
62              ity.
63
64
65       -w WAIT
66              is the number of usec we wait while playing with the strobe sig‐
67              nal.   While  most  printers  appear  to be able to deal with an
68              extremely short strobe,  some  printers  demand  a  longer  one.
69              Increasing this from the default 1 may make it possible to print
70              with those printers.  This may also  make  it  possible  to  use
71              longer cables. It's also possible to decrease this value to 0 if
72              your printer is fast enough or your machine is slow enough.
73
74
75       -a {on|off}
76              This is whether to abort on printer error - the default  is  not
77              to.   If  you are sitting at your computer, you probably want to
78              be able to see an error and fix it, and have the printer  go  on
79              printing.   On  the  other hand, if you aren't, you might rather
80              that your printer spooler find out that the printer isn't ready,
81              quit trying, and send you mail about it.  The choice is yours.
82
83
84       -o {on|off}
85              This option is much like -a.  It makes any open() of this device
86              check to see that the device is on-line and  not  reporting  any
87              out  of  paper or other errors.  This is the correct setting for
88              most versions of lpd.
89
90
91       -C {on|off}
92              This option adds extra ("careful") error  checking.   When  this
93              option is on, the printer driver will ensure that the printer is
94              on-line and not reporting any  out  of  paper  or  other  errors
95              before  sending  data.  This is particularly useful for printers
96              that normally appear to accept data when turned off.
97
98              NOTE: This option  is  obsolete  because  it's  the  default  in
99              2.1.131 kernel or later.
100
101
102       -s     This  option returns the current printer status, both as a deci‐
103              mal number from 0..255, and as a list  of  active  flags.   When
104              this option is specified, -q off, turning off the display of the
105              current IRQ, is implied.
106
107
108       -T {on|off}
109              This option is obsolete. It was  added  in  Linux  2.1.131,  and
110              removed  again  in Linux 2.3.10. The below is for these old ker‐
111              nels only.
112
113              This option tells the lp driver to trust or not the  IRQ.   This
114              option  makes  sense  only  if you are using interrupts.  If you
115              tell the lp driver to trust the irq, then, when  the  lp  driver
116              will  get an irq, it will send the next pending character to the
117              printer unconditionally, even if the printer still claims to  be
118              BUSY.   This  is  the only way to sleep on interrupt (and so the
119              handle the irq printing efficiently) at least  on  Epson  Stylus
120              Color  Printers.   The  lp  driver  automagically detects if you
121              could get improved performance by setting this flag, and in such
122              case it will warn you with a kernel message.
123
124              NOTE:  Trusting  the  irq is reported to corrupt the printing on
125              some hardware, you must try to know if your printer will work or
126              not...
127
128
129       -r     This option resets the port.  It requires a Linux kernel version
130              of 1.1.80 or later.
131
132
133       -q {on|off}
134              This option sets printing the display of the  current  IRQ  set‐
135              ting.
136
137
138

NOTES

140       -o, -C, and -s all require a Linux kernel version of 1.1.76 or later.
141
142       -C requires a Linux version prior to 2.1.131.
143
144       -T requires a Linux version of 2.1.131 or later.
145
146

BUGS

148       By  some  unfortunate  coincidence the ioctl LPSTRICT of 2.0.36 has the
149       same number as the ioctl LPTRUSTIRQ introduced in 2.1.131. So,  use  of
150       the  -T option on a 2.0.36 kernel with an tunelp compiled under 2.1.131
151       or later may have unexpected effects.
152
153

FILES

155       /dev/lp?
156       /proc/parport/*/*
157
158

AVAILABILITY

160       The tunelp  command is part of the util-linux-ng package and is  avail‐
161       able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
162
163
164
165tunelp                            7 May 1999                         tunelp(8)
Impressum