<net/if.h>: Do not include <net/if_var.h> for _KERNEL
authorAaron LI <aly@aaronly.me>
Tue, 20 Mar 2018 08:04:41 +0000 (16:04 +0800)
committerAaron LI <aly@aaronly.me>
Sun, 5 Aug 2018 01:46:04 +0000 (09:46 +0800)
* Clean up an ancient leftover: do not include <net/if_var.h> from <net/if.h>
  for kernel stuffs.

* Adjust various files to include the necessary <net/if_var.h> header.

NOTE:
I have also tested removing the inclusion of <net/if.h> from <net/if_var.h>,
therefore add <net/if.h> inclusion for those files that need it but only
included <net/if_var.h>.  For some files, the header inclusion orderings are
also adjusted.

62 files changed:
sys/bus/u4b/net/if_udav.c
sys/bus/u4b/usb_pf.c
sys/dev/netif/ig_hal/e1000_osdep.c
sys/dev/netif/mii_layer/acphy.c
sys/dev/netif/mii_layer/amphy.c
sys/dev/netif/mii_layer/e1000phy.c
sys/dev/netif/mii_layer/exphy.c
sys/dev/netif/mii_layer/inphy.c
sys/dev/netif/mii_layer/jmphy.c
sys/dev/netif/mii_layer/lxtphy.c
sys/dev/netif/mii_layer/mii_physubr.c
sys/dev/netif/mii_layer/mlphy.c
sys/dev/netif/mii_layer/nsgphy.c
sys/dev/netif/mii_layer/nsphy.c
sys/dev/netif/mii_layer/pnaphy.c
sys/dev/netif/mii_layer/qsphy.c
sys/dev/netif/mii_layer/ruephy.c
sys/dev/netif/mii_layer/tlphy.c
sys/dev/netif/mii_layer/ukphy.c
sys/dev/netif/mii_layer/xmphy.c
sys/dev/netif/ral/if_ral_pci.c
sys/dev/netif/sln/if_sln.c
sys/emulation/ndis/subr_u4bd.c
sys/kern/kern_uuid.c
sys/kern/sys_socket.c
sys/net/altq/altq_red.c
sys/net/altq/altq_rio.c
sys/net/altq/altq_rmclass.c
sys/net/dummynet/ip_dummynet.c
sys/net/dummynet3/ip_dummynet3.c
sys/net/if.h
sys/net/if_clone.c
sys/net/if_media.c
sys/net/if_mib.c
sys/net/if_poll.c
sys/net/ipfw3/ip_fw3.c
sys/net/ipfw3_basic/ip_fw3_sync.c
sys/net/ipfw3_basic/ip_fw3_table.c
sys/net/ipfw3_layer2/ip_fw3_layer2.c
sys/net/ipfw3_layer4/ip_fw3_layer4.c
sys/net/net_osdep.c
sys/net/pf/pf_norm.c
sys/net/pfil.c
sys/net/route.c
sys/net/rtsock.c
sys/netbt/hci.h
sys/netgraph/bridge/ng_bridge.c
sys/netgraph/pppoe/ng_pppoe.c
sys/netinet/tcp_output.c
sys/netproto/802_11/wlan/ieee80211_crypto.c
sys/netproto/802_11/wlan/ieee80211_crypto_none.c
sys/netproto/802_11/wlan/ieee80211_hwmp.c
sys/netproto/802_11/wlan/ieee80211_phy.c
sys/netproto/802_11/wlan/ieee80211_ratectl.c
sys/netproto/802_11/wlan/ieee80211_ratectl_none.c
sys/netproto/802_11/wlan/ieee80211_tdma.c
sys/netproto/802_11/wlan_acl/ieee80211_acl.c
sys/netproto/802_11/wlan_ccmp/ieee80211_crypto_ccmp.c
sys/netproto/802_11/wlan_tkip/ieee80211_crypto_tkip.c
sys/netproto/802_11/wlan_wep/ieee80211_crypto_wep.c
sys/netproto/802_11/wlan_xauth/ieee80211_xauth.c
sys/vfs/nfs/nfs_vfsops.c

