diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-08 21:18:19 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-08 21:18:19 +0000 |
commit | ec76778bae590cc6a4cf85e411ed98cbaa49d5ea (patch) | |
tree | f6dfaa92374102afbbe82a17d82bcd1cd01f6db1 /sys/dev/cardbus | |
parent | 137ae27d67b5c55b00a6c986ed33850da12699e9 (diff) |
move com_activate() to where it belongs
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/com_cardbus.c | 42 |
1 files changed, 38 insertions, 4 deletions
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; |