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