index 63c4357..6aaa668 100644 (file)
@@ -60,6 +60,8 @@
 #include <sys/malloc.h>
 #include <sys/priv.h>
 
+#include <net/if.h>
+#include <net/if_var.h>
 #include <net/ifq_var.h>
 
 #include <bus/u4b/usb.h>
index 0fd4658..8329079 100644 (file)
@@ -42,6 +42,7 @@
 #include <sys/socket.h>
 #include <sys/sockio.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_clone.h>
 #include <net/if_types.h>
 #include <net/ifq_var.h>
index 77ee6a5..9045f5e 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/sysctl.h>
-#include <net/if_var.h>
+#include <net/if.h>
 #include <net/if_media.h>
 
 #include "e1000_api.h"
index 1da8ade..cfcc2ad 100644 (file)
@@ -81,6 +81,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index b750391..59d4e7b 100644 (file)
@@ -47,6 +47,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index b858239..6c0df65 100644 (file)
@@ -49,6 +49,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 978cdb5..74e6373 100644 (file)
@@ -80,6 +80,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 27867da..e7a2fe3 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 46b9e1d..f1bce20 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/kernel.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include <dev/netif/mii_layer/mii.h>
index 7ce1931..2c371d6 100644 (file)
@@ -83,6 +83,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index a20be77..210bc3c 100644 (file)
@@ -53,6 +53,7 @@
 #include <sys/thread2.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index ba9d7c9..6b4129e 100644 (file)
@@ -58,6 +58,7 @@
 #include <machine/clock.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index fe51973..b27ddb4 100644 (file)
@@ -56,6 +56,7 @@
 #include <machine/clock.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 2d7a8b2..1f6fdc0 100644 (file)
@@ -82,6 +82,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 2a429db..1dc92ef 100644 (file)
@@ -51,6 +51,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include <machine/clock.h>
index 007f93a..dbd335a 100644 (file)
@@ -83,6 +83,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index b27bc9d..b53822f 100644 (file)
@@ -38,6 +38,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include <dev/netif/mii_layer/mii.h>
index 9de792b..e79fffb 100644 (file)
@@ -84,6 +84,7 @@
 #include <machine/clock.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index 5b795eb..8d3beb2 100644 (file)
@@ -81,6 +81,7 @@
 #include <sys/bus.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include <machine/clock.h>
index 94a5d04..f0aa443 100644 (file)
@@ -47,6 +47,7 @@
 #include <machine/clock.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include "mii.h"
index e275b6d..e51b540 100644 (file)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 
 #include <net/ethernet.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/route.h>
 
index 12b4281..b8ded81 100644 (file)
 
 #include <net/bpf.h>
 #include <net/ethernet.h>
-#include <net/ifq_var.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_arp.h>
 #include <net/if_dl.h>
 #include <net/if_media.h>
-#include <net/if_var.h>
+#include <net/ifq_var.h>
 
 #include <vm/pmap.h>
 #include <vm/vm.h>
index 909c774..8fe2558 100644 (file)
@@ -50,6 +50,7 @@
 #include <sys/queue.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <netproto/802_11/ieee80211_var.h>
 #include <netproto/802_11/ieee80211_ioctl.h>
index 1cc1b01..0901c96 100644 (file)
@@ -39,6 +39,7 @@
 #include <sys/sysproto.h>
 #include <sys/uuid.h>
 #include <sys/gpt.h>
