Here is a program that uses the recent serial ioctl calls to change
the port or IRQ of a serial device.  I use it to change /dev/ttys3 to
IRQ 5.  You must be root to run it or make it setuid to root.  Please
be careful when specifying port numbers!

If you get the message "Device busy" it means that you have another
serial port currently using that IRQ or that you have specified an IRQ
that is used by another hardware device such as the keyboard or a hard
disk controller.

IRQs 2, 3, 4, and 5 are typically available and can often be set by
DIP switches or jumpers on your serial card.  With 0.96c patchlevel 1
or higher you can use any IRQ that your card lets you configure and
that is unused by Linux.  If you are not sure, go ahead and try.
Linux will let you know.

Some examples:

# setserial
usage: setserial serial-device [ port irq ]
for example: setserial /dev/ttys3 0x03e8 5
Use a leading '0x' for hex numbers.
CAUTION: Using an invalid port can lock up your machine!
# setserial /dev/ttys3
/dev/ttys3, Type: 16450, Line: 2, Port: 0x03e8, IRQ: 4
# setserial /dev/ttys3 0 5
/dev/ttys3, Type: 16450, Line: 2, Port: 0x03e8 (was 0x03e8), IRQ: 5 (was 4)
#

There is a minor bug that prevents this from working with 0.96c
patchlevel 1.  Use unpatched 0.96c, wait for 0.96c patchlevel 2, or
apply this patch.

*** linux/kernel/chr_drv/serial.c.orig	Sun Jul 12 23:48:13 1992
--- linux/kernel/chr_drv/serial.c	Mon Jul 13 19:28:37 1992
***************
*** 416,421 ****
--- 416,422 ----
  		retval = request_irq(new_irq,handler);
  		if (retval)
  			return retval;
+ 		info->irq = new_irq;
  		free_irq(irq);
  	}
  	cli();

I have uploaded setserial.tar.Z to banjo and tsx-11.

Rick Sladkey
jrs@world.std.com
