aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTatsumi Hosokawa <hosokawa@FreeBSD.org>2000-01-15 12:02:03 +0000
committerTatsumi Hosokawa <hosokawa@FreeBSD.org>2000-01-15 12:02:03 +0000
commitd789ee6ac844f90ba8ee8c6e33c85765bfe1c906 (patch)
tree3012b7ad26406d84227f623c26caa92942db2715 /sys
parent3d2afd8604324cca2538034da85a563a6af11750 (diff)
downloadsrc-d789ee6ac844f90ba8ee8c6e33c85765bfe1c906.tar.gz
src-d789ee6ac844f90ba8ee8c6e33c85765bfe1c906.zip
Fixed a bug in PCIC polling mode.
(it does not work without this fix)
Notes
Notes: svn path=/head/; revision=56037
Diffstat (limited to 'sys')
-rw-r--r--sys/pccard/pcic.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 156675d8d223..d9fb874af4df 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -263,7 +263,7 @@ pcic_probe(device_t dev)
char *name;
int i;
int error;
- struct resource *res;
+ struct resource *res = 0;
int rid;
static int maybe_vlsi = 0;
@@ -452,10 +452,14 @@ pcic_probe(device_t dev)
if (pcic_irq == 0) {
/* See if the user has requested a specific IRQ */
if (!getenv_int("machdep.pccard.pcic_irq", &pcic_irq))
- pcic_irq = 0;
+ pcic_irq = -1;
rid = 0;
- res = bus_alloc_resource(dev, SYS_RES_IRQ,
- &rid, pcic_irq, ~0, 1, RF_ACTIVE);
+ if (pcic_irq) {
+ if (pcic_irq < 0)
+ pcic_irq = 0;
+ res = bus_alloc_resource(dev, SYS_RES_IRQ,
+ &rid, pcic_irq, ~0, 1, RF_ACTIVE);
+ }
if (res) {
error = bus_setup_intr(dev, res,
INTR_TYPE_MISC, pcicintr, NULL, &ih);
@@ -465,9 +469,14 @@ pcic_probe(device_t dev)
return error;
}
pcic_irq = rman_get_start(res);
+ printf("pcic: management irq %d\n", pcic_irq);
} else {
- printf("pcic: polling, can't alloc %d\n",
- pcic_irq);
+ if (pcic_irq)
+ printf("pcic: polling mode, can't alloc %d\n",
+ pcic_irq);
+ else
+ printf("pcic: polling mode\n");
+ pcic_irq = 0;
}
}
/*
@@ -496,6 +505,8 @@ pcic_probe(device_t dev)
*/
if (pcic_irq > 0)
sp->putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF);
+ else if (pcic_irq == 0)
+ sp->putb(sp, PCIC_STAT_INT, 0xF);
}
if (validslots && pcic_irq <= 0)
pcictimeout_ch = timeout(pcictimeout, 0, hz/2);