iee_ioctl(): Make this look like other drivers, fixing a missing "splx(s)"
as a side-effect. Don't bother handling IFF_PROMISC here, because ether_ioctl() already calls (*if_init)() to handle flags changes. When adding/deleting multicast addresses, only whack the address filter if the interface is marked RUNNING. Fixes kern/27678.
This commit is contained in:
parent
559857f039
commit
bebd825b66
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i82596.c,v 1.3 2004/10/30 18:08:37 thorpej Exp $ */
|
||||
/* $NetBSD: i82596.c,v 1.4 2004/10/30 23:52:22 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 Jochen Kunz.
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.3 2004/10/30 18:08:37 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.4 2004/10/30 23:52:22 thorpej Exp $");
|
||||
|
||||
/* autoconfig and device stuff */
|
||||
#include <sys/param.h>
|
||||
@ -703,31 +703,29 @@ iee_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
int err;
|
||||
|
||||
s = splnet();
|
||||
if (cmd == SIOCSIFMEDIA || cmd == SIOCGIFMEDIA)
|
||||
return(ifmedia_ioctl(ifp, (struct ifreq *) data,
|
||||
&sc->sc_ifmedia, cmd));
|
||||
else {
|
||||
XXXthorpej rewrite me please
|
||||
switch (cmd) {
|
||||
case SIOCSIFMEDIA:
|
||||
case SIOCGIFMEDIA:
|
||||
err = ifmedia_ioctl(ifp, (struct ifreq *) data,
|
||||
&sc->sc_ifmedia, cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
err = ether_ioctl(ifp, cmd, data);
|
||||
if ((err == ENETRESET && (ifp->if_flags & IFF_RUNNING) != 0) ||
|
||||
((ifp->if_flags & IFF_PROMISC) != 0
|
||||
&& (sc->sc_cf[8] & IEE_CF_8_PRM) == 0)
|
||||
|| ((ifp->if_flags & IFF_PROMISC) == 0
|
||||
&& (sc->sc_cf[8] & IEE_CF_8_PRM) != 0)) {
|
||||
/* Do multicast setup / toggle promisc mode. */
|
||||
if ((ifp->if_flags & IFF_PROMISC) != 0)
|
||||
sc->sc_cf[8] |= IEE_CF_8_PRM;
|
||||
else
|
||||
sc->sc_cf[8] &= ~IEE_CF_8_PRM;
|
||||
/* Put new multicast list into the hardware filter. */
|
||||
iee_cb_setup(sc, IEE_CB_CMD_MCS | IEE_CB_S | IEE_CB_EL
|
||||
| IEE_CB_I);
|
||||
if ((sc->sc_flags & IEE_WANT_MCAST) == 0)
|
||||
/* Mcast setup is not defered. */
|
||||
(sc->sc_iee_cmd)(sc, IEE_SCB_CUC_EXE);
|
||||
err = 0;
|
||||
} else if (err == ENETRESET)
|
||||
if (err == ENETRESET) {
|
||||
/*
|
||||
* Multicast list as changed; set the hardware filter
|
||||
* accordingly.
|
||||
*/
|
||||
if (ifp->if_flags & IFF_RUNNING) {
|
||||
iee_cb_setup(sc, IEE_CB_CMD_MCS | IEE_CB_S |
|
||||
IEE_CB_EL | IEE_CB_I);
|
||||
if ((sc->sc_flags & IEE_WANT_MCAST) == 0)
|
||||
(*sc->sc_iee_cmd)(sc, IEE_SCB_CUC_EXE);
|
||||
}
|
||||
err = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
splx(s);
|
||||
return(err);
|
||||
|
Loading…
Reference in New Issue
Block a user