Deleted Added
full compact
if_media.h (99994) if_media.h (114163)
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 99994 2002-07-14 21:58:19Z kbyanc $ */
2/* $FreeBSD: head/sys/net/if_media.h 114163 2003-04-28 16:35:51Z sam $ */
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

--- 97 unchanged lines hidden (view full) ---

108
109/*
110 * if_media Options word:
111 * Bits Use
112 * ---- -------
113 * 0-4 Media variant
114 * 5-7 Media type
115 * 8-15 Type specific options
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

--- 97 unchanged lines hidden (view full) ---

108
109/*
110 * if_media Options word:
111 * Bits Use
112 * ---- -------
113 * 0-4 Media variant
114 * 5-7 Media type
115 * 8-15 Type specific options
116 * 16-19 RFU
116 * 16-18 Mode (for multi-mode devices)
117 * 19 RFU
117 * 20-27 Shared (global) options
118 * 28-31 Instance
119 */
120
121/*
122 * Ethernet
123 */
124#define IFM_ETHER 0x00000020

--- 41 unchanged lines hidden (view full) ---

166#define IFM_FDDI_MMF 4 /* Multi-mode fiber */
167#define IFM_FDDI_UTP 5 /* CDDI / UTP */
168#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */
169
170/*
171 * IEEE 802.11 Wireless
172 */
173#define IFM_IEEE80211 0x00000080
118 * 20-27 Shared (global) options
119 * 28-31 Instance
120 */
121
122/*
123 * Ethernet
124 */
125#define IFM_ETHER 0x00000020

--- 41 unchanged lines hidden (view full) ---

167#define IFM_FDDI_MMF 4 /* Multi-mode fiber */
168#define IFM_FDDI_UTP 5 /* CDDI / UTP */
169#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */
170
171/*
172 * IEEE 802.11 Wireless
173 */
174#define IFM_IEEE80211 0x00000080
175/* NB: 0,1,2 are auto, manual, none defined below */
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 */
176#define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */
177#define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */
178#define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */
179#define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */
180#define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */
181#define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */
182#define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */
181#define IFM_IEEE80211_ODFM6 10 /* ODFM 6Mbps */
182#define IFM_IEEE80211_ODFM9 11 /* ODFM 9Mbps */
183#define IFM_IEEE80211_ODFM12 12 /* ODFM 12Mbps */
184#define IFM_IEEE80211_ODFM18 13 /* ODFM 18Mbps */
185#define IFM_IEEE80211_ODFM24 14 /* ODFM 24Mbps */
186#define IFM_IEEE80211_ODFM36 15 /* ODFM 36Mbps */
187#define IFM_IEEE80211_ODFM48 16 /* ODFM 48Mbps */
188#define IFM_IEEE80211_ODFM54 17 /* ODFM 54Mbps */
189#define IFM_IEEE80211_ODFM72 18 /* ODFM 72Mbps */
183#define IFM_IEEE80211_OFDM6 10 /* OFDM 6Mbps */
184#define IFM_IEEE80211_OFDM9 11 /* OFDM 9Mbps */
185#define IFM_IEEE80211_OFDM12 12 /* OFDM 12Mbps */
186#define IFM_IEEE80211_OFDM18 13 /* OFDM 18Mbps */
187#define IFM_IEEE80211_OFDM24 14 /* OFDM 24Mbps */
188#define IFM_IEEE80211_OFDM36 15 /* OFDM 36Mbps */
189#define IFM_IEEE80211_OFDM48 16 /* OFDM 48Mbps */
190#define IFM_IEEE80211_OFDM54 17 /* OFDM 54Mbps */
191#define IFM_IEEE80211_OFDM72 18 /* OFDM 72Mbps */
190#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */
191#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */
192#define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */
193#define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */
192#define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */
193#define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */
194#define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */
195#define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */
196#define IFM_IEEE80211_TURBO 0x00001000 /* Operate in turbo mode */
197/* operating mode for multi-mode devices */
198#define IFM_IEEE80211_11A 1 /* 5Ghz, OFDM mode */
199#define IFM_IEEE80211_11B 2 /* Direct Sequence mode */
200#define IFM_IEEE80211_11G 3 /* 2Ghz, CCK mode */
194
195/*
196 * Shared media sub-types
197 */
198#define IFM_AUTO 0 /* Autoselect best media */
199#define IFM_MANUAL 1 /* Jumper/dipswitch selects media */
200#define IFM_NONE 2 /* Deselect all media */
201

