summaryrefslogtreecommitdiffstats
path: root/sys/net/if_media.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_media.h')
-rw-r--r--sys/net/if_media.h65
1 files changed, 57 insertions, 8 deletions
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index 08d0561..1708559 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -1,4 +1,5 @@
/* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */
+/* $FreeBSD$ */
/*
* Copyright (c) 1997
@@ -49,7 +50,7 @@
* to implement this interface.
*/
-#ifdef _KERNEL
+#ifdef KERNEL
#include <sys/queue.h>
@@ -86,6 +87,9 @@ struct ifmedia {
void ifmedia_init __P((struct ifmedia *ifm, int dontcare_mask,
ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback));
+/* Remove all mediums from a struct ifmedia. */
+void ifmedia_removeall __P(( struct ifmedia *ifm));
+
/* Add one supported medium to a struct ifmedia. */
void ifmedia_add __P((struct ifmedia *ifm, int mword, int data, void *aux));
@@ -100,14 +104,13 @@ void ifmedia_set __P((struct ifmedia *ifm, int mword));
int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr,
struct ifmedia *ifm, u_long cmd));
-#endif /*_KERNEL */
+#endif /*KERNEL */
/*
* if_media Options word:
* Bits Use
* ---- -------
- * 0-3 Media variant
- * 4 RFU
+ * 0-4 Media variant
* 5-7 Media type
* 8-15 Type specific options
* 16-19 RFU
@@ -127,6 +130,15 @@ int ifmedia_ioctl __P((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_TX 17 /* 1000BaseTX 4 pair cat 5 */
+#define IFM_homePNA 18 /* HomePNA media for ethernet frames */
+/* note 31 is the max! */
/*
* Token ring
@@ -136,9 +148,14 @@ int ifmedia_ioctl __P((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_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 */
/*
* FDDI
@@ -170,7 +187,7 @@ int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr,
* Masks
*/
#define IFM_NMASK 0x000000e0 /* Network type */
-#define IFM_TMASK 0x0000000f /* Media sub-type */
+#define IFM_TMASK 0x0000001f /* Media sub-type */
#define IFM_IMASK 0xf0000000 /* Instance */
#define IFM_ISHIFT 28 /* Instance shift */
#define IFM_OMASK 0x0000ff00 /* Type specific options */
@@ -185,9 +202,19 @@ int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr,
/*
* Macros to extract various bits of information from the media word.
*/
-#define IFM_TYPE(x) ((x) & IFM_NMASK)
-#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
-#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT)
+#define IFM_TYPE(x) ((x) & IFM_NMASK)
+#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
+#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_INST_MAX IFM_INST(IFM_IMASK)
+
+/*
+ * Macro to create a media word.
+ */
+#define IFM_MAKEWORD(type, subtype, options, instance) \
+ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT))
/*
* NetBSD extension not defined in the BSDI API. This is used in various
@@ -217,6 +244,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_TX, "1000baseTX" }, \
+ { IFM_homePNA, "homePNA" }, \
{ 0, NULL }, \
}
@@ -232,6 +267,13 @@ struct ifmedia_description {
{ 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" }, \
{ 0, NULL }, \
}
@@ -244,6 +286,8 @@ struct ifmedia_description {
{ IFM_TOK_STP16, "DB9/16Mbit" }, \
{ IFM_TOK_UTP4, "UTP/4Mbit" }, \
{ IFM_TOK_UTP16, "UTP/16Mbit" }, \
+ { IFM_TOK_STP100, "STP/100Mbit" }, \
+ { IFM_TOK_UTP100, "UTP/100Mbit" }, \
{ 0, NULL }, \
}
@@ -252,6 +296,8 @@ struct ifmedia_description {
{ IFM_TOK_STP16, "16STP" }, \
{ IFM_TOK_UTP4, "4UTP" }, \
{ IFM_TOK_UTP16, "16UTP" }, \
+ { IFM_TOK_STP100, "100STP" }, \
+ { IFM_TOK_UTP100, "100UTP" }, \
{ 0, NULL }, \
}
@@ -259,6 +305,9 @@ struct ifmedia_description {
{ IFM_TOK_ETR, "EarlyTokenRelease" }, \
{ IFM_TOK_SRCRT, "SourceRouting" }, \
{ IFM_TOK_ALLR, "AllRoutes" }, \
+ { IFM_TOK_DTR, "Dedicated" }, \
+ { IFM_TOK_CLASSIC,"Classic" }, \
+ { IFM_TOK_AUTO, " " }, \
{ 0, NULL }, \
}
OpenPOWER on IntegriCloud