summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2011-11-22 20:57:06 +0000
committeryongari <yongari@FreeBSD.org>2011-11-22 20:57:06 +0000
commit2a52428fd64d703130594f1ed066a391470a097b (patch)
tree687f939f8fd8946c5fad31fbbc077bc2f61838e6 /sys/dev
parent96623b87d93454791b95523ce36464a89de1e3b5 (diff)
downloadFreeBSD-src-2a52428fd64d703130594f1ed066a391470a097b.zip
FreeBSD-src-2a52428fd64d703130594f1ed066a391470a097b.tar.gz
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.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vge/if_vge.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index 720c320..1c1a99b 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -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) */
OpenPOWER on IntegriCloud