diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-02-03 19:42:20 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-02-03 19:42:20 +0000 |
commit | 7633d43b4912de17adf25793c4abcd0eb1de511d (patch) | |
tree | d155c68858507bfe88339bc2caaffaaef2524a12 /sys/dev/pcmcia | |
parent | c56bc0232706602951ed14832b18f4d4b27d2d88 (diff) |
Make pccomms suspendable (tested on a 3Com Megahertz combo card).
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r-- | sys/dev/pcmcia/com_pcmcia.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c index 19fe7322d0b..311e0f9f5b9 100644 --- a/sys/dev/pcmcia/com_pcmcia.c +++ b/sys/dev/pcmcia/com_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pcmcia.c,v 1.24 1999/10/27 17:41:47 fgsch Exp $ */ +/* $OpenBSD: com_pcmcia.c,v 1.25 2000/02/03 19:42:19 angelos Exp $ */ /* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */ /* @@ -153,6 +153,7 @@ int com_pcmcia_match __P((struct device *, void *, void *)); void com_pcmcia_attach __P((struct device *, struct device *, void *)); int com_pcmcia_detach __P((struct device *, int)); void com_pcmcia_cleanup __P((void *)); +int com_pcmcia_activate __P((struct device *, enum devact)); int com_pcmcia_enable __P((struct com_softc *)); void com_pcmcia_disable __P((struct com_softc *)); @@ -174,12 +175,12 @@ struct com_pcmcia_softc { #if NCOM_PCMCIA struct cfattach com_pcmcia_ca = { sizeof(struct com_pcmcia_softc), com_pcmcia_match, com_pcmcia_attach, - com_pcmcia_detach, com_activate + com_pcmcia_detach, com_pcmcia_activate }; #elif NPCCOM_PCMCIA struct cfattach pccom_pcmcia_ca = { sizeof(struct com_pcmcia_softc), com_pcmcia_match, com_pcmcia_attach, - com_pcmcia_detach, com_activate + com_pcmcia_detach, com_pcmcia_activate }; #endif @@ -234,6 +235,33 @@ com_pcmcia_match(parent, match, aux) return 0; } +int +com_pcmcia_activate(dev, act) + struct device *dev; + enum devact act; +{ + struct com_pcmcia_softc *sc = (void *) dev; + int s; + + s = spltty(); + switch (act) { + case DVACT_ACTIVATE: + pcmcia_function_enable(sc->sc_pf); + printf("%s:", sc->sc_com.sc_dev.dv_xname); + sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_TTY, + comintr, sc); + printf("\n"); + break; + + case DVACT_DEACTIVATE: + pcmcia_function_disable(sc->sc_pf); + pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih); + break; + } + splx(s); + return (0); +} + void com_pcmcia_attach(parent, self, aux) struct device *parent, *self; |