From 56cb20cd72fe963798dce1e251b44b05804db024 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 29 Nov 1995 15:00:07 +0000 Subject: [PATCH] Removed builtin list of port addresses. The address for sio3 conflicted with S3 graphics cards. Now users should put sio[2-3] in the config file if the hardware exisst, even if the probe is certain to fail due to an interrupt conflict. Otherwise, ports sharing the interrupt may fail the probe if the system is warm booted while sio[2-3] are active (perhaps under another OS). The same problem for nonstandard ports is now handled better than before. --- sys/dev/sio/sio.c | 15 +++++---------- sys/i386/isa/sio.c | 15 +++++---------- sys/isa/sio.c | 15 +++++---------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 7692fd16c151..5e6800cd84b0 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.121 1995/11/29 10:47:54 julian Exp $ + * $Id: sio.c,v 1.122 1995/11/29 14:39:57 julian Exp $ */ #include "sio.h" @@ -339,9 +339,6 @@ static struct speedtab comspeedtab[] = { { -1, -1 } }; -/* XXX - configure this list */ -static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, }; - static struct kern_devconf kdc_sio[NSIO] = { { 0, 0, 0, /* filled in by dev_attach */ "sio", 0, { MDDT_ISA, 0, "tty" }, @@ -502,13 +499,13 @@ sioprobe(dev) struct isa_device *dev; { static bool_t already_init; - Port_t *com_ptr; bool_t failures[10]; int fn; struct isa_device *idev; Port_t iobase; u_char mcr_image; int result; + struct isa_device *xdev; sioregisterdev(dev); @@ -519,11 +516,9 @@ sioprobe(dev) * from any used port that shares the interrupt vector. * XXX the gate enable is elsewhere for some multiports. */ - for (com_ptr = likely_com_ports; - com_ptr < &likely_com_ports[sizeof likely_com_ports - / sizeof likely_com_ports[0]]; - ++com_ptr) - outb(*com_ptr + com_mcr, 0); + for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++) + if (xdev->id_driver == &siodriver && xdev->id_enabled) + outb(xdev->id_iobase + com_mcr, 0); #if NCRD > 0 /* * If PC-Card probe required, then register driver with diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index 7692fd16c151..5e6800cd84b0 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.121 1995/11/29 10:47:54 julian Exp $ + * $Id: sio.c,v 1.122 1995/11/29 14:39:57 julian Exp $ */ #include "sio.h" @@ -339,9 +339,6 @@ static struct speedtab comspeedtab[] = { { -1, -1 } }; -/* XXX - configure this list */ -static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, }; - static struct kern_devconf kdc_sio[NSIO] = { { 0, 0, 0, /* filled in by dev_attach */ "sio", 0, { MDDT_ISA, 0, "tty" }, @@ -502,13 +499,13 @@ sioprobe(dev) struct isa_device *dev; { static bool_t already_init; - Port_t *com_ptr; bool_t failures[10]; int fn; struct isa_device *idev; Port_t iobase; u_char mcr_image; int result; + struct isa_device *xdev; sioregisterdev(dev); @@ -519,11 +516,9 @@ sioprobe(dev) * from any used port that shares the interrupt vector. * XXX the gate enable is elsewhere for some multiports. */ - for (com_ptr = likely_com_ports; - com_ptr < &likely_com_ports[sizeof likely_com_ports - / sizeof likely_com_ports[0]]; - ++com_ptr) - outb(*com_ptr + com_mcr, 0); + for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++) + if (xdev->id_driver == &siodriver && xdev->id_enabled) + outb(xdev->id_iobase + com_mcr, 0); #if NCRD > 0 /* * If PC-Card probe required, then register driver with diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 7692fd16c151..5e6800cd84b0 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.121 1995/11/29 10:47:54 julian Exp $ + * $Id: sio.c,v 1.122 1995/11/29 14:39:57 julian Exp $ */ #include "sio.h" @@ -339,9 +339,6 @@ static struct speedtab comspeedtab[] = { { -1, -1 } }; -/* XXX - configure this list */ -static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, }; - static struct kern_devconf kdc_sio[NSIO] = { { 0, 0, 0, /* filled in by dev_attach */ "sio", 0, { MDDT_ISA, 0, "tty" }, @@ -502,13 +499,13 @@ sioprobe(dev) struct isa_device *dev; { static bool_t already_init; - Port_t *com_ptr; bool_t failures[10]; int fn; struct isa_device *idev; Port_t iobase; u_char mcr_image; int result; + struct isa_device *xdev; sioregisterdev(dev); @@ -519,11 +516,9 @@ sioprobe(dev) * from any used port that shares the interrupt vector. * XXX the gate enable is elsewhere for some multiports. */ - for (com_ptr = likely_com_ports; - com_ptr < &likely_com_ports[sizeof likely_com_ports - / sizeof likely_com_ports[0]]; - ++com_ptr) - outb(*com_ptr + com_mcr, 0); + for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++) + if (xdev->id_driver == &siodriver && xdev->id_enabled) + outb(xdev->id_iobase + com_mcr, 0); #if NCRD > 0 /* * If PC-Card probe required, then register driver with