summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2000-02-15 17:29:09 +0000
committerbde <bde@FreeBSD.org>2000-02-15 17:29:09 +0000
commit54489bb7493e06d358070fdbac16a8b28853e4c9 (patch)
tree37cb79f9e67338f9881aca4d06ef69c0ede304f9 /sys/dev/sio
parent77f276d5acc586c5900491e6b280b246771e7705 (diff)
downloadFreeBSD-src-54489bb7493e06d358070fdbac16a8b28853e4c9.zip
FreeBSD-src-54489bb7493e06d358070fdbac16a8b28853e4c9.tar.gz
Fixed regressions in rev.1.274:
1) Non-AST4 multiport cards were broken by bypassing the code that changes `idev' to the multiport master device. 2) AST4 multiport cards apparently were broken by inverting the test for the master device having an irq. 3) Error handling for nonexistent master devices was broken by removing a check for a null pointer. 4) `int' error codes returned by bus_get_resource() were assigned directly to the boolean variable com->no_irq. Probably harmless, since the boolean is implemented as a u_char. Submitted by: part 1) by Chris Radek <cradek@in221.inetnebr.com> part 2) by yokota Approved by: jkh
Diffstat (limited to 'sys/dev/sio')
-rw-r--r--sys/dev/sio/sio.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index a409a55..0876620 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -692,7 +692,7 @@ sioprobe(dev)
idev = dev;
mcr_image = MCR_IENABLE;
#ifdef COM_MULTIPORT
- if (COM_ISMULTIPORT(flags) && !COM_NOTAST4(flags)) {
+ if (COM_ISMULTIPORT(flags)) {
Port_t xiobase;
u_long io;
@@ -702,14 +702,18 @@ sioprobe(dev)
device_get_unit(dev), COM_MPMASTER(flags));
idev = dev;
}
- if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, NULL) == 0) {
- xiobase = io;
- if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL))
- outb(xiobase + com_scr, 0x80); /* no irq */
- else
- outb(xiobase + com_scr, 0);
+ if (!COM_NOTAST4(flags)) {
+ if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io,
+ NULL) == 0) {
+ xiobase = io;
+ if (bus_get_resource(idev, SYS_RES_IRQ, 0,
+ NULL, NULL) == 0)
+ outb(xiobase + com_scr, 0x80);
+ else
+ outb(xiobase + com_scr, 0);
+ }
+ mcr_image = 0;
}
- mcr_image = 0;
}
#endif /* COM_MULTIPORT */
if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL) != 0)
@@ -1011,7 +1015,7 @@ sioattach(dev)
com->cfcr_image = CFCR_8BITS;
com->dtr_wait = 3 * hz;
com->loses_outints = COM_LOSESOUTINTS(flags) != 0;
- com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL);
+ com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL) != 0;
com->tx_fifo_size = 1;
com->obufs[0].l_head = com->obuf1;
com->obufs[1].l_head = com->obuf2;
@@ -1170,8 +1174,8 @@ determined_type: ;
printf(")");
masterdev = devclass_get_device(sio_devclass,
COM_MPMASTER(flags));
- com->no_irq = bus_get_resource(masterdev, SYS_RES_IRQ, 0, NULL,
- NULL);
+ com->no_irq = (masterdev == NULL || bus_get_resource(masterdev,
+ SYS_RES_IRQ, 0, NULL, NULL) != 0);
}
#endif /* COM_MULTIPORT */
if (unit == comconsole)
OpenPOWER on IntegriCloud