summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-11-30 21:25:57 +0000
committerjhb <jhb@FreeBSD.org>2009-11-30 21:25:57 +0000
commit1f48c677b57a5904d8da8f832f04e5037fb047bb (patch)
tree6d2042bb73a33dbf340665490e45ee7bd49482e4 /sys/net/if.c
parent31cb46fffa46fb0a3aa51830f8a4690eb5d0863b (diff)
downloadFreeBSD-src-1f48c677b57a5904d8da8f832f04e5037fb047bb.zip
FreeBSD-src-1f48c677b57a5904d8da8f832f04e5037fb047bb.tar.gz
Remove if_timer/if_watchdog now that they are no longer used. The space
used by if_timer is reserved for expanding if_index to an int in the future. Reviewed by: rwatson, brooks
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 55de666..003f3ea 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -96,8 +96,6 @@ struct ifindex_entry {
struct ifnet *ife_ifnet;
};
-static int slowtimo_started;
-
SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
@@ -125,10 +123,8 @@ static int ifconf(u_long, caddr_t);
static void if_freemulti(struct ifmultiaddr *);
static void if_init(void *);
static void if_grow(void);
-static void if_check(void *);
static void if_route(struct ifnet *, int flag, int fam);
static int if_setflag(struct ifnet *, int, int, int *, int);
-static void if_slowtimo(void *);
static int if_transmit(struct ifnet *ifp, struct mbuf *m);
static void if_unroute(struct ifnet *, int flag, int fam);
static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
@@ -185,11 +181,6 @@ struct sx ifnet_sxlock;
static if_com_alloc_t *if_com_alloc[256];
static if_com_free_t *if_com_free[256];
-/*
- * System initialization
- */
-SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_check, NULL);
-
MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals");
MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");
MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address");
@@ -375,18 +366,6 @@ if_grow(void)
V_ifindex_table = e;
}
-static void
-if_check(void *dummy __unused)
-{
-
- /*
- * If at least one interface added during boot uses
- * if_watchdog then start the timer.
- */
- if (slowtimo_started)
- if_slowtimo(0);
-}
-
/*
* Allocate a struct ifnet and an index for an interface. A layer 2
* common structure will also be allocated if an allocation routine is
@@ -670,18 +649,6 @@ if_attach_internal(struct ifnet *ifp, int vmove)
/* Announce the interface. */
rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
-
- if (!vmove && ifp->if_watchdog != NULL) {
- if_printf(ifp,
- "WARNING: using obsoleted if_watchdog interface\n");
-
- /*
- * Note that we need if_slowtimo(). If this happens after
- * boot, then call if_slowtimo() directly.
- */
- if (atomic_cmpset_int(&slowtimo_started, 0, 1) && !cold)
- if_slowtimo(0);
- }
}
static void
@@ -1973,39 +1940,6 @@ if_qflush(struct ifnet *ifp)
}
/*
- * Handle interface watchdog timer routines. Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- *
- * XXXRW: Note that because timeouts run with Giant, if_watchdog() is called
- * holding Giant.
- */
-static void
-if_slowtimo(void *arg)
-{
- VNET_ITERATOR_DECL(vnet_iter);
- struct ifnet *ifp;
- int s = splimp();
-
- VNET_LIST_RLOCK_NOSLEEP();
- IFNET_RLOCK_NOSLEEP();
- VNET_FOREACH(vnet_iter) {
- CURVNET_SET(vnet_iter);
- TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
- if (ifp->if_timer == 0 || --ifp->if_timer)
- continue;
- if (ifp->if_watchdog)
- (*ifp->if_watchdog)(ifp);
- }
- CURVNET_RESTORE();
- }
- IFNET_RUNLOCK_NOSLEEP();
- VNET_LIST_RUNLOCK_NOSLEEP();
- splx(s);
- timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
* Map interface name to interface structure pointer, with or without
* returning a reference.
*/
OpenPOWER on IntegriCloud