In mcstop(), don't clear IFF_UP. Other drivers don't mess with IFF_UP

internally, other than to set it when they gain their first address.
Every caller of mcstop() bar one was either preserving the state of IFF_UP
itself or was conditional on its already being clear, so the only effect of
this is to simplify the code and to change that one case, thereby curing
PR port-macppc/12088 (underflows on "mc" cause it to be taken down).
This commit is contained in:
bjh21 2003-06-04 21:30:06 +00:00
parent 362ac6119e
commit 6a5af969d4
2 changed files with 4 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_mc.c,v 1.20 2003/04/02 00:44:22 thorpej Exp $ */
/* $NetBSD: if_mc.c,v 1.21 2003/06/04 21:30:06 bjh21 Exp $ */
/*-
* Copyright (c) 1997 David Huang <khym@bga.com>
@ -195,7 +195,6 @@ mcioctl(ifp, cmd, data)
struct ifreq *ifr;
int s = splnet(), err = 0;
int temp;
switch (cmd) {
@ -254,9 +253,7 @@ mcioctl(ifp, cmd, data)
* reset the interface to pick up any other changes
* in flags
*/
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
mcstart(ifp);
}
break;
@ -273,9 +270,7 @@ mcioctl(ifp, cmd, data)
* Multicast list has changed; set the hardware
* filter accordingly. But remember UP flag!
*/
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
err = 0;
}
break;
@ -422,7 +417,7 @@ mcstop(sc)
DELAY(100);
sc->sc_if.if_timer = 0;
sc->sc_if.if_flags &= ~(IFF_RUNNING | IFF_UP);
sc->sc_if.if_flags &= ~IFF_RUNNING;
splx(s);
return (0);
@ -438,12 +433,9 @@ mcwatchdog(ifp)
struct ifnet *ifp;
{
struct mc_softc *sc = ifp->if_softc;
int temp;
printf("mcwatchdog: resetting chip\n");
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: am79c950.c,v 1.13 2003/04/02 03:04:01 thorpej Exp $ */
/* $NetBSD: am79c950.c,v 1.14 2003/06/04 21:30:06 bjh21 Exp $ */
/*-
* Copyright (c) 1997 David Huang <khym@bga.com>
@ -202,7 +202,6 @@ mcioctl(ifp, cmd, data)
struct ifreq *ifr;
int s = splnet(), err = 0;
int temp;
switch (cmd) {
@ -261,9 +260,7 @@ mcioctl(ifp, cmd, data)
* reset the interface to pick up any other changes
* in flags
*/
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
mcstart(ifp);
}
break;
@ -280,9 +277,7 @@ mcioctl(ifp, cmd, data)
* Multicast list has changed; set the hardware
* filter accordingly. But remember UP flag!
*/
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
err = 0;
}
break;
@ -436,7 +431,7 @@ mcstop(sc)
DELAY(100);
sc->sc_if.if_timer = 0;
sc->sc_if.if_flags &= ~(IFF_RUNNING | IFF_UP);
sc->sc_if.if_flags &= ~IFF_RUNNING;
splx(s);
return (0);
@ -452,12 +447,9 @@ mcwatchdog(ifp)
struct ifnet *ifp;
{
struct mc_softc *sc = ifp->if_softc;
int temp;
printf("mcwatchdog: resetting chip\n");
temp = ifp->if_flags & IFF_UP;
mcreset(sc);
ifp->if_flags |= temp;
}
/*