Skip to contentSkip to conversation

tunelp: use linux header

PATCH Applied Sami Kerola 2 participants 2 messages Jul 29, 2017 – Jul 31, 2017 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tunelp: use linux header

Remove use of LPTRUSTIRQ in same go. The LPTRUSTIRQ provided --trust-irq option, but it has not worked in nearly 20 years.

Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/include/linux/lp.h
Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/drivers/char/lp.c

---
 sys-utils/Makemodule.am |  2 +-
 sys-utils/lp.h          | 83 -------------------------------------------------
 sys-utils/tunelp.8      | 24 --------------
 sys-utils/tunelp.c      | 14 ++-------
 4 files changed, 3 insertions(+), 120 deletions(-)
 delete mode 100644 sys-utils/lp.h
sys-utils/Makemodule.am +1 -1
index 754f1f44d..66b540874 100644
@@ -74,7 +74,7 @@ endif
 if BUILD_TUNELP
 usrsbin_exec_PROGRAMS += tunelp
 dist_man_MANS += sys-utils/tunelp.8
-tunelp_SOURCES = sys-utils/tunelp.c sys-utils/lp.h
+tunelp_SOURCES = sys-utils/tunelp.c
 tunelp_LDADD = $(LDADD) libcommon.la
 endif
 
sys-utils/lp.h deleted +0 -83

83 lines not on this page · raw message

sys-utils/tunelp.8 +0 -24
index 1798ec978..90db83491 100644
@@ -96,22 +96,6 @@ This option returns the current printer status, both as a decimal number from
 0..255, and as a list of active flags.  When this option is specified, \-q
 off, turning off the display of the current IRQ, is implied.
 .TP
-\fB\-T\fR, \fB\-\-trust\-irq\fR \fI<on|off>\fR
-This option is obsolete. It was added in Linux 2.1.131, and removed again in
-Linux 2.3.10.  The below is for these old kernels only.
-.IP
-This option tells 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 will get an irq, it will send the next
-pending character to the printer unconditionally, even if the printer still
-claims to be BUSY.  This is the only way to sleep on interrupt (and so the
-handle the irq printing efficiently) at least on Epson Stylus Color Printers.
-The lp driver automagically detects if you could get improved performance by
-setting this flag, and in such case it will warn you with a kernel message.
-.IP
-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
 \fB\-r\fR, \fB\-\-reset\fR
 This option resets the port.  It requires a Linux kernel version of 1.1.80 or
 later.
@@ -127,14 +111,6 @@ all require a Linux kernel version of 1.1.76 or later.
 .PP
 .B \-C
 requires a Linux version prior to 2.1.131.
-.PP
-.B \-T
-requires a Linux version of 2.1.131 or later.
-.SH BUGS
-By some unfortunate coincidence the ioctl LPSTRICT of 2.0.36 has the same
-number as the ioctl LPTRUSTIRQ introduced in 2.1.131.  So, use of the \-T
-option on a 2.0.36 kernel with an tunelp compiled under 2.1.131 or later may
-have unexpected effects.
 .SH FILES
 .I /dev/lp?
 .br
sys-utils/tunelp.c +2 -12
index c6bdc66e9..fe261f393 100644
@@ -69,7 +69,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "lp.h"
+#include <linux/lp.h>
+
 #include "nls.h"
 #include "closestream.h"
 #include "strutils.h"
@@ -108,7 +109,6 @@ static void __attribute__((__noreturn__)) usage(void)
 	fputs(_(" -o, --check-status <on|off>  check printer status before printing\n"), out);
 	fputs(_(" -C, --careful <on|off>       extra checking to status check\n"), out);
 	fputs(_(" -s, --status                 query printer status\n"), out);
-	fputs(_(" -T, --trust-irq <on|off>     make driver to trust irq\n"), out);
 	fputs(_(" -r, --reset                  reset the port\n"), out);
 	fputs(_(" -q, --print-irq <on|off>     display current irq setting\n"), out);
 	fputs(USAGE_SEPARATOR, out);
@@ -229,16 +229,6 @@ int main(int argc, char **argv)
 			cmds = cmds->next;
 			cmds->next = NULL;
 			break;
-		case 'T':
-			/* Note: this will do the wrong thing on
-			 * 2.0.36 when compiled under 2.2.x
-			 */
-			cmds->op = LPTRUSTIRQ;
-			cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL);
-			cmds->next = xmalloc(sizeof(struct command));
-			cmds = cmds->next;
-			cmds->next = NULL;
-			break;
 		case 'v':
 		case 'V':
 			printf(UTIL_LINUX_VERSION);
Signature · 1 line
2.13.3
maintainer Applied
#1 lore raw
Quoted 6 lines · Sami Kerola
 sys-utils/Makemodule.am |  2 +-
 sys-utils/lp.h          | 83 -------------------------------------------------
 sys-utils/tunelp.8      | 24 --------------
 sys-utils/tunelp.c      | 14 ++-------
 4 files changed, 3 insertions(+), 120 deletions(-)
 delete mode 100644 sys-utils/lp.h

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com