Module Name: src Committed By: thorpej Date: Tue Feb 4 05:44:15 UTC 2020
Modified Files: src/sys/dev/pci: if_age.c if_alc.c if_ale.c if_aq.c if_bge.c if_bnx.c if_cas.c if_ena.c if_et.c if_ixl.c if_msk.c if_nfe.c if_sip.c if_vte.c src/sys/dev/pci/cxgb: cxgb_main.c src/sys/dev/pci/ixgbe: ixv.c Log Message: Use ifmedia_fini(). To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/if_age.c cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_alc.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/if_ale.c src/sys/dev/pci/if_cas.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_aq.c cvs rdiff -u -r1.343 -r1.344 src/sys/dev/pci/if_bge.c cvs rdiff -u -r1.90 -r1.91 src/sys/dev/pci/if_bnx.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_ena.c cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/if_et.c src/sys/dev/pci/if_vte.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_ixl.c cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/if_msk.c cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/if_nfe.c cvs rdiff -u -r1.176 -r1.177 src/sys/dev/pci/if_sip.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/cxgb/cxgb_main.c cvs rdiff -u -r1.144 -r1.145 src/sys/dev/pci/ixgbe/ixv.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/dev/pci/if_age.c diff -u src/sys/dev/pci/if_age.c:1.66 src/sys/dev/pci/if_age.c:1.67 --- src/sys/dev/pci/if_age.c:1.66 Thu Jan 30 13:59:24 2020 +++ src/sys/dev/pci/if_age.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_age.c,v 1.66 2020/01/30 13:59:24 thorpej Exp $ */ +/* $NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */ /*- @@ -31,7 +31,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.66 2020/01/30 13:59:24 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $"); #include "vlan.h" @@ -320,13 +320,13 @@ age_detach(device_t self, int flags) mii_detach(&sc->sc_miibus, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->sc_miibus.mii_media, IFM_INST_ANY); - ether_ifdetach(ifp); if_detach(ifp); age_dma_free(sc); + /* Delete all remaining media. */ + ifmedia_fini(&sc->sc_miibus.mii_media); + if (sc->sc_irq_handle != NULL) { pci_intr_disestablish(sc->sc_pct, sc->sc_irq_handle); sc->sc_irq_handle = NULL; Index: src/sys/dev/pci/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.47 src/sys/dev/pci/if_alc.c:1.48 --- src/sys/dev/pci/if_alc.c:1.47 Thu Jan 30 13:59:24 2020 +++ src/sys/dev/pci/if_alc.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.47 2020/01/30 13:59:24 thorpej Exp $ */ +/* $NetBSD: if_alc.c,v 1.48 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon <yong...@freebsd.org> @@ -1542,13 +1542,13 @@ alc_detach(device_t self, int flags) mii_detach(&sc->sc_miibus, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->sc_miibus.mii_media, IFM_INST_ANY); - ether_ifdetach(ifp); if_detach(ifp); alc_dma_free(sc); + /* Delete all remaining media. */ + ifmedia_fini(&sc->sc_miibus.mii_media); + alc_phy_down(sc); if (sc->sc_irq_handle != NULL) { pci_intr_disestablish(sc->sc_pct, sc->sc_irq_handle); Index: src/sys/dev/pci/if_ale.c diff -u src/sys/dev/pci/if_ale.c:1.38 src/sys/dev/pci/if_ale.c:1.39 --- src/sys/dev/pci/if_ale.c:1.38 Thu Jan 30 13:59:24 2020 +++ src/sys/dev/pci/if_ale.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ale.c,v 1.38 2020/01/30 13:59:24 thorpej Exp $ */ +/* $NetBSD: if_ale.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yong...@freebsd.org> @@ -32,7 +32,7 @@ /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.38 2020/01/30 13:59:24 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $"); #include "vlan.h" @@ -613,13 +613,13 @@ ale_detach(device_t self, int flags) mii_detach(&sc->sc_miibus, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->sc_miibus.mii_media, IFM_INST_ANY); - ether_ifdetach(ifp); if_detach(ifp); ale_dma_free(sc); + /* Delete all remaining media. */ + ifmedia_fini(&sc->sc_miibus.mii_media); + if (sc->sc_irq_handle != NULL) { pci_intr_disestablish(sc->sc_pct, sc->sc_irq_handle); sc->sc_irq_handle = NULL; Index: src/sys/dev/pci/if_cas.c diff -u src/sys/dev/pci/if_cas.c:1.38 src/sys/dev/pci/if_cas.c:1.39 --- src/sys/dev/pci/if_cas.c:1.38 Thu Jan 30 05:24:53 2020 +++ src/sys/dev/pci/if_cas.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cas.c,v 1.38 2020/01/30 05:24:53 thorpej Exp $ */ +/* $NetBSD: if_cas.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ /* @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.38 2020/01/30 05:24:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $"); #ifndef _MODULE #include "opt_inet.h" @@ -760,7 +760,7 @@ cas_detach(device_t self, int flags) 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); Index: src/sys/dev/pci/if_aq.c diff -u src/sys/dev/pci/if_aq.c:1.6 src/sys/dev/pci/if_aq.c:1.7 --- src/sys/dev/pci/if_aq.c:1.6 Fri Jan 31 22:41:07 2020 +++ src/sys/dev/pci/if_aq.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_aq.c,v 1.6 2020/01/31 22:41:07 thorpej Exp $ */ +/* $NetBSD: if_aq.c,v 1.7 2020/02/04 05:44:14 thorpej Exp $ */ /** * aQuantia Corporation Network Driver @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.6 2020/01/31 22:41:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.7 2020/02/04 05:44:14 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_if_aq.h" @@ -1581,6 +1581,8 @@ aq_detach(device_t self, int flags __unu AQ_EVCNT_DETACH(sc, cprc); #endif + ifmedia_fini(&sc->sc_media); + mutex_destroy(&sc->sc_mpi_mutex); mutex_destroy(&sc->sc_mutex); Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.343 src/sys/dev/pci/if_bge.c:1.344 --- src/sys/dev/pci/if_bge.c:1.343 Sat Feb 1 06:17:23 2020 +++ src/sys/dev/pci/if_bge.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.343 2020/02/01 06:17:23 thorpej Exp $ */ +/* $NetBSD: if_bge.c,v 1.344 2020/02/04 05:44:14 thorpej Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.343 2020/02/01 06:17:23 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.344 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -4041,12 +4041,12 @@ bge_detach(device_t self, int flags __un mii_detach(&sc->bge_mii, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->bge_mii.mii_media, IFM_INST_ANY); - ether_ifdetach(ifp); if_detach(ifp); + /* Delete all remaining media. */ + ifmedia_fini(&sc->bge_mii.mii_media); + bge_release_resources(sc); return 0; Index: src/sys/dev/pci/if_bnx.c diff -u src/sys/dev/pci/if_bnx.c:1.90 src/sys/dev/pci/if_bnx.c:1.91 --- src/sys/dev/pci/if_bnx.c:1.90 Sat Feb 1 07:12:40 2020 +++ src/sys/dev/pci/if_bnx.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bnx.c,v 1.90 2020/02/01 07:12:40 thorpej Exp $ */ +/* $NetBSD: if_bnx.c,v 1.91 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $ */ /*- @@ -35,7 +35,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.90 2020/02/01 07:12:40 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.91 2020/02/04 05:44:14 thorpej Exp $"); /* * The following controllers are supported by this driver: @@ -975,12 +975,12 @@ bnx_detach(device_t dev, int flags) ether_ifdetach(ifp); workqueue_destroy(sc->bnx_wq); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->bnx_mii.mii_media, IFM_INST_ANY); - if_detach(ifp); mii_detach(&sc->bnx_mii, MII_PHY_ANY, MII_OFFSET_ANY); + /* Delete all remaining media. */ + ifmedia_fini(&sc->bnx_mii.mii_media); + /* Release all remaining resources. */ bnx_release_resources(sc); Index: src/sys/dev/pci/if_ena.c diff -u src/sys/dev/pci/if_ena.c:1.20 src/sys/dev/pci/if_ena.c:1.21 --- src/sys/dev/pci/if_ena.c:1.20 Sat Feb 1 02:32:40 2020 +++ src/sys/dev/pci/if_ena.c Tue Feb 4 05:44:14 2020 @@ -31,7 +31,7 @@ #if 0 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.20 2020/02/01 02:32:40 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.21 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -3880,6 +3880,7 @@ ena_detach(device_t pdev, int flags) ether_ifdetach(adapter->ifp); if_free(adapter->ifp); } + ifmedia_fini(&adapter->media); ena_free_all_io_rings_resources(adapter); Index: src/sys/dev/pci/if_et.c diff -u src/sys/dev/pci/if_et.c:1.29 src/sys/dev/pci/if_et.c:1.30 --- src/sys/dev/pci/if_et.c:1.29 Thu Jan 30 05:42:00 2020 +++ src/sys/dev/pci/if_et.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_et.c,v 1.29 2020/01/30 05:42:00 thorpej Exp $ */ +/* $NetBSD: if_et.c,v 1.30 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.29 2020/01/30 05:42:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.30 2020/02/04 05:44:14 thorpej Exp $"); #include "opt_inet.h" #include "vlan.h" @@ -332,13 +332,13 @@ et_detach(device_t self, int flags) mii_detach(&sc->sc_miibus, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete all remaining media. */ - ifmedia_delete_instance(&sc->sc_miibus.mii_media, IFM_INST_ANY); - ether_ifdetach(ifp); if_detach(ifp); et_dma_free(sc); + /* Delete all remaining media. */ + ifmedia_fini(&sc->sc_miibus.mii_media); + if (sc->sc_irq_handle != NULL) { pci_intr_disestablish(sc->sc_pct, sc->sc_irq_handle); sc->sc_irq_handle = NULL; Index: src/sys/dev/pci/if_vte.c diff -u src/sys/dev/pci/if_vte.c:1.29 src/sys/dev/pci/if_vte.c:1.30 --- src/sys/dev/pci/if_vte.c:1.29 Sat Feb 1 05:14:28 2020 +++ src/sys/dev/pci/if_vte.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vte.c,v 1.29 2020/02/01 05:14:28 thorpej Exp $ */ +/* $NetBSD: if_vte.c,v 1.30 2020/02/04 05:44:14 thorpej Exp $ */ /* * Copyright (c) 2011 Manuel Bouyer. All rights reserved. @@ -55,7 +55,7 @@ /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.29 2020/02/01 05:14:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.30 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -325,10 +325,10 @@ vte_detach(device_t dev, int flags __unu pmf_device_deregister(dev); mii_detach(&sc->vte_mii, MII_PHY_ANY, MII_OFFSET_ANY); - ifmedia_delete_instance(&sc->vte_mii.mii_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); + ifmedia_fini(&sc->vte_mii.mii_media); vte_dma_free(sc); Index: src/sys/dev/pci/if_ixl.c diff -u src/sys/dev/pci/if_ixl.c:1.35 src/sys/dev/pci/if_ixl.c:1.36 --- src/sys/dev/pci/if_ixl.c:1.35 Sat Feb 1 12:45:05 2020 +++ src/sys/dev/pci/if_ixl.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ixl.c,v 1.35 2020/02/01 12:45:05 thorpej Exp $ */ +/* $NetBSD: if_ixl.c,v 1.36 2020/02/04 05:44:14 thorpej Exp $ */ /* * Copyright (c) 2013-2015, Intel Corporation @@ -1522,9 +1522,9 @@ ixl_detach(device_t self, int flags) sc->sc_workq_txrx = NULL; } - ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); + ifmedia_fini(&sc->sc_media); ixl_teardown_interrupts(sc); ixl_teardown_stats(sc); Index: src/sys/dev/pci/if_msk.c diff -u src/sys/dev/pci/if_msk.c:1.97 src/sys/dev/pci/if_msk.c:1.98 --- src/sys/dev/pci/if_msk.c:1.97 Thu Jan 30 05:42:00 2020 +++ src/sys/dev/pci/if_msk.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_msk.c,v 1.97 2020/01/30 05:42:00 thorpej Exp $ */ +/* $NetBSD: if_msk.c,v 1.98 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $ */ /* @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.97 2020/01/30 05:42:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.98 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1332,14 +1332,14 @@ msk_detach(device_t self, int flags) if (LIST_FIRST(&sc_if->sk_mii.mii_phys) != NULL) mii_detach(&sc_if->sk_mii, MII_PHY_ANY, MII_OFFSET_ANY); - /* Delete any remaining media. */ - ifmedia_delete_instance(&sc_if->sk_mii.mii_media, IFM_INST_ANY); - pmf_device_deregister(self); ether_ifdetach(ifp); if_detach(ifp); + /* Delete any remaining media. */ + ifmedia_fini(&sc_if->sk_mii.mii_media); + msk_free_jumbo_mem(sc_if); bus_dmamem_unmap(sc->sc_dmatag, sc_if->sk_rdata, Index: src/sys/dev/pci/if_nfe.c diff -u src/sys/dev/pci/if_nfe.c:1.73 src/sys/dev/pci/if_nfe.c:1.74 --- src/sys/dev/pci/if_nfe.c:1.73 Thu Jan 30 05:42:00 2020 +++ src/sys/dev/pci/if_nfe.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_nfe.c,v 1.73 2020/01/30 05:42:00 thorpej Exp $ */ +/* $NetBSD: if_nfe.c,v 1.74 2020/02/04 05:44:14 thorpej Exp $ */ /* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */ /*- @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.73 2020/01/30 05:42:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.74 2020/02/04 05:44:14 thorpej Exp $"); #include "opt_inet.h" #include "vlan.h" @@ -452,6 +452,7 @@ nfe_detach(device_t self, int flags) ether_ifdetach(ifp); if_detach(ifp); mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + ifmedia_fini(&sc->sc_mii.mii_media); nfe_free_rx_ring(sc, &sc->rxq); mutex_destroy(&sc->rxq.mtx); Index: src/sys/dev/pci/if_sip.c diff -u src/sys/dev/pci/if_sip.c:1.176 src/sys/dev/pci/if_sip.c:1.177 --- src/sys/dev/pci/if_sip.c:1.176 Thu Jan 30 05:42:00 2020 +++ src/sys/dev/pci/if_sip.c Tue Feb 4 05:44:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sip.c,v 1.176 2020/01/30 05:42:00 thorpej Exp $ */ +/* $NetBSD: if_sip.c,v 1.177 2020/02/04 05:44:14 thorpej Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.176 2020/01/30 05:42:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.177 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -911,6 +911,7 @@ sipcom_do_detach(device_t self, enum sip ether_ifdetach(ifp); if_detach(ifp); mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + ifmedia_fini(&sc->sc_mii.mii_media); /*FALLTHROUGH*/ case SIP_ATTACH_CREATE_RXMAP: Index: src/sys/dev/pci/cxgb/cxgb_main.c diff -u src/sys/dev/pci/cxgb/cxgb_main.c:1.7 src/sys/dev/pci/cxgb/cxgb_main.c:1.8 --- src/sys/dev/pci/cxgb/cxgb_main.c:1.7 Sun Dec 9 11:49:06 2018 +++ src/sys/dev/pci/cxgb/cxgb_main.c Tue Feb 4 05:44:14 2020 @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.7 2018/12/09 11:49:06 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.8 2020/02/04 05:44:14 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -810,6 +810,8 @@ cxgb_port_detach(device_t self, int flag PORT_LOCK_DEINIT(p); if_detach(p->ifp); + ifmedia_fini(&p->media); + return (0); } Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.144 src/sys/dev/pci/ixgbe/ixv.c:1.145 --- src/sys/dev/pci/ixgbe/ixv.c:1.144 Tue Jan 21 14:55:55 2020 +++ src/sys/dev/pci/ixgbe/ixv.c Tue Feb 4 05:44:15 2020 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.144 2020/01/21 14:55:55 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.145 2020/02/04 05:44:15 thorpej Exp $*/ /****************************************************************************** @@ -619,6 +619,7 @@ ixv_detach(device_t dev, int flags) bus_generic_detach(dev); #endif if_detach(adapter->ifp); + ifmedia_fini(&adapter->media); if_percpuq_destroy(adapter->ipq); sysctl_teardown(&adapter->sysctllog);