diff options
Diffstat (limited to 'sys/net/if_media.c')
-rw-r--r-- | sys/net/if_media.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sys/net/if_media.c b/sys/net/if_media.c index 1dcf18f..128b924 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,4 +1,5 @@ /* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1997 @@ -47,14 +48,12 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/errno.h> -#include <sys/ioctl.h> #include <sys/socket.h> +#include <sys/sockio.h> #include <sys/malloc.h> #include <net/if.h> #include <net/if_media.h> -#include <net/netisr.h> /* * Compile-time options: @@ -63,7 +62,7 @@ * Useful for debugging newly-ported drivers. */ -struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, +static struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, int flags, int mask)); #ifdef IFMEDIA_DEBUG @@ -90,6 +89,19 @@ ifmedia_init(ifm, dontcare_mask, change_callback, status_callback) ifm->ifm_status = status_callback; } +void +ifmedia_removeall(ifm) + struct ifmedia *ifm; +{ + struct ifmedia_entry *entry; + + for (entry = LIST_FIRST(&ifm->ifm_list); entry; + entry = LIST_FIRST(&ifm->ifm_list)) { + LIST_REMOVE(entry, ifm_list); + free(entry, M_IFADDR); + } +} + /* * Add a media configuration to the list of supported media * for a specific interface instance. @@ -234,8 +246,8 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) */ #ifdef IFMEDIA_DEBUG if (ifmedia_debug) { - printf("ifmedia_ioctl: switching %s to ", - ifp->if_xname); + printf("ifmedia_ioctl: switching %s%d to ", + ifp->if_name, ifp->if_unit); ifmedia_printword(match->ifm_media); } #endif @@ -328,7 +340,7 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) * Find media entry matching a given ifm word. * */ -struct ifmedia_entry * +static struct ifmedia_entry * ifmedia_match(ifm, target, mask) struct ifmedia *ifm; int target; |