diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-05-27 13:32:39 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-05-27 13:32:39 +0000 |
commit | 0b0223dd8e0ccc7fd7168d0adc4a65f16aa6a0b7 (patch) | |
tree | f8daa2920f7cb0f4c7640eec01e7ec4009acd1b3 /sys/dev/pcmcia/pcmcia.c | |
parent | b126d3ceb8a1c65758137789c8dc6a4262bfd988 (diff) |
A Sound+SCSI card
Diffstat (limited to 'sys/dev/pcmcia/pcmcia.c')
-rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index edd3f7b2251..32bb11b53f5 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia.c,v 1.13 1999/03/04 23:23:56 deraadt Exp $ */ +/* $OpenBSD: pcmcia.c,v 1.14 1999/05/27 13:32:38 niklas Exp $ */ /* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */ /* @@ -166,9 +166,6 @@ pcmcia_card_attach(dev) for (pf = sc->card.pf_head.sqh_first; pf != NULL; pf = pf->pf_list.sqe_next) { - if (pf->cfe_head.sqh_first == NULL) - continue; - pf->sc = sc; pf->cfe = NULL; pf->ih_fct = NULL; @@ -177,9 +174,6 @@ pcmcia_card_attach(dev) for (pf = sc->card.pf_head.sqh_first; pf != NULL; pf = pf->pf_list.sqe_next) { - if (pf->cfe_head.sqh_first == NULL) - continue; - paa.manufacturer = sc->card.manufacturer; paa.product = sc->card.product; paa.card = &sc->card; @@ -189,15 +183,21 @@ pcmcia_card_attach(dev) pcmcia_submatch)) { attached++; - DPRINTF(("%s: function %d CCR at %d " - "offset %lx: %x %x %x %x, %x %x %x %x, %x\n", - sc->dev.dv_xname, pf->number, - pf->pf_ccr_window, pf->pf_ccr_offset, - pcmcia_ccr_read(pf, 0x00), - pcmcia_ccr_read(pf, 0x02), pcmcia_ccr_read(pf, 0x04), - pcmcia_ccr_read(pf, 0x06), pcmcia_ccr_read(pf, 0x0A), - pcmcia_ccr_read(pf, 0x0C), pcmcia_ccr_read(pf, 0x0E), - pcmcia_ccr_read(pf, 0x10), pcmcia_ccr_read(pf, 0x12))); + if (SIMPLEQ_FIRST(&pf->cfe_head)) { + DPRINTF(("%s: function %d CCR at %d offset %lx" + ": %x %x %x %x, %x %x %x %x, %x\n", + sc->dev.dv_xname, pf->number, + pf->pf_ccr_window, pf->pf_ccr_offset, + pcmcia_ccr_read(pf, 0x00), + pcmcia_ccr_read(pf, 0x02), + pcmcia_ccr_read(pf, 0x04), + pcmcia_ccr_read(pf, 0x06), + pcmcia_ccr_read(pf, 0x0A), + pcmcia_ccr_read(pf, 0x0C), + pcmcia_ccr_read(pf, 0x0E), + pcmcia_ccr_read(pf, 0x10), + pcmcia_ccr_read(pf, 0x12))); + } } } @@ -332,20 +332,20 @@ pcmcia_function_enable(pf) if (pf->sc->sc_enabled_count++ == 0) pcmcia_chip_socket_enable(pf->sc->pct, pf->sc->pch); DPRINTF(("%s: ++enabled_count = %d\n", pf->sc->dev.dv_xname, - pf->sc->sc_enabled_count)); + pf->sc->sc_enabled_count)); if (pf->pf_flags & PFF_ENABLED) { /* * Don't do anything if we're already enabled. */ - return (0); + DPRINTF(("%s: pcmcia_function_enable on enabled func\n")); + return (0); } /* * it's possible for different functions' CCRs to be in the same * underlying page. Check for that. */ - for (tmp = pf->sc->card.pf_head.sqh_first; tmp != NULL; tmp = tmp->pf_list.sqe_next) { if ((tmp->pf_flags & PFF_ENABLED) && @@ -390,6 +390,7 @@ pcmcia_function_enable(pf) reg |= PCMCIA_CCR_OPTION_IREQ_ENABLE; } + pcmcia_ccr_write(pf, PCMCIA_CCR_OPTION, reg); reg = 0; @@ -618,7 +619,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg) if (pf->sc->ih != NULL) panic("card has intr handler, but no function does"); #endif - s = splhigh(); + s = spltty(); /* set up the handler for the new function */ @@ -635,11 +636,10 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg) panic("functions have ih, but the card does not"); #endif - /* XXX need #ifdef for splserial on x86 */ - s = splhigh(); + s = spltty(); pcmcia_chip_intr_disestablish(pf->sc->pct, pf->sc->pch, - pf->sc->ih); + pf->sc->ih); /* set up the handler for the new function */ pf->ih_fct = ih_fct; @@ -651,7 +651,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg) splx(s); } else { - s = splhigh(); + s = spltty(); /* set up the handler for the new function */ @@ -751,8 +751,7 @@ pcmcia_intr_disestablish(pf, ih) if (pf->sc->ih == NULL) panic("changing ih ipl, but card has no ih"); #endif - /* XXX need #ifdef for splserial on x86 */ - s = splhigh(); + s = spltty(); pcmcia_chip_intr_disestablish(pf->sc->pct, pf->sc->pch, pf->sc->ih); @@ -766,7 +765,7 @@ pcmcia_intr_disestablish(pf, ih) splx(s); } else { - s = splhigh(); + s = spltty(); pf->ih_fct = NULL; pf->ih_arg = NULL; @@ -778,6 +777,7 @@ pcmcia_intr_disestablish(pf, ih) } } +#ifndef PCMCIADEBUG int pcmcia_card_intr(arg) void *arg; @@ -807,7 +807,7 @@ pcmcia_card_intr(arg) return (ret); } -#ifdef PCMCIADEBUG +#else /* PCMCIADEBUG */ int pcmcia_card_intrdebug(arg) void *arg; @@ -844,4 +844,4 @@ pcmcia_card_intrdebug(arg) return (ret); } -#endif +#endif /* PCMCIADEBUG */ |