Date: Wed, 1 Sep 2010 22:08:23 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212119 - head/sys/dev/sis Message-ID: <201009012208.o81M8NAP083137@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Wed Sep 1 22:08:23 2010 New Revision: 212119 URL: http://svn.freebsd.org/changeset/base/212119 Log: 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: head/sys/dev/sis/if_sis.c head/sys/dev/sis/if_sisreg.h Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Wed Sep 1 21:51:29 2010 (r212118) +++ head/sys/dev/sis/if_sis.c Wed Sep 1 22:08:23 2010 (r212119) @@ -2185,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; @@ -2200,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: head/sys/dev/sis/if_sisreg.h ============================================================================== --- head/sys/dev/sis/if_sisreg.h Wed Sep 1 21:51:29 2010 (r212118) +++ head/sys/dev/sis/if_sisreg.h Wed Sep 1 22:08:23 2010 (r212119) @@ -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?201009012208.o81M8NAP083137>