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).
This commit is contained in:
ozaki-r 2014-11-26 07:22:05 +00:00
parent 1ceb2f0443
commit af22e70cfc
2 changed files with 13 additions and 11 deletions

View File

@ -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 disable)
}
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);

View File

@ -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 {