--- 10 unchanged lines hidden (view full) ---

212/*
213 * Masks
214 */
215#define IFM_NMASK 0x000000e0 /* Network type */
216#define IFM_TMASK 0x0000001f /* Media sub-type */
217#define IFM_IMASK 0xf0000000 /* Instance */
218#define IFM_ISHIFT 28 /* Instance shift */
219#define IFM_OMASK 0x0000ff00 /* Type specific options */
201
202/*
203 * Shared media sub-types
204 */
205#define IFM_AUTO 0 /* Autoselect best media */
206#define IFM_MANUAL 1 /* Jumper/dipswitch selects media */
207#define IFM_NONE 2 /* Deselect all media */
208

--- 10 unchanged lines hidden (view full) ---

219/*
220 * Masks
221 */
222#define IFM_NMASK 0x000000e0 /* Network type */
223#define IFM_TMASK 0x0000001f /* Media sub-type */
224#define IFM_IMASK 0xf0000000 /* Instance */
225#define IFM_ISHIFT 28 /* Instance shift */
226#define IFM_OMASK 0x0000ff00 /* Type specific options */
227#define IFM_MMASK 0x00070000 /* Mode */
228#define IFM_MSHIFT 16 /* Mode shift */
220#define IFM_GMASK 0x0ff00000 /* Global options */
221
222/*
223 * Status bits
224 */
225#define IFM_AVALID 0x00000001 /* Active bit valid */
226#define IFM_ACTIVE 0x00000002 /* Interface attached to working net */
227
228/*
229 * Macros to extract various bits of information from the media word.
230 */
231#define IFM_TYPE(x) ((x) & IFM_NMASK)
232#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
233#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK)
234#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT)
235#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK))
229#define IFM_GMASK 0x0ff00000 /* Global options */
230
231/*
232 * Status bits
233 */
234#define IFM_AVALID 0x00000001 /* Active bit valid */
235#define IFM_ACTIVE 0x00000002 /* Interface attached to working net */
236
237/*
238 * Macros to extract various bits of information from the media word.
239 */
240#define IFM_TYPE(x) ((x) & IFM_NMASK)
241#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
242#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK)
243#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT)
244#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK))
245#define IFM_MODE(x) (((x) & IFM_MMASK) >> IFM_MSHIFT)
236
237#define IFM_INST_MAX IFM_INST(IFM_IMASK)
238
239/*
240 * Macro to create a media word.
241 */
242#define IFM_MAKEWORD(type, subtype, options, instance) \
243 ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT))
246
247#define IFM_INST_MAX IFM_INST(IFM_IMASK)
248
249/*
250 * Macro to create a media word.
251 */
252#define IFM_MAKEWORD(type, subtype, options, instance) \
253 ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT))
254#define IFM_MAKEMODE(mode) \
255 (((mode) << IFM_MSHIFT) & IFM_MMASK)
244
245/*
246 * NetBSD extension not defined in the BSDI API. This is used in various
247 * places to get the canonical description for a given type/subtype.
248 *
249 * NOTE: all but the top-level type descriptions must contain NO whitespace!
250 * Otherwise, parsing these in ifconfig(8) would be a nightmare.
251 */

--- 107 unchanged lines hidden (view full) ---

359#define IFM_SUBTYPE_IEEE80211_DESCRIPTIONS { \
360 { IFM_IEEE80211_FH1, "FH/1Mbps" }, \
361 { IFM_IEEE80211_FH2, "FH/2Mbps" }, \
362 { IFM_IEEE80211_DS1, "DS/1Mbps" }, \
363 { IFM_IEEE80211_DS2, "DS/2Mbps" }, \
364 { IFM_IEEE80211_DS5, "DS/5.5Mbps" }, \
365 { IFM_IEEE80211_DS11, "DS/11Mbps" }, \
366 { IFM_IEEE80211_DS22, "DS/22Mbps" }, \
256
257/*
258 * NetBSD extension not defined in the BSDI API. This is used in various
259 * places to get the canonical description for a given type/subtype.
260 *
261 * NOTE: all but the top-level type descriptions must contain NO whitespace!
262 * Otherwise, parsing these in ifconfig(8) would be a nightmare.
263 */

