diff options
| author | thorpej <thorpej@NetBSD.org> | 2020-02-04 05:18:36 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2020-02-04 05:18:36 +0000 |
| commit | 280814b9a1f1ca3e63b8f6006821ca6cd48ea436 (patch) | |
| tree | 6c24811a5ef57c8a792a0dd1dbf3691d72d0bfcd /sys/dev | |
| parent | a467cf22eceb0c2cd992d12db185417fc571941e (diff) | |
Use ifmedia_fini().
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/hyperv/if_hvn.c | 5 | ||||
| -rw-r--r-- | sys/dev/ic/ax88190.c | 5 | ||||
| -rw-r--r-- | sys/dev/ic/cs89x0.c | 5 | ||||
| -rw-r--r-- | sys/dev/ic/dl10019.c | 5 | ||||
| -rw-r--r-- | sys/dev/ic/dp8390.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/elink3.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/elinkxl.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/gem.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/i82557.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/i82596.c | 5 | ||||
| -rw-r--r-- | sys/dev/ic/mb86950.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/mb86960.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/rtl8169.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/rtl81x9.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/smc91cxx.c | 10 | ||||
| -rw-r--r-- | sys/dev/ic/tulip.c | 10 |
16 files changed, 68 insertions, 63 deletions
diff --git a/sys/dev/hyperv/if_hvn.c b/sys/dev/hyperv/if_hvn.c index ed6acd733b7..9b0d7b80448 100644 --- a/sys/dev/hyperv/if_hvn.c +++ b/sys/dev/hyperv/if_hvn.c @@ -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 @@ hvn_detach(device_t self, int flags) ether_ifdetach(ifp); if_detach(ifp); + ifmedia_fini(&sc->sc_media); if_percpuq_destroy(sc->sc_ipq); hvn_rndis_detach(sc); diff --git a/sys/dev/ic/ax88190.c b/sys/dev/ic/ax88190.c index 53cb5000de4..771b9b9ee8b 100644 --- a/sys/dev/ic/ax88190.c +++ b/sys/dev/ic/ax88190.c @@ -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 @@ ax88190_media_fini(struct dp8390_softc *sc) { mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + ifmedia_fini(&sc->sc_mii.mii_media); } int diff --git a/sys/dev/ic/cs89x0.c b/sys/dev/ic/cs89x0.c index 04ef13d751e..07d083298ba 100644 --- a/sys/dev/ic/cs89x0.c +++ b/sys/dev/ic/cs89x0.c @@ -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 @@ cs_detach(struct cs_softc *sc) rnd_detach_source(&sc->rnd_source); ether_ifdetach(ifp); if_detach(ifp); + ifmedia_fini(&sc->sc_media); sc->sc_cfgflags &= ~CFGFLG_ATTACHED; } diff --git a/sys/dev/ic/dl10019.c b/sys/dev/ic/dl10019.c index baae9ea7947..735d02cbb32 100644 --- a/sys/dev/ic/dl10019.c +++ b/sys/dev/ic/dl10019.c @@ -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 @@ dl10019_media_fini(struct dp8390_softc *sc) { mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + ifmedia_fini(&sc->sc_mii.mii_media); } int diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index d6e008d5784..9d3649af911 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -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 @@ dp8390_detach(struct dp8390_softc *sc, int flags) 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 --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index abb6786f938..741b67829f6 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -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 @@ ep_detach(device_t self, int flags) 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 --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c index 4a58440b5d2..3ba84454d66 100644 --- a/sys/dev/ic/elinkxl.c +++ b/sys/dev/ic/elinkxl.c @@ -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 @@ ex_detach(struct ex_softc *sc) 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 --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 58124858e80..a04acd18c64 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -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 @@ gem_detach(struct gem_softc *sc, int flags) 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 --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index 2a0e768929b..0eec53ca9c1 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.157 2020/01/29 14:49:44 thorpej Exp $ */ +/* $NetBSD: i82557.c,v 1.158 2020/02/04 05:25:39 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.157 2020/01/29 14:49:44 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.158 2020/02/04 05:25:39 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -2508,13 +2508,13 @@ fxp_detach(struct fxp_softc *sc, int flags) 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); + for (i = 0; i < FXP_NRFABUFS; i++) { bus_dmamap_unload(sc->sc_dmat, sc->sc_rxmaps[i]); bus_dmamap_destroy(sc->sc_dmat, sc->sc_rxmaps[i]); diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c index 9816822b1b6..22be811b6a0 100644 --- a/sys/dev/ic/i82596.c +++ b/sys/dev/ic/i82596.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82596.c,v 1.43 2020/01/29 14:49:44 thorpej Exp $ */ +/* $NetBSD: i82596.c,v 1.44 2020/02/04 05:25:39 thorpej Exp $ */ /* * Copyright (c) 2003 Jochen Kunz. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.43 2020/01/29 14:49:44 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.44 2020/02/04 05:25:39 thorpej Exp $"); /* autoconfig and device stuff */ #include <sys/param.h> @@ -699,6 +699,7 @@ iee_detach(struct iee_softc *sc, int flags) iee_stop(ifp, 1); ether_ifdetach(ifp); if_detach(ifp); + ifmedia_fini(&sc->sc_ifmedia); bus_dmamap_unload(sc->sc_dmat, sc->sc_shmem_map); bus_dmamap_destroy(sc->sc_dmat, sc->sc_shmem_map); bus_dmamem_unmap(sc->sc_dmat, sc->sc_shmem_addr, sc->sc_shmem_sz); diff --git a/sys/dev/ic/mb86950.c b/sys/dev/ic/mb86950.c index 2df6db87ad4..188a6104e81 100644 --- a/sys/dev/ic/mb86950.c +++ b/sys/dev/ic/mb86950.c @@ -1,4 +1,4 @@ -/* $NetBSD: mb86950.c,v 1.33 2020/01/29 15:00:39 thorpej Exp $ */ +/* $NetBSD: mb86950.c,v 1.34 2020/02/04 05:25:39 thorpej Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.33 2020/01/29 15:00:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.34 2020/02/04 05:25:39 thorpej Exp $"); /* * Device driver for Fujitsu mb86950 based Ethernet cards. @@ -965,15 +965,15 @@ mb86950_detach(struct mb86950_softc *sc) if ((sc->sc_stat & ESTAR_STAT_ATTACHED) == 0) return 0; - /* Delete all media. */ - ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); - /* Unhook the entropy source. */ rnd_detach_source(&sc->rnd_source); ether_ifdetach(ifp); if_detach(ifp); + /* Delete all media. */ + ifmedia_fini(&sc->sc_media); + return 0; } diff --git a/sys/dev/ic/mb86960.c b/sys/dev/ic/mb86960.c index 7b78591140e..cfbbde8124f 100644 --- a/sys/dev/ic/mb86960.c +++ b/sys/dev/ic/mb86960.c @@ -1,4 +1,4 @@ -/* $NetBSD: mb86960.c,v 1.94 2020/01/29 15:00:39 thorpej Exp $ */ +/* $NetBSD: mb86960.c,v 1.95 2020/02/04 05:25:39 thorpej Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.94 2020/01/29 15:00:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.95 2020/02/04 05:25:39 thorpej Exp $"); /* * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards. @@ -1799,15 +1799,15 @@ mb86960_detach(struct mb86960_softc *sc) if ((sc->sc_stat & FE_STAT_ATTACHED) == 0) return 0; - /* Delete all media. */ - ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); - /* Unhook the entropy source. */ rnd_detach_source(&sc->rnd_source); ether_ifdetach(ifp); if_detach(ifp); + /* Delete all media. */ + ifmedia_fini(&sc->sc_media); + mb86960_disable(sc); return 0; } diff --git a/sys/dev/ic/rtl8169.c b/sys/dev/ic/rtl8169.c index b4370b7df32..a2a8d854bc4 100644 --- a/sys/dev/ic/rtl8169.c +++ b/sys/dev/ic/rtl8169.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl8169.c,v 1.162 2020/01/29 15:06:12 thorpej Exp $ */ +/* $NetBSD: rtl8169.c,v 1.163 2020/02/04 05:25:39 thorpej Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.162 2020/01/29 15:06:12 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.163 2020/02/04 05:25:39 thorpej Exp $"); /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */ /* @@ -984,13 +984,13 @@ re_detach(struct rtk_softc *sc) /* Detach all PHYs. */ mii_detach(&sc->mii, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&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->mii.mii_media); + /* Destroy DMA maps for RX buffers. */ for (i = 0; i < RE_RX_DESC_CNT; i++) if (sc->re_ldata.re_rxsoft[i].rxs_dmamap != NULL) diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 8e10e6593f3..33a06a35eae 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl81x9.c,v 1.108 2020/01/29 15:06:12 thorpej Exp $ */ +/* $NetBSD: rtl81x9.c,v 1.109 2020/02/04 05:25:39 thorpej Exp $ */ /* * Copyright (c) 1997, 1998 @@ -86,7 +86,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.108 2020/01/29 15:06:12 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.109 2020/02/04 05:25:39 thorpej Exp $"); #include <sys/param.h> @@ -829,14 +829,14 @@ rtk_detach(struct rtk_softc *sc) /* Detach all PHYs. */ mii_detach(&sc->mii, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&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->mii.mii_media); + for (i = 0; i < RTK_TX_LIST_CNT; i++) { txd = &sc->rtk_tx_descs[i]; if (txd->txd_dmamap != NULL) diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index cf31f09ecbe..74208a1e69e 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.104 2020/01/30 04:56:11 thorpej Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.105 2020/02/04 05:25:39 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.104 2020/01/30 04:56:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.105 2020/02/04 05:25:39 thorpej Exp $"); #include "opt_inet.h" @@ -1386,14 +1386,14 @@ smc91cxx_detach(device_t self, int flags) /* smc91cxx_attach() never fails */ - /* Delete all 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 media. */ + ifmedia_fini(&sc->sc_mii.mii_media); + return 0; } diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index 50262f2977b..bcd0f77e1f7 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.201 2020/01/29 14:18:54 thorpej Exp $ */ +/* $NetBSD: tulip.c,v 1.202 2020/02/04 05:25:39 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.201 2020/01/29 14:18:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.202 2020/02/04 05:25:39 thorpej Exp $"); #include <sys/param.h> @@ -619,14 +619,14 @@ tlp_detach(struct tulip_softc *sc) 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 < TULIP_NRXDESC; i++) { rxs = &sc->sc_rxsoft[i]; if (rxs->rxs_mbuf != NULL) { |
