summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ed/if_ed.c13
-rw-r--r--sys/dev/sio/sio.c12
2 files changed, 20 insertions, 5 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 3e9f325..e5c1771 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -13,7 +13,7 @@
* the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
* and a variety of similar clones.
*
- * $Id: if_ed.c,v 1.77 1995/10/10 09:52:30 phk Exp $
+ * $Id: if_ed.c,v 1.78 1995/10/13 19:47:40 wollman Exp $
*/
#include "ed.h"
@@ -223,7 +223,12 @@ void
edunload(struct pccard_dev *dp)
{
struct ed_softc *sc = &ed_softc[dp->isahd.id_unit];
+ if (sc->kdc.kdc_state == DC_UNCONFIGURED) {
+ printf("ed%d: already unloaded\n", dp->isahd.id_unit);
+ return;
+ }
sc->kdc.kdc_state = DC_UNCONFIGURED;
+ sc->arpcom.ac_if.if_flags &= ~IFF_RUNNING;
if_down(&sc->arpcom.ac_if);
sc->gone = 1;
printf("ed%d: unload\n", dp->isahd.id_unit);
@@ -2231,8 +2236,10 @@ ed_ioctl(ifp, command, data)
struct ifreq *ifr = (struct ifreq *) data;
int s, error = 0;
- if (sc->gone)
- return -1;
+ if (sc->gone) {
+ ifp->if_flags &= ~IFF_RUNNING;
+ return ENXIO;
+ }
s = splimp();
switch (command) {
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index c811dcc..a7b48ea 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.112 1995/09/19 12:37:41 phk Exp $
+ * $Id: sio.c,v 1.113 1995/09/24 04:59:16 davidg Exp $
*/
#include "sio.h"
@@ -358,7 +358,7 @@ static struct kern_devconf kdc_sio[NSIO] = { {
&kdc_isa0, /* parent */
0, /* parentdata */
DC_UNCONFIGURED, /* state */
- "RS-232 serial port",
+ "Serial port",
DC_CLS_SERIAL /* class */
} };
#if NCRD > 0
@@ -449,6 +449,12 @@ siounload(struct pccard_dev *dp)
int s,unit,nowhere;
com = com_addr(dp->isahd.id_unit);
+ if (!com->iobase) {
+ printf("sio%d already unloaded!\n",dp->isahd.id_unit);
+ return;
+ }
+ kdc_sio[com->unit].kdc_state = DC_UNCONFIGURED;
+ kdc_sio[com->unit].kdc_description = "Serial port";
if (com->tp && (com->tp->t_state & TS_ISOPEN)) {
com->gone = 1;
printf("sio%d: unload\n", dp->isahd.id_unit);
@@ -493,6 +499,8 @@ sioregisterdev(id)
return;
if (unit != 0)
kdc_sio[unit] = kdc_sio[0];
+ kdc_sio[unit].kdc_state = DC_UNCONFIGURED;
+ kdc_sio[unit].kdc_description = "Serial port";
kdc_sio[unit].kdc_unit = unit;
kdc_sio[unit].kdc_isa = id;
dev_attach(&kdc_sio[unit]);
OpenPOWER on IntegriCloud