Date: Tue, 22 Nov 2011 20:57: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: r227837 - head/sys/dev/vge Message-ID: <201111222057.pAMKv6VC009302@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Tue Nov 22 20:57:06 2011 New Revision: 227837 URL: http://svn.freebsd.org/changeset/base/227837 Log: Announce flow control capability to underlying PHY driver. Pause timer value is initialized to 0xFFFF. Controller allows just 4 different TX pause thresholds. The lowest possible threshold value looks too aggressive so use next available threshold value. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Tue Nov 22 20:45:11 2011 (r227836) +++ head/sys/dev/vge/if_vge.c Tue Nov 22 20:57:06 2011 (r227837) @@ -1103,7 +1103,7 @@ vge_attach(device_t dev) /* Do MII setup */ error = mii_attach(dev, &sc->vge_miibus, ifp, vge_ifmedia_upd, vge_ifmedia_sts, BMSR_DEFCAPMASK, sc->vge_phyaddr, MII_OFFSET_ANY, - 0); + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -2112,9 +2112,16 @@ vge_init_locked(struct vge_softc *sc) vge_rxfilter(sc); vge_setvlan(sc); - /* Enable flow control */ - - CSR_WRITE_1(sc, VGE_CRS2, 0x8B); + /* Initialize pause timer. */ + CSR_WRITE_2(sc, VGE_TX_PAUSE_TIMER, 0xFFFF); + /* + * Initialize flow control parameters. + * TX XON high threshold : 48 + * TX pause low threshold : 24 + * Disable hald-duplex flow control + */ + CSR_WRITE_1(sc, VGE_CRC2, 0xFF); + CSR_WRITE_1(sc, VGE_CRS2, VGE_CR2_XON_ENABLE | 0x0B); /* Enable jumbo frame reception (if desired) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111222057.pAMKv6VC009302>