diff options
author | Nathan Binkert <nate@cvs.openbsd.org> | 2002-11-26 06:01:29 +0000 |
---|---|---|
committer | Nathan Binkert <nate@cvs.openbsd.org> | 2002-11-26 06:01:29 +0000 |
commit | 6305f12c83ebd24f17abde19361cfec044ac75a7 (patch) | |
tree | 08b5799abbee81cbb004b151ad789ed837bd781f | |
parent | b2b15e45eca7137f0e7fb63a1de580af95881196 (diff) |
1000baseTX -> 1000baseT
- More technically correct
- Matches FreeBSD and NetBSD
- Preserved #define for 1000baseTX for backwards compatibility
ok jason@
-rw-r--r-- | sys/dev/ic/gem.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/brgphy.c | 10 | ||||
-rw-r--r-- | sys/dev/mii/eephy.c | 10 | ||||
-rw-r--r-- | sys/dev/mii/mii_physubr.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/nsgphy.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_bge.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_em.c | 14 | ||||
-rw-r--r-- | sys/dev/pci/if_lge.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_nge.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_sk.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ti.c | 10 | ||||
-rw-r--r-- | sys/net/if_media.h | 13 |
12 files changed, 44 insertions, 55 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index beacde2f72a..67c345b61a5 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.28 2002/09/22 15:56:17 jason Exp $ */ +/* $OpenBSD: gem.c,v 1.29 2002/11/26 06:01:27 nate Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -302,7 +302,7 @@ gem_config(sc) * Unless we are Apple. */ TAILQ_FOREACH(ifm, &sc->sc_media.ifm_list, ifm_list) { - if (IFM_SUBTYPE(ifm->ifm_media) == IFM_1000_TX || + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_1000_T || IFM_SUBTYPE(ifm->ifm_media) == IFM_1000_SX || IFM_SUBTYPE(ifm->ifm_media) == IFM_1000_LX || IFM_SUBTYPE(ifm->ifm_media) == IFM_1000_CX) { @@ -1304,7 +1304,7 @@ gem_mii_statchg(dev) v |= GEM_MAC_XIF_ECHO_DISABL; switch (IFM_SUBTYPE(sc->sc_mii.mii_media_active)) { - case IFM_1000_TX: /* Gigabit using GMII interface */ + case IFM_1000_T: /* Gigabit using GMII interface */ v |= GEM_MAC_XIF_GMII_MODE; break; default: diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index e0cbe03f9a5..272e91b2194 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.13 2002/11/26 04:37:47 jason Exp $ */ +/* $OpenBSD: brgphy.c,v 1.14 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 2000 @@ -195,7 +195,7 @@ brgphy_service(sc, mii, cmd) #endif (void) brgphy_mii_phy_auto(sc, 1); break; - case IFM_1000_TX: + case IFM_1000_T: speed = BRGPHY_S1000; goto setit; case IFM_100_T4: @@ -215,7 +215,7 @@ brgphy_service(sc, mii, cmd) } PHY_WRITE(sc, BRGPHY_MII_ANAR, BRGPHY_SEL_TYPE); - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_TX) + if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) break; /* @@ -320,10 +320,10 @@ brgphy_status(sc) switch (PHY_READ(sc, BRGPHY_MII_AUXSTS) & BRGPHY_AUXSTS_AN_RES) { case BRGPHY_RES_1000FD: - mii->mii_media_active |= IFM_1000_TX | IFM_FDX; + mii->mii_media_active |= IFM_1000_T | IFM_FDX; break; case BRGPHY_RES_1000HD: - mii->mii_media_active |= IFM_1000_TX | IFM_HDX; + mii->mii_media_active |= IFM_1000_T | IFM_HDX; break; case BRGPHY_RES_100FD: mii->mii_media_active |= IFM_100_TX | IFM_FDX; diff --git a/sys/dev/mii/eephy.c b/sys/dev/mii/eephy.c index 64ce3c1e7e3..8e8975819fc 100644 --- a/sys/dev/mii/eephy.c +++ b/sys/dev/mii/eephy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eephy.c,v 1.7 2002/05/04 11:30:06 fgsch Exp $ */ +/* $OpenBSD: eephy.c,v 1.8 2002/11/26 06:01:28 nate Exp $ */ /* * Principal Author: Parag Patel * Copyright (c) 2001 @@ -130,12 +130,12 @@ eephyattach(struct device *parent, struct device *self, void *aux) #ifndef __OpenBSD__ printf("%s: ", sc->mii_dev.dv_xname); #endif - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, IFM_FDX, sc->mii_inst), + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), E1000_CR_SPEED_1000 | E1000_CR_FULL_DUPLEX); PRINT("1000baseTX-FDX"); /* TODO - apparently 1000BT-simplex not supported? - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, 0, sc->mii_inst), + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), E1000_CR_SPEED_1000); PRINT("1000baseTX"); */ @@ -249,7 +249,7 @@ eephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) (void)eephy_mii_phy_auto(sc, 1); break; - case IFM_1000_TX: + case IFM_1000_T: if (sc->mii_flags & MIIF_DOINGAUTO) return (0); @@ -382,7 +382,7 @@ eephy_status(struct mii_softc *sc) } if (ssr & E1000_SSR_1000MBS) - mii->mii_media_active |= IFM_1000_TX; + mii->mii_media_active |= IFM_1000_T; else if (ssr & E1000_SSR_100MBS) mii->mii_media_active |= IFM_100_TX; else diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 320b40e1b62..f39a714be41 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii_physubr.c,v 1.13 2002/05/04 11:30:06 fgsch Exp $ */ +/* $OpenBSD: mii_physubr.c,v 1.14 2002/11/26 06:01:28 nate Exp $ */ /* $NetBSD: mii_physubr.c,v 1.20 2001/04/13 23:30:09 thorpej Exp $ */ /*- @@ -377,12 +377,12 @@ mii_phy_add_media(sc) } if (sc->mii_extcapabilities & EXTSR_1000THDX) { sc->mii_anegticks = 10; - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, 0, + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), MII_MEDIA_1000_T); } if (sc->mii_extcapabilities & EXTSR_1000TFDX) { sc->mii_anegticks = 10; - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, IFM_FDX, + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), MII_MEDIA_1000_T_FDX); } } diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c index ff7504e661a..53aad5d1a73 100644 --- a/sys/dev/mii/nsgphy.c +++ b/sys/dev/mii/nsgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsgphy.c,v 1.8 2002/05/04 11:30:06 fgsch Exp $ */ +/* $OpenBSD: nsgphy.c,v 1.9 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 2001 @@ -191,7 +191,7 @@ nsgphy_service(sc, mii, cmd) case IFM_AUTO: (void) nsgphy_mii_phy_auto(sc, 0); break; - case IFM_1000_TX: + case IFM_1000_T: if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { PHY_WRITE(sc, NSGPHY_MII_BMCR, NSGPHY_BMCR_FDX|NSGPHY_BMCR_SPD1); @@ -316,9 +316,9 @@ nsgphy_status(sc) anlpar = PHY_READ(sc, NSGPHY_MII_ANLPAR); gstat = PHY_READ(sc, NSGPHY_MII_1000STS); if (gstat & NSGPHY_1000STS_LPFD) - mii->mii_media_active |= IFM_1000_TX|IFM_FDX; + mii->mii_media_active |= IFM_1000_T|IFM_FDX; else if (gstat & NSGPHY_1000STS_LPHD) - mii->mii_media_active |= IFM_1000_TX|IFM_HDX; + mii->mii_media_active |= IFM_1000_T|IFM_HDX; else if (anlpar & NSGPHY_ANLPAR_100T4) mii->mii_media_active |= IFM_100_T4; else if (anlpar & NSGPHY_ANLPAR_100FDX) @@ -336,7 +336,7 @@ nsgphy_status(sc) switch(bmcr & (NSGPHY_BMCR_SPD1|NSGPHY_BMCR_SPD0)) { case NSGPHY_S1000: - mii->mii_media_active |= IFM_1000_TX; + mii->mii_media_active |= IFM_1000_T; break; case NSGPHY_S100: mii->mii_media_active |= IFM_100_TX; diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index ef382611832..65809a09afa 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.16 2002/11/26 05:09:36 nate Exp $ */ +/* $OpenBSD: if_bge.c,v 1.17 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 @@ -493,7 +493,7 @@ bge_miibus_statchg(dev) struct mii_data *mii = &sc->bge_mii; BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) { + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) { BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); } else { BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index cc0b004fd4b..4a0c3e24073 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -1100,11 +1100,7 @@ em_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) ifmr->ifm_active |= IFM_100_TX; break; case 1000: -#if __FreeBSD_version < 500000 - ifmr->ifm_active |= IFM_1000_TX; -#else ifmr->ifm_active |= IFM_1000_T; -#endif break; } if (sc->link_duplex == FULL_DUPLEX) @@ -1140,11 +1136,7 @@ em_media_change(struct ifnet *ifp) sc->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT; break; case IFM_1000_SX: -#if __FreeBSD_version < 500000 - case IFM_1000_TX: -#else case IFM_1000_T: -#endif sc->hw.autoneg = DO_AUTO_NEG; sc->hw.autoneg_advertised = ADVERTISE_1000_FULL; break; @@ -1448,15 +1440,9 @@ em_setup_interface(struct em_softc * sc) 0, NULL); ifmedia_add(&sc->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); -#if __FreeBSD_version < 500000 - ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_TX | IFM_FDX, - 0, NULL); - ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_TX, 0, NULL); -#else ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T, 0, NULL); -#endif } ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO); diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index d0338d6efaa..5d9fb4f1258 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.10 2002/07/10 18:08:13 deraadt Exp $ */ +/* $OpenBSD: if_lge.c,v 1.11 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -303,7 +303,7 @@ void lge_miibus_statchg(dev) LGE_CLRBIT(sc, LGE_GMIIMODE, LGE_GMIIMODE_SPEED); switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_1000_TX: + case IFM_1000_T: case IFM_1000_SX: LGE_SETBIT(sc, LGE_GMIIMODE, LGE_SPEED_1000); break; @@ -1147,7 +1147,7 @@ void lge_tick(xsc) IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->lge_link++; if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX|| - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) printf("%s: gigabit link up\n", sc->sc_dv.dv_xname); if (!IFQ_IS_EMPTY(&ifp->if_snd)) diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index 28f202dbd11..3b52d48b07c 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.23 2002/09/22 17:53:43 nate Exp $ */ +/* $OpenBSD: if_nge.c,v 1.24 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -597,7 +597,7 @@ nge_miibus_statchg(dev) CSR_WRITE_4(sc, NGE_RX_CFG, rxcfg); /* If we have a 1000Mbps link, set the mode_1000 bit. */ - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) NGE_SETBIT(sc, NGE_CFG, NGE_CFG_MODE_1000); else NGE_CLRBIT(sc, NGE_CFG, NGE_CFG_MODE_1000); @@ -1549,7 +1549,7 @@ nge_tick(xsc) if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->nge_link++; - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) DPRINTF(("%s: gigabit link up\n", sc->sc_dv.dv_xname)); if (!IFQ_IS_EMPTY(&ifp->if_snd)) diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 1648262ad30..449bf29feb7 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.25 2002/06/08 23:32:16 jason Exp $ */ +/* $OpenBSD: if_sk.c,v 1.26 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1175,7 +1175,7 @@ skc_attach(parent, self, aux) sc->sk_pmd = IFM_1000_CX; break; case SK_PMD_1000BASETX: - sc->sk_pmd = IFM_1000_TX; + sc->sk_pmd = IFM_1000_T; break; default: printf("%s: unknown media type: 0x%x\n", diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 8aca9b39d64..11f0fd7225c 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.39 2002/11/19 18:40:17 jason Exp $ */ +/* $OpenBSD: if_ti.c,v 1.40 2002/11/26 06:01:28 nate Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1635,9 +1635,9 @@ ti_attach(parent, self, aux) ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL); ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL); - ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_TX, 0, NULL); + ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_T, 0, NULL); ifmedia_add(&sc->ifmedia, - IFM_ETHER|IFM_1000_TX|IFM_FDX, 0, NULL); + IFM_ETHER|IFM_1000_T|IFM_FDX, 0, NULL); } else { /* Fiber cards don't support 10/100 modes. */ ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX, 0, NULL); @@ -2182,7 +2182,7 @@ int ti_ifmedia_upd(ifp) TI_CMD_CODE_NEGOTIATE_BOTH, 0); break; case IFM_1000_SX: - case IFM_1000_TX: + case IFM_1000_T: CSR_WRITE_4(sc, TI_GCR_GLINK, TI_GLNK_PREF|TI_GLNK_1000MB| TI_GLNK_RX_FLOWCTL_Y|TI_GLNK_ENB); CSR_WRITE_4(sc, TI_GCR_LINK, 0); @@ -2240,7 +2240,7 @@ void ti_ifmedia_sts(ifp, ifmr) if (sc->ti_linkstat == TI_EV_CODE_GIG_LINK_UP) { media = CSR_READ_4(sc, TI_GCR_GLINK_STAT); if (sc->ti_copper) - ifmr->ifm_active |= IFM_1000_TX; + ifmr->ifm_active |= IFM_1000_T; else ifmr->ifm_active |= IFM_1000_SX; if (media & TI_GLNK_FULL_DUPLEX) diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 3d766e1df76..5b3eda3ca79 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.h,v 1.10 2002/04/10 19:25:07 millert Exp $ */ +/* $OpenBSD: if_media.h,v 1.11 2002/11/26 06:01:28 nate Exp $ */ /* $NetBSD: if_media.h,v 1.22 2000/02/17 21:53:16 sommerfeld Exp $ */ /*- @@ -178,7 +178,8 @@ int ifmedia_baudrate(int); #define IFM_10_FL 13 /* 10BaseFL - Fiber */ #define IFM_1000_LX 14 /* 1000baseLX - single-mode fiber */ #define IFM_1000_CX 15 /* 1000baseCX - 150ohm STP */ -#define IFM_1000_TX 16 /* 1000baseTX - 4 pair cat 5 */ +#define IFM_1000_T 16 /* 1000baseT - 4 pair cat 5 */ +#define IFM_1000_TX IFM_1000_T /* for backwards compatibility */ #define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */ /* @@ -351,8 +352,10 @@ struct ifmedia_description { { IFM_ETHER|IFM_1000_LX, "1000LX" }, \ { IFM_ETHER|IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER|IFM_1000_CX, "1000CX" }, \ - { IFM_ETHER|IFM_1000_TX, "1000baseTX" }, \ - { IFM_ETHER|IFM_1000_TX, "1000TX" }, \ + { IFM_ETHER|IFM_1000_T, "1000baseT" }, \ + { IFM_ETHER|IFM_1000_T, "1000T" }, \ + { IFM_ETHER|IFM_1000_T, "1000baseTX" }, \ + { IFM_ETHER|IFM_1000_T, "1000TX" }, \ { IFM_ETHER|IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER|IFM_HPNA_1, "HPNA1" }, \ \ @@ -434,7 +437,7 @@ struct ifmedia_baudrate { { IFM_ETHER|IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER|IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_CX, IF_Mbps(1000) }, \ - { IFM_ETHER|IFM_1000_TX, IF_Mbps(1000) }, \ + { IFM_ETHER|IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_HPNA_1, IF_Mbps(1) }, \ \ { IFM_TOKEN|IFM_TOK_STP4, IF_Mbps(4) }, \ |