Deleted Added
full compact
if_media.c (98849) if_media.c (114163)
1/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */
1/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */
2/* $FreeBSD: head/sys/net/if_media.c 98849 2002-06-26 03:37:47Z ken $ */
2/* $FreeBSD: head/sys/net/if_media.c 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

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

404 IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
405
406struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
407 IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
408
409struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
410 IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS;
411
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

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

404 IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
405
406struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
407 IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
408
409struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
410 IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS;
411
412struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] =
413 IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS;
414
412struct ifmedia_description ifm_subtype_shared_descriptions[] =
413 IFM_SUBTYPE_SHARED_DESCRIPTIONS;
414
415struct ifmedia_description ifm_shared_option_descriptions[] =
416 IFM_SHARED_OPTION_DESCRIPTIONS;
417
418struct ifmedia_type_to_subtype {
419 struct ifmedia_description *subtypes;
420 struct ifmedia_description *options;
415struct ifmedia_description ifm_subtype_shared_descriptions[] =
416 IFM_SUBTYPE_SHARED_DESCRIPTIONS;
417
418struct ifmedia_description ifm_shared_option_descriptions[] =
419 IFM_SHARED_OPTION_DESCRIPTIONS;
420
421struct ifmedia_type_to_subtype {
422 struct ifmedia_description *subtypes;
423 struct ifmedia_description *options;
424 struct ifmedia_description *modes;
421};
422
423/* must be in the same order as IFM_TYPE_DESCRIPTIONS */
424struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
425 {
426 &ifm_subtype_ethernet_descriptions[0],
425};
426
427/* must be in the same order as IFM_TYPE_DESCRIPTIONS */
428struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
429 {
430 &ifm_subtype_ethernet_descriptions[0],
427 &ifm_subtype_ethernet_option_descriptions[0]
431 &ifm_subtype_ethernet_option_descriptions[0],
432 NULL,
428 },
429 {
430 &ifm_subtype_tokenring_descriptions[0],
433 },
434 {
435 &ifm_subtype_tokenring_descriptions[0],
431 &ifm_subtype_tokenring_option_descriptions[0]
436 &ifm_subtype_tokenring_option_descriptions[0],
437 NULL,
432 },
433 {
434 &ifm_subtype_fddi_descriptions[0],
438 },
439 {
440 &ifm_subtype_fddi_descriptions[0],
435 &ifm_subtype_fddi_option_descriptions[0]
441 &ifm_subtype_fddi_option_descriptions[0],
442 NULL,
436 },
437 {
438 &ifm_subtype_ieee80211_descriptions[0],
443 },
444 {
445 &ifm_subtype_ieee80211_descriptions[0],
439 &ifm_subtype_ieee80211_option_descriptions[0]
446 &ifm_subtype_ieee80211_option_descriptions[0],
447 &ifm_subtype_ieee80211_mode_descriptions[0]
440 },
441};
442
443/*
444 * print a media word.
445 */
446static void
447ifmedia_printword(ifmw)

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

457 if (IFM_TYPE(ifmw) == desc->ifmt_word)
458 break;
459 if (desc->ifmt_string == NULL) {
460 printf("<unknown type>\n");
461 return;
462 }
463 printf(desc->ifmt_string);
464
448 },
449};
450
451/*
452 * print a media word.
453 */
454static void
455ifmedia_printword(ifmw)

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

465 if (IFM_TYPE(ifmw) == desc->ifmt_word)
466 break;
467 if (desc->ifmt_string == NULL) {
468 printf("<unknown type>\n");
469 return;
470 }
471 printf(desc->ifmt_string);
472
473 /* Any mode. */
474 for (desc = ttos->modes; desc && desc->ifmt_string != NULL; desc++)
475 if (IFM_MODE(ifmw) == desc->ifmt_word) {
476 if (desc->ifmt_string != NULL)
477 printf(" mode %s", desc->ifmt_string);
478 break;
479 }
480
465 /*
466 * Check for the shared subtype descriptions first, then the
467 * type-specific ones.
468 */
469 for (desc = ifm_subtype_shared_descriptions;
470 desc->ifmt_string != NULL; desc++)
471 if (IFM_SUBTYPE(ifmw) == desc->ifmt_word)
472 goto got_subtype;

--- 39 unchanged lines hidden ---
481 /*
482 * Check for the shared subtype descriptions first, then the
483 * type-specific ones.
484 */
485 for (desc = ifm_subtype_shared_descriptions;
486 desc->ifmt_string != NULL; desc++)
487 if (IFM_SUBTYPE(ifmw) == desc->ifmt_word)
488 goto got_subtype;

--- 39 unchanged lines hidden ---