summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pcmcia/pcmcia.c58
-rw-r--r--sys/dev/pcmcia/pcmciadevs3
-rw-r--r--sys/dev/pcmcia/pcmciavar.h3
3 files changed, 33 insertions, 31 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 */
diff --git a/sys/dev/pcmcia/pcmciadevs b/sys/dev/pcmcia/pcmciadevs
index a7815c3882e..bf7bbde7b52 100644
--- a/sys/dev/pcmcia/pcmciadevs
+++ b/sys/dev/pcmcia/pcmciadevs
@@ -1,4 +1,4 @@
- $OpenBSD: pcmciadevs,v 1.11 1999/05/16 22:42:44 niklas Exp $
+ $OpenBSD: pcmciadevs,v 1.12 1999/05/27 13:32:38 niklas Exp $
/* $NetBSD: pcmciadevs,v 1.13 1998/08/17 23:10:12 thorpej Exp $ */
/*
@@ -144,6 +144,7 @@ product TDK XIR_CEM_10 0x110a Xircom CreditCard Ethernet + Modem
/* NewMedia Products */
product NEWMEDIA BASICS 0x0019 NewMedia BASICS Ethernet
+product NEWMEDIA MULTIMEDIA 0x100b NewMedia Multimedia Sound/SCSI
/* Standard Microsystems Corporation Products */
product SMC 8016 0x0105 SMC 8016 EtherCard
diff --git a/sys/dev/pcmcia/pcmciavar.h b/sys/dev/pcmcia/pcmciavar.h
index 43ee1501036..9be00703a19 100644
--- a/sys/dev/pcmcia/pcmciavar.h
+++ b/sys/dev/pcmcia/pcmciavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmciavar.h,v 1.7 1999/01/28 04:58:32 fgsch Exp $ */
+/* $OpenBSD: pcmciavar.h,v 1.8 1999/05/27 13:32:38 niklas Exp $ */
/* $NetBSD: pcmciavar.h,v 1.5 1998/07/19 17:28:17 christos Exp $ */
/*
@@ -131,6 +131,7 @@ struct pcmcia_function {
void *ih_arg;
int ih_ipl;
int pf_flags;
+ int irq;
};
/* pf_flags */