Module Name: src Committed By: msaitoh Date: Fri Feb 28 06:53:22 UTC 2020
Modified Files: src/sys/dev/pci: if_tl.c Log Message: When a media change is requested, don't just all (*if_init)(). That's needlessly disruptive and incompatible with future locking changes. We can use ether_mediachange() instead. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/dev/pci/if_tl.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_tl.c diff -u src/sys/dev/pci/if_tl.c:1.119 src/sys/dev/pci/if_tl.c:1.120 --- src/sys/dev/pci/if_tl.c:1.119 Thu Jan 30 05:24:53 2020 +++ src/sys/dev/pci/if_tl.c Fri Feb 28 06:53:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tl.c,v 1.119 2020/01/30 05:24:53 thorpej Exp $ */ +/* $NetBSD: if_tl.c,v 1.120 2020/02/28 06:53:22 msaitoh Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.119 2020/01/30 05:24:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.120 2020/02/28 06:53:22 msaitoh Exp $"); #undef TLDEBUG #define TL_PRIV_STATS @@ -107,7 +107,6 @@ static void tl_pci_attach(device_t, devi static int tl_intr(void *); static int tl_ifioctl(struct ifnet *, ioctl_cmd_t, void *); -static int tl_mediachange(struct ifnet *); static void tl_ifwatchdog(struct ifnet *); static bool tl_shutdown(device_t, int); @@ -428,7 +427,7 @@ tl_pci_attach(device_t parent, device_t mii->mii_writereg = tl_mii_write; mii->mii_statchg = tl_statchg; sc->tl_ec.ec_mii = mii; - ifmedia_init(&mii->mii_media, IFM_IMASK, tl_mediachange, + ifmedia_init(&mii->mii_media, IFM_IMASK, ether_mediachange, ether_mediastatus); mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (LIST_FIRST(&mii->mii_phys) == NULL) { @@ -1414,15 +1413,6 @@ tl_ifwatchdog(struct ifnet *ifp) } static int -tl_mediachange(struct ifnet *ifp) -{ - - if (ifp->if_flags & IFF_UP) - tl_init(ifp); - return 0; -} - -static int tl_add_RxBuff(tl_softc_t *sc, struct Rx_list *Rx, struct mbuf *oldm) { struct mbuf *m;