diff options
-rw-r--r-- | sys/arch/i386/isa/pccom.c | 35 | ||||
-rw-r--r-- | sys/dev/cardbus/com_cardbus.c | 42 | ||||
-rw-r--r-- | sys/dev/ic/com.c | 35 | ||||
-rw-r--r-- | sys/dev/ic/comvar.h | 3 |
4 files changed, 41 insertions, 74 deletions
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c index 303837c9a10..67f60199e60 100644 --- a/sys/arch/i386/isa/pccom.c +++ b/sys/arch/i386/isa/pccom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccom.c,v 1.58 2007/05/08 20:33:07 deraadt Exp $ */ +/* $OpenBSD: pccom.c,v 1.59 2007/05/08 21:18:18 deraadt Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -153,7 +153,6 @@ tcflag_t comconscflag = TTYDEF_CFLAG; int commajor; int comsopen = 0; -int comevents = 0; #ifdef KGDB #include <sys/kgdb.h> @@ -415,38 +414,6 @@ comattach(struct device *parent, struct device *self, void *aux) } int -com_activate(struct device *self, enum devact act) -{ - struct com_softc *sc = (struct com_softc *)self; - int s, rv = 0; - - /* XXX splserial, when we get that. */ - s = spltty(); - switch (act) { - case DVACT_ACTIVATE: - break; - - case DVACT_DEACTIVATE: -#ifdef KGDB - if (sc->sc_hwflags & (COM_HW_CONSOLE|COM_HW_KGDB)) { -#else - if (sc->sc_hwflags & COM_HW_CONSOLE) { -#endif /* KGDB */ - rv = EBUSY; - break; - } - - if (sc->disable != NULL && sc->enabled != 0) { - (*sc->disable)(sc); - sc->enabled = 0; - } - break; - } - splx(s); - return (rv); -} - -int comopen(dev_t dev, int flag, int mode, struct proc *p) { int unit = DEVUNIT(dev); diff --git a/sys/dev/cardbus/com_cardbus.c b/sys/dev/cardbus/com_cardbus.c index fb3b1ad3a2e..af7eda1b341 100644 --- a/sys/dev/cardbus/com_cardbus.c +++ b/sys/dev/cardbus/com_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_cardbus.c,v 1.28 2007/05/08 20:43:07 deraadt Exp $ */ +/* $OpenBSD: com_cardbus.c,v 1.29 2007/05/08 21:18:18 deraadt Exp $ */ /* $NetBSD: com_cardbus.c,v 1.4 2000/04/17 09:21:59 joda Exp $ */ /* @@ -115,6 +115,10 @@ struct csdev *com_cardbus_find_csdev(struct cardbus_attach_args *); int com_cardbus_gofigure(struct cardbus_attach_args *, struct com_cardbus_softc *); +int com_activate(struct device *, enum devact); +int com_detach(struct device *, int); +int comopen(dev_t dev, int flag, int mode, struct proc *p); + #if NCOM_CARDBUS struct cfattach com_cardbus_ca = { sizeof(struct com_cardbus_softc), com_cardbus_match, @@ -386,9 +390,6 @@ com_cardbus_disable(struct com_softc *sc) Cardbus_function_disable(csc->cc_ct); } -int com_detach(struct device *, int); -int comopen(dev_t dev, int flag, int mode, struct proc *p); - int com_detach(self, flags) struct device *self; @@ -429,6 +430,39 @@ com_detach(self, flags) } int +com_activate(self, act) + struct device *self; + enum devact act; +{ + struct com_softc *sc = (struct com_softc *)self; + int s, rv = 0; + + s = spltty(); + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: +#ifdef KGDB + if (sc->sc_hwflags & (COM_HW_CONSOLE|COM_HW_KGDB)) { +#else + if (sc->sc_hwflags & COM_HW_CONSOLE) { +#endif /* KGDB */ + rv = EBUSY; + break; + } + + if (sc->disable != NULL && sc->enabled != 0) { + (*sc->disable)(sc); + sc->enabled = 0; + } + break; + } + splx(s); + return (rv); +} + +int com_cardbus_detach(struct device *self, int flags) { struct com_cardbus_softc *csc = (struct com_cardbus_softc *) self; diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 9a8d0539344..b38725ba57e 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.113 2007/05/08 20:33:07 deraadt Exp $ */ +/* $OpenBSD: com.c,v 1.114 2007/05/08 21:18:18 deraadt Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -200,39 +200,6 @@ comprobe1(iot, ioh) #endif int -com_activate(self, act) - struct device *self; - enum devact act; -{ - struct com_softc *sc = (struct com_softc *)self; - int s, rv = 0; - - s = spltty(); - switch (act) { - case DVACT_ACTIVATE: - break; - - case DVACT_DEACTIVATE: -#ifdef KGDB - if (sc->sc_hwflags & (COM_HW_CONSOLE|COM_HW_KGDB)) { -#else - if (sc->sc_hwflags & COM_HW_CONSOLE) { -#endif /* KGDB */ - rv = EBUSY; - break; - } - - if (sc->disable != NULL && sc->enabled != 0) { - (*sc->disable)(sc); - sc->enabled = 0; - } - break; - } - splx(s); - return (rv); -} - -int comopen(dev, flag, mode, p) dev_t dev; int flag, mode; diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h index be9262c9ea6..acea583ce5a 100644 --- a/sys/dev/ic/comvar.h +++ b/sys/dev/ic/comvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: comvar.h,v 1.41 2007/05/08 20:33:07 deraadt Exp $ */ +/* $OpenBSD: comvar.h,v 1.42 2007/05/08 21:18:18 deraadt Exp $ */ /* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */ /* @@ -140,7 +140,6 @@ struct com_softc { int comprobe1(bus_space_tag_t, bus_space_handle_t); int comstop(struct tty *, int); int comintr(void *); -int com_activate(struct device *, enum devact); void comdiag(void *); int comspeed(long, long); |