summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2013-01-13 05:40:06 +0000
committerBrad Smith <brad@cvs.openbsd.org>2013-01-13 05:40:06 +0000
commit46fe175326ca6e779670da58414fdf08a7a0e390 (patch)
tree6e5d91025ed6f9ef4ccc42ef404639c5b9426789 /sys
parent51bcd15c4853035d1a7d236c096657edb19569dd (diff)
Add support for reporting flow control status for 5708S/5709S fibre PHY.
ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/mii/brgphy.c12
-rw-r--r--sys/dev/mii/brgphyreg.h4
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 58eda7c6a6e..e64cc90adfb 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brgphy.c,v 1.99 2013/01/10 00:37:24 dlg Exp $ */
+/* $OpenBSD: brgphy.c,v 1.100 2013/01/13 05:40:05 brad Exp $ */
/*
* Copyright (c) 2000
@@ -632,6 +632,13 @@ brgphy_5708s_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_FDX;
else
mii->mii_media_active |= IFM_HDX;
+
+ if (mii->mii_media_active & IFM_FDX) {
+ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_TX_PAUSE)
+ mii->mii_media_active |= IFM_FLOW | IFM_ETH_TXPAUSE;
+ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_RX_PAUSE)
+ mii->mii_media_active |= IFM_FLOW | IFM_ETH_RXPAUSE;
+ }
} else
mii->mii_media_active = ife->ifm_media;
}
@@ -690,6 +697,9 @@ brgphy_5709s_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_FDX;
else
mii->mii_media_active |= IFM_HDX;
+
+ if (mii->mii_media_active & IFM_FDX)
+ mii->mii_media_active |= mii_phy_flowstatus(sc);
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/brgphyreg.h b/sys/dev/mii/brgphyreg.h
index 6c6afec95b9..cd564e1ba55 100644
--- a/sys/dev/mii/brgphyreg.h
+++ b/sys/dev/mii/brgphyreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: brgphyreg.h,v 1.15 2010/07/10 07:59:33 sthen Exp $ */
+/* $OpenBSD: brgphyreg.h,v 1.16 2013/01/13 05:40:05 brad Exp $ */
/*
* Copyright (c) 2000
@@ -349,6 +349,8 @@
#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_100 (0x1 << 3)
#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_1G (0x2 << 3)
#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_25G (0x3 << 3)
+#define BRGPHY_5708S_PG0_1000X_STAT1_TX_PAUSE 0x0020
+#define BRGPHY_5708S_PG0_1000X_STAT1_RX_PAUSE 0x0040
#define BRGPHY_5708S_PG0_1000X_CTL2 0x11
#define BRGPHY_5708S_PG0_1000X_CTL2_PAR_DET_EN 0x0001