summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-09-29 21:19:25 +0000
committeryongari <yongari@FreeBSD.org>2010-09-29 21:19:25 +0000
commitbec33718ece30f08154dfc53ea8936f0f2115d86 (patch)
tree1486b7bf0d4fe487be21548e4aeec9089859fa08 /sys/dev/bge
parenta41992e8eaa7dc04439c09368d6177d2c982b021 (diff)
downloadFreeBSD-src-bec33718ece30f08154dfc53ea8936f0f2115d86.zip
FreeBSD-src-bec33718ece30f08154dfc53ea8936f0f2115d86.tar.gz
After r207391, brgphy(4) passes resolved flow-control settings to
parent driver. Use that information to configure flow-control. One drawback is there is no way to disable flow-control as we still don't have proper way to not advertise RX/TX pause capability to link partner. But I don't think it would cause severe problems and users can selectively disable flow-control in switch port.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 9bc7026..e75e9f3 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -882,10 +882,21 @@ bge_miibus_statchg(device_t dev)
else
BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII);
- if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX)
+ if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) {
BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
- else
+ if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1)
+ BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
+ else
+ BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
+ if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0)
+ BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
+ else
+ BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
+ } else {
BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
+ BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
+ BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
+ }
}
/*
OpenPOWER on IntegriCloud