if_media.h (95673) | if_media.h (95702) |
---|---|
1/* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */ | 1/* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */ |
2/* $FreeBSD: head/sys/net/if_media.h 95673 2002-04-28 20:34:20Z phk $ */ | 2/* $FreeBSD: head/sys/net/if_media.h 95702 2002-04-29 05:32:44Z phk $ */ |
3 4/* 5 * Copyright (c) 1997 6 * Jonathan Stone and Jason R. Thorpe. All rights reserved. 7 * 8 * This software is derived from information provided by Matt Thomas. 9 * 10 * Redistribution and use in source and binary forms, with or without --- 105 unchanged lines hidden (view full) --- 116 * 16-19 RFU 117 * 20-27 Shared (global) options 118 * 28-31 Instance 119 */ 120 121/* 122 * Ethernet 123 */ | 3 4/* 5 * Copyright (c) 1997 6 * Jonathan Stone and Jason R. Thorpe. All rights reserved. 7 * 8 * This software is derived from information provided by Matt Thomas. 9 * 10 * Redistribution and use in source and binary forms, with or without --- 105 unchanged lines hidden (view full) --- 116 * 16-19 RFU 117 * 20-27 Shared (global) options 118 * 28-31 Instance 119 */ 120 121/* 122 * Ethernet 123 */ |
124#define IFM_ETHER 0x00000020 | 124#define IFM_ETHER 0x00000020 |
125#define IFM_10_T 3 /* 10BaseT - RJ45 */ 126#define IFM_10_2 4 /* 10Base2 - Thinnet */ 127#define IFM_10_5 5 /* 10Base5 - AUI */ 128#define IFM_100_TX 6 /* 100BaseTX - RJ45 */ 129#define IFM_100_FX 7 /* 100BaseFX - Fiber */ 130#define IFM_100_T4 8 /* 100BaseT4 - 4 pair cat 3 */ 131#define IFM_100_VG 9 /* 100VG-AnyLAN */ 132#define IFM_100_T2 10 /* 100BaseT2 */ | 125#define IFM_10_T 3 /* 10BaseT - RJ45 */ 126#define IFM_10_2 4 /* 10Base2 - Thinnet */ 127#define IFM_10_5 5 /* 10Base5 - AUI */ 128#define IFM_100_TX 6 /* 100BaseTX - RJ45 */ 129#define IFM_100_FX 7 /* 100BaseFX - Fiber */ 130#define IFM_100_T4 8 /* 100BaseT4 - 4 pair cat 3 */ 131#define IFM_100_VG 9 /* 100VG-AnyLAN */ 132#define IFM_100_T2 10 /* 100BaseT2 */ |
133#define IFM_1000_FX 11 /* 1000BaseFX - gigabit over fiber */ 134#define IFM_10_STP 12 /* 10BaseT over shielded TP */ 135#define IFM_10_FL 13 /* 10baseFL - Fiber */ 136#define IFM_1000_SX 14 /* 1000BaseSX Multi-mode Fiber */ 137#define IFM_1000_LX 15 /* 1000BaseLX Single-mode Fiber */ 138#define IFM_1000_CX 16 /* 1000BaseCX 150ohm STP */ 139#define IFM_1000_T 17 /* 1000BaseTX 4 pair cat 5 */ 140#define IFM_homePNA 18 /* HomePNA media for ethernet frames */ | 133#define IFM_1000_SX 11 /* 1000BaseSX - multi-mode fiber */ 134#define IFM_10_STP 12 /* 10BaseT over shielded TP */ 135#define IFM_10_FL 13 /* 10BaseFL - Fiber */ 136#define IFM_1000_LX 14 /* 1000baseLX - single-mode fiber */ 137#define IFM_1000_CX 15 /* 1000baseCX - 150ohm STP */ 138#define IFM_1000_T 16 /* 1000baseT - 4 pair cat 5 */ 139#define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */ |
141/* note 31 is the max! */ 142 | 140/* note 31 is the max! */ 141 |
142#define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ 143 |
|
143/* 144 * Token ring 145 */ 146#define IFM_TOKEN 0x00000040 147#define IFM_TOK_STP4 3 /* Shielded twisted pair 4m - DB9 */ 148#define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */ 149#define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */ 150#define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */ | 144/* 145 * Token ring 146 */ 147#define IFM_TOKEN 0x00000040 148#define IFM_TOK_STP4 3 /* Shielded twisted pair 4m - DB9 */ 149#define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */ 150#define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */ 151#define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */ |
151#define IFM_TOK_STP100 7 /* Shielded twisted pair 100m - DB9 */ 152#define IFM_TOK_UTP100 8 /* Unshielded twisted pair 100m - RJ45 */ | 152#define IFM_TOK_STP100 7 /* Shielded twisted pair 100m - DB9 */ 153#define IFM_TOK_UTP100 8 /* Unshielded twisted pair 100m - RJ45 */ |
153#define IFM_TOK_ETR 0x00000200 /* Early token release */ 154#define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */ 155#define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */ | 154#define IFM_TOK_ETR 0x00000200 /* Early token release */ 155#define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */ 156#define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */ |
156#define IFM_TOK_DTR 0x00002000 /* Dedicated token ring */ 157#define IFM_TOK_CLASSIC 0x00004000 /* Classic token ring */ 158#define IFM_TOK_AUTO 0x00008000 /* Automatic Dedicate/Classic token ring */ | 157#define IFM_TOK_DTR 0x00002000 /* Dedicated token ring */ 158#define IFM_TOK_CLASSIC 0x00004000 /* Classic token ring */ 159#define IFM_TOK_AUTO 0x00008000 /* Automatic Dedicate/Classic token ring */ |
159 160/* 161 * FDDI 162 */ 163#define IFM_FDDI 0x00000060 164#define IFM_FDDI_SMF 3 /* Single-mode fiber */ 165#define IFM_FDDI_MMF 4 /* Multi-mode fiber */ | 160 161/* 162 * FDDI 163 */ 164#define IFM_FDDI 0x00000060 165#define IFM_FDDI_SMF 3 /* Single-mode fiber */ 166#define IFM_FDDI_MMF 4 /* Multi-mode fiber */ |
166#define IFM_FDDI_UTP 5 /* CDDI / UTP */ 167#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ | 167#define IFM_FDDI_UTP 5 /* CDDI / UTP */ 168#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ |
168 169/* 170 * IEEE 802.11 Wireless 171 */ | 169 170/* 171 * IEEE 802.11 Wireless 172 */ |
172#define IFM_IEEE80211 0x00000080 173#define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ 174#define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ 175#define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */ 176#define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */ 177#define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */ 178#define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */ 179#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */ 180#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ 181#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ | 173#define IFM_IEEE80211 0x00000080 174#define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ 175#define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ 176#define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */ 177#define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */ 178#define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */ 179#define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */ 180#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */ 181#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ 182#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ |
182 183/* 184 * Shared media sub-types 185 */ 186#define IFM_AUTO 0 /* Autoselect best media */ 187#define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ 188#define IFM_NONE 2 /* Deselect all media */ 189 190/* 191 * Shared options 192 */ | 183 184/* 185 * Shared media sub-types 186 */ 187#define IFM_AUTO 0 /* Autoselect best media */ 188#define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ 189#define IFM_NONE 2 /* Deselect all media */ 190 191/* 192 * Shared options 193 */ |
193#define IFM_FDX 0x00100000 /* Force full duplex */ | 194#define IFM_FDX 0x00100000 /* Force full duplex */ |
194#define IFM_HDX 0x00200000 /* Force half duplex */ | 195#define IFM_HDX 0x00200000 /* Force half duplex */ |
195#define IFM_FLAG0 0x01000000 /* Driver defined flag */ 196#define IFM_FLAG1 0x02000000 /* Driver defined flag */ 197#define IFM_FLAG2 0x04000000 /* Driver defined flag */ | 196#define IFM_FLAG0 0x01000000 /* Driver defined flag */ 197#define IFM_FLAG1 0x02000000 /* Driver defined flag */ 198#define IFM_FLAG2 0x04000000 /* Driver defined flag */ |
198#define IFM_LOOP 0x08000000 /* Put hardware in loopback */ 199 200/* 201 * Masks 202 */ 203#define IFM_NMASK 0x000000e0 /* Network type */ 204#define IFM_TMASK 0x0000001f /* Media sub-type */ 205#define IFM_IMASK 0xf0000000 /* Instance */ --- 7 unchanged lines hidden (view full) --- 213#define IFM_AVALID 0x00000001 /* Active bit valid */ 214#define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ 215 216/* 217 * Macros to extract various bits of information from the media word. 218 */ 219#define IFM_TYPE(x) ((x) & IFM_NMASK) 220#define IFM_SUBTYPE(x) ((x) & IFM_TMASK) | 199#define IFM_LOOP 0x08000000 /* Put hardware in loopback */ 200 201/* 202 * Masks 203 */ 204#define IFM_NMASK 0x000000e0 /* Network type */ 205#define IFM_TMASK 0x0000001f /* Media sub-type */ 206#define IFM_IMASK 0xf0000000 /* Instance */ --- 7 unchanged lines hidden (view full) --- 214#define IFM_AVALID 0x00000001 /* Active bit valid */ 215#define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ 216 217/* 218 * Macros to extract various bits of information from the media word. 219 */ 220#define IFM_TYPE(x) ((x) & IFM_NMASK) 221#define IFM_SUBTYPE(x) ((x) & IFM_TMASK) |
221#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) | 222#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) |
222#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) | 223#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) |
223#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK)) | 224#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK)) |
224 | 225 |
225#define IFM_INST_MAX IFM_INST(IFM_IMASK) | 226#define IFM_INST_MAX IFM_INST(IFM_IMASK) |
226 227/* 228 * Macro to create a media word. 229 */ | 227 228/* 229 * Macro to create a media word. 230 */ |
230#define IFM_MAKEWORD(type, subtype, options, instance) \ | 231#define IFM_MAKEWORD(type, subtype, options, instance) \ |
231 ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) 232 233/* 234 * NetBSD extension not defined in the BSDI API. This is used in various 235 * places to get the canonical description for a given type/subtype. 236 * 237 * NOTE: all but the top-level type descriptions must contain NO whitespace! 238 * Otherwise, parsing these in ifconfig(8) would be a nightmare. --- 15 unchanged lines hidden (view full) --- 254 { IFM_10_T, "10baseT/UTP" }, \ 255 { IFM_10_2, "10base2/BNC" }, \ 256 { IFM_10_5, "10base5/AUI" }, \ 257 { IFM_100_TX, "100baseTX" }, \ 258 { IFM_100_FX, "100baseFX" }, \ 259 { IFM_100_T4, "100baseT4" }, \ 260 { IFM_100_VG, "100baseVG" }, \ 261 { IFM_100_T2, "100baseT2" }, \ | 232 ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) 233 234/* 235 * NetBSD extension not defined in the BSDI API. This is used in various 236 * places to get the canonical description for a given type/subtype. 237 * 238 * NOTE: all but the top-level type descriptions must contain NO whitespace! 239 * Otherwise, parsing these in ifconfig(8) would be a nightmare. --- 15 unchanged lines hidden (view full) --- 255 { IFM_10_T, "10baseT/UTP" }, \ 256 { IFM_10_2, "10base2/BNC" }, \ 257 { IFM_10_5, "10base5/AUI" }, \ 258 { IFM_100_TX, "100baseTX" }, \ 259 { IFM_100_FX, "100baseFX" }, \ 260 { IFM_100_T4, "100baseT4" }, \ 261 { IFM_100_VG, "100baseVG" }, \ 262 { IFM_100_T2, "100baseT2" }, \ |
262 { IFM_1000_FX, "1000baseFX" }, \ | |
263 { IFM_10_STP, "10baseSTP" }, \ 264 { IFM_10_FL, "10baseFL" }, \ 265 { IFM_1000_SX, "1000baseSX" }, \ 266 { IFM_1000_LX, "1000baseLX" }, \ 267 { IFM_1000_CX, "1000baseCX" }, \ 268 { IFM_1000_T, "1000baseTX" }, \ | 263 { IFM_10_STP, "10baseSTP" }, \ 264 { IFM_10_FL, "10baseFL" }, \ 265 { IFM_1000_SX, "1000baseSX" }, \ 266 { IFM_1000_LX, "1000baseLX" }, \ 267 { IFM_1000_CX, "1000baseCX" }, \ 268 { IFM_1000_T, "1000baseTX" }, \ |
269 { IFM_homePNA, "homePNA" }, \ | 269 { IFM_1000_T, "1000baseT" }, \ 270 { IFM_HPNA_1, "homePNA" }, \ |
270 { 0, NULL }, \ 271} 272 273#define IFM_SUBTYPE_ETHERNET_ALIASES { \ 274 { IFM_10_T, "UTP" }, \ 275 { IFM_10_T, "10UTP" }, \ 276 { IFM_10_2, "BNC" }, \ 277 { IFM_10_2, "10BNC" }, \ 278 { IFM_10_5, "AUI" }, \ 279 { IFM_10_5, "10AUI" }, \ 280 { IFM_100_TX, "100TX" }, \ | 271 { 0, NULL }, \ 272} 273 274#define IFM_SUBTYPE_ETHERNET_ALIASES { \ 275 { IFM_10_T, "UTP" }, \ 276 { IFM_10_T, "10UTP" }, \ 277 { IFM_10_2, "BNC" }, \ 278 { IFM_10_2, "10BNC" }, \ 279 { IFM_10_5, "AUI" }, \ 280 { IFM_10_5, "10AUI" }, \ 281 { IFM_100_TX, "100TX" }, \ |
281 { IFM_100_FX, "100FX" }, \ | |
282 { IFM_100_T4, "100T4" }, \ 283 { IFM_100_VG, "100VG" }, \ 284 { IFM_100_T2, "100T2" }, \ | 282 { IFM_100_T4, "100T4" }, \ 283 { IFM_100_VG, "100VG" }, \ 284 { IFM_100_T2, "100T2" }, \ |
285 { IFM_1000_FX, "1000FX" }, \ | |
286 { IFM_10_STP, "10STP" }, \ 287 { IFM_10_FL, "10FL" }, \ | 285 { IFM_10_STP, "10STP" }, \ 286 { IFM_10_FL, "10FL" }, \ |
288 { IFM_1000_FX, "1000SX" }, \ 289 { IFM_1000_FX, "1000LX" }, \ 290 { IFM_1000_FX, "1000CX" }, \ 291 { IFM_1000_FX, "1000TX" }, \ | 287 { IFM_1000_SX, "1000SX" }, \ 288 { IFM_1000_LX, "1000LX" }, \ 289 { IFM_1000_CX, "1000CX" }, \ 290 { IFM_1000_T, "1000TX" }, \ 291 { IFM_1000_T, "1000T" }, \ |
292 { 0, NULL }, \ 293} 294 295#define IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS { \ 296 { 0, NULL }, \ 297} 298 299#define IFM_SUBTYPE_TOKENRING_DESCRIPTIONS { \ --- 106 unchanged lines hidden --- | 292 { 0, NULL }, \ 293} 294 295#define IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS { \ 296 { 0, NULL }, \ 297} 298 299#define IFM_SUBTYPE_TOKENRING_DESCRIPTIONS { \ --- 106 unchanged lines hidden --- |