Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 20:41:15 +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-7@freebsd.org
Subject:   svn commit: r213621 - stable/7/sys/dev/sis
Message-ID:  <201010082041.o98KfFUN013295@svn.freebsd.org>

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

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/7/sys/dev/sis/if_sis.c
  stable/7/sys/dev/sis/if_sisreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/sis/if_sis.c
==============================================================================
--- stable/7/sys/dev/sis/if_sis.c	Fri Oct  8 20:40:05 2010	(r213620)
+++ stable/7/sys/dev/sis/if_sis.c	Fri Oct  8 20:41:15 2010	(r213621)
@@ -2132,6 +2132,7 @@ sis_ifmedia_upd(struct ifnet *ifp)
 {
 	struct sis_softc	*sc;
 	struct mii_data		*mii;
+	int			error;
 
 	sc = ifp->if_softc;
 
@@ -2143,10 +2144,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);
 }
 
 /*
@@ -2180,10 +2181,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;
@@ -2195,7 +2205,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/7/sys/dev/sis/if_sisreg.h
==============================================================================
--- stable/7/sys/dev/sis/if_sisreg.h	Fri Oct  8 20:40:05 2010	(r213620)
+++ stable/7/sys/dev/sis/if_sisreg.h	Fri Oct  8 20:41:15 2010	(r213621)
@@ -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?201010082041.o98KfFUN013295>