summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-05 18:23:38 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-05 18:23:38 +0000
commit94e57ab59d4f7c46b1dff3080c5d629576558290 (patch)
tree3397ef12a129fa79eeac17b01e22607691dcc9a9
parent4558eea7c087e144aa576f34b461299c0b3f7538 (diff)
call vr_setmulti() if adjusting PROMISC or ALLMULTI and do not do a full
re-init if configuring the IP address. tested by Andrey Matveev
-rw-r--r--sys/dev/pci/if_vr.c21
-rw-r--r--sys/dev/pci/if_vrreg.h3
2 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index 264764e2fa1..24f87c72d79 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.55 2006/01/14 09:50:20 brad Exp $ */
+/* $OpenBSD: if_vr.c,v 1.56 2006/02/05 18:23:37 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1209,6 +1209,7 @@ vr_intr(void *arg)
if ((status & VR_ISR_BUSERR) || (status & VR_ISR_TX_UNDERRUN)) {
vr_reset(sc);
+ ifp->if_flags &= ~IFF_RUNNING;
vr_init(sc);
break;
}
@@ -1373,6 +1374,11 @@ vr_init(void *xsc)
s = splnet();
+ if (ifp->if_flags & IFF_RUNNING) {
+ splx(s);
+ return;
+ }
+
/*
* Cancel pending I/O and free all RX/TX buffers.
*/
@@ -1481,8 +1487,10 @@ vr_ifmedia_upd(struct ifnet *ifp)
{
struct vr_softc *sc = ifp->if_softc;
- if (ifp->if_flags & IFF_UP)
+ if (ifp->if_flags & IFF_UP) {
+ ifp->if_flags &= ~IFF_RUNNING;
vr_init(sc);
+ }
return(0);
}
@@ -1533,12 +1541,17 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
break;
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
- vr_init(sc);
+ if ((ifp->if_flags & IFF_RUNNING) &&
+ ((ifp->if_flags ^ sc->sc_if_flags) &
+ (IFF_ALLMULTI | IFF_PROMISC)) != 0)
+ vr_setmulti(sc);
+ else
+ vr_init(sc);
} else {
if (ifp->if_flags & IFF_RUNNING)
vr_stop(sc);
}
- error = 0;
+ sc->sc_if_flags = ifp->if_flags;
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h
index 33a75542707..6ecec0535cf 100644
--- a/sys/dev/pci/if_vrreg.h
+++ b/sys/dev/pci/if_vrreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vrreg.h,v 1.16 2005/12/07 22:48:39 brad Exp $ */
+/* $OpenBSD: if_vrreg.h,v 1.17 2006/02/05 18:23:37 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -471,6 +471,7 @@ struct vr_softc {
struct timeout sc_to;
bus_dmamap_t sc_listmap; /* descriptor list map */
bus_dma_segment_t sc_listseg;
+ int sc_if_flags;
};
#define VR_F_RESTART 0x01 /* Restart unit on next tick */