From 09a09ef05e5d5f17d8e2c9040c29e458c7d01506 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 1 Apr 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-04-01 --- pc/devi82365.c | 17 +++++++++++------ pc/ether509.c | 2 +- pc/ether589.c | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pc/devi82365.c b/pc/devi82365.c index dae0883d58e12b90925551c2db6a84b53ac7272a..d43a837a4d50ac65695a65b029ecbcbea2577283 100644 --- a/pc/devi82365.c +++ b/pc/devi82365.c @@ -898,6 +898,11 @@ pcmio(int slotno, ISAConf *isa) Slot *pp; Conftab *ct; PCMmap *m; + int irq; + + irq = isa->irq; + if(irq == 2) + irq = 9; if(slotno > nslot) return -1; @@ -908,23 +913,22 @@ pcmio(int slotno, ISAConf *isa) /* find a configuration with the right port */ for(ct = pp->ctab; ct < &pp->ctab[pp->nctab]; ct++){ - if(ct->nioregs && ct->port == isa->port) + if(ct->nioregs && ct->port == isa->port && ((1<irqs)) break; } /* if non found, settle for one with the some ioregs */ if(ct == &pp->ctab[pp->nctab]) for(ct = pp->ctab; ct < &pp->ctab[pp->nctab]; ct++) - if(ct->nioregs) + if(ct->nioregs && ((1<irqs)) break; if(ct == &pp->ctab[pp->nctab]) return -1; /* route interrupts */ - if(isa->irq == 2) - isa->irq = 9; - wrreg(pp, Rigc, isa->irq | Fnotreset | Fiocard); + isa->irq = irq; + wrreg(pp, Rigc, irq | Fnotreset | Fiocard); /* set power and enable device */ x = vcode(ct->vpp1); @@ -957,7 +961,7 @@ pcmio(int slotno, ISAConf *isa) x = ct->index; if((ct->irqtype & 0x20) && ((ct->irqtype & 0x40)==0 || isa->irq>7)) x |= Clevel; - *p = x|ct->index; + *p = x; delay(5); pcmunmap(slotno, m); @@ -1218,6 +1222,7 @@ irq(Slot *pp, Conftab *ct) ct->irqs = getlong(pp, 2); else ct->irqs = 1<<(c&0xf); + ct->irqs &= 0xDEB8; /* levels available to card */ } static void diff --git a/pc/ether509.c b/pc/ether509.c index 9f5db085c60527ac9fed16fe90478c885fcfab9a..24185f45021700f950e519ec2544417502c6bbdf 100644 --- a/pc/ether509.c +++ b/pc/ether509.c @@ -581,7 +581,7 @@ ether509reset(Ether *ether) } } if(strcmp(ether->type, "3C589") == 0) - port = ether->port; + port = ether->card.port; if(port == 0) port = tcm579(ether); if(port == 0) diff --git a/pc/ether589.c b/pc/ether589.c index 5ae9430327c50bf3807db1b0e3b5f3c5d3fccc8f..333d707e4e5b8e42950847eaa251a35d9d46c572 100644 --- a/pc/ether589.c +++ b/pc/ether589.c @@ -38,7 +38,7 @@ reset(Ether *ether) if(ether->irq == 0) ether->irq = 10; if(ether->port == 0) - ether->port = 0x3F0; + ether->port = 0x240; port = ether->port; slot = pcmspecial("3C589", ether); @@ -55,7 +55,7 @@ reset(Ether *ether) /* IRQ must be 3 on 3C589 */ x = ins(port + ResourceConfig); - outs(port + ResourceConfig, 0x3000 | (x&0xfff)); + outs(port + ResourceConfig, 0x3f00 | (x&0xfff)); /* move product ID to register */ while(ins(port+EEPROMcmd) & 0x8000)