Module Name: src
Committed By: ozaki-r
Date: Wed Nov 26 07:22:05 UTC 2014
Modified Files:
src/sys/net: if.c if.h
Log Message:
Rename if_watchdog to if_slowtimo
if_watchdog callbacks do a little more than what "watchdog" suggests.
Discussed with uebayasi@ (the idea originally from openbsd-tech).
To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/net/if.c
cvs rdiff -u -r1.176 -r1.177 src/sys/net/if.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.294 src/sys/net/if.c:1.295
--- src/sys/net/if.c:1.294 Wed Nov 26 07:06:03 2014
+++ src/sys/net/if.c Wed Nov 26 07:22:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.294 2014/11/26 07:06:03 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.295 2014/11/26 07:22:05 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.294 2014/11/26 07:06:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.295 2014/11/26 07:22:05 ozaki-r Exp $");
#include "opt_inet.h"
@@ -338,7 +338,7 @@ if_nullstop(struct ifnet *ifp, int disab
}
void
-if_nullwatchdog(struct ifnet *ifp)
+if_nullslowtimo(struct ifnet *ifp)
{
/* Nothing. */
@@ -688,7 +688,7 @@ if_deactivate(struct ifnet *ifp)
ifp->if_ioctl = if_nullioctl;
ifp->if_init = if_nullinit;
ifp->if_stop = if_nullstop;
- ifp->if_watchdog = if_nullwatchdog;
+ ifp->if_slowtimo = if_nullslowtimo;
ifp->if_drain = if_nulldrain;
/* No more packets may be enqueued. */
@@ -1494,7 +1494,7 @@ if_up(struct ifnet *ifp)
}
/*
- * Handle interface watchdog timer routines. Called
+ * Handle interface slowtimo timer routines. Called
* from softclock, we decrement timers (if set) and
* call the appropriate interface routine on expiration.
*/
@@ -1507,8 +1507,8 @@ if_slowtimo(void *arg)
IFNET_FOREACH(ifp) {
if (ifp->if_timer == 0 || --ifp->if_timer)
continue;
- if (ifp->if_watchdog != NULL)
- (*ifp->if_watchdog)(ifp);
+ if (ifp->if_slowtimo != NULL)
+ (*ifp->if_slowtimo)(ifp);
}
splx(s);
callout_reset(&if_slowtimo_ch, hz / IFNET_SLOWHZ, if_slowtimo, NULL);
Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.176 src/sys/net/if.h:1.177
--- src/sys/net/if.h:1.176 Wed Nov 26 07:06:03 2014
+++ src/sys/net/if.h Wed Nov 26 07:22:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.176 2014/11/26 07:06:03 ozaki-r Exp $ */
+/* $NetBSD: if.h,v 1.177 2014/11/26 07:22:05 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -253,7 +253,7 @@ typedef struct ifnet {
int if_pcount; /* number of promiscuous listeners */
struct bpf_if *if_bpf; /* packet filter structure */
u_short if_index; /* numeric abbreviation for this if */
- short if_timer; /* time 'til if_watchdog called */
+ short if_timer; /* time 'til if_slowtimo called */
short if_flags; /* up/down, broadcast, etc. */
short if__pad1; /* be nice to m68k ports */
struct if_data if_data; /* statistics and other data about if */
@@ -274,8 +274,9 @@ typedef struct ifnet {
(struct ifnet *);
void (*if_stop) /* stop routine */
(struct ifnet *, int);
- void (*if_watchdog) /* timer routine */
+ void (*if_slowtimo) /* timer routine */
(struct ifnet *);
+#define if_watchdog if_slowtimo
void (*if_drain) /* routine to release resources */
(struct ifnet *);
struct ifaltq if_snd; /* output queue (includes altq) */
@@ -925,7 +926,8 @@ void if_nullstart(struct ifnet *);
int if_nullioctl(struct ifnet *, u_long, void *);
int if_nullinit(struct ifnet *);
void if_nullstop(struct ifnet *, int);
-void if_nullwatchdog(struct ifnet *);
+void if_nullslowtimo(struct ifnet *);
+#define if_nullwatchdog if_nullslowtimo
void if_nulldrain(struct ifnet *);
#else
struct if_nameindex {