summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2013-10-26 18:40:17 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2013-10-26 18:40:17 +0000
commit61a3ac6e276662c7bdc0b4e2d12a3a7d9acb1adc (patch)
tree9820d962804735a61b97b2d9e576f3759cdea60e
parentdce533f3905933a3a627f7fd6a49f2f5d3278174 (diff)
Notes
-rw-r--r--sys/dev/mii/acphy.c12
-rw-r--r--sys/dev/mii/amphy.c6
-rw-r--r--sys/dev/mii/atphy.c12
-rw-r--r--sys/dev/mii/axphy.c6
-rw-r--r--sys/dev/mii/bmtphy.c6
-rw-r--r--sys/dev/mii/brgphy.c10
-rw-r--r--sys/dev/mii/ciphy.c12
-rw-r--r--sys/dev/mii/e1000phy.c14
-rw-r--r--sys/dev/mii/gentbi.c6
-rw-r--r--sys/dev/mii/icsphy.c6
-rw-r--r--sys/dev/mii/ip1000phy.c14
-rw-r--r--sys/dev/mii/jmphy.c13
-rw-r--r--sys/dev/mii/lxtphy.c6
-rw-r--r--sys/dev/mii/mii_physubr.c5
-rw-r--r--sys/dev/mii/mlphy.c12
-rw-r--r--sys/dev/mii/nsgphy.c6
-rw-r--r--sys/dev/mii/nsphy.c7
-rw-r--r--sys/dev/mii/nsphyter.c6
-rw-r--r--sys/dev/mii/pnaphy.c6
-rw-r--r--sys/dev/mii/qsphy.c12
-rw-r--r--sys/dev/mii/rdcphy.c6
-rw-r--r--sys/dev/mii/rgephy.c13
-rw-r--r--sys/dev/mii/rlphy.c13
-rw-r--r--sys/dev/mii/rlswitch.c6
-rw-r--r--sys/dev/mii/smcphy.c10
-rw-r--r--sys/dev/mii/smscphy.c10
-rw-r--r--sys/dev/mii/tdkphy.c6
-rw-r--r--sys/dev/mii/tlphy.c12
-rw-r--r--sys/dev/mii/truephy.c7
-rw-r--r--sys/dev/mii/ukphy.c6
-rw-r--r--sys/dev/mii/xmphy.c12
-rw-r--r--sys/dev/usb/net/ruephy.c12
-rw-r--r--sys/dev/xl/xlphy.c12
33 files changed, 9 insertions, 293 deletions
diff --git a/sys/dev/mii/acphy.c b/sys/dev/mii/acphy.c
index c61c05bf43730..edb5221179f10 100644
--- a/sys/dev/mii/acphy.c
+++ b/sys/dev/mii/acphy.c
@@ -168,12 +168,6 @@ acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
/* Wake & deisolate up if necessary */
reg = PHY_READ(sc, MII_BMCR);
if (reg & (BMCR_ISO | BMCR_PDOWN))
@@ -184,12 +178,6 @@ acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* This PHY's autonegotiation doesn't need to be kicked.
*/
break;
diff --git a/sys/dev/mii/amphy.c b/sys/dev/mii/amphy.c
index bd90ccf650896..ae3827db9a222 100644
--- a/sys/dev/mii/amphy.c
+++ b/sys/dev/mii/amphy.c
@@ -119,12 +119,6 @@ amphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/atphy.c b/sys/dev/mii/atphy.c
index cca8813a7cb78..c215e4c9254d5 100644
--- a/sys/dev/mii/atphy.c
+++ b/sys/dev/mii/atphy.c
@@ -116,12 +116,6 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
atphy_setmedia(sc, ife->ifm_media);
@@ -175,12 +169,6 @@ done:
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
diff --git a/sys/dev/mii/axphy.c b/sys/dev/mii/axphy.c
index 78f3901c6cbf7..f6fbc2a9f4317 100644
--- a/sys/dev/mii/axphy.c
+++ b/sys/dev/mii/axphy.c
@@ -113,12 +113,6 @@ axphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c
index 81c2bd2ae1f8d..a4e880e0489ff 100644
--- a/sys/dev/mii/bmtphy.c
+++ b/sys/dev/mii/bmtphy.c
@@ -159,12 +159,6 @@ bmtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index dd29b340d8e64..bdefbe5649564 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/ethernet.h>
#include <net/if_media.h>
@@ -314,10 +315,6 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
case MII_POLLSTAT:
break;
case MII_MEDIACHG:
- /* If the interface is not up, don't do anything. */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
/* Todo: Why is this here? Is it really needed? */
PHY_RESET(sc); /* XXX hardware bug work-around */
@@ -337,11 +334,6 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
}
break;
case MII_TICK:
- /* Bail if the interface isn't up. */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
-
/* Bail if autoneg isn't in process. */
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c
index e830f279e95ef..1b7eb7747b9d2 100644
--- a/sys/dev/mii/ciphy.c
+++ b/sys/dev/mii/ciphy.c
@@ -131,12 +131,6 @@ ciphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
ciphy_fixup(sc); /* XXX hardware bug work-around */
switch (IFM_SUBTYPE(ife->ifm_media)) {
@@ -187,12 +181,6 @@ setit:
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
diff --git a/sys/dev/mii/e1000phy.c b/sys/dev/mii/e1000phy.c
index 4854d78e651cf..d151b364405df 100644
--- a/sys/dev/mii/e1000phy.c
+++ b/sys/dev/mii/e1000phy.c
@@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/bus.h>
-
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
@@ -311,12 +311,6 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) {
e1000phy_mii_phy_auto(sc, ife->ifm_media);
break;
@@ -375,12 +369,6 @@ done:
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
diff --git a/sys/dev/mii/gentbi.c b/sys/dev/mii/gentbi.c
index 05209cfaae84f..52dc8fcdb064f 100644
--- a/sys/dev/mii/gentbi.c
+++ b/sys/dev/mii/gentbi.c
@@ -191,12 +191,6 @@ gentbi_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c
index 6330d9efd620f..53afc9a6fcf4d 100644
--- a/sys/dev/mii/icsphy.c
+++ b/sys/dev/mii/icsphy.c
@@ -145,12 +145,6 @@ icsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/ip1000phy.c b/sys/dev/mii/ip1000phy.c
index b7fb5151ae32c..8a82004f7ce1e 100644
--- a/sys/dev/mii/ip1000phy.c
+++ b/sys/dev/mii/ip1000phy.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
@@ -126,13 +127,6 @@ ip1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0) {
- break;
- }
-
PHY_RESET(sc);
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
@@ -180,12 +174,6 @@ done:
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
diff --git a/sys/dev/mii/jmphy.c b/sys/dev/mii/jmphy.c
index 14fdf7e787cc5..f1efa980bc596 100644
--- a/sys/dev/mii/jmphy.c
+++ b/sys/dev/mii/jmphy.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
@@ -121,24 +122,12 @@ jmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
if (jmphy_setmedia(sc, ife) != EJUSTRETURN)
return (EINVAL);
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
diff --git a/sys/dev/mii/lxtphy.c b/sys/dev/mii/lxtphy.c
index d7059fb5ceeb4..d673f2cd92d8b 100644
--- a/sys/dev/mii/lxtphy.c
+++ b/sys/dev/mii/lxtphy.c
@@ -168,12 +168,6 @@ lxtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_FX)
lxtphy_set_fx(sc);
else
diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c
index 8e1476a7df45e..c8ee613a9179b 100644
--- a/sys/dev/mii/mii_physubr.c
+++ b/sys/dev/mii/mii_physubr.c
@@ -209,13 +209,8 @@ int
mii_phy_tick(struct mii_softc *sc)
{
struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur;
- struct ifnet *ifp = sc->mii_pdata->mii_ifp;
int reg;
- /* Just bail now if the interface is down. */
- if ((ifp->if_flags & IFF_UP) == 0)
- return (EJUSTRETURN);
-
/*
* If we're not doing autonegotiation, we don't need to do
* any extra work here. However, we need to check the link
diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c
index f9b1962f2f0d8..eb6aa4c660746 100644
--- a/sys/dev/mii/mlphy.c
+++ b/sys/dev/mii/mlphy.c
@@ -205,12 +205,6 @@ mlphy_service(xsc, mii, cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
@@ -266,12 +260,6 @@ mlphy_service(xsc, mii, cmd)
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c
index 988e5c2cabc88..e87747a5443b5 100644
--- a/sys/dev/mii/nsgphy.c
+++ b/sys/dev/mii/nsgphy.c
@@ -159,12 +159,6 @@ nsgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c
index 01cd31d77b0b0..7b450fb00b49b 100644
--- a/sys/dev/mii/nsphy.c
+++ b/sys/dev/mii/nsphy.c
@@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
@@ -152,12 +153,6 @@ nsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
reg = PHY_READ(sc, MII_NSPHY_PCR);
/*
diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c
index dabb156a536c5..00c0550a8caa5 100644
--- a/sys/dev/mii/nsphyter.c
+++ b/sys/dev/mii/nsphyter.c
@@ -149,12 +149,6 @@ nsphyter_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/pnaphy.c b/sys/dev/mii/pnaphy.c
index 29f2c7851d7eb..6e5c51b255cf6 100644
--- a/sys/dev/mii/pnaphy.c
+++ b/sys/dev/mii/pnaphy.c
@@ -121,12 +121,6 @@ pnaphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_HPNA_1:
mii_phy_setmedia(sc);
diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c
index a649e5c710d43..e1d137ca09897 100644
--- a/sys/dev/mii/qsphy.c
+++ b/sys/dev/mii/qsphy.c
@@ -143,23 +143,11 @@ qsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* This PHY's autonegotiation doesn't need to be kicked.
*/
break;
diff --git a/sys/dev/mii/rdcphy.c b/sys/dev/mii/rdcphy.c
index 6f7f98d5f99ae..c411eaecfa8b2 100644
--- a/sys/dev/mii/rdcphy.c
+++ b/sys/dev/mii/rdcphy.c
@@ -121,12 +121,6 @@ rdcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_100_TX:
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index aa919f5346396..6a34303e5303c 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_arp.h>
#include <net/if_media.h>
@@ -153,12 +154,6 @@ rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
PHY_RESET(sc); /* XXX hardware bug work-around */
anar = PHY_READ(sc, RGEPHY_MII_ANAR);
@@ -231,12 +226,6 @@ setit:
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c
index ddf8d73dc2359..b98c0403ba424 100644
--- a/sys/dev/mii/rlphy.c
+++ b/sys/dev/mii/rlphy.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/socket.h>
#include <sys/bus.h>
+#include <sys/taskqueue.h> /* XXXGL: if_rlreg.h contamination */
#include <net/if.h>
#include <net/if_arp.h>
@@ -141,23 +142,11 @@ rlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* The RealTek PHY's autonegotiation doesn't need to be
* kicked; it continues in the background.
*/
diff --git a/sys/dev/mii/rlswitch.c b/sys/dev/mii/rlswitch.c
index b158fd40c37b8..5082e7ccb0605 100644
--- a/sys/dev/mii/rlswitch.c
+++ b/sys/dev/mii/rlswitch.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/socket.h>
#include <sys/bus.h>
+#include <sys/taskqueue.h> /* XXXGL: if_rlreg.h contamination */
#include <net/if.h>
#include <net/if_arp.h>
@@ -353,11 +354,6 @@ rlswitch_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_TICK:
- /*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
break;
}
diff --git a/sys/dev/mii/smcphy.c b/sys/dev/mii/smcphy.c
index e96805357fe20..484c736909bc1 100644
--- a/sys/dev/mii/smcphy.c
+++ b/sys/dev/mii/smcphy.c
@@ -134,12 +134,6 @@ smcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
smcphy_auto(sc, ife->ifm_media);
@@ -153,10 +147,6 @@ smcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_TICK:
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0) {
- return (0);
- }
-
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
break;
}
diff --git a/sys/dev/mii/smscphy.c b/sys/dev/mii/smscphy.c
index 5029f2a1ce175..1d6ce618b7b15 100644
--- a/sys/dev/mii/smscphy.c
+++ b/sys/dev/mii/smscphy.c
@@ -120,12 +120,6 @@ smscphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
smscphy_auto(sc, ife->ifm_media);
@@ -139,10 +133,6 @@ smscphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_TICK:
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0) {
- return (0);
- }
-
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
break;
}
diff --git a/sys/dev/mii/tdkphy.c b/sys/dev/mii/tdkphy.c
index d07327c9a4510..0dfb934767f2e 100644
--- a/sys/dev/mii/tdkphy.c
+++ b/sys/dev/mii/tdkphy.c
@@ -122,12 +122,6 @@ tdkphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c
index ac5cff3d46f3c..52300db389dd7 100644
--- a/sys/dev/mii/tlphy.c
+++ b/sys/dev/mii/tlphy.c
@@ -217,12 +217,6 @@ tlphy_service(struct mii_softc *self, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
@@ -247,12 +241,6 @@ tlphy_service(struct mii_softc *self, struct mii_data *mii, int cmd)
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
diff --git a/sys/dev/mii/truephy.c b/sys/dev/mii/truephy.c
index df17b2474edf6..66e4e26fcde6d 100644
--- a/sys/dev/mii/truephy.c
+++ b/sys/dev/mii/truephy.c
@@ -44,6 +44,7 @@
#include <sys/bus.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
@@ -180,12 +181,6 @@ truephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_AUTOEN;
PHY_WRITE(sc, MII_BMCR, bmcr);
diff --git a/sys/dev/mii/ukphy.c b/sys/dev/mii/ukphy.c
index 9d52eb580ca52..45addcbc75707 100644
--- a/sys/dev/mii/ukphy.c
+++ b/sys/dev/mii/ukphy.c
@@ -140,12 +140,6 @@ ukphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c
index 328d34ad9a53e..2e2fff988a15f 100644
--- a/sys/dev/mii/xmphy.c
+++ b/sys/dev/mii/xmphy.c
@@ -148,12 +148,6 @@ xmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
#ifdef foo
@@ -182,12 +176,6 @@ xmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
diff --git a/sys/dev/usb/net/ruephy.c b/sys/dev/usb/net/ruephy.c
index bb9931e44d5d3..746ddbae6aa7b 100644
--- a/sys/dev/usb/net/ruephy.c
+++ b/sys/dev/usb/net/ruephy.c
@@ -123,23 +123,11 @@ ruephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
diff --git a/sys/dev/xl/xlphy.c b/sys/dev/xl/xlphy.c
index 2fe9e0d9058dc..a5555c7ff3f98 100644
--- a/sys/dev/xl/xlphy.c
+++ b/sys/dev/xl/xlphy.c
@@ -152,23 +152,11 @@ xlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case MII_MEDIACHG:
- /*
- * If the interface is not up, don't do anything.
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- break;
-
mii_phy_setmedia(sc);
break;
case MII_TICK:
/*
- * Is the interface even up?
- */
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
-
- /*
* The 3Com PHY's autonegotiation doesn't need to be
* kicked; it continues in the background.
*/