Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci When a media change is requested, don't just all...



details:   https://anonhg.NetBSD.org/src/rev/39a6b76ad84e
branches:  trunk
changeset: 745313:39a6b76ad84e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Feb 28 06:53:22 2020 +0000

description:
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.

diffstat:

 sys/dev/pci/if_tl.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (51 lines):

diff -r a4bda6d33c69 -r 39a6b76ad84e sys/dev/pci/if_tl.c
--- a/sys/dev/pci/if_tl.c       Fri Feb 28 06:01:23 2020 +0000
+++ b/sys/dev/pci/if_tl.c       Fri Feb 28 06:53:22 2020 +0000
@@ -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 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 @@
        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 @@
 }
 
 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;



Home | Main Index | Thread Index | Old Index