📄 tunelp.8
字号:
.\" This file Copyright (C) 1992-1997 Michael K. Johnson <johnsonm@redhat.com>.\" This file Copyright (C) 1998 Andrea Arcangeli <andrea@e-mind.com>.\" It may be distributed under the terms of the GNU General Public License,.\" version 2, or any higher version. See section COPYING of the GNU General.\" Public license for conditions under which this file may be redistributed..\".\" Polished a bit - aeb.TH tunelp 8 "7 May 1999" "tunelp" "Linux Programmer's Manual".SH NAMEtunelp \- set various parameters for the lp device.SH SYNOPSIS\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] ].SH DESCRIPTION\fBtunelp\fP sets several parameters for the /dev/lp\fI?\fP devices, for betterperformance (or for any performance at all, if your printer won't workwithout it...) Without parameters, it tells whether the device is usinginterrupts, and if so, which one. With parameters, it sets the devicecharacteristics accordingly. The parameters are as follows:.TP.BI \-i " <IRQ>"specifies the IRQ to use for the parallel port in question. If thisis set to something non-zero, \-t and \-c have no effect. If your portdoes not use interrupts, this option will make printing stop.The command.B tunelp -i 0restores non-interrupt driven (polling) action, and your printer shouldwork again. If your parallel port does support interrupts,interrupt-driven printing should be somewhat faster and efficient, andwill probably be desirable.NOTE: This option will have no effect with kernel 2.1.131 or later sincethe irq is handled by the parport driver. You can changethe parport irq for example via.IR /proc/parport/*/irq .Read.I /usr/src/linux/Documentation/parport.txtfor more details on parport..TP.BI \-t " <TIME>"is the amount of time in jiffies that the driver waits if theprinter doesn't take a character for the number of tries dictated bythe \-c parameter. 10 is the default value. If you want fastestpossible printing, and don't care about system load, you may set thisto 0. If you don't care how fast your printer goes, or are printingtext on a slow printer with a buffer, then 500 (5 seconds) should befine, and will give you very low system load. This value generallyshould be lower for printing graphics than text, by a factor ofapproximately 10, for best performance..TP.BI \-c " <CHARS>"is the number of times to try to output a character to theprinter before sleeping for \-t \fI<TIME>\fP. It is the number of times arounda loop that tries to send a character to the printer. 120 appears tobe a good value for most printers in polling mode. 1000 is the default,because there are some printers that become jerky otherwise, but you \fImust\fPset this to `1' to handle the maximal CPU efficiency if you are usinginterrupts. If you have a very fast printer, a value of 10 might make moresense even if in polling mode.If you have a \fIreally\fP old printer, you can increase this further.Setting \-t \fI<TIME>\fP to 0 is equivalent to setting \-c \fI<CHARS>\fPto infinity..TP.BI \-w " <WAIT>"is the number of usec we wait while playing with the strobe signal.While most printers appear to be able to deal with an extremelyshort strobe, some printers demand a longer one. Increasing this fromthe default 1 may make it possible to print with those printers. This may alsomake it possible to use longer cables. It's also possible to decrease thisvalue to 0 if your printer is fast enough or your machine is slow enough..TP.B \-a [on|off]This is whether to abort on printer error - the defaultis not to. If you are sitting at your computer, you probably want tobe able to see an error and fix it, and have the printer go onprinting. On the other hand, if you aren't, you might rather thatyour printer spooler find out that the printer isn't ready, quittrying, and send you mail about it. The choice is yours..TP.B \-o [on|off]This option is much like \-a. It makes any.I open()of this device check to see that the device is on-line and not reporting anyout of paper or other errors. This is the correct setting for mostversions of lpd..TP.B \-C [on|off]This option adds extra ("careful") error checking. Whenthis option is on, the printer driver will ensure that the printer ison-line and not reporting any out of paper or other errors beforesending data. This is particularly useful for printers that normallyappear to accept data when turned off.NOTE: This option is obsolete because it's the default in 2.1.131 kernelor later..TP.B \-sThis option returns the current printer status, both as a decimal number from 0..255, and as a list of active flags. Whenthis option is specified, \-q off, turning off the display of thecurrent IRQ, is implied..TP.B \-T [on|off]This option tell the lp driver to trust or not the IRQ.This option makes sense only if you are using interrupts.If you tell the lp driver to trust the irq, then, when the lp driver willget an irq, it will send the next pending character to the printerunconditionally, even if the printer still claims to be BUSY.This is the only way to sleep on interrupt (and so the handle the irqprinting efficiently) at least on Epson Stylus Color Printers.The lp driver automagically detects if you could get improvedperformance by setting this flag, and in such case it will warn youwith a kernel message.NOTE: Trusting the irq is reported to corrupt the printing on some hardware,you must try to know if your printer will work or not....TP.B \-rThis option resets the port. It requires a Linux kernel version of1.1.80 or later..TP.B \-q [on|off]This option sets printing the display of the current IRQ setting..SH NOTES\-o, \-C, and \-s all require a Linux kernel version of 1.1.76 or later.\-C requires a Linux version prior to 2.1.131.\-T requires a Linux version of 2.1.131 or later..SH BUGSBy some unfortunate coincidence the ioctl LPSTRICT of 2.0.36 has the samenumber as the ioctl LPTRUSTIRQ introduced in 2.1.131. So, use of the \-T optionon a 2.0.36 kernel with an tunelp compiled under 2.1.131 or later may haveunexpected effects..SH FILES.I /dev/lp?.br.I /proc/parport/*/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -