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)
#

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

Rick Sladkey
jrs@world.std.com


Michael K. Johnson: johnsonm@stolaf.edu

I have hacked setserial to allow you to set the high speed modes
allowed by the new serial drivers.  The usage for this is:
# setserial /dev/ttys0 SPD_HI
sets /dev/ttys0 so that when 38400 baud is set, 56000 baud is really
selected.
# setserial /dev/ttys0 SPD_VHI
sets /dev/ttys0 so that when 38400 baud is set, 115000 baud is really
selected.

These changes are a bit of a hack, but work all right.  I'd prefer to
re-write the whole program, but it works, for now.

Please note that these changes require linux .99 or above, or a kernel
patch for .98.2 or above which you can get by mailing me at the
address above.   -mkj