Fixed a bug in PCIC polling mode.
(it does not work without this fix)
This commit is contained in:
parent
3d2afd8604
commit
d789ee6ac8
|
@ -263,7 +263,7 @@ pcic_probe(device_t dev)
|
||||||
char *name;
|
char *name;
|
||||||
int i;
|
int i;
|
||||||
int error;
|
int error;
|
||||||
struct resource *res;
|
struct resource *res = 0;
|
||||||
int rid;
|
int rid;
|
||||||
static int maybe_vlsi = 0;
|
static int maybe_vlsi = 0;
|
||||||
|
|
||||||
|
@ -452,10 +452,14 @@ pcic_probe(device_t dev)
|
||||||
if (pcic_irq == 0) {
|
if (pcic_irq == 0) {
|
||||||
/* See if the user has requested a specific IRQ */
|
/* See if the user has requested a specific IRQ */
|
||||||
if (!getenv_int("machdep.pccard.pcic_irq", &pcic_irq))
|
if (!getenv_int("machdep.pccard.pcic_irq", &pcic_irq))
|
||||||
pcic_irq = 0;
|
pcic_irq = -1;
|
||||||
rid = 0;
|
rid = 0;
|
||||||
res = bus_alloc_resource(dev, SYS_RES_IRQ,
|
if (pcic_irq) {
|
||||||
&rid, pcic_irq, ~0, 1, RF_ACTIVE);
|
if (pcic_irq < 0)
|
||||||
|
pcic_irq = 0;
|
||||||
|
res = bus_alloc_resource(dev, SYS_RES_IRQ,
|
||||||
|
&rid, pcic_irq, ~0, 1, RF_ACTIVE);
|
||||||
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
error = bus_setup_intr(dev, res,
|
error = bus_setup_intr(dev, res,
|
||||||
INTR_TYPE_MISC, pcicintr, NULL, &ih);
|
INTR_TYPE_MISC, pcicintr, NULL, &ih);
|
||||||
|
@ -465,9 +469,14 @@ pcic_probe(device_t dev)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
pcic_irq = rman_get_start(res);
|
pcic_irq = rman_get_start(res);
|
||||||
|
printf("pcic: management irq %d\n", pcic_irq);
|
||||||
} else {
|
} else {
|
||||||
printf("pcic: polling, can't alloc %d\n",
|
if (pcic_irq)
|
||||||
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)
|
if (pcic_irq > 0)
|
||||||
sp->putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF);
|
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)
|
if (validslots && pcic_irq <= 0)
|
||||||
pcictimeout_ch = timeout(pcictimeout, 0, hz/2);
|
pcictimeout_ch = timeout(pcictimeout, 0, hz/2);
|
||||||
|
|
Loading…
Reference in New Issue