summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-07-09 16:00:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-07-09 16:00:49 +0000
commitfa8533f1c4abaae0c3044218bf7eebf0d7280a4d (patch)
tree37db54b23ffb2a2299f9d51a46383aa4d10581cc /sys
parentf7ea8910e22e9ed4750db74b0db0bb4db2a857af (diff)
In ne2000_detect(), temporarily mark the dp8390 subpart as inactive, so that
we ignore interrupts; this allows unplugging a card when the probe gets stuck without panicing.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ne2000.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ic/ne2000.c b/sys/dev/ic/ne2000.c
index 527b71bf68b..255b648dc05 100644
--- a/sys/dev/ic/ne2000.c
+++ b/sys/dev/ic/ne2000.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ne2000.c,v 1.15 2005/10/22 23:26:02 brad Exp $ */
+/* $OpenBSD: ne2000.c,v 1.16 2006/07/09 16:00:48 miod Exp $ */
/* $NetBSD: ne2000.c,v 1.12 1998/06/10 01:15:50 thorpej Exp $ */
/*-
@@ -307,7 +307,10 @@ ne2000_detect(nsc)
bus_space_handle_t asich = nsc->sc_asich;
static u_int8_t test_pattern[32] = "THIS is A memory TEST pattern";
u_int8_t test_buffer[32], tmp;
- int i, rv = 0;
+ int state, i, rv = 0;
+
+ state = dsc->sc_enabled;
+ dsc->sc_enabled = 0;
/* Reset the board. */
#ifdef GWETHER
@@ -446,6 +449,8 @@ ne2000_detect(nsc)
bus_space_write_1(nict, nich, ED_P0_ISR, 0xff);
out:
+ dsc->sc_enabled = state;
+
return (rv);
}