summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-10-02 03:44:19 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-10-02 03:44:19 +0000
commit93ec0c2c4ff81f173b00826686d05d99404846b4 (patch)
treeeece887d43add56d5044219a0bca0a1f0fd96802 /sys
parent929dec7a8e95927f017435a1716e6565060e6694 (diff)
return EINVAL for the Gig manual media types when attached to a
Fast Ethernet PHY.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/mii/eephy.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/mii/eephy.c b/sys/dev/mii/eephy.c
index bfb2b29d4ea..24520887ae5 100644
--- a/sys/dev/mii/eephy.c
+++ b/sys/dev/mii/eephy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eephy.c,v 1.31 2006/10/01 15:47:03 brad Exp $ */
+/* $OpenBSD: eephy.c,v 1.32 2006/10/02 03:44:18 brad Exp $ */
/*
* Principal Author: Parag Patel
* Copyright (c) 2001
@@ -153,6 +153,7 @@ eephyattach(struct device *parent, struct device *self, void *aux)
(PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK))
sc->mii_flags |= MIIF_HAVEFIBER;
+ fast_ether = 0;
if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_MARVELL &&
MII_MODEL(ma->mii_id2) == MII_MODEL_MARVELL_E3082) {
/* 88E3082 10/100 Fast Ethernet PHY. */
@@ -275,6 +276,9 @@ eephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case IFM_1000_SX:
+ if (fast_ether == 1)
+ return (EINVAL);
+
PHY_RESET(sc);
PHY_WRITE(sc, E1000_CR,
@@ -283,6 +287,9 @@ eephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
break;
case IFM_1000_T:
+ if (fast_ether == 1)
+ return (EINVAL);
+
PHY_RESET(sc);
/* TODO - any other way to force 1000BT? */