Change the if_reset vector to if_init, and add an if_stop. if_stop

also takes an argument indicating whether or not the interface should
also be disabled (i.e. power removed, resources freed, etc.)
This commit is contained in:
thorpej 2000-10-11 16:52:34 +00:00
parent 0eafc475c2
commit 7e2259325b
2 changed files with 19 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.74 2000/10/07 03:41:38 itojun Exp $ */ /* $NetBSD: if.c,v 1.75 2000/10/11 16:52:34 thorpej Exp $ */
/*- /*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -214,13 +214,22 @@ if_nullioctl(ifp, cmd, data)
} }
int int
if_nullreset(ifp) if_nullinit(ifp)
struct ifnet *ifp; struct ifnet *ifp;
{ {
return (ENXIO); return (ENXIO);
} }
void
if_nullstop(ifp, disable)
struct ifnet *ifp;
int disable;
{
/* Nothing. */
}
void void
if_nullwatchdog(ifp) if_nullwatchdog(ifp)
struct ifnet *ifp; struct ifnet *ifp;
@ -357,7 +366,8 @@ if_deactivate(ifp)
ifp->if_input = if_nullinput; ifp->if_input = if_nullinput;
ifp->if_start = if_nullstart; ifp->if_start = if_nullstart;
ifp->if_ioctl = if_nullioctl; ifp->if_ioctl = if_nullioctl;
ifp->if_reset = if_nullreset; ifp->if_init = if_nullinit;
ifp->if_stop = if_nullstop;
ifp->if_watchdog = if_nullwatchdog; ifp->if_watchdog = if_nullwatchdog;
ifp->if_drain = if_nulldrain; ifp->if_drain = if_nulldrain;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.h,v 1.53 2000/07/20 18:40:27 thorpej Exp $ */ /* $NetBSD: if.h,v 1.54 2000/10/11 16:52:34 thorpej Exp $ */
/*- /*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -240,8 +240,10 @@ struct ifnet { /* and the entries */
__P((struct ifnet *)); __P((struct ifnet *));
int (*if_ioctl) /* ioctl routine */ int (*if_ioctl) /* ioctl routine */
__P((struct ifnet *, u_long, caddr_t)); __P((struct ifnet *, u_long, caddr_t));
int (*if_reset) /* XXX bus reset routine */ int (*if_init) /* init routine */
__P((struct ifnet *)); __P((struct ifnet *));
void (*if_stop) /* stop routine */
__P((struct ifnet *, int));
void (*if_watchdog) /* timer routine */ void (*if_watchdog) /* timer routine */
__P((struct ifnet *)); __P((struct ifnet *));
void (*if_drain) /* routine to release resources */ void (*if_drain) /* routine to release resources */
@ -628,7 +630,8 @@ int if_nulloutput __P((struct ifnet *, struct mbuf *,
void if_nullinput __P((struct ifnet *, struct mbuf *)); void if_nullinput __P((struct ifnet *, struct mbuf *));
void if_nullstart __P((struct ifnet *)); void if_nullstart __P((struct ifnet *));
int if_nullioctl __P((struct ifnet *, u_long, caddr_t)); int if_nullioctl __P((struct ifnet *, u_long, caddr_t));
int if_nullreset __P((struct ifnet *)); int if_nullinit __P((struct ifnet *));
void if_nullstop __P((struct ifnet *, int));
void if_nullwatchdog __P((struct ifnet *)); void if_nullwatchdog __P((struct ifnet *));
void if_nulldrain __P((struct ifnet *)); void if_nulldrain __P((struct ifnet *));
#else #else