+#include <net/if.h>
 #include <net/if_var.h>
 
 /*
index cac7ffb..daa841d 100644 (file)
@@ -50,6 +50,7 @@
 #include <sys/socketvar2.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 
 struct fileops socketops = {
index 1b70522..0d7a8aa 100644 (file)
@@ -74,6 +74,7 @@
 #include <sys/errno.h>
 
 #include <net/if.h>
+#include <net/ifq_var.h>
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
index 040d97b..2ca0e25 100644 (file)
@@ -73,6 +73,7 @@
 #include <sys/errno.h>
 
 #include <net/if.h>
+#include <net/ifq_var.h>
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
index 953bfef..8b1134c 100644 (file)
@@ -55,6 +55,7 @@
 #include <sys/thread2.h>
 
 #include <net/if.h>
+#include <net/ifq_var.h>
 #include <net/netmsg2.h>
 #include <net/netisr2.h>
 
index 69ae7b9..61169bb 100644 (file)
@@ -62,6 +62,7 @@
 #include <net/netisr2.h>
 #include <net/route.h>
 
+#include <net/if.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
 
index ac5222c..5ba58d2 100644 (file)
@@ -66,6 +66,7 @@
 #include <net/netisr2.h>
 #include <net/route.h>
 
+#include <net/if.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
 
index f8ba564..ce46a88 100644 (file)
@@ -381,11 +381,5 @@ char               *if_indextoname(unsigned int, char *);
 struct if_nameindex *if_nameindex(void);
 void            if_freenameindex(struct if_nameindex *);
 __END_DECLS
-#endif
-
-#ifdef _KERNEL
-/* XXX - this should go away soon. */
-#include <net/if_var.h>
-#endif
-
+#endif /* !_KERNEL */
 #endif /* !_NET_IF_H_ */
index a76dc57..3fc4f2b 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/malloc.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_clone.h>
 
 static LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
index 4be6133..5b03525 100644 (file)
@@ -53,6 +53,7 @@
 #include <sys/malloc.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 /*
index 6a72ba2..9bdc729 100644 (file)
@@ -37,6 +37,7 @@
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_mib.h>
 
 /*
index abe1f70..0c26a29 100644 (file)
@@ -42,6 +42,7 @@
 #include <sys/msgport2.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_poll.h>
 #include <net/netmsg2.h>
 #include <net/netisr2.h>
index 0cf148b..e53964c 100644 (file)
 #include <sys/lock.h>
 #include <sys/mplock2.h>
 
+#include <net/if.h>
+#include <net/radix.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/netmsg2.h>
+
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_divert.h>
 #include <netinet/if_ether.h>
 
-#include <net/if.h>
-#include <net/radix.h>
-#include <net/route.h>
-#include <net/pfil.h>
-#include <net/netmsg2.h>
-
 #include <net/ipfw3/ip_fw.h>
 #include <net/ipfw3/ip_fw3_set.h>
 #include <net/ipfw3_basic/ip_fw3_log.h>
index a3a6ba1..fbf43c2 100644 (file)
 #include <sys/thread2.h>
 #include <sys/mplock2.h>
 
+#include <net/if.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/netmsg2.h>
+#include <net/ethernet.h>
+
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_divert.h>
 #include <netinet/if_ether.h>
 
-#include <net/if.h>
-#include <net/route.h>
-#include <net/pfil.h>
-#include <net/netmsg2.h>
-#include <net/ethernet.h>
-
 #include <net/ipfw3/ip_fw.h>
 #include <net/ipfw3_basic/ip_fw3_sync.h>
 
index 3e7ecb9..c1b54aa 100644 (file)
 #include <sys/thread2.h>
 #include <sys/mplock2.h>
 
+#include <net/if.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/netmsg2.h>
+#include <net/ethernet.h>
+
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_divert.h>
 #include <netinet/if_ether.h>
 
-#include <net/if.h>
-#include <net/route.h>
-#include <net/pfil.h>
-#include <net/netmsg2.h>
-#include <net/ethernet.h>
-
 #include <net/ipfw3/ip_fw.h>
 #include <net/ipfw3_basic/ip_fw3_table.h>
 
index 3326cd1..429b363 100644 (file)
@@ -51,6 +51,7 @@
 #include <net/netmsg2.h>
 #include <net/netisr2.h>
 #include <net/route.h>
+#include <net/if.h>
 
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
index b031815..c1b3e09 100644 (file)
 #include <sys/param.h>
 #include <sys/ucred.h>
 
+#include <net/if.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/netmsg2.h>
+#include <net/netisr2.h>
+#include <net/route.h>
+
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
 #include <netinet/in.h>
 #include <netinet/udp_var.h>
 #include <netinet/if_ether.h>
 
-#include <net/bpf.h>
-#include <net/ethernet.h>
-#include <net/netmsg2.h>
-#include <net/netisr2.h>
-#include <net/route.h>
-
 #include <net/ipfw3/ip_fw.h>
 
 #include "ip_fw3_layer4.h"
index 89a2dc9..a10f079 100644 (file)
@@ -43,6 +43,7 @@
 #include <machine/cpu.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_types.h>
 #include <net/netisr.h>
 #include <net/route.h>
index 7f5ca86..b5c783c 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/time.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_types.h>
 #include <net/bpf.h>
 #include <net/route.h>
index 34f4791..a10038d 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/pfil.h>
 #include <net/netmsg2.h>
 #include <net/netisr2.h>
index ce9a5bc..971a4ac 100644 (file)
@@ -77,6 +77,7 @@
 #include <sys/thread.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 #include <net/netisr.h>
 
index 7850eac..74a5575 100644 (file)
@@ -80,6 +80,7 @@
 #include <sys/socketvar2.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 #include <net/raw_cb.h>
 #include <net/netmsg2.h>
index 598beba..f1cb2a7 100644 (file)
@@ -2365,7 +2365,8 @@ struct btreq {
 
 #ifdef _KERNEL
 
-#include <net/if.h>            /* for struct ifqueue */
+#include <net/if.h>
+#include <net/if_var.h>                /* for struct ifqueue */
 
 struct l2cap_channel;
 struct mbuf;
