summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/hme.c30
-rw-r--r--sys/dev/ic/hmevar.h3
2 files changed, 25 insertions, 8 deletions
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index 199b00769a8..ecfc99b537f 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.31 2004/05/31 01:51:30 mcbride Exp $ */
+/* $OpenBSD: hme.c,v 1.32 2004/08/08 19:01:20 brad Exp $ */
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
/*-
@@ -239,6 +239,7 @@ hme_config(sc)
ifp->if_watchdog = hme_watchdog;
ifp->if_flags =
IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+ sc->sc_if_flags = ifp->if_flags;
IFQ_SET_READY(&ifp->if_snd);
ifp->if_capabilities |= IFCAP_VLAN_MTU;
@@ -621,6 +622,7 @@ hme_init(sc)
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
+ sc->sc_if_flags = ifp->if_flags;
ifp->if_timer = 0;
hme_start(ifp);
}
@@ -1045,6 +1047,7 @@ hme_mii_statchg(dev)
v &= ~HME_MAC_TXCFG_FULLDPLX;
sc->sc_arpcom.ac_if.if_flags &= ~IFF_SIMPLEX;
}
+ sc->sc_if_flags = sc->sc_arpcom.ac_if.if_flags;
bus_space_write_4(t, mac, HME_MACI_TXCFG, v);
}
@@ -1123,12 +1126,15 @@ hme_ioctl(ifp, cmd, data)
switch (cmd) {
case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
- hme_init(sc);
+ if (ifp->if_flags & IFF_UP)
+ hme_setladrf(sc);
+ else {
+ ifp->if_flags |= IFF_UP;
+ hme_init(sc);
+ }
arp_ifinit(&sc->sc_arpcom, ifa);
break;
#endif
@@ -1156,10 +1162,19 @@ hme_ioctl(ifp, cmd, data)
hme_init(sc);
} else if ((ifp->if_flags & IFF_UP) != 0) {
/*
- * Reset the interface to pick up changes in any other
- * flags that affect hardware registers.
+ * If setting debug or promiscuous mode, do not reset
+ * the chip; for everything else, call hme_init()
+ * which will trigger a reset.
*/
- hme_init(sc);
+#define RESETIGN (IFF_CANTCHANGE | IFF_DEBUG)
+ if (ifp->if_flags == sc->sc_if_flags)
+ break;
+ if ((ifp->if_flags & (~RESETIGN))
+ == (sc->sc_if_flags & (~RESETIGN)))
+ hme_setladrf(sc);
+ else
+ hme_init(sc);
+#undef RESETIGN
}
#ifdef HMEDEBUG
sc->sc_debug = (ifp->if_flags & IFF_DEBUG) != 0 ? 1 : 0;
@@ -1192,6 +1207,7 @@ hme_ioctl(ifp, cmd, data)
break;
}
+ sc->sc_if_flags = ifp->if_flags;
splx(s);
return (error);
}
diff --git a/sys/dev/ic/hmevar.h b/sys/dev/ic/hmevar.h
index 59d53def1fb..0e1b02fd42a 100644
--- a/sys/dev/ic/hmevar.h
+++ b/sys/dev/ic/hmevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hmevar.h,v 1.7 2002/11/20 22:07:45 jason Exp $ */
+/* $OpenBSD: hmevar.h,v 1.8 2004/08/08 19:01:20 brad Exp $ */
/* $NetBSD: hmevar.h,v 1.6 2000/09/28 10:56:57 tsutsui Exp $ */
/*-
@@ -87,6 +87,7 @@ struct hme_softc {
int sc_debug;
void *sc_sh; /* shutdownhook cookie */
+ short sc_if_flags;
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; /* MAC address */
/* Special hardware hooks */