--- 107 unchanged lines hidden (view full) ---

371#define IFM_SUBTYPE_IEEE80211_DESCRIPTIONS { \
372 { IFM_IEEE80211_FH1, "FH/1Mbps" }, \
373 { IFM_IEEE80211_FH2, "FH/2Mbps" }, \
374 { IFM_IEEE80211_DS1, "DS/1Mbps" }, \
375 { IFM_IEEE80211_DS2, "DS/2Mbps" }, \
376 { IFM_IEEE80211_DS5, "DS/5.5Mbps" }, \
377 { IFM_IEEE80211_DS11, "DS/11Mbps" }, \
378 { IFM_IEEE80211_DS22, "DS/22Mbps" }, \
367 { IFM_IEEE80211_ODFM6, "ODFM/6Mbps" }, \
368 { IFM_IEEE80211_ODFM9, "ODFM/9Mbps" }, \
369 { IFM_IEEE80211_ODFM12, "ODFM/12Mbps" }, \
370 { IFM_IEEE80211_ODFM18, "ODFM/18Mbps" }, \
371 { IFM_IEEE80211_ODFM24, "ODFM/24Mbps" }, \
372 { IFM_IEEE80211_ODFM36, "ODFM/36Mbps" }, \
373 { IFM_IEEE80211_ODFM48, "ODFM/48Mbps" }, \
374 { IFM_IEEE80211_ODFM54, "ODFM/54Mbps" }, \
375 { IFM_IEEE80211_ODFM72, "ODFM/72Mbps" }, \
379 { IFM_IEEE80211_OFDM6, "OFDM/6Mbps" }, \
380 { IFM_IEEE80211_OFDM9, "OFDM/9Mbps" }, \
381 { IFM_IEEE80211_OFDM12, "OFDM/12Mbps" }, \
382 { IFM_IEEE80211_OFDM18, "OFDM/18Mbps" }, \
383 { IFM_IEEE80211_OFDM24, "OFDM/24Mbps" }, \
384 { IFM_IEEE80211_OFDM36, "OFDM/36Mbps" }, \
385 { IFM_IEEE80211_OFDM48, "OFDM/48Mbps" }, \
386 { IFM_IEEE80211_OFDM54, "OFDM/54Mbps" }, \
387 { IFM_IEEE80211_OFDM72, "OFDM/72Mbps" }, \
376 { 0, NULL }, \
377}
378
379#define IFM_SUBTYPE_IEEE80211_ALIASES { \
380 { IFM_IEEE80211_FH1, "FH1" }, \
381 { IFM_IEEE80211_FH2, "FH2" }, \
382 { IFM_IEEE80211_FH1, "FrequencyHopping/1Mbps" }, \
383 { IFM_IEEE80211_FH2, "FrequencyHopping/2Mbps" }, \
384 { IFM_IEEE80211_DS1, "DS1" }, \
385 { IFM_IEEE80211_DS2, "DS2" }, \
386 { IFM_IEEE80211_DS5, "DS5.5" }, \
387 { IFM_IEEE80211_DS11, "DS11" }, \
388 { IFM_IEEE80211_DS22, "DS22" }, \
389 { IFM_IEEE80211_DS1, "DirectSequence/1Mbps" }, \
390 { IFM_IEEE80211_DS2, "DirectSequence/2Mbps" }, \
391 { IFM_IEEE80211_DS5, "DirectSequence/5.5Mbps" }, \
392 { IFM_IEEE80211_DS11, "DirectSequence/11Mbps" }, \
393 { IFM_IEEE80211_DS22, "DirectSequence/22Mbps" }, \
388 { 0, NULL }, \
389}
390
391#define IFM_SUBTYPE_IEEE80211_ALIASES { \
392 { IFM_IEEE80211_FH1, "FH1" }, \
393 { IFM_IEEE80211_FH2, "FH2" }, \
394 { IFM_IEEE80211_FH1, "FrequencyHopping/1Mbps" }, \
395 { IFM_IEEE80211_FH2, "FrequencyHopping/2Mbps" }, \
396 { IFM_IEEE80211_DS1, "DS1" }, \
397 { IFM_IEEE80211_DS2, "DS2" }, \
398 { IFM_IEEE80211_DS5, "DS5.5" }, \
399 { IFM_IEEE80211_DS11, "DS11" }, \
400 { IFM_IEEE80211_DS22, "DS22" }, \
401 { IFM_IEEE80211_DS1, "DirectSequence/1Mbps" }, \
402 { IFM_IEEE80211_DS2, "DirectSequence/2Mbps" }, \
403 { IFM_IEEE80211_DS5, "DirectSequence/5.5Mbps" }, \
404 { IFM_IEEE80211_DS11, "DirectSequence/11Mbps" }, \
405 { IFM_IEEE80211_DS22, "DirectSequence/22Mbps" }, \
394 { IFM_IEEE80211_ODFM6, "ODFM6" }, \
395 { IFM_IEEE80211_ODFM9, "ODFM9" }, \
396 { IFM_IEEE80211_ODFM12, "ODFM12" }, \
397 { IFM_IEEE80211_ODFM18, "ODFM18" }, \
398 { IFM_IEEE80211_ODFM24, "ODFM24" }, \
399 { IFM_IEEE80211_ODFM36, "ODFM36" }, \
400 { IFM_IEEE80211_ODFM48, "ODFM48" }, \
401 { IFM_IEEE80211_ODFM54, "ODFM54" }, \
402 { IFM_IEEE80211_ODFM72, "ODFM72" }, \
406 { IFM_IEEE80211_OFDM6, "OFDM6" }, \
407 { IFM_IEEE80211_OFDM9, "OFDM9" }, \
408 { IFM_IEEE80211_OFDM12, "OFDM12" }, \
409 { IFM_IEEE80211_OFDM18, "OFDM18" }, \
410 { IFM_IEEE80211_OFDM24, "OFDM24" }, \
411 { IFM_IEEE80211_OFDM36, "OFDM36" }, \
412 { IFM_IEEE80211_OFDM48, "OFDM48" }, \
413 { IFM_IEEE80211_OFDM54, "OFDM54" }, \
414 { IFM_IEEE80211_OFDM72, "OFDM72" }, \
415 { IFM_IEEE80211_DS1, "CCK1" }, \
416 { IFM_IEEE80211_DS2, "CCK2" }, \
417 { IFM_IEEE80211_DS5, "CCK5.5" }, \
418 { IFM_IEEE80211_DS11, "CCK11" }, \
403 { 0, NULL }, \
404}
405
406#define IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS { \
407 { IFM_IEEE80211_ADHOC, "adhoc" }, \
408 { IFM_IEEE80211_HOSTAP, "hostap" }, \
409 { IFM_IEEE80211_IBSS, "ibss" }, \
410 { IFM_IEEE80211_IBSSMASTER, "ibss-master" }, \
419 { 0, NULL }, \
420}
421
422#define IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS { \
423 { IFM_IEEE80211_ADHOC, "adhoc" }, \
424 { IFM_IEEE80211_HOSTAP, "hostap" }, \
425 { IFM_IEEE80211_IBSS, "ibss" }, \
426 { IFM_IEEE80211_IBSSMASTER, "ibss-master" }, \
427 { IFM_IEEE80211_TURBO, "turbo" }, \
411 { 0, NULL }, \
412}
413
428 { 0, NULL }, \
429}
430
431#define IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS { \
432 { IFM_IEEE80211_11A, "11a" }, \
433 { IFM_IEEE80211_11B, "11b" }, \
434 { IFM_IEEE80211_11G, "11g" }, \
435 { 0, NULL }, \
436}
437
414#define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \
415 { IFM_AUTO, "autoselect" }, \
416 { IFM_MANUAL, "manual" }, \
417 { IFM_NONE, "none" }, \
418 { 0, NULL }, \
419}
420
421#define IFM_SUBTYPE_SHARED_ALIASES { \

--- 15 unchanged lines hidden ---
438#define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \
439 { IFM_AUTO, "autoselect" }, \
440 { IFM_MANUAL, "manual" }, \
441 { IFM_NONE, "none" }, \
442 { 0, NULL }, \
443}
444
445#define IFM_SUBTYPE_SHARED_ALIASES { \

--- 15 unchanged lines hidden ---