aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-10-05 03:01:13 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-10-05 03:01:13 +0000
commitedeea0841372d2237f55567cee47153dec406f32 (patch)
tree7f053e3a28be037fb594ada8d6272c9f2161f3eb
parentf2caf6f54872ee4d1a1d57622c0f267234d7629f (diff)
Notes
-rw-r--r--sys/i386/isa/if_ix.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/i386/isa/if_ix.c b/sys/i386/isa/if_ix.c
index a7adc3e3b598b..1c7ef5723b890 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");)