diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mii/ciphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/icsphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/inphy.c | 9 | ||||
-rw-r--r-- | sys/dev/mii/iophy.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/lxtphy.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/mtdphy.c | 17 | ||||
-rw-r--r-- | sys/dev/mii/nsgphy.c | 30 | ||||
-rw-r--r-- | sys/dev/mii/nsphy.c | 18 | ||||
-rw-r--r-- | sys/dev/mii/nsphyter.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/qsphy.c | 18 | ||||
-rw-r--r-- | sys/dev/mii/rgephy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/tlphy.c | 18 | ||||
-rw-r--r-- | sys/dev/mii/tqphy.c | 23 | ||||
-rw-r--r-- | sys/dev/mii/txphy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/xmphy.c | 17 |
15 files changed, 144 insertions, 80 deletions
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index 32dee8f6cf8..7bc288d080e 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciphy.c,v 1.3 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: ciphy.c,v 1.4 2005/02/19 06:00:03 brad Exp $ */ /* $FreeBSD: ciphy.c,v 1.1 2004/09/10 20:57:45 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -86,11 +86,11 @@ const struct mii_phy_funcs ciphy_funcs = { }; static const struct mii_phydesc ciphys[] = { - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201, + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201, MII_STR_CICADA_CS8201 }, - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, MII_STR_CICADA_CS8201A }, - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, MII_STR_CICADA_CS8201B }, { 0, 0, diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c index 96c554914f2..4d33ff897c4 100644 --- a/sys/dev/mii/icsphy.c +++ b/sys/dev/mii/icsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icsphy.c,v 1.16 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: icsphy.c,v 1.17 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: icsphy.c,v 1.17 2000/02/02 23:34:56 thorpej Exp $ */ /*- @@ -109,11 +109,11 @@ const struct mii_phy_funcs icsphy_funcs = { }; static const struct mii_phydesc icsphys[] = { - { MII_OUI_xxICS, MII_MODEL_xxICS_1890, + { MII_OUI_xxICS, MII_MODEL_xxICS_1890, MII_STR_xxICS_1890 }, - { MII_OUI_xxICS, MII_MODEL_xxICS_1892, + { MII_OUI_xxICS, MII_MODEL_xxICS_1892, MII_STR_xxICS_1892 }, - { MII_OUI_xxICS, MII_MODEL_xxICS_1893, + { MII_OUI_xxICS, MII_MODEL_xxICS_1893, MII_STR_xxICS_1893 }, { 0, 0, diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c index 2d2854b954b..2f0861649f4 100644 --- a/sys/dev/mii/inphy.c +++ b/sys/dev/mii/inphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inphy.c,v 1.12 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: inphy.c,v 1.13 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: inphy.c,v 1.18 2000/02/02 23:34:56 thorpej Exp $ */ /*- @@ -108,12 +108,13 @@ const struct mii_phy_funcs inphy_funcs = { }; static const struct mii_phydesc inphys[] = { - { MII_OUI_INTEL, MII_MODEL_INTEL_I82555, + { MII_OUI_INTEL, MII_MODEL_INTEL_I82555, MII_STR_INTEL_I82555 }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I82562EM, + { MII_OUI_INTEL, MII_MODEL_INTEL_I82562EM, MII_STR_INTEL_I82562EM }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I82562ET, + { MII_OUI_INTEL, MII_MODEL_INTEL_I82562ET, MII_STR_INTEL_I82562ET }, + { 0, 0, NULL }, }; diff --git a/sys/dev/mii/iophy.c b/sys/dev/mii/iophy.c index 1af4174baa2..dada4f88744 100644 --- a/sys/dev/mii/iophy.c +++ b/sys/dev/mii/iophy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iophy.c,v 1.11 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: iophy.c,v 1.12 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: iophy.c,v 1.8 2000/02/02 23:34:56 thorpej Exp $ */ /* @@ -106,9 +106,9 @@ const struct mii_phy_funcs iophy_funcs = { }; static const struct mii_phydesc iophys[] = { - { MII_OUI_xxINTEL, MII_MODEL_xxINTEL_I82553, + { MII_OUI_xxINTEL, MII_MODEL_xxINTEL_I82553, MII_STR_xxINTEL_I82553 }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I82553, + { MII_OUI_INTEL, MII_MODEL_INTEL_I82553, MII_STR_INTEL_I82553 }, { 0, 0, diff --git a/sys/dev/mii/lxtphy.c b/sys/dev/mii/lxtphy.c index abb5719aa8e..d8f8148e097 100644 --- a/sys/dev/mii/lxtphy.c +++ b/sys/dev/mii/lxtphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lxtphy.c,v 1.13 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: lxtphy.c,v 1.14 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: lxtphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -113,9 +113,9 @@ const struct mii_phy_funcs lxtphy971_funcs = { }; static const struct mii_phydesc lxtphys[] = { - { MII_OUI_xxLEVEL1, MII_MODEL_xxLEVEL1_LXT970, + { MII_OUI_xxLEVEL1, MII_MODEL_xxLEVEL1_LXT970, MII_STR_xxLEVEL1_LXT970 }, - { MII_OUI_xxLEVEL1a, MII_MODEL_xxLEVEL1a_LXT971, + { MII_OUI_xxLEVEL1a, MII_MODEL_xxLEVEL1a_LXT971, MII_STR_xxLEVEL1a_LXT971 }, { 0, 0, diff --git a/sys/dev/mii/mtdphy.c b/sys/dev/mii/mtdphy.c index dbcdfe8db99..c8a2684d8f8 100644 --- a/sys/dev/mii/mtdphy.c +++ b/sys/dev/mii/mtdphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtdphy.c,v 1.11 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: mtdphy.c,v 1.12 2005/02/19 06:00:04 brad Exp $ */ /* * Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net) @@ -63,13 +63,20 @@ const struct mii_phy_funcs mtdphy_funcs = { mtdphy_service, ukphy_status, mii_phy_reset, }; +static const struct mii_phydesc mtdphys[] = { + { MII_OUI_MYSON, MII_MODEL_MYSON_MTD972, + MII_STR_MYSON_MTD972 }, + + { 0, 0, + NULL }, +}; + int mtdphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_MYSON && - MII_MODEL(ma->mii_id2) == MII_MODEL_MYSON_MTD972) + if (mii_phy_match(ma, mtdphys) != NULL) return (10); return (0); @@ -81,8 +88,10 @@ mtdphyattach(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_MYSON_MTD972, MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, mtdphys); + 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; diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c index 8707b97a7b9..07ec2f1372f 100644 --- a/sys/dev/mii/nsgphy.c +++ b/sys/dev/mii/nsgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsgphy.c,v 1.13 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: nsgphy.c,v 1.14 2005/02/19 06:00:04 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 2001 @@ -84,14 +84,22 @@ const struct mii_phy_funcs nsgphy_funcs = { nsgphy_service, nsgphy_status, mii_phy_reset, }; +static const struct mii_phydesc nsgphys[] = { + { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83861, + MII_STR_NATSEMI_DP83861 }, + { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83891, + MII_STR_NATSEMI_DP83891 }, + + { 0, 0, + NULL }, +}; + int nsgphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_NATSEMI && - (MII_MODEL(ma->mii_id2) == MII_MODEL_NATSEMI_DP83891 || - MII_MODEL(ma->mii_id2) == MII_MODEL_NATSEMI_DP83861)) + if (mii_phy_match(ma, nsgphys) != NULL) return (10); return (0); @@ -103,18 +111,10 @@ nsgphyattach(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; - switch(MII_MODEL(ma->mii_id2)) { - case MII_MODEL_NATSEMI_DP83861: - printf(": %s, rev. %d\n", MII_STR_NATSEMI_DP83861, - MII_REV(ma->mii_id2)); - break; - - case MII_MODEL_NATSEMI_DP83891: - printf(": %s, rev. %d\n", MII_STR_NATSEMI_DP83891, - MII_REV(ma->mii_id2)); - break; - } + mpd = mii_phy_match(ma, nsgphys); + 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; diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c index 73dc68e1f30..a364a57db9e 100644 --- a/sys/dev/mii/nsphy.c +++ b/sys/dev/mii/nsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsphy.c,v 1.17 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: nsphy.c,v 1.18 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -108,13 +108,20 @@ const struct mii_phy_funcs nsphy_funcs = { nsphy_service, nsphy_status, nsphy_reset, }; +static const struct mii_phydesc nsphys[] = { + { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83840, + MII_STR_NATSEMI_DP83840 }, + + { 0, 0, + NULL }, +}; + int nsphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_NATSEMI && - MII_MODEL(ma->mii_id2) == MII_MODEL_NATSEMI_DP83840) + if (mii_phy_match(ma, nsphys) != NULL) return (10); return (0); @@ -126,9 +133,10 @@ nsphyattach(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_NATSEMI_DP83840, - MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, nsphys); + 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; diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c index 0eef321db5f..d87ec91ea39 100644 --- a/sys/dev/mii/nsphyter.c +++ b/sys/dev/mii/nsphyter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsphyter.c,v 1.10 2005/02/05 22:20:42 brad Exp $ */ +/* $OpenBSD: nsphyter.c,v 1.11 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: nsphyter.c,v 1.5 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -108,10 +108,10 @@ const struct mii_phy_funcs nsphyter_funcs = { }; static const struct mii_phydesc nsphyterphys[] = { - { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83843, - MII_STR_NATSEMI_DP83843 }, - { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83815, + { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83815, MII_STR_NATSEMI_DP83815 }, + { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83843, + MII_STR_NATSEMI_DP83843 }, { 0, 0, NULL }, diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c index 00706af0548..96c45d6490c 100644 --- a/sys/dev/mii/qsphy.c +++ b/sys/dev/mii/qsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qsphy.c,v 1.12 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: qsphy.c,v 1.13 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: qsphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -107,13 +107,20 @@ const struct mii_phy_funcs qsphy_funcs = { qsphy_service, qsphy_status, qsphy_reset, }; +static const struct mii_phydesc qsphys[] = { + { MII_OUI_QUALSEMI, MII_MODEL_QUALSEMI_QS6612, + MII_STR_QUALSEMI_QS6612 }, + + { 0, 0, + NULL }, +}; + int qsphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_QUALSEMI && - MII_MODEL(ma->mii_id2) == MII_MODEL_QUALSEMI_QS6612) + if (mii_phy_match(ma, qsphys) != NULL) return (10); return (0); @@ -125,9 +132,10 @@ qsphyattach(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_QUALSEMI_QS6612, - MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, qsphys); + 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; 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; diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index 9458e8fc5d2..8bb74af2827 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlphy.c,v 1.15 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: tlphy.c,v 1.16 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: tlphy.c,v 1.26 2000/07/04 03:29:00 thorpej Exp $ */ /*- @@ -123,13 +123,20 @@ const struct mii_phy_funcs tlphy_funcs = { tlphy_service, tlphy_status, mii_phy_reset, }; +static const struct mii_phydesc tlphys[] = { + { MII_OUI_xxTI, MII_MODEL_xxTI_TLAN10T, + MII_STR_xxTI_TLAN10T }, + + { 0, 0, + NULL }, +}; + int tlphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxTI && - MII_MODEL(ma->mii_id2) == MII_MODEL_xxTI_TLAN10T) + if (mii_phy_match(ma, tlphys) != NULL) return (10); return (0); @@ -142,9 +149,10 @@ tlphyattach(struct device *parent, struct device *self, void *aux) struct tl_softc *tlsc = (struct tl_softc *)self->dv_parent; 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_xxTI_TLAN10T, - MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, tlphys); + printf(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2)); sc->sc_mii.mii_inst = mii->mii_instance; sc->sc_mii.mii_phy = ma->mii_phyno; diff --git a/sys/dev/mii/tqphy.c b/sys/dev/mii/tqphy.c index f90e413c6b2..8ecb76f721b 100644 --- a/sys/dev/mii/tqphy.c +++ b/sys/dev/mii/tqphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tqphy.c,v 1.9 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: tqphy.c,v 1.10 2005/02/19 06:00:04 brad Exp $ */ /* $NetBSD: tqphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */ /* @@ -108,17 +108,21 @@ const struct mii_phy_funcs tqphy_funcs = { tqphy_service, tqphy_status, mii_phy_reset, }; +static const struct mii_phydesc tqphys[] = { + { MII_OUI_TSC, MII_MODEL_TSC_78Q2120, + MII_STR_TSC_78Q2120 }, + + { 0, 0, + NULL }, +}; + int tqphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_TSC) - switch MII_MODEL(ma->mii_id2) { - case MII_MODEL_TSC_78Q2120: - /* case MII_MODEL_TSC_78Q2121: */ - return (10); - } + if (mii_phy_match(ma, tqphys) != NULL) + return (10); return (0); } @@ -129,9 +133,10 @@ tqphyattach(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_TSC_78Q2120, - MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, tqphys); + 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; diff --git a/sys/dev/mii/txphy.c b/sys/dev/mii/txphy.c index c1c4b4a444a..4c3f059352f 100644 --- a/sys/dev/mii/txphy.c +++ b/sys/dev/mii/txphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: txphy.c,v 1.9 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: txphy.c,v 1.10 2005/02/19 06:00:04 brad Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -62,14 +62,22 @@ const struct mii_phy_funcs txphy_funcs = { txphy_service, ukphy_status, mii_phy_reset, }; +static const struct mii_phydesc txphys[] = { + { MII_OUI_xxTI, MII_MODEL_xxTI_TNETE2101, + MII_STR_xxTI_TNETE2101 }, + + { 0, 0, + NULL }, +}; + int txphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxTI && - MII_MODEL(ma->mii_id2) == MII_MODEL_xxTI_TNETE2101) + if (mii_phy_match(ma, txphys) != NULL) return (10); + return (0); } @@ -79,9 +87,10 @@ txphyattach(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_xxTI_TNETE2101, - MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, txphys); + 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; diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 76bcb10ea06..c0729bb63b6 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xmphy.c,v 1.10 2005/01/28 18:27:55 brad Exp $ */ +/* $OpenBSD: xmphy.c,v 1.11 2005/02/19 06:00:04 brad Exp $ */ /* * Copyright (c) 2000 @@ -78,12 +78,19 @@ const struct mii_phy_funcs xmphy_funcs = { xmphy_service, xmphy_status, mii_phy_reset, }; +static const struct mii_phydesc xmphys[] = { + { MII_OUI_xxXAQTI, MII_MODEL_XAQTI_XMACII, + MII_STR_XAQTI_XMACII }, + + { 0, 0, + NULL }, +}; + int xmphy_probe(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxXAQTI && - MII_MODEL(ma->mii_id2) == MII_MODEL_XAQTI_XMACII) + if (mii_phy_match(ma, xmphys) != NULL) return(10); return(0); @@ -95,8 +102,10 @@ xmphy_attach(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_XAQTI_XMACII, MII_REV(ma->mii_id2)); + mpd = mii_phy_match(ma, xmphys); + 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; |