diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mii/exphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/icsphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/inphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/lxtphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/mii.c | 27 | ||||
-rw-r--r-- | sys/dev/mii/mtdphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/nsphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/qsphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/rlphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/sqphy.c | 8 | ||||
-rw-r--r-- | sys/dev/mii/tlphy.c | 15 | ||||
-rw-r--r-- | sys/dev/mii/ukphy.c | 8 |
12 files changed, 28 insertions, 94 deletions
diff --git a/sys/dev/mii/exphy.c b/sys/dev/mii/exphy.c index 8d88968f104..25498719b7d 100644 --- a/sys/dev/mii/exphy.c +++ b/sys/dev/mii/exphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exphy.c,v 1.3 1999/07/16 14:59:06 jason Exp $ */ +/* $OpenBSD: exphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: exphy.c,v 1.15.6.1 1999/04/23 15:39:33 perry Exp $ */ /*- @@ -174,13 +174,9 @@ exphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c index 10a84e1cd9d..e899ccdadef 100644 --- a/sys/dev/mii/icsphy.c +++ b/sys/dev/mii/icsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icsphy.c,v 1.2 1999/07/16 14:59:06 jason Exp $ */ +/* $OpenBSD: icsphy.c,v 1.3 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: icsphy.c,v 1.8.6.1 1999/04/23 15:40:56 perry Exp $ */ /*- @@ -156,13 +156,9 @@ icsphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c index 38c2660ca52..0f07f41fe44 100644 --- a/sys/dev/mii/inphy.c +++ b/sys/dev/mii/inphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inphy.c,v 1.3 1999/07/16 14:59:06 jason Exp $ */ +/* $OpenBSD: inphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: inphy.c,v 1.10.6.1 1999/04/23 15:39:09 perry Exp $ */ /*- @@ -165,13 +165,9 @@ inphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/lxtphy.c b/sys/dev/mii/lxtphy.c index cf5e290757b..e2cb377d8e3 100644 --- a/sys/dev/mii/lxtphy.c +++ b/sys/dev/mii/lxtphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lxtphy.c,v 1.2 1999/07/16 14:59:06 jason Exp $ */ +/* $OpenBSD: lxtphy.c,v 1.3 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: lxtphy.c,v 1.9.6.1 1999/04/23 15:41:43 perry Exp $ */ /*- @@ -156,13 +156,9 @@ lxtphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index f814256f5e3..ba60852ba13 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii.c,v 1.4 1999/02/04 23:00:57 jason Exp $ */ +/* $OpenBSD: mii.c,v 1.5 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: mii.c,v 1.9 1998/11/05 04:08:02 thorpej Exp $ */ /*- @@ -278,30 +278,19 @@ mii_add_media(mii, bmsr, instance) struct mii_data *mii; int bmsr, instance; { - const char *sep = ""; - #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " - if (bmsr & BMSR_10THDX) { + if (bmsr & BMSR_10THDX) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, instance), 0); - PRINT("10baseT"); - } - if (bmsr & BMSR_10TFDX) { + if (bmsr & BMSR_10TFDX) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, instance), BMCR_FDX); - PRINT("10baseT-FDX"); - } - if (bmsr & BMSR_100TXHDX) { + if (bmsr & BMSR_100TXHDX) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, instance), BMCR_S100); - PRINT("100baseTX"); - } - if (bmsr & BMSR_100TXFDX) { + if (bmsr & BMSR_100TXFDX) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, instance), BMCR_S100|BMCR_FDX); - PRINT("100baseTX-FDX"); - } if (bmsr & BMSR_100T4) { /* * XXX How do you enable 100baseT4? I assume we set @@ -311,13 +300,9 @@ mii_add_media(mii, bmsr, instance) */ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, instance), BMCR_S100); - PRINT("100baseT4"); } - if (bmsr & BMSR_ANEG) { + if (bmsr & BMSR_ANEG) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, instance), BMCR_AUTOEN); - PRINT("auto"); - } #undef ADD -#undef PRINT } diff --git a/sys/dev/mii/mtdphy.c b/sys/dev/mii/mtdphy.c index 4ea4f144d15..cff80b3d69e 100644 --- a/sys/dev/mii/mtdphy.c +++ b/sys/dev/mii/mtdphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtdphy.c,v 1.2 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: mtdphy.c,v 1.3 1999/07/23 12:39:11 deraadt Exp $ */ /* * Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net) @@ -106,13 +106,9 @@ mtdphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); } int diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c index 02a602ed862..aa6241e0cde 100644 --- a/sys/dev/mii/nsphy.c +++ b/sys/dev/mii/nsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsphy.c,v 1.5 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: nsphy.c,v 1.6 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: nsphy.c,v 1.18 1999/07/14 23:57:36 thorpej Exp $ */ /*- @@ -168,13 +168,9 @@ nsphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c index 598466a5b99..5305cdabfcb 100644 --- a/sys/dev/mii/qsphy.c +++ b/sys/dev/mii/qsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qsphy.c,v 1.3 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: qsphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: qsphy.c,v 1.11.6.1 1999/04/23 15:39:21 perry Exp $ */ /*- @@ -156,13 +156,9 @@ qsphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c index 163dba09be4..5053e78d974 100644 --- a/sys/dev/mii/rlphy.c +++ b/sys/dev/mii/rlphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlphy.c,v 1.3 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: rlphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* * Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net) @@ -115,13 +115,9 @@ rlphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); } int diff --git a/sys/dev/mii/sqphy.c b/sys/dev/mii/sqphy.c index 0f58e2d2589..eac511080d0 100644 --- a/sys/dev/mii/sqphy.c +++ b/sys/dev/mii/sqphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sqphy.c,v 1.2 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: sqphy.c,v 1.3 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: sqphy.c,v 1.8.6.1 1999/04/23 15:41:25 perry Exp $ */ /*- @@ -156,13 +156,9 @@ sqphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index 84457393f5d..75b184dfb51 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlphy.c,v 1.3 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: tlphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: tlphy.c,v 1.16.6.1 1999/04/23 15:40:13 perry Exp $ */ /*- @@ -159,7 +159,6 @@ tlphyattach(parent, self, 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 char *sep = ""; printf(": %s, rev. %d\n", MII_STR_TI_TLAN10T, MII_REV(ma->mii_id2)); @@ -194,30 +193,20 @@ tlphyattach(parent, self, aux) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, sc->sc_mii.mii_inst), BMCR_LOOP); -#define PRINT(s) printf("%s%s", sep, s); sep = ", " - - printf("%s: ", sc->sc_mii.mii_dev.dv_xname); if (sc->sc_tlphycap) { if (sc->sc_tlphycap & TLPHY_MEDIA_10_2) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base2/BNC"); } else if (sc->sc_tlphycap & TLPHY_MEDIA_10_5) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base5/AUI"); } } if (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) { - printf(sep); mii_add_media(mii, sc->sc_mii.mii_capabilities, sc->sc_mii.mii_inst); - } else if ((sc->sc_tlphycap & (TLPHY_MEDIA_10_2 | TLPHY_MEDIA_10_5)) - == 0) - printf("no media present"); - printf("\n"); + } #undef ADD -#undef PRINT } int diff --git a/sys/dev/mii/ukphy.c b/sys/dev/mii/ukphy.c index 6ae8a128791..14cbeaa2232 100644 --- a/sys/dev/mii/ukphy.c +++ b/sys/dev/mii/ukphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukphy.c,v 1.3 1999/07/16 14:59:07 jason Exp $ */ +/* $OpenBSD: ukphy.c,v 1.4 1999/07/23 12:39:11 deraadt Exp $ */ /* $NetBSD: ukphy.c,v 1.1.6.1 1999/04/23 15:39:00 perry Exp $ */ /*- @@ -153,13 +153,9 @@ ukphyattach(parent, self, aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - printf("%s: ", sc->mii_dev.dv_xname); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else + if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_add_media(mii, sc->mii_capabilities, sc->mii_inst); - printf("\n"); #undef ADD } |