Fix wi_intr() to avoid touching card registers during insert/remove events,

when sharing an interrupt with other devices:
check sc->sc_enabled,  and drop the interrupt if its' off.

Also check for IFF_RUNNING, on advice of Enami Tsugotomo.
This commit is contained in:
jonathan 2000-10-13 19:15:08 +00:00
parent 86974d7235
commit 6e67f82712
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wi.c,v 1.40 2000/10/12 04:50:58 enami Exp $ */
/* $NetBSD: if_wi.c,v 1.41 2000/10/13 19:15:08 jonathan Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@ -670,7 +670,9 @@ int wi_intr(arg)
struct ifnet *ifp;
u_int16_t status;
if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0)
if (sc->sc_enabled == 0 ||
(sc->sc_dev.dv_flags & DVF_ACTIVE) == 0 ||
(sc->sc_ethercom.ec_if.if_flags & IFF_RUNNING) == 0)
return (0);
ifp = &sc->sc_ethercom.ec_if;