1/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */
2/* $Id: if_media.c,v 1.6 1998/02/09 06:09:54 eivind Exp $ */
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
--- 73 unchanged lines hidden (view full) ---
84 LIST_INIT(&ifm->ifm_list);
85 ifm->ifm_cur = NULL;
86 ifm->ifm_media = 0;
87 ifm->ifm_mask = dontcare_mask; /* IF don't-care bits */
88 ifm->ifm_change = change_callback;
89 ifm->ifm_status = status_callback;
90}
91
92void
93ifmedia_removeall(ifm)
94 struct ifmedia *ifm;
95{
96 struct ifmedia_entry *entry;
97
98 for (entry = LIST_FIRST(&ifm->ifm_list); entry;
99 entry = LIST_FIRST(&ifm->ifm_list)) {
100 LIST_REMOVE(entry, ifm_list);
101 free(entry, M_IFADDR);
102 }
103}
104
105/*
106 * Add a media configuration to the list of supported media
107 * for a specific interface instance.
108 */
109void
110ifmedia_add(ifm, mword, data, aux)
111 struct ifmedia *ifm;
112 int mword;
--- 375 unchanged lines hidden ---
2/* $Id: if_media.c,v 1.6 1998/02/09 06:09:54 eivind Exp $ */
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
--- 73 unchanged lines hidden (view full) ---
84 LIST_INIT(&ifm->ifm_list);
85 ifm->ifm_cur = NULL;
86 ifm->ifm_media = 0;
87 ifm->ifm_mask = dontcare_mask; /* IF don't-care bits */
88 ifm->ifm_change = change_callback;
89 ifm->ifm_status = status_callback;
90}
91
92void
93ifmedia_removeall(ifm)
94 struct ifmedia *ifm;
95{
96 struct ifmedia_entry *entry;
97
98 for (entry = LIST_FIRST(&ifm->ifm_list); entry;
99 entry = LIST_FIRST(&ifm->ifm_list)) {
100 LIST_REMOVE(entry, ifm_list);
101 free(entry, M_IFADDR);
102 }
103}
104
105/*
106 * Add a media configuration to the list of supported media
107 * for a specific interface instance.
108 */
109void
110ifmedia_add(ifm, mword, data, aux)
111 struct ifmedia *ifm;
112 int mword;
--- 375 unchanged lines hidden ---