summaryrefslogtreecommitdiff
path: root/sys/dev/mii/rgephy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mii/rgephy.c')
-rw-r--r--sys/dev/mii/rgephy.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index 310f467efd2..522ba91dd96 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rgephy.c,v 1.7 2005/01/28 18:27:55 brad Exp $ */
+/* $OpenBSD: rgephy.c,v 1.8 2005/02/19 06:00:04 brad Exp $ */
/*
* Copyright (c) 2003
* Bill Paul <wpaul@windriver.com>. All rights reserved.
@@ -91,15 +91,21 @@ const struct mii_phy_funcs rgephy_funcs = {
rgephy_service, rgephy_status, rgephy_reset,
};
+static const struct mii_phydesc rgephys[] = {
+ { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S,
+ MII_STR_xxREALTEK_RTL8169S },
+
+ { 0, 0,
+ NULL },
+};
+
int
rgephymatch(struct device *parent, void *match, void *aux)
{
struct mii_attach_args *ma = aux;
- if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxREALTEK &&
- MII_MODEL(ma->mii_id2) == MII_MODEL_xxREALTEK_RTL8169S) {
+ if (mii_phy_match(ma, rgephys) != NULL)
return(10);
- }
return(0);
}
@@ -110,9 +116,10 @@ rgephyattach(struct device *parent, struct device *self, void *aux)
struct mii_softc *sc = (struct mii_softc *)self;
struct mii_attach_args *ma = aux;
struct mii_data *mii = ma->mii_data;
+ const struct mii_phydesc *mpd;
- printf(": %s, rev. %d\n", MII_STR_xxREALTEK_RTL8169S,
- MII_REV(ma->mii_id2));
+ mpd = mii_phy_match(ma, rgephys);
+ printf(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2));
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;