index 3d9fb21..cac83bd 100644 (file)
@@ -69,6 +69,7 @@
 #include <sys/thread2.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/ethernet.h>
 
 #include <netinet/in.h>
index adeb2bb..f2d476f 100644 (file)
@@ -57,6 +57,7 @@
 #include <sys/syslog.h>
 #include <sys/thread2.h>
 
+#include <net/if.h>
 #include <net/if_var.h>
 #include <net/ethernet.h>
 
index 5496dd1..74358b8 100644 (file)
@@ -80,6 +80,7 @@
 #include <sys/thread.h>
 #include <sys/globaldata.h>
 
+#include <net/if.h>
 #include <net/if_var.h>
 #include <net/route.h>
 #include <net/netmsg2.h>
index f09e3c8..2f3dfdd 100644 (file)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>              /* XXX ETHER_HDR_LEN */
 
index cb5dacc..96915b6 100644 (file)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
index 1cac766..0b78370 100644 (file)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/if_llc.h>
 #include <net/ethernet.h>
index aecd4a0..7feaab3 100644 (file)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 
 #include <net/ethernet.h>
index f4ab11d..2223c39 100644 (file)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/malloc.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 #include <net/route.h>
index 92e9156..cba1fee 100644 (file)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
index 892090d..7653af9 100644 (file)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/if_llc.h>
 #include <net/ethernet.h>
index 7297e9c..d2b37b9 100644 (file)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 #include <net/route.h>
index d95e949..2a96608 100644 (file)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
index a3c5db6..d75107f 100644 (file)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
index 4287346..548e340 100644 (file)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
index a3f66f3..b777795 100644 (file)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 
 #include <net/if.h>
 #include <net/if_media.h>
+#include <net/ifq_var.h>
 #include <net/ethernet.h>
 #include <net/route.h>
 
index c64d44b..3cc5904 100644 (file)
@@ -55,6 +55,7 @@
 #include <vm/vm_extern.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 #include <netinet/in.h>