diff --git a/sys/i386/isa/if_ix.c b/sys/i386/isa/if_ix.c index a7adc3e3b59..1c7ef5723b8 100644 --- a/sys/i386/isa/if_ix.c +++ b/sys/i386/isa/if_ix.c @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_ix.c,v 1.7 1995/05/30 08:02:15 rgrimes Exp $ + * $Id: if_ix.c,v 1.8 1995/09/19 18:55:11 bde Exp $ */ #include "ix.h" @@ -318,6 +318,7 @@ ixprobe(struct isa_device *dvp) { /* ZZZ irq_translate should really be unsigned, but until * isa_device.h and all uses are fixed we have to live with it */ short irq_translate[] = {0, IRQ9, IRQ3, IRQ4, IRQ5, IRQ10, IRQ11, 0}; + char irq_encode[] = { 0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 5, 6, 0, 0, 0, 0 }; DEBUGBEGIN(DEBUGPROBE) DEBUGDO(printf ("ixprobe:");) @@ -498,10 +499,20 @@ ixprobe(struct isa_device *dvp) { */ irq = ixeeprom_read(unit, eeprom_config1); irq = (irq & IRQ) >> IRQ_SHIFT; - sc->irq_encoded = irq; irq = irq_translate[irq]; - if (irq != dvp->id_irq) { - printf("Warning board is configured for IRQ %d\n", irq); + if (dvp->id_irq > 0) { + if (irq != dvp->id_irq) { + printf("ix%d: WARNING: board is configured for IRQ %d, using %d\n", + unit, ffs(irq) - 1, ffs(dvp->id_irq) - 1); + irq = dvp->id_irq; + } + } else { + dvp->id_irq = irq; + } + sc->irq_encoded = irq_encode[ffs(irq) - 1]; + if (sc->irq_encoded == 0) { + printf("ix%d: invalid irq (%d)\n", ffs(irq) - 1); + goto ixprobe_exit; } /* @@ -1516,13 +1527,16 @@ int ixioctl(struct ifnet *ifp, int cmd, caddr_t data) { int unit = ifp->if_unit; int status = 0; + int s; ix_softc_t *sc = &ix_softc[unit]; DEBUGBEGIN(DEBUGIOCTL) DEBUGDO(printf("ixioctl:");) DEBUGEND - switch(cmd) { + s = splimp(); + + switch(cmd) { case SIOCSIFADDR: { struct ifaddr *ifa = (struct ifaddr *)data; @@ -1574,6 +1588,7 @@ ixioctl(struct ifnet *ifp, int cmd, caddr_t data) { break; } } + splx(s); DEBUGBEGIN(DEBUGIOCTL) DEBUGDO(printf("ixioctl exit\n");)