Module Name: src
Committed By: thorpej
Date: Tue Feb 18 15:00:42 UTC 2020
Modified Files:
src/sys/arch/mips/cavium/dev: if_cnmac.c
Log Message:
- Use ether_mediachange().
- Don't call the media change function directly from the init
function; bounce through mii_ifmedia_change().
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mips/cavium/dev/if_cnmac.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/cavium/dev/if_cnmac.c
diff -u src/sys/arch/mips/cavium/dev/if_cnmac.c:1.16 src/sys/arch/mips/cavium/dev/if_cnmac.c:1.17
--- src/sys/arch/mips/cavium/dev/if_cnmac.c:1.16 Wed Jan 29 05:30:14 2020
+++ src/sys/arch/mips/cavium/dev/if_cnmac.c Tue Feb 18 15:00:42 2020
@@ -1,8 +1,8 @@
-/* $NetBSD: if_cnmac.c,v 1.16 2020/01/29 05:30:14 thorpej Exp $ */
+/* $NetBSD: if_cnmac.c,v 1.17 2020/02/18 15:00:42 thorpej Exp $ */
#include <sys/cdefs.h>
#if 0
-__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.16 2020/01/29 05:30:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.17 2020/02/18 15:00:42 thorpej Exp $");
#endif
#include "opt_octeon.h"
@@ -121,7 +121,6 @@ static void octeon_eth_mii_statchg(struc
static int octeon_eth_mediainit(struct octeon_eth_softc *);
static void octeon_eth_mediastatus(struct ifnet *, struct ifmediareq *);
-static int octeon_eth_mediachange(struct ifnet *);
static inline void octeon_eth_send_queue_flush_prefetch(struct octeon_eth_softc *);
static inline void octeon_eth_send_queue_flush_fetch(struct octeon_eth_softc *);
@@ -546,7 +545,7 @@ octeon_eth_mediainit(struct octeon_eth_s
sc->sc_ethercom.ec_mii = mii;
/* Initialize ifmedia structures. */
- ifmedia_init(&mii->mii_media, 0, octeon_eth_mediachange,
+ ifmedia_init(&mii->mii_media, 0, ether_mediachange,
octeon_eth_mediastatus);
phy = prop_dictionary_get(device_properties(sc->sc_dev), "phy-addr");
@@ -586,16 +585,6 @@ octeon_eth_mediastatus(struct ifnet *ifp
sc->sc_gmx_port->sc_port_flowflags;
}
-static int
-octeon_eth_mediachange(struct ifnet *ifp)
-{
- struct octeon_eth_softc *sc = ifp->if_softc;
-
- mii_mediachg(&sc->sc_mii);
-
- return 0;
-}
-
/* ---- send buffer garbage collection */
static inline void
@@ -1226,7 +1215,7 @@ octeon_eth_init(struct ifnet *ifp)
} else {
octeon_gmx_port_enable(sc->sc_gmx_port, 1);
}
- octeon_eth_mediachange(ifp);
+ mii_ifmedia_change(&sc->sc_mii);
octeon_gmx_set_filter(sc->sc_gmx_port);