Date: Mon, 14 Dec 2009 22:20:06 +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: r200551 - head/sys/dev/vge Message-ID: <200912142220.nBEMK6VO040416@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Mon Dec 14 22:20:05 2009 New Revision: 200551 URL: http://svn.freebsd.org/changeset/base/200551 Log: Whenever link state change interrupt is raised, vge_tick() is called and vge(4) used to drive auto-negotiation timer(mii_tick) in vge_tick(). Therefore the mii_tick was not called for every hz such that auto-negotiation complete was never handled in vge(4). Use mii_pollstat to extract current negotiated speed/duplex instead of mii_tick. The latter is valid only for auto-negotiation case. While I'm here change the confusing function name vge_tick() to vge_link_statchg(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:08:35 2009 (r200550) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:20:05 2009 (r200551) @@ -168,6 +168,7 @@ static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); @@ -182,7 +183,6 @@ static void vge_setmulti(struct vge_soft static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); -static void vge_tick(void *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1595,7 +1595,7 @@ vge_txeof(struct vge_softc *sc) } static void -vge_tick(void *xsc) +vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1606,7 +1606,7 @@ vge_tick(void *xsc) VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); - mii_tick(mii); + mii_pollstat(mii); if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { sc->vge_flags &= ~VGE_FLAG_LINK; @@ -1735,7 +1735,7 @@ vge_intr(void *arg) } if (status & VGE_ISR_LINKSTS) - vge_tick(sc); + vge_link_statchg(sc); } /* Re-enable interrupts */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912142220.nBEMK6VO040416>