Source-Changes-HG archive

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

[src/trunk]: src/sys Use ifmedia_fini().



details:   https://anonhg.NetBSD.org/src/rev/f22cd8e5ef5c
branches:  trunk
changeset: 744504:f22cd8e5ef5c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Feb 04 05:18:36 2020 +0000

description:
Use ifmedia_fini().

diffstat:

 sys/arch/mips/atheros/dev/if_ae.c |  10 +++++-----
 sys/arch/mips/ralink/ralink_eth.c |   6 +++---
 sys/dev/hyperv/if_hvn.c           |   5 +++--
 sys/dev/ic/ax88190.c              |   5 +++--
 sys/dev/ic/cs89x0.c               |   5 +++--
 sys/dev/ic/dl10019.c              |   5 +++--
 sys/dev/ic/dp8390.c               |  10 +++++-----
 sys/dev/ic/elink3.c               |  10 +++++-----
 sys/dev/ic/elinkxl.c              |  10 +++++-----
 sys/dev/ic/gem.c                  |   6 +++---
 sys/dev/ic/i82557.c               |  10 +++++-----
 sys/dev/ic/i82596.c               |   5 +++--
 sys/dev/ic/mb86950.c              |  10 +++++-----
 sys/dev/ic/mb86960.c              |  10 +++++-----
 sys/dev/ic/rtl8169.c              |  10 +++++-----
 sys/dev/ic/rtl81x9.c              |  10 +++++-----
 sys/dev/ic/smc91cxx.c             |  10 +++++-----
 sys/dev/ic/tulip.c                |  10 +++++-----
 18 files changed, 76 insertions(+), 71 deletions(-)

diffs (truncated from 577 to 300 lines):

diff -r e20ad117d0cd -r f22cd8e5ef5c sys/arch/mips/atheros/dev/if_ae.c
--- a/sys/arch/mips/atheros/dev/if_ae.c Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/arch/mips/atheros/dev/if_ae.c Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $Id: if_ae.c,v 1.38 2020/01/29 05:30:14 thorpej Exp $ */
+/* $Id: if_ae.c,v 1.39 2020/02/04 05:18:36 thorpej Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.38 2020/01/29 05:30:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.39 2020/02/04 05:18:36 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -485,13 +485,13 @@
        /* Detach all PHYs */
        mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
 
-       /* Delete all remaining media. */
-       ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
-
        rnd_detach_source(&sc->sc_rnd_source);
        ether_ifdetach(ifp);
        if_detach(ifp);
 
+       /* Delete all remaining media. */
+       ifmedia_fini(&sc->sc_mii.mii_media);
+
        for (i = 0; i < AE_NRXDESC; i++) {
                rxs = &sc->sc_rxsoft[i];
                if (rxs->rxs_mbuf != NULL) {
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/arch/mips/ralink/ralink_eth.c
--- a/sys/arch/mips/ralink/ralink_eth.c Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/arch/mips/ralink/ralink_eth.c Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_eth.c,v 1.20 2020/01/29 05:30:14 thorpej Exp $  */
+/*     $NetBSD: ralink_eth.c,v 1.21 2020/02/04 05:18:36 thorpej Exp $  */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ralink_eth.c -- Ralink Ethernet Driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.20 2020/01/29 05:30:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.21 2020/02/04 05:18:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -656,9 +656,9 @@
 
        ralink_eth_disable(sc);
        mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
-       ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
        ether_ifdetach(ifp);
        if_detach(ifp);
+       ifmedia_fini(&sc->sc_mii.mii_media);
 
        for (i = 0; i < RALINK_ETH_NUM_RX_DESC; i++) {
                rxs = &sc->sc_rxstate[i];
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_hvn.c,v 1.16 2020/01/29 05:55:16 thorpej Exp $      */
+/*     $NetBSD: if_hvn.c,v 1.17 2020/02/04 05:25:38 thorpej Exp $      */
 /*     $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.16 2020/01/29 05:55:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.17 2020/02/04 05:25:38 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -362,6 +362,7 @@
 
        ether_ifdetach(ifp);
        if_detach(ifp);
+       ifmedia_fini(&sc->sc_media);
        if_percpuq_destroy(sc->sc_ipq);
 
        hvn_rndis_detach(sc);
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/ax88190.c
--- a/sys/dev/ic/ax88190.c      Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/ax88190.c      Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ax88190.c,v 1.15 2019/05/29 06:17:28 msaitoh Exp $     */
+/*     $NetBSD: ax88190.c,v 1.16 2020/02/04 05:25:39 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.15 2019/05/29 06:17:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.16 2020/02/04 05:25:39 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,6 +108,7 @@
 {
 
        mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
+       ifmedia_fini(&sc->sc_mii.mii_media);
 }
 
 int
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/cs89x0.c
--- a/sys/dev/ic/cs89x0.c       Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/cs89x0.c       Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cs89x0.c,v 1.48 2020/01/29 14:14:55 thorpej Exp $      */
+/*     $NetBSD: cs89x0.c,v 1.49 2020/02/04 05:25:39 thorpej Exp $      */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -212,7 +212,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.48 2020/01/29 14:14:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.49 2020/02/04 05:25:39 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -517,6 +517,7 @@
                rnd_detach_source(&sc->rnd_source);
                ether_ifdetach(ifp);
                if_detach(ifp);
+               ifmedia_fini(&sc->sc_media);
                sc->sc_cfgflags &= ~CFGFLG_ATTACHED;
        }
 
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/dl10019.c
--- a/sys/dev/ic/dl10019.c      Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/dl10019.c      Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dl10019.c,v 1.14 2019/05/29 06:17:28 msaitoh Exp $     */
+/*     $NetBSD: dl10019.c,v 1.15 2020/02/04 05:25:39 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.14 2019/05/29 06:17:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.15 2020/02/04 05:25:39 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -143,6 +143,7 @@
 {
 
        mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
+       ifmedia_fini(&sc->sc_mii.mii_media);
 }
 
 int
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/dp8390.c
--- a/sys/dev/ic/dp8390.c       Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/dp8390.c       Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dp8390.c,v 1.96 2020/01/29 14:14:55 thorpej Exp $      */
+/*     $NetBSD: dp8390.c,v 1.97 2020/02/04 05:25:39 thorpej Exp $      */
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.96 2020/01/29 14:14:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.97 2020/02/04 05:25:39 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -1220,12 +1220,12 @@
        if (sc->sc_media_fini != NULL)
                (*sc->sc_media_fini)(sc);
 
-       /* Delete all remaining media. */
-       ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY);
-
        rnd_detach_source(&sc->rnd_source);
        ether_ifdetach(ifp);
        if_detach(ifp);
 
+       /* Delete all remaining media. */
+       ifmedia_fini(&sc->sc_media);
+
        return 0;
 }
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/elink3.c       Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3.c,v 1.150 2020/01/29 14:17:27 thorpej Exp $     */
+/*     $NetBSD: elink3.c,v 1.151 2020/02/04 05:25:39 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.150 2020/01/29 14:17:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.151 2020/02/04 05:25:39 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -2005,13 +2005,13 @@
                mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
        }
 
-       /* Delete all remaining media. */
-       ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
-
        rnd_detach_source(&sc->rnd_source);
        ether_ifdetach(ifp);
        if_detach(ifp);
 
+       /* Delete all remaining media. */
+       ifmedia_fini(&sc->sc_mii.mii_media);
+
        pmf_device_deregister(sc->sc_dev);
 
        return (0);
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/elinkxl.c      Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elinkxl.c,v 1.134 2020/01/29 14:17:27 thorpej Exp $    */
+/*     $NetBSD: elinkxl.c,v 1.135 2020/02/04 05:25:39 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.134 2020/01/29 14:17:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.135 2020/02/04 05:25:39 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1688,13 +1688,13 @@
                mii_detach(&sc->ex_mii, MII_PHY_ANY, MII_OFFSET_ANY);
        }
 
-       /* Delete all remaining media. */
-       ifmedia_delete_instance(&sc->ex_mii.mii_media, IFM_INST_ANY);
-
        rnd_detach_source(&sc->rnd_source);
        ether_ifdetach(ifp);
        if_detach(ifp);
 
+       /* Delete all remaining media. */
+       ifmedia_fini(&sc->ex_mii.mii_media);
+
        for (i = 0; i < EX_NUPD; i++) {
                rxd = &sc->sc_rxdescs[i];
                if (rxd->rx_mbhead != NULL) {
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Tue Feb 04 05:16:18 2020 +0000
+++ b/sys/dev/ic/gem.c  Tue Feb 04 05:18:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.126 2020/01/29 21:11:38 christos Exp $ */
+/*     $NetBSD: gem.c,v 1.127 2020/02/04 05:25:39 thorpej Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.126 2020/01/29 21:11:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.127 2020/02/04 05:25:39 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -175,7 +175,7 @@
                rnd_detach_source(&sc->rnd_source);
                ether_ifdetach(ifp);
                if_detach(ifp);
-               ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
+               ifmedia_fini(&sc->sc_mii.mii_media);
 
                callout_destroy(&sc->sc_tick_ch);
                callout_destroy(&sc->sc_rx_watchdog);
diff -r e20ad117d0cd -r f22cd8e5ef5c sys/dev/ic/i82557.c



Home | Main Index | Thread Index | Old Index