aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii/truephy.c
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 /sys/dev/mii/truephy.c
parentdce533f3905933a3a627f7fd6a49f2f5d3278174 (diff)
downloadsrc-61a3ac6e276662c7bdc0b4e2d12a3a7d9acb1adc.tar.gz
src-61a3ac6e276662c7bdc0b4e2d12a3a7d9acb1adc.zip
The MII layer shouldn't care about administrative status of an
interface. Make MII drivers forget about 'struct ifnet'. Later plan is to provide an administrative downcall from ifnet layer into drivers, to inform them about administrative status change. If someone thinks that processing MII events for an administratively down interface is a big problem, then drivers would turn MII processing off. The following MII drivers do evil things, like strcmp() on driver name, so they still need knowledge of ifnet and thus include if_var.h. They all need to be fixed: sys/dev/mii/brgphy.c sys/dev/mii/e1000phy.c sys/dev/mii/ip1000phy.c sys/dev/mii/jmphy.c sys/dev/mii/nsphy.c sys/dev/mii/rgephy.c sys/dev/mii/truephy.c Sponsored by: Netflix Sponsored by: Nginx, Inc.
Notes
Notes: svn path=/head/; revision=257184
Diffstat (limited to 'sys/dev/mii/truephy.c')
-rw-r--r--sys/dev/mii/truephy.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/dev/mii/truephy.c b/sys/dev/mii/truephy.c
index df17b2474edf..66e4e26fcde6 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);