Newsgroups: comp.os.linux.announce
From: gamble!nigel@uunet.UU.NET (Nigel Gamble)
Subject: ANNOUNCE: Interrupt driven printer driver version 0.3
Message-ID: <1993Feb15.004213.18554@tc.cornell.edu>
Date: Mon, 15 Feb 1993 00:42:13 GMT
Approved: linux-announce@tc.cornell.edu (Matt Welsh)

Version 0.3 of the interrupt driven parallel printer driver has been
uploaded to tsx-11.mit.edu:/pub/linux/BETA/lp/lpirq.3.tar.Z
It has been tested with Linux 0.99pl4, but it should also work
with 0.99pl5.

If you have been having problems with abormally slow printing,
this driver should fix it.

Please let me know if you download it, even if it works perfectly!

Interrupt driven parallel printer driver, version 0.3
-----------------------------------------------------
Nigel Gamble, 14 Feb 1993.
uunet!gamble!nigel
gamble!nigel@uunet.uu.net

This new version of the Linux parallel printer driver makes use of the
interrupt hardware that is present on most of the I/O cards in use
on machines capable of running Linux.  It is much more efficient than
the existing driver (which uses over 20% cpu while printing a
ghostscript graphics file on my Epson compatible 9-pin dot-matix
printer).  It completely eliminates the problem of slow printing
previously seen with incorrect values of LP_INIT_CHAR; in fact,
LP_INIT_CHAR and LP_INIT_TIME are not used at all by the interrupt
driver.

Installation instructions
=========================

0.	You need to have linux 0.99pl4 or 0.99pl5.

1.	Look at struct lp_struct lp_table in lp.h.  The first column
	is the base address of the printer port, the second is the
	interrupt number.  My board uses interrupt 7 for 0x378 (/dev/lp1).
	A zero in this column means the the old polling driver is
	used.  I expect that this configuration will be correct
	for most people with the standard `2 serial + 1 parallel'
	I/O card, but if it's not correct for you, change it.

2.	Copy lp.h to /usr/src/linux/include/linux (you may wish save
	the old lp.h as lp.h.OLD first).

3.	Copy lp.c to /usr/src/linux/kernel/chr_drv (you may wish save
	the old lp.c as lp.c.OLD first).

4.	Remake and reboot the kernel as usual.

There are two new ioctls:

	ioctl(fd, LPSETIRQ, irq);

can be used to change the interrupt number used without recompiling
and rebooting.  The source of a simple program, lpcntl.c, is included
which calls the ioctl, so

	lpcntl /dev/lp1 0

can be used to switch to the polling driver, and

	lpcntl /dev/lp1 7

can be used to switch back to the interrupt driver using interrupt 7.
Note that you need to be super-user to change the interrupt number.

	ioctl(fd, LPGETIRQ);

returns the current interrupt number, and

	lpcntl /dev/lp1

(without the second argument) will print the current interrupt number.

Changes from version 0.2
========================

1.	All reported bugs fixed.

2.	Performance improvements (noticable when using a laser printer).

3.	LPSETIRQ ioctl now requires root permission.

Changes from version 0.1
========================

1.	Error handling in the polled driver fixed (supplied by
	Michael K. Johnson).

2.	Default IRQ 5 added for /dev/lp2.

3.	ioctl command LPIRQ replaced by LPSETIRQ and LPGETIRQ.

4.	lpcntl.c modified for new ioctl commands.
-- 
Nigel Gamble                                    gamble!nigel@uunet.UU.NET
Ft. Lauderdale, FL                              uunet!gamble!nigel


-- 
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
