summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-04-29 05:32:44 +0000
committerphk <phk@FreeBSD.org>2002-04-29 05:32:44 +0000
commitd6fb98dc451080d8516b824d9264bdc0540c30ca (patch)
treee47b942f09403904a0e5a2454d0b9e6ac5675751 /sys
parentd61adfe67867ef34d9c1418efc0221ae7edf0e4f (diff)
downloadFreeBSD-src-d6fb98dc451080d8516b824d9264bdc0540c30ca.zip
FreeBSD-src-d6fb98dc451080d8516b824d9264bdc0540c30ca.tar.gz
Move us yet closer to IFM_* definitions in NetBSD.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/dc/if_dc.c12
-rw-r--r--sys/dev/mii/pnaphy.c4
-rw-r--r--sys/net/if_media.h84
-rw-r--r--sys/pci/if_dc.c12
4 files changed, 56 insertions, 56 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 540e8a6..905f2bc 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -915,7 +915,7 @@ static void dc_miibus_statchg(dev)
mii = device_get_softc(sc->dc_miibus);
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) &&
- IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA) {
+ IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
dc_setcfg(sc, ifm->ifm_media);
sc->dc_if_media = ifm->ifm_media;
} else {
@@ -949,7 +949,7 @@ static void dc_miibus_mediainit(dev)
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) && rev >= DC_REVISION_DM9102A)
- ifmedia_add(ifm, IFM_ETHER|IFM_homePNA, 0, NULL);
+ ifmedia_add(ifm, IFM_ETHER|IFM_HPNA_1, 0, NULL);
return;
}
@@ -1445,7 +1445,7 @@ static void dc_setcfg(sc, media)
* on the external MII port.
*/
if (DC_IS_DAVICOM(sc)) {
- if (IFM_SUBTYPE(media) == IFM_homePNA) {
+ if (IFM_SUBTYPE(media) == IFM_HPNA_1) {
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
sc->dc_link = 1;
} else {
@@ -3296,7 +3296,7 @@ static void dc_init(xsc)
ifp->if_flags &= ~IFF_OACTIVE;
/* Don't start the ticker if this is a homePNA link. */
- if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_homePNA)
+ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1)
sc->dc_link = 1;
else {
if (sc->dc_flags & DC_21143_NWAY)
@@ -3334,7 +3334,7 @@ static int dc_ifmedia_upd(ifp)
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) &&
- IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA)
+ IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1)
dc_setcfg(sc, ifm->ifm_media);
else
sc->dc_link = 0;
@@ -3358,7 +3358,7 @@ static void dc_ifmedia_sts(ifp, ifmr)
mii_pollstat(mii);
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc)) {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA) {
+ if (IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
ifmr->ifm_active = ifm->ifm_media;
ifmr->ifm_status = 0;
return;
diff --git a/sys/dev/mii/pnaphy.c b/sys/dev/mii/pnaphy.c
index 596b899..744cd86 100644
--- a/sys/dev/mii/pnaphy.c
+++ b/sys/dev/mii/pnaphy.c
@@ -144,7 +144,7 @@ pnaphy_attach(dev)
if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0)
printf("no media present");
else {
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_homePNA, 0, sc->mii_inst), 0);
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, sc->mii_inst), 0);
PRINT("HomePNA");
}
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
@@ -240,7 +240,7 @@ pnaphy_service(sc, mii, cmd)
/* Update the media status. */
ukphy_status(sc);
if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T)
- mii->mii_media_active = IFM_ETHER|IFM_homePNA;
+ mii->mii_media_active = IFM_ETHER|IFM_HPNA_1;
/* Callback if something changed. */
mii_phy_update(sc, cmd);
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index 6f05a28..03941d8 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -121,7 +121,7 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
/*
* Ethernet
*/
-#define IFM_ETHER 0x00000020
+#define IFM_ETHER 0x00000020
#define IFM_10_T 3 /* 10BaseT - RJ45 */
#define IFM_10_2 4 /* 10Base2 - Thinnet */
#define IFM_10_5 5 /* 10Base5 - AUI */
@@ -130,16 +130,17 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
#define IFM_100_T4 8 /* 100BaseT4 - 4 pair cat 3 */
#define IFM_100_VG 9 /* 100VG-AnyLAN */
#define IFM_100_T2 10 /* 100BaseT2 */
-#define IFM_1000_FX 11 /* 1000BaseFX - gigabit over fiber */
-#define IFM_10_STP 12 /* 10BaseT over shielded TP */
-#define IFM_10_FL 13 /* 10baseFL - Fiber */
-#define IFM_1000_SX 14 /* 1000BaseSX Multi-mode Fiber */
-#define IFM_1000_LX 15 /* 1000BaseLX Single-mode Fiber */
-#define IFM_1000_CX 16 /* 1000BaseCX 150ohm STP */
-#define IFM_1000_T 17 /* 1000BaseTX 4 pair cat 5 */
-#define IFM_homePNA 18 /* HomePNA media for ethernet frames */
+#define IFM_1000_SX 11 /* 1000BaseSX - multi-mode fiber */
+#define IFM_10_STP 12 /* 10BaseT over shielded TP */
+#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_T 16 /* 1000baseT - 4 pair cat 5 */
+#define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */
/* note 31 is the max! */
+#define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */
+
/*
* Token ring
*/
@@ -148,14 +149,14 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
#define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */
#define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */
#define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */
-#define IFM_TOK_STP100 7 /* Shielded twisted pair 100m - DB9 */
-#define IFM_TOK_UTP100 8 /* Unshielded twisted pair 100m - RJ45 */
+#define IFM_TOK_STP100 7 /* Shielded twisted pair 100m - DB9 */
+#define IFM_TOK_UTP100 8 /* Unshielded twisted pair 100m - RJ45 */
#define IFM_TOK_ETR 0x00000200 /* Early token release */
#define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */
#define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */
-#define IFM_TOK_DTR 0x00002000 /* Dedicated token ring */
-#define IFM_TOK_CLASSIC 0x00004000 /* Classic token ring */
-#define IFM_TOK_AUTO 0x00008000 /* Automatic Dedicate/Classic token ring */
+#define IFM_TOK_DTR 0x00002000 /* Dedicated token ring */
+#define IFM_TOK_CLASSIC 0x00004000 /* Classic token ring */
+#define IFM_TOK_AUTO 0x00008000 /* Automatic Dedicate/Classic token ring */
/*
* FDDI
@@ -163,22 +164,22 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
#define IFM_FDDI 0x00000060
#define IFM_FDDI_SMF 3 /* Single-mode fiber */
#define IFM_FDDI_MMF 4 /* Multi-mode fiber */
-#define IFM_FDDI_UTP 5 /* CDDI / UTP */
-#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */
+#define IFM_FDDI_UTP 5 /* CDDI / UTP */
+#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */
/*
* IEEE 802.11 Wireless
*/
-#define IFM_IEEE80211 0x00000080
-#define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */
-#define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */
-#define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */
-#define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */
-#define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */
-#define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */
-#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */
-#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */
-#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */
+#define IFM_IEEE80211 0x00000080
+#define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */
+#define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */
+#define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */
+#define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */
+#define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */
+#define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */
+#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */
+#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */
+#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */
/*
* Shared media sub-types
@@ -190,11 +191,11 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
/*
* Shared options
*/
-#define IFM_FDX 0x00100000 /* Force full duplex */
+#define IFM_FDX 0x00100000 /* Force full duplex */
#define IFM_HDX 0x00200000 /* Force half duplex */
-#define IFM_FLAG0 0x01000000 /* Driver defined flag */
-#define IFM_FLAG1 0x02000000 /* Driver defined flag */
-#define IFM_FLAG2 0x04000000 /* Driver defined flag */
+#define IFM_FLAG0 0x01000000 /* Driver defined flag */
+#define IFM_FLAG1 0x02000000 /* Driver defined flag */
+#define IFM_FLAG2 0x04000000 /* Driver defined flag */
#define IFM_LOOP 0x08000000 /* Put hardware in loopback */
/*
@@ -218,16 +219,16 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
*/
#define IFM_TYPE(x) ((x) & IFM_NMASK)
#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
-#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK)
+#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK)
#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT)
-#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK))
+#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK))
-#define IFM_INST_MAX IFM_INST(IFM_IMASK)
+#define IFM_INST_MAX IFM_INST(IFM_IMASK)
/*
* Macro to create a media word.
*/
-#define IFM_MAKEWORD(type, subtype, options, instance) \
+#define IFM_MAKEWORD(type, subtype, options, instance) \
((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT))
/*
@@ -259,14 +260,14 @@ struct ifmedia_description {
{ IFM_100_T4, "100baseT4" }, \
{ IFM_100_VG, "100baseVG" }, \
{ IFM_100_T2, "100baseT2" }, \
- { IFM_1000_FX, "1000baseFX" }, \
{ IFM_10_STP, "10baseSTP" }, \
{ IFM_10_FL, "10baseFL" }, \
{ IFM_1000_SX, "1000baseSX" }, \
{ IFM_1000_LX, "1000baseLX" }, \
{ IFM_1000_CX, "1000baseCX" }, \
{ IFM_1000_T, "1000baseTX" }, \
- { IFM_homePNA, "homePNA" }, \
+ { IFM_1000_T, "1000baseT" }, \
+ { IFM_HPNA_1, "homePNA" }, \
{ 0, NULL }, \
}
@@ -278,17 +279,16 @@ struct ifmedia_description {
{ IFM_10_5, "AUI" }, \
{ IFM_10_5, "10AUI" }, \
{ IFM_100_TX, "100TX" }, \
- { IFM_100_FX, "100FX" }, \
{ IFM_100_T4, "100T4" }, \
{ IFM_100_VG, "100VG" }, \
{ IFM_100_T2, "100T2" }, \
- { IFM_1000_FX, "1000FX" }, \
{ IFM_10_STP, "10STP" }, \
{ IFM_10_FL, "10FL" }, \
- { IFM_1000_FX, "1000SX" }, \
- { IFM_1000_FX, "1000LX" }, \
- { IFM_1000_FX, "1000CX" }, \
- { IFM_1000_FX, "1000TX" }, \
+ { IFM_1000_SX, "1000SX" }, \
+ { IFM_1000_LX, "1000LX" }, \
+ { IFM_1000_CX, "1000CX" }, \
+ { IFM_1000_T, "1000TX" }, \
+ { IFM_1000_T, "1000T" }, \
{ 0, NULL }, \
}
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 540e8a6..905f2bc 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -915,7 +915,7 @@ static void dc_miibus_statchg(dev)
mii = device_get_softc(sc->dc_miibus);
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) &&
- IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA) {
+ IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
dc_setcfg(sc, ifm->ifm_media);
sc->dc_if_media = ifm->ifm_media;
} else {
@@ -949,7 +949,7 @@ static void dc_miibus_mediainit(dev)
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) && rev >= DC_REVISION_DM9102A)
- ifmedia_add(ifm, IFM_ETHER|IFM_homePNA, 0, NULL);
+ ifmedia_add(ifm, IFM_ETHER|IFM_HPNA_1, 0, NULL);
return;
}
@@ -1445,7 +1445,7 @@ static void dc_setcfg(sc, media)
* on the external MII port.
*/
if (DC_IS_DAVICOM(sc)) {
- if (IFM_SUBTYPE(media) == IFM_homePNA) {
+ if (IFM_SUBTYPE(media) == IFM_HPNA_1) {
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
sc->dc_link = 1;
} else {
@@ -3296,7 +3296,7 @@ static void dc_init(xsc)
ifp->if_flags &= ~IFF_OACTIVE;
/* Don't start the ticker if this is a homePNA link. */
- if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_homePNA)
+ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1)
sc->dc_link = 1;
else {
if (sc->dc_flags & DC_21143_NWAY)
@@ -3334,7 +3334,7 @@ static int dc_ifmedia_upd(ifp)
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc) &&
- IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA)
+ IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1)
dc_setcfg(sc, ifm->ifm_media);
else
sc->dc_link = 0;
@@ -3358,7 +3358,7 @@ static void dc_ifmedia_sts(ifp, ifmr)
mii_pollstat(mii);
ifm = &mii->mii_media;
if (DC_IS_DAVICOM(sc)) {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_homePNA) {
+ if (IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
ifmr->ifm_active = ifm->ifm_media;
ifmr->ifm_status = 0;
return;
OpenPOWER on IntegriCloud