summaryrefslogtreecommitdiff
path: root/sys/dev/mii/mii.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1998-11-11 19:34:52 +0000
committerJason Wright <jason@cvs.openbsd.org>1998-11-11 19:34:52 +0000
commitb67320a002793e8f496722a85d888421724eb4dc (patch)
tree4c109936ccfb901a84c59a7f464a83c8a9a31a41 /sys/dev/mii/mii.c
parentb4d28fc47cc2f346e2f660be351cb60a89bd26ee (diff)
Merge with NetBSD:
o additional phy drivers (seeq, ics, level1) o "unknown phy" driver for unsupported phys o collected common code into mii_physubr o exphy isn't the only phy that doesn't have valid id registers
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r--sys/dev/mii/mii.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index 40cc6e12194..1bec2fc803e 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mii.c,v 1.1 1998/09/10 17:17:33 jason Exp $ */
-/* $NetBSD: mii.c,v 1.7 1998/08/11 00:41:44 thorpej Exp $ */
+/* $OpenBSD: mii.c,v 1.2 1998/11/11 19:34:47 jason Exp $ */
+/* $NetBSD: mii.c,v 1.9 1998/11/05 04:08:02 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -131,7 +131,7 @@ mii_print(aux, pnp)
struct mii_attach_args *ma = aux;
if (pnp != NULL)
- printf("PHY oui 0x%x model 0x%x rev 0x%x at %s",
+ printf("OUI 0x%06x model 0x%04x rev %d at %s",
MII_OUI(ma->mii_id1, ma->mii_id2), MII_MODEL(ma->mii_id2),
MII_REV(ma->mii_id2), pnp);
@@ -197,6 +197,25 @@ mii_anar(media)
}
/*
+ * Given a BMCR value, return the corresponding ifmedia word.
+ */
+int
+mii_media_from_bmcr(bmcr)
+ int bmcr;
+{
+ int rv = IFM_ETHER;
+
+ if (bmcr & BMCR_S100)
+ rv |= IFM_100_TX;
+ else
+ rv |= IFM_10_T;
+ if (bmcr & IFM_FDX)
+ rv |= IFM_FDX;
+
+ return (rv);
+}
+
+/*
* Media changed; notify all PHYs.
*/
int