Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 20:39:45 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r213619 - stable/8/sys/dev/sis
Message-ID:  <201010082039.o98KdjpP013156@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Oct  8 20:39:45 2010
New Revision: 213619
URL: http://svn.freebsd.org/changeset/base/213619

Log:
  MFC r212117,212119:
  rr212117:
    Report result of link state change to caller. Previously it always
    returned success.
  
  r212119:
    Do not reinitialize controller whenever promiscuous mode or
    allmulti is toggled. Controller does not require reinitialization.
    This removes unnecessary controller reinitialization whenever
    tcpdump is used.
    While I'm here remove unnecessary variable reinitialization.

Modified:
  stable/8/sys/dev/sis/if_sis.c
  stable/8/sys/dev/sis/if_sisreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/sis/if_sis.c
==============================================================================
--- stable/8/sys/dev/sis/if_sis.c	Fri Oct  8 20:37:13 2010	(r213618)
+++ stable/8/sys/dev/sis/if_sis.c	Fri Oct  8 20:39:45 2010	(r213619)
@@ -2136,6 +2136,7 @@ sis_ifmedia_upd(struct ifnet *ifp)
 {
 	struct sis_softc	*sc;
 	struct mii_data		*mii;
+	int			error;
 
 	sc = ifp->if_softc;
 
@@ -2147,10 +2148,10 @@ sis_ifmedia_upd(struct ifnet *ifp)
 		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
 			mii_phy_reset(miisc);
 	}
-	mii_mediachg(mii);
+	error = mii_mediachg(mii);
 	SIS_UNLOCK(sc);
 
-	return (0);
+	return (error);
 }
 
 /*
@@ -2184,10 +2185,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm
 	case SIOCSIFFLAGS:
 		SIS_LOCK(sc);
 		if (ifp->if_flags & IFF_UP) {
-			sis_initl(sc);
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
+			    ((ifp->if_flags ^ sc->sis_if_flags) &
+			    (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+				if (sc->sis_type == SIS_TYPE_83815)
+					sis_setmulti_ns(sc);
+				else
+					sis_setmulti_sis(sc);
+			} else
+				sis_initl(sc);
 		} else if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
 			sis_stop(sc);
 		}
+		sc->sis_if_flags = ifp->if_flags;
 		SIS_UNLOCK(sc);
 		error = 0;
 		break;
@@ -2199,7 +2209,6 @@ sis_ioctl(struct ifnet *ifp, u_long comm
 		else
 			sis_setmulti_sis(sc);
 		SIS_UNLOCK(sc);
-		error = 0;
 		break;
 	case SIOCGIFMEDIA:
 	case SIOCSIFMEDIA:

Modified: stable/8/sys/dev/sis/if_sisreg.h
==============================================================================
--- stable/8/sys/dev/sis/if_sisreg.h	Fri Oct  8 20:37:13 2010	(r213618)
+++ stable/8/sys/dev/sis/if_sisreg.h	Fri Oct  8 20:39:45 2010	(r213619)
@@ -471,6 +471,7 @@ struct sis_softc {
 	bus_addr_t		sis_tx_paddr;
 	struct callout		sis_stat_ch;
 	int			sis_watchdog_timer;
+	int			sis_if_flags;
 #ifdef DEVICE_POLLING
 	int			rxcycles;
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010082039.o98KdjpP013156>