Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/cavium/dev - Use ether_mediachange().



details:   https://anonhg.NetBSD.org/src/rev/86e87f29f6a8
branches:  trunk
changeset: 744938:86e87f29f6a8
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Feb 18 15:00:42 2020 +0000

description:
- Use ether_mediachange().
- Don't call the media change function directly from the init
  function; bounce through mii_ifmedia_change().

diffstat:

 sys/arch/mips/cavium/dev/if_cnmac.c |  19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diffs (57 lines):

diff -r 256e58bfba76 -r 86e87f29f6a8 sys/arch/mips/cavium/dev/if_cnmac.c
--- a/sys/arch/mips/cavium/dev/if_cnmac.c       Tue Feb 18 14:49:32 2020 +0000
+++ b/sys/arch/mips/cavium/dev/if_cnmac.c       Tue Feb 18 15:00:42 2020 +0000
@@ -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 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 @@
        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 @@
            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 @@
        } 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);
 



Home | Main Index | Thread Index | Old Index