diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 8d14704e4faa..2fa3df095a5c 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: mii.c,v 1.44 2008/01/10 07:29:41 dyoung Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.44 2008/01/10 07:29:41 dyoung Exp $"); #include #include @@ -212,7 +212,6 @@ mii_detach(struct mii_data *mii, int phyloc, int offloc) offloc != child->mii_offset) continue; } - LIST_REMOVE(child, mii_list); (void) config_detach(&child->mii_dev, DETACH_FORCE); } } @@ -239,6 +238,12 @@ phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return PHY_SERVICE(sc, mii, cmd); } +int +mii_ifmedia_change(struct mii_data *mii) +{ + return ifmedia_change(&mii->mii_media, mii->mii_ifp); +} + /* * Media changed; notify all PHYs. */ diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 7d4a8444a217..246f97218449 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.55 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.56 2008/01/10 07:29:41 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.55 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.56 2008/01/10 07:29:41 dyoung Exp $"); #include #include @@ -572,6 +572,7 @@ mii_phy_detach(struct device *self, int flags) callout_stop(&sc->mii_nway_ch); mii_phy_delete_media(sc); + LIST_REMOVE(sc, mii_list); return (0); } diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index 17cac6a965de..487fb7b4944e 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.48 2007/12/09 20:28:03 jmcneill Exp $ */ +/* $NetBSD: miivar.h,v 1.49 2008/01/10 07:29:42 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -240,6 +240,8 @@ void mii_tick(struct mii_data *); void mii_pollstat(struct mii_data *); void mii_down(struct mii_data *); +int mii_ifmedia_change(struct mii_data *); + int mii_phy_activate(struct device *, enum devact); int mii_phy_detach(struct device *, int);