sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.
This commit is contained in:
riastradh 2021-12-31 14:25:22 +00:00
parent daeb11daa6
commit b4d088cb3b
23 changed files with 84 additions and 84 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_enet.c,v 1.33 2020/12/31 02:16:14 uwe Exp $ */ /* $NetBSD: if_enet.c,v 1.34 2021/12/31 14:25:22 riastradh Exp $ */
/* /*
* Copyright (c) 2014 Ryo Shimizu <ryo@nerv.org> * Copyright (c) 2014 Ryo Shimizu <ryo@nerv.org>
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.33 2020/12/31 02:16:14 uwe Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.34 2021/12/31 14:25:22 riastradh Exp $");
#include "vlan.h" #include "vlan.h"
@ -1027,7 +1027,7 @@ enet_ioctl(struct ifnet *ifp, u_long command, void *data)
error = 0; error = 0;
switch (command) { switch (command) {
case SIOCSIFCAP: case SIOCSIFCAP:
error = (*ifp->if_init)(ifp); error = if_init(ifp);
break; break;
case SIOCADDMULTI: case SIOCADDMULTI:
case SIOCDELMULTI: case SIOCDELMULTI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ave.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /* $NetBSD: if_ave.c,v 1.22 2021/12/31 14:25:22 riastradh Exp $ */
/*- /*-
* Copyright (c) 2020 The NetBSD Foundation, Inc. * Copyright (c) 2020 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.22 2021/12/31 14:25:22 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -790,7 +790,7 @@ ave_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_scx.c,v 1.33 2021/12/21 21:30:49 nisimura Exp $ */ /* $NetBSD: if_scx.c,v 1.34 2021/12/31 14:25:22 riastradh Exp $ */
/*- /*-
* Copyright (c) 2020 The NetBSD Foundation, Inc. * Copyright (c) 2020 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
#define NOT_MP_SAFE 0 #define NOT_MP_SAFE 0
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_scx.c,v 1.33 2021/12/21 21:30:49 nisimura Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_scx.c,v 1.34 2021/12/31 14:25:22 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -1201,7 +1201,7 @@ scx_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break; break;
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunxi_emac.c,v 1.34 2021/11/07 19:21:33 jmcneill Exp $ */ /* $NetBSD: sunxi_emac.c,v 1.35 2021/12/31 14:25:22 riastradh Exp $ */
/*- /*-
* Copyright (c) 2016-2017 Jared McNeill <jmcneill@invisible.ca> * Copyright (c) 2016-2017 Jared McNeill <jmcneill@invisible.ca>
@ -33,7 +33,7 @@
#include "opt_net_mpsafe.h" #include "opt_net_mpsafe.h"
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.34 2021/11/07 19:21:33 jmcneill Exp $"); __KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.35 2021/12/31 14:25:22 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -932,7 +932,7 @@ sunxi_emac_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if ((ifp->if_flags & IFF_RUNNING) != 0) { else if ((ifp->if_flags & IFF_RUNNING) != 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp425_if_npe.c,v 1.49 2021/12/31 14:24:38 riastradh Exp $ */ /* $NetBSD: ixp425_if_npe.c,v 1.50 2021/12/31 14:25:22 riastradh Exp $ */
/*- /*-
* Copyright (c) 2006 Sam Leffler. All rights reserved. * Copyright (c) 2006 Sam Leffler. All rights reserved.
@ -28,7 +28,7 @@
#if 0 #if 0
__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
#endif #endif
__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.49 2021/12/31 14:24:38 riastradh Exp $"); __KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.50 2021/12/31 14:25:22 riastradh Exp $");
/* /*
* Intel XScale NPE Ethernet driver. * Intel XScale NPE Ethernet driver.
@ -1435,7 +1435,7 @@ npeioctl(struct ifnet *ifp, u_long cmd, void *data)
* If interface is marked up and it is stopped, then * If interface is marked up and it is stopped, then
* start it. * start it.
*/ */
error = (*ifp->if_init)(ifp); error = if_init(ifp);
} else if ((ifp->if_flags & IFF_UP) != 0) { } else if ((ifp->if_flags & IFF_UP) != 0) {
u_short diff; u_short diff;
@ -1457,7 +1457,7 @@ npeioctl(struct ifnet *ifp, u_long cmd, void *data)
* any other flags that affect the hardware * any other flags that affect the hardware
* state. * state.
*/ */
error = (*ifp->if_init)(ifp); error = if_init(ifp);
} }
} }
sc->sc_if_flags = ifp->if_flags; sc->sc_if_flags = ifp->if_flags;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cemac.c,v 1.23 2020/06/28 12:43:00 skrll Exp $ */ /* $NetBSD: if_cemac.c,v 1.24 2021/12/31 14:25:22 riastradh Exp $ */
/* /*
* Copyright (c) 2015 Genetec Corporation. All rights reserved. * Copyright (c) 2015 Genetec Corporation. All rights reserved.
@ -40,7 +40,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.23 2020/06/28 12:43:00 skrll Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.24 2021/12/31 14:25:22 riastradh Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -759,7 +759,7 @@ cemac_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) { if (cmd == SIOCSIFCAP) {
error = (*ifp->if_init)(ifp); error = if_init(ifp);
} else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) } else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcmgenet.c,v 1.10 2021/08/10 15:28:44 jmcneill Exp $ */ /* $NetBSD: bcmgenet.c,v 1.11 2021/12/31 14:25:22 riastradh Exp $ */
/*- /*-
* Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca> * Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca>
@ -34,7 +34,7 @@
#include "opt_ddb.h" #include "opt_ddb.h"
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.10 2021/08/10 15:28:44 jmcneill Exp $"); __KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.11 2021/12/31 14:25:22 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -916,7 +916,7 @@ genet_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if ((ifp->if_flags & IFF_RUNNING) != 0) { else if ((ifp->if_flags & IFF_RUNNING) != 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: dm9000.c,v 1.32 2021/12/05 07:26:35 msaitoh Exp $ */ /* $NetBSD: dm9000.c,v 1.33 2021/12/31 14:25:22 riastradh Exp $ */
/* /*
* Copyright (c) 2009 Paul Fleischer * Copyright (c) 2009 Paul Fleischer
@ -833,7 +833,7 @@ dme_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break; break;
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags && IFF_RUNNING) { else if (ifp->if_flags && IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtl8169.c,v 1.168 2021/09/04 19:27:43 jakllsch Exp $ */ /* $NetBSD: rtl8169.c,v 1.169 2021/12/31 14:25:22 riastradh Exp $ */
/* /*
* Copyright (c) 1997, 1998-2003 * Copyright (c) 1997, 1998-2003
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.168 2021/09/04 19:27:43 jakllsch Exp $"); __KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.169 2021/12/31 14:25:22 riastradh Exp $");
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */ /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
/* /*
@ -2130,7 +2130,7 @@ re_ioctl(struct ifnet *ifp, u_long command, void *data)
error = 0; error = 0;
if (command == SIOCSIFCAP) if (command == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (command != SIOCADDMULTI && command != SIOCDELMULTI) else if (command != SIOCADDMULTI && command != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) else if (ifp->if_flags & IFF_RUNNING)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_dge.c,v 1.62 2021/12/05 04:32:36 msaitoh Exp $ */ /* $NetBSD: if_dge.c,v 1.63 2021/12/31 14:25:23 riastradh Exp $ */
/* /*
* Copyright (c) 2004, SUNET, Swedish University Computer Network. * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@ -80,7 +80,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.62 2021/12/05 04:32:36 msaitoh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.63 2021/12/31 14:25:23 riastradh Exp $");
@ -1453,7 +1453,7 @@ dge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
else if ((error = ifioctl_common(ifp, cmd, data)) != ENETRESET) else if ((error = ifioctl_common(ifp, cmd, data)) != ENETRESET)
break; break;
else if (ifp->if_flags & IFF_UP) else if (ifp->if_flags & IFF_UP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else else
error = 0; error = 0;
break; break;
@ -1488,7 +1488,7 @@ dge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iwn.c,v 1.97 2021/09/19 11:37:01 andvar Exp $ */ /* $NetBSD: if_iwn.c,v 1.98 2021/12/31 14:25:23 riastradh Exp $ */
/* $OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $ */ /* $OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $ */
/*- /*-
@ -22,7 +22,7 @@
* adapters. * adapters.
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.97 2021/09/19 11:37:01 andvar Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.98 2021/12/31 14:25:23 riastradh Exp $");
#define IWN_USE_RBUF /* Use local storage for RX */ #define IWN_USE_RBUF /* Use local storage for RX */
#undef IWN_HWCRYPTO /* XXX does not even compile yet */ #undef IWN_HWCRYPTO /* XXX does not even compile yet */
@ -973,7 +973,7 @@ iwn_power(int why, void *arg)
s = splnet(); s = splnet();
ifp = &sc->sc_ic.ic_if; ifp = &sc->sc_ic.ic_if;
if (ifp->if_flags & IFF_UP) { if (ifp->if_flags & IFF_UP) {
ifp->if_init(ifp); if_init(ifp);
if (ifp->if_flags & IFF_RUNNING) if (ifp->if_flags & IFF_RUNNING)
ifp->if_start(ifp); ifp->if_start(ifp);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_kse.c,v 1.57 2021/05/08 00:27:02 thorpej Exp $ */ /* $NetBSD: if_kse.c,v 1.58 2021/12/31 14:25:23 riastradh Exp $ */
/*- /*-
* Copyright (c) 2006 The NetBSD Foundation, Inc. * Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.57 2021/05/08 00:27:02 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.58 2021/12/31 14:25:23 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -689,7 +689,7 @@ kse_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break; break;
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sip.c,v 1.183 2021/10/21 13:21:54 andvar Exp $ */ /* $NetBSD: if_sip.c,v 1.184 2021/12/31 14:25:23 riastradh Exp $ */
/*- /*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.183 2021/10/21 13:21:54 andvar Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.184 2021/12/31 14:25:23 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -1869,7 +1869,7 @@ sipcom_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wm.c,v 1.725 2021/12/23 17:05:49 hannken Exp $ */ /* $NetBSD: if_wm.c,v 1.726 2021/12/31 14:25:23 riastradh Exp $ */
/* /*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@ -82,7 +82,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.725 2021/12/23 17:05:49 hannken Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.726 2021/12/31 14:25:23 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h" #include "opt_net_mpsafe.h"
@ -3675,7 +3675,7 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = 0; error = 0;
if (cmd == SIOCSIFCAP) if (cmd == SIOCSIFCAP)
error = (*ifp->if_init)(ifp); error = if_init(ifp);
else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI) else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
; ;
else if (ifp->if_flags & IFF_RUNNING) { else if (ifp->if_flags & IFF_RUNNING) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe.c,v 1.301 2021/12/24 05:11:04 msaitoh Exp $ */ /* $NetBSD: ixgbe.c,v 1.302 2021/12/31 14:25:23 riastradh Exp $ */
/****************************************************************************** /******************************************************************************
@ -64,7 +64,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.301 2021/12/24 05:11:04 msaitoh Exp $"); __KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.302 2021/12/31 14:25:23 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -5770,7 +5770,7 @@ ixgbe_sysctl_dmac(SYSCTLFN_ARGS)
/* Re-initialize hardware if it's already running */ /* Re-initialize hardware if it's already running */
if (ifp->if_flags & IFF_RUNNING) if (ifp->if_flags & IFF_RUNNING)
ifp->if_init(ifp); if_init(ifp);
return (0); return (0);
} }
@ -6103,7 +6103,7 @@ ixgbe_sysctl_eee_state(SYSCTLFN_ARGS)
} }
/* Restart auto-neg */ /* Restart auto-neg */
ifp->if_init(ifp); if_init(ifp);
device_printf(dev, "New EEE state: %d\n", new_eee); device_printf(dev, "New EEE state: %d\n", new_eee);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_urtw.c,v 1.24 2020/03/15 23:04:51 thorpej Exp $ */ /* $NetBSD: if_urtw.c,v 1.25 2021/12/31 14:25:24 riastradh Exp $ */
/* $OpenBSD: if_urtw.c,v 1.39 2011/07/03 15:47:17 matthew Exp $ */ /* $OpenBSD: if_urtw.c,v 1.39 2011/07/03 15:47:17 matthew Exp $ */
/*- /*-
@ -19,7 +19,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.24 2020/03/15 23:04:51 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.25 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_usb.h" #include "opt_usb.h"
@ -1045,7 +1045,7 @@ urtw_media_change(struct ifnet *ifp)
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
(IFF_UP | IFF_RUNNING)) (IFF_UP | IFF_RUNNING))
ifp->if_init(ifp); if_init(ifp);
return 0; return 0;
} }
@ -2395,7 +2395,7 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
case IFF_UP|IFF_RUNNING: case IFF_UP|IFF_RUNNING:
break; break;
case IFF_UP: case IFF_UP:
ifp->if_init(ifp); if_init(ifp);
break; break;
case IFF_RUNNING: case IFF_RUNNING:
urtw_stop(ifp, 1); urtw_stop(ifp, 1);
@ -2419,7 +2419,7 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
if (error == ENETRESET) { if (error == ENETRESET) {
if (IS_RUNNING(ifp) && if (IS_RUNNING(ifp) &&
(ic->ic_roaming != IEEE80211_ROAMING_MANUAL)) (ic->ic_roaming != IEEE80211_ROAMING_MANUAL))
ifp->if_init(ifp); if_init(ifp);
error = 0; error = 0;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_agr.c,v 1.53 2021/09/30 03:15:25 yamaguchi Exp $ */ /* $NetBSD: if_agr.c,v 1.54 2021/12/31 14:25:24 riastradh Exp $ */
/*- /*-
* Copyright (c)2005 YAMAMOTO Takashi, * Copyright (c)2005 YAMAMOTO Takashi,
@ -27,7 +27,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.53 2021/09/30 03:15:25 yamaguchi Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.54 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -759,7 +759,7 @@ agrport_cleanup(struct agr_softc *sc, struct agr_port *port)
memcpy(LLADDR(ifp_port->if_sadl), port->port_origlladdr, memcpy(LLADDR(ifp_port->if_sadl), port->port_origlladdr,
ifp_port->if_addrlen); ifp_port->if_addrlen);
if (ifp_port->if_init != NULL) { if (ifp_port->if_init != NULL) {
error = (*ifp_port->if_init)(ifp_port); error = if_init(ifp_port);
} }
#else #else
union { union {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_bridge.c,v 1.185 2021/12/31 14:24:50 riastradh Exp $ */ /* $NetBSD: if_bridge.c,v 1.186 2021/12/31 14:25:24 riastradh Exp $ */
/* /*
* Copyright 2001 Wasabi Systems, Inc. * Copyright 2001 Wasabi Systems, Inc.
@ -80,7 +80,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.185 2021/12/31 14:24:50 riastradh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.186 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -618,7 +618,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
* If interface is marked up and it is stopped, then * If interface is marked up and it is stopped, then
* start it. * start it.
*/ */
error = (*ifp->if_init)(ifp); error = if_init(ifp);
break; break;
default: default:
break; break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ethersubr.c,v 1.308 2021/12/31 14:24:38 riastradh Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.309 2021/12/31 14:25:24 riastradh Exp $ */
/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -61,7 +61,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.308 2021/12/31 14:24:38 riastradh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.309 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -1468,7 +1468,7 @@ ether_ioctl_reinit(struct ethercom *ec)
* If interface is marked up and it is stopped, then * If interface is marked up and it is stopped, then
* start it. * start it.
*/ */
return (*ifp->if_init)(ifp); return if_init(ifp);
case IFF_UP | IFF_RUNNING: case IFF_UP | IFF_RUNNING:
error = 0; error = 0;
if (ec->ec_ifflags_cb != NULL) { if (ec->ec_ifflags_cb != NULL) {
@ -1479,10 +1479,10 @@ ether_ioctl_reinit(struct ethercom *ec)
* changes in any other flags that * changes in any other flags that
* affect the hardware state. * affect the hardware state.
*/ */
return (*ifp->if_init)(ifp); return if_init(ifp);
} }
} else } else
error = (*ifp->if_init)(ifp); error = if_init(ifp);
return error; return error;
case 0: case 0:
break; break;
@ -1514,7 +1514,7 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
&& (ifp->if_flags & (IFF_UP | IFF_RUNNING)) != && (ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
(IFF_UP | IFF_RUNNING)) { (IFF_UP | IFF_RUNNING)) {
ifp->if_flags |= IFF_UP; ifp->if_flags |= IFF_UP;
if ((error = (*ifp->if_init)(ifp)) != 0) if ((error = if_init(ifp)) != 0)
return error; return error;
} }
#ifdef INET #ifdef INET
@ -1539,7 +1539,7 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
return error; return error;
else if (ifp->if_flags & IFF_UP) { else if (ifp->if_flags & IFF_UP) {
/* Make sure the device notices the MTU change. */ /* Make sure the device notices the MTU change. */
return (*ifp->if_init)(ifp); return if_init(ifp);
} else } else
return 0; return 0;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ieee1394subr.c,v 1.66 2020/08/28 06:23:42 ozaki-r Exp $ */ /* $NetBSD: if_ieee1394subr.c,v 1.67 2021/12/31 14:25:24 riastradh Exp $ */
/* /*
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.66 2020/08/28 06:23:42 ozaki-r Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.67 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -681,13 +681,13 @@ ieee1394_ioctl(struct ifnet *ifp, u_long cmd, void *data)
switch (ifa->ifa_addr->sa_family) { switch (ifa->ifa_addr->sa_family) {
#ifdef INET #ifdef INET
case AF_INET: case AF_INET:
if ((error = (*ifp->if_init)(ifp)) != 0) if ((error = if_init(ifp)) != 0)
break; break;
arp_ifinit(ifp, ifa); arp_ifinit(ifp, ifa);
break; break;
#endif /* INET */ #endif /* INET */
default: default:
error = (*ifp->if_init)(ifp); error = if_init(ifp);
break; break;
} }
break; break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wg.c,v 1.66 2021/12/31 14:24:38 riastradh Exp $ */ /* $NetBSD: if_wg.c,v 1.67 2021/12/31 14:25:24 riastradh Exp $ */
/* /*
* Copyright (C) Ryota Ozaki <ozaki.ryota@gmail.com> * Copyright (C) Ryota Ozaki <ozaki.ryota@gmail.com>
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.66 2021/12/31 14:24:38 riastradh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.67 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_altq_enabled.h" #include "opt_altq_enabled.h"
@ -4619,7 +4619,7 @@ wg_ioctl(struct ifnet *ifp, u_long cmd, void *data)
(ifp->if_flags & (IFF_UP | IFF_RUNNING)) != (ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
(IFF_UP | IFF_RUNNING)) { (IFF_UP | IFF_RUNNING)) {
ifp->if_flags |= IFF_UP; ifp->if_flags |= IFF_UP;
error = ifp->if_init(ifp); error = if_init(ifp);
} }
return error; return error;
case SIOCADDMULTI: case SIOCADDMULTI:
@ -4673,7 +4673,7 @@ wg_ioctl(struct ifnet *ifp, u_long cmd, void *data)
* If interface is marked up and it is stopped, then * If interface is marked up and it is stopped, then
* start it. * start it.
*/ */
error = (*ifp->if_init)(ifp); error = if_init(ifp);
break; break;
default: default:
break; break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_lagg.c,v 1.27 2021/12/31 14:24:38 riastradh Exp $ */ /* $NetBSD: if_lagg.c,v 1.28 2021/12/31 14:25:24 riastradh Exp $ */
/* /*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@ -20,7 +20,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.27 2021/12/31 14:24:38 riastradh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.28 2021/12/31 14:25:24 riastradh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -725,7 +725,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break; break;
case IFF_UP: case IFF_UP:
case IFF_UP | IFF_RUNNING: case IFF_UP | IFF_RUNNING:
error = ifp->if_init(ifp); error = if_init(ifp);
break; break;
} }
@ -2115,7 +2115,7 @@ lagg_port_setsadl(struct lagg_port *lp, uint8_t *lladdr,
if (ifp_port->if_init != NULL) { if (ifp_port->if_init != NULL) {
error = 0; error = 0;
if (ISSET(ifp_port->if_flags, IFF_RUNNING)) if (ISSET(ifp_port->if_flags, IFF_RUNNING))
error = ifp_port->if_init(ifp_port); error = if_init(ifp_port);
if (error != 0) { if (error != 0) {
lagg_log(lp->lp_softc, LOG_WARNING, lagg_log(lp->lp_softc, LOG_WARNING,
@ -2161,7 +2161,7 @@ lagg_port_unsetsadl(struct lagg_port *lp)
if (ifp_port->if_init != NULL) { if (ifp_port->if_init != NULL) {
error = 0; error = 0;
if (ISSET(ifp_port->if_flags, IFF_RUNNING)) if (ISSET(ifp_port->if_flags, IFF_RUNNING))
error = ifp_port->if_init(ifp_port); error = if_init(ifp_port);
if (error != 0) { if (error != 0) {
lagg_log(lp->lp_softc, LOG_WARNING, lagg_log(lp->lp_softc, LOG_WARNING,
@ -2385,7 +2385,7 @@ lagg_port_setup(struct lagg_softc *sc,
lagg_port_syncvlan(sc, lp); lagg_port_syncvlan(sc, lp);
if (stopped) { if (stopped) {
error = ifp_port->if_init(ifp_port); error = if_init(ifp_port);
if (error != 0) if (error != 0)
goto remove_port; goto remove_port;
} }
@ -2415,7 +2415,7 @@ restore_ipv6lla:
KASSERT(IFNET_LOCKED(ifp_port)); KASSERT(IFNET_LOCKED(ifp_port));
lagg_in6_ifdetach(ifp_port); lagg_in6_ifdetach(ifp_port);
if (stopped) { if (stopped) {
if (ifp_port->if_init(ifp_port) != 0) { if (if_init(ifp_port) != 0) {
lagg_log(sc, LOG_WARNING, lagg_log(sc, LOG_WARNING,
"couldn't re-start port %s\n", "couldn't re-start port %s\n",
ifp_port->if_xname); ifp_port->if_xname);
@ -2487,7 +2487,7 @@ lagg_port_teardown(struct lagg_softc *sc, struct lagg_port *lp,
IFNET_UNLOCK(ifp_port); IFNET_UNLOCK(ifp_port);
if (stopped) { if (stopped) {
ifp_port->if_init(ifp_port); if_init(ifp_port);
} }
if (is_ifdetach == false) { if (is_ifdetach == false) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: link_proto.c,v 1.39 2019/09/25 09:53:37 ozaki-r Exp $ */ /* $NetBSD: link_proto.c,v 1.40 2021/12/31 14:25:24 riastradh Exp $ */
/*- /*-
* Copyright (c) 1982, 1986, 1993 * Copyright (c) 1982, 1986, 1993
@ -32,7 +32,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.39 2019/09/25 09:53:37 ozaki-r Exp $"); __KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.40 2021/12/31 14:25:24 riastradh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -255,7 +255,7 @@ link_control(struct socket *so, unsigned long cmd, void *data,
return error; return error;
else if ((ifp->if_flags & IFF_RUNNING) != 0 && else if ((ifp->if_flags & IFF_RUNNING) != 0 &&
ifp->if_init != NULL) ifp->if_init != NULL)
return (*ifp->if_init)(ifp); return if_init(ifp);
else else
return 0; return 0;
default: default: