summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-04-29 17:23:23 +0000
committerharti <harti@FreeBSD.org>2003-04-29 17:23:23 +0000
commit7cb80f0d91bac91209aee934234d22b21cd84f6d (patch)
tree6d09fc1dfe94350d3a19d15b2d28906d297f782e /sys/net
parent0ab2dac10866e26ec79c2a544b010a6e9a09b8b5 (diff)
downloadFreeBSD-src-7cb80f0d91bac91209aee934234d22b21cd84f6d.zip
FreeBSD-src-7cb80f0d91bac91209aee934234d22b21cd84f6d.tar.gz
Add media types and options for ATM. While on most ATM cards media cannot
be changed, it is very convenient to be able to toggle SDH/Sonet, idle/unassigned cells and scrambled mode and to see the carrier state. Reviewed by: -arch (if_media.h definitions)
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_media.c11
-rw-r--r--sys/net/if_media.h52
2 files changed, 63 insertions, 0 deletions
diff --git a/sys/net/if_media.c b/sys/net/if_media.c
index 2201c97..a584419 100644
--- a/sys/net/if_media.c
+++ b/sys/net/if_media.c
@@ -412,6 +412,12 @@ struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] =
IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS;
+struct ifmedia_description ifm_subtype_atm_descriptions[] =
+ IFM_SUBTYPE_ATM_DESCRIPTIONS;
+
+struct ifmedia_description ifm_subtype_atm_option_descriptions[] =
+ IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS;
+
struct ifmedia_description ifm_subtype_shared_descriptions[] =
IFM_SUBTYPE_SHARED_DESCRIPTIONS;
@@ -446,6 +452,11 @@ struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
&ifm_subtype_ieee80211_option_descriptions[0],
&ifm_subtype_ieee80211_mode_descriptions[0]
},
+ {
+ &ifm_subtype_atm_descriptions[0],
+ &ifm_subtype_atm_option_descriptions[0],
+ NULL,
+ },
};
/*
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index b48f594..32d9c34 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -200,6 +200,23 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr,
#define IFM_IEEE80211_11G 3 /* 2Ghz, CCK mode */
/*
+ * ATM
+ */
+#define IFM_ATM 0x000000a0
+#define IFM_ATM_UNKNOWN 3
+#define IFM_ATM_UTP_25 4
+#define IFM_ATM_TAXI_100 5
+#define IFM_ATM_TAXI_140 6
+#define IFM_ATM_MM_155 7
+#define IFM_ATM_SM_155 8
+#define IFM_ATM_UTP_155 9
+#define IFM_ATM_MM_622 10
+#define IFM_ATM_SM_622 11
+#define IFM_ATM_SDH 0x00000100 /* SDH instead of SONET */
+#define IFM_ATM_NOSCRAMB 0x00000200 /* no scrambling */
+#define IFM_ATM_UNASSIGNED 0x00000400 /* unassigned cells */
+
+/*
* Shared media sub-types
*/
#define IFM_AUTO 0 /* Autoselect best media */
@@ -271,6 +288,7 @@ struct ifmedia_description {
{ IFM_TOKEN, "Token ring" }, \
{ IFM_FDDI, "FDDI" }, \
{ IFM_IEEE80211, "IEEE 802.11 Wireless Ethernet" }, \
+ { IFM_ATM, "ATM" }, \
{ 0, NULL }, \
}
@@ -435,6 +453,40 @@ struct ifmedia_description {
{ 0, NULL }, \
}
+# define IFM_SUBTYPE_ATM_DESCRIPTIONS { \
+ { IFM_ATM_UNKNOWN, "Unknown" }, \
+ { IFM_ATM_UTP_25, "UTP/25.6MBit" }, \
+ { IFM_ATM_TAXI_100, "Taxi/100MBit" }, \
+ { IFM_ATM_TAXI_140, "Taxi/140MBit" }, \
+ { IFM_ATM_MM_155, "Multi-mode/155MBit" }, \
+ { IFM_ATM_SM_155, "Single-mode/155MBit" }, \
+ { IFM_ATM_UTP_155, "UTP/155MBit" }, \
+ { IFM_ATM_MM_622, "Mult-imode/622MBit" }, \
+ { IFM_ATM_SM_622, "Single-mode/622MBit" }, \
+ { 0, NULL }, \
+}
+
+# define IFM_SUBTYPE_ATM_ALIASES { \
+ { IFM_ATM_UNKNOWN, "UNKNOWN" }, \
+ { IFM_ATM_UTP_25, "UTP-25" }, \
+ { IFM_ATM_TAXI_100, "TAXI-100" }, \
+ { IFM_ATM_TAXI_140, "TAXI-140" }, \
+ { IFM_ATM_MM_155, "MM-155" }, \
+ { IFM_ATM_SM_155, "SM-155" }, \
+ { IFM_ATM_UTP_155, "UTP-155" }, \
+ { IFM_ATM_MM_622, "MM-622" }, \
+ { IFM_ATM_SM_622, "SM-622" }, \
+ { 0, NULL }, \
+}
+
+#define IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS { \
+ { IFM_ATM_SDH, "SDH" }, \
+ { IFM_ATM_NOSCRAMB, "Noscramb" }, \
+ { IFM_ATM_UNASSIGNED, "Unassigned" }, \
+ { 0, NULL }, \
+}
+
+
#define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \
{ IFM_AUTO, "autoselect" }, \
{ IFM_MANUAL, "manual" }, \
OpenPOWER on IntegriCloud