From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:39:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4E9106564A; Fri, 8 Oct 2010 20:39:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52B468FC15; Fri, 8 Oct 2010 20:39:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98Kdjft013159; Fri, 8 Oct 2010 20:39:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KdjpP013156; Fri, 8 Oct 2010 20:39:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082039.o98KdjpP013156@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213619 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:39:46 -0000 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