diff options
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r-- | sys/dev/mii/mii.c | 25 |
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 |