From 55ff1b22946e618cb105497d7e034a78b1834512 Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 2 Sep 2003 22:44:08 +0000 Subject: [PATCH] If the frontend passes in sc->irq=0, set PCIC_INTR_ENABLE. Also, don't clear that bit all over the bloody place --- sys/dev/ic/i82365.c | 10 ++++++---- sys/dev/isa/i82365_isasubr.c | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c index 7218e421da9d..49625f82b169 100644 --- a/sys/dev/ic/i82365.c +++ b/sys/dev/ic/i82365.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365.c,v 1.72 2003/01/31 00:26:30 thorpej Exp $ */ +/* $NetBSD: i82365.c,v 1.73 2003/09/02 22:44:08 mycroft Exp $ */ /* * Copyright (c) 2000 Christian E. Hopps. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.72 2003/01/31 00:26:30 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.73 2003/09/02 22:44:08 mycroft Exp $"); #define PCICDEBUG @@ -442,6 +442,8 @@ pcic_attach_socket_finish(h) /* steer above mgmt interrupt to configured place */ intr = pcic_read(h, PCIC_INTR); intr &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE); + if (sc->irq == 0) + intr |= PCIC_INTR_ENABLE; pcic_write(h, PCIC_INTR, intr); /* power down the socket */ @@ -1421,7 +1423,7 @@ pcic_chip_socket_enable(pch) /* disable interrupts */ intr = pcic_read(h, PCIC_INTR); - intr &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE); + intr &= ~PCIC_INTR_IRQ_MASK; pcic_write(h, PCIC_INTR, intr); /* power down the socket to reset it, clear the card reset pin */ @@ -1557,7 +1559,7 @@ pcic_chip_socket_disable(pch) /* disable interrupts */ intr = pcic_read(h, PCIC_INTR); - intr &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE); + intr &= ~PCIC_INTR_IRQ_MASK; pcic_write(h, PCIC_INTR, intr); /* power down the socket */ diff --git a/sys/dev/isa/i82365_isasubr.c b/sys/dev/isa/i82365_isasubr.c index 251cc5c6c0a3..05c432dda9ad 100644 --- a/sys/dev/isa/i82365_isasubr.c +++ b/sys/dev/isa/i82365_isasubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365_isasubr.c,v 1.31 2003/01/06 13:05:13 wiz Exp $ */ +/* $NetBSD: i82365_isasubr.c,v 1.32 2003/09/02 22:44:09 mycroft Exp $ */ /* * Copyright (c) 2000 Christian E. Hopps. All rights reserved. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.31 2003/01/06 13:05:13 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.32 2003/09/02 22:44:09 mycroft Exp $"); #define PCICISADEBUG @@ -496,7 +496,7 @@ pcic_isa_chip_intr_establish(pch, pf, ipl, fct, arg) h->ih_irq = irq; if (h->flags & PCIC_FLAG_ENABLED) { reg = pcic_read(h, PCIC_INTR); - reg &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE); + reg &= ~PCIC_INTR_IRQ_MASK; pcic_write(h, PCIC_INTR, reg | irq); } @@ -523,7 +523,7 @@ pcic_isa_chip_intr_disestablish(pch, ih) h->ih_irq = 0; if (h->flags & PCIC_FLAG_ENABLED) { reg = pcic_read(h, PCIC_INTR); - reg &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE); + reg &= ~PCIC_INTR_IRQ_MASK; pcic_write(h, PCIC_INTR, reg); } }