summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/libbsdport/ifmedia.c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-04-23 04:32:07 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-04-23 04:32:07 +0000
commitb2b1e460eb0142fb7e6e2a465dc386cd2a3bf452 (patch)
tree865ee2652a7ba2e1d581ee539413a910ed64d4bc /bsd_eth_drivers/libbsdport/ifmedia.c
parent - added le32enc() (diff)
downloadlibbsdport-b2b1e460eb0142fb7e6e2a465dc386cd2a3bf452.tar.bz2
- added ifmedia_removeall().
Diffstat (limited to 'bsd_eth_drivers/libbsdport/ifmedia.c')
-rw-r--r--bsd_eth_drivers/libbsdport/ifmedia.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bsd_eth_drivers/libbsdport/ifmedia.c b/bsd_eth_drivers/libbsdport/ifmedia.c
index 77c3bd3..719e020 100644
--- a/bsd_eth_drivers/libbsdport/ifmedia.c
+++ b/bsd_eth_drivers/libbsdport/ifmedia.c
@@ -50,6 +50,16 @@ struct ifmedia_entry *ifmen, *ifmep, *ifme;
}
}
+void
+ifmedia_removeall(struct ifmedia *ifm)
+{
+struct ifmedia_entry *ifmen, *ifmep, *ifme;
+ for ( ifmep = LIST_FIRST(&ifm->ifm_list); ifmep; ifmep = ifmen ) {
+ ifmen = LIST_NEXT(ifmep, ifm_list);
+ free(ifmep, M_DEVBUF);
+ }
+}
+
int
ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, u_long cmd)
{