Interrupt driven parallel printer driver, version 0.4
-----------------------------------------------------
Nigel Gamble, 6 Mar 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.99pl6.

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.

	If you have a sound card (e.g. Soundblaster), make sure that
	it is using a different interrupt from your printer port.

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.3
========================

1.	Linux 0.99pl6 change merged.

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.
