* @APPLE_LICENSE_HEADER_END@
*/
/* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */
+/* $FreeBSD: src/sys/net/if_media.h,v 1.9.2.1 2001/07/04 00:12:38 brooks Exp $ */
/*
* Copyright (c) 1997
#ifndef _NET_IF_MEDIA_H_
#define _NET_IF_MEDIA_H_
+#include <sys/appleapiopts.h>
/*
* Prototypes and definitions for BSD/OS-compatible network interface
* to implement this interface.
*/
-#ifdef KERNEL
-
+#ifdef KERNEL_PRIVATE
#include <sys/queue.h>
/*
* Driver callbacks for media status and change requests.
*/
-typedef int (*ifm_change_cb_t) __P((struct ifnet *ifp));
-typedef void (*ifm_stat_cb_t) __P((struct ifnet *ifp, struct ifmediareq *req));
+typedef int (*ifm_change_cb_t)(struct ifnet *ifp);
+typedef void (*ifm_stat_cb_t)(struct ifnet *ifp, struct ifmediareq *req);
/*
* In-kernel representation of a single supported media type.
};
/* Initialize an interface's struct if_media field. */
-void ifmedia_init __P((struct ifmedia *ifm, int dontcare_mask,
- ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback));
+void ifmedia_init(struct ifmedia *ifm, int dontcare_mask,
+ ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback);
/* Add one supported medium to a struct ifmedia. */
-void ifmedia_add __P((struct ifmedia *ifm, int mword, int data, void *aux));
+void ifmedia_add(struct ifmedia *ifm, int mword, int data, void *aux);
/* Add an array (of ifmedia_entry) media to a struct ifmedia. */
void ifmedia_list_add(struct ifmedia *mp, struct ifmedia_entry *lp,
int count);
/* Set default media type on initialization. */
-void ifmedia_set __P((struct ifmedia *ifm, int mword));
+void ifmedia_set(struct ifmedia *ifm, int mword);
/* Common ioctl function for getting/setting media, called by driver. */
-int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr,
- struct ifmedia *ifm, u_long cmd));
+int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
+ struct ifmedia *ifm, u_long cmd);
-#endif /*KERNEL */
+#endif /* KERNEL_PRIVATE */
/*
* if_media Options word:
#define IFM_100_VG 9 /* 100VG-AnyLAN */
#define IFM_100_T2 10 /* 100BaseT2 */
#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_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_TX 16 /* 1000baseTX - 4 pair cat 5 */
+#define IFM_1000_T 16 /* 1000baseT - 4 pair cat 5 */
+#ifdef PRIVATE
+#define IFM_1000_TX IFM_1000_T /* For compatibility */
+#endif /* PRIVATE */
#define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */
+#define IFM_10G_SR 18 /* 10GbaseSR - multi-mode fiber */
+#define IFM_10G_LR 19 /* 10GbaseLR - single-mode fiber */
/*
* Token ring
#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
#define IFM_IEEE80211_DS5 6 /* Direct Sequence 5Mbps*/
#define IFM_IEEE80211_DS11 7 /* Direct Sequence 11Mbps*/
#define IFM_IEEE80211_DS1 8 /* Direct Sequence 1Mbps */
+#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */
#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */
/*
/*
* 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
{ IFM_10_FL, "10baseFL" }, \
{ IFM_1000_LX, "1000baseLX" }, \
{ IFM_1000_CX, "1000baseCX" }, \
- { IFM_1000_TX, "1000baseTX" }, \
+ { IFM_1000_T, "1000baseT" }, \
{ IFM_HPNA_1, "HomePNA1" }, \
+ { IFM_10G_SR, "10GbaseSR" }, \
+ { IFM_10G_LR, "10GbaseLR" }, \
{ 0, NULL }, \
}
{ IFM_10_FL, "10FL" }, \
{ IFM_1000_LX, "1000LX" }, \
{ IFM_1000_CX, "1000CX" }, \
- { IFM_1000_TX, "1000TX" }, \
+ { IFM_1000_T, "1000T" }, \
{ IFM_HPNA_1, "HPNA1" }, \
+ { IFM_10G_SR, "10GSR" }, \
+ { IFM_10G_LR, "10GLR" }, \
{ 0, NULL }, \
}
{ IFM_IEEE80211_DS2, "DS2" }, \
{ IFM_IEEE80211_DS5, "DS5" }, \
{ IFM_IEEE80211_DS11, "DS11" }, \
+ { IFM_IEEE80211_DS22, "DS22" }, \
{ 0, NULL }, \
}