summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-06-09 21:25:14 +0000
committerscottl <scottl@FreeBSD.org>2003-06-09 21:25:14 +0000
commitf99b05da8812b112d8825f82a7ab665e2be567f2 (patch)
treeda2491f5d0f8fd212b271b9cd27559d33d5e1322 /sys/dev/sio/sio.c
parent7c32cdbb93079a97f5866b0437e36fcbc2c28570 (diff)
downloadFreeBSD-src-f99b05da8812b112d8825f82a7ab665e2be567f2.zip
FreeBSD-src-f99b05da8812b112d8825f82a7ab665e2be567f2.tar.gz
Track the resource id of the memory port instead of just assuming that
it is 0x0. Cardbus-based sio/modem cards can now be ejected without panic'ing.
Diffstat (limited to 'sys/dev/sio/sio.c')
-rw-r--r--sys/dev/sio/sio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 7b11c25..3304078 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -265,8 +265,9 @@ struct com_s {
struct resource *irqres;
struct resource *ioportres;
- void *cookie;
- dev_t devs[6];
+ int ioportrid;
+ void *cookie;
+ dev_t devs[6];
/*
* Data area for output buffers. Someday we should build the output
@@ -448,7 +449,8 @@ siodetach(dev)
bus_release_resource(dev, SYS_RES_IRQ, 0, com->irqres);
}
if (com->ioportres)
- bus_release_resource(dev, SYS_RES_IOPORT, 0, com->ioportres);
+ bus_release_resource(dev, SYS_RES_IOPORT, com->ioportrid,
+ com->ioportres);
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
device_printf(dev, "still open, forcing close\n");
(*linesw[com->tp->t_line].l_close)(com->tp, 0);
@@ -931,6 +933,7 @@ sioattach(dev, xrid, rclk)
bzero(com, sizeof *com);
com->unit = unit;
com->ioportres = port;
+ com->ioportrid = rid;
com->bst = rman_get_bustag(port);
com->bsh = rman_get_bushandle(port);
com->cfcr_image = CFCR_8BITS;
OpenPOWER on IntegriCloud