diff options
author | jfv <jfv@FreeBSD.org> | 2013-07-12 22:36:26 +0000 |
---|---|---|
committer | jfv <jfv@FreeBSD.org> | 2013-07-12 22:36:26 +0000 |
commit | 634e1583d3b76eff927332ced54509365b20ff53 (patch) | |
tree | 1ecc87a9a3aeb69afa909c0d9efabaea4ef4bc05 | |
parent | 851ca387c5ade2c32eeb8585f5e8a796bcccfc0b (diff) | |
download | FreeBSD-src-634e1583d3b76eff927332ced54509365b20ff53.zip FreeBSD-src-634e1583d3b76eff927332ced54509365b20ff53.tar.gz |
Change the E1000 driver option header handling to match the
ixgbe driver. As it was, when building them as a module INET
and INET6 are not defined. In these drivers it does not cause
a panic, however it does result in different behavior in the
ioctl routine when you are using a module vs static, and I
think the behavior should be the same.
MFC after: 3 days
-rw-r--r-- | sys/dev/e1000/if_em.c | 5 | ||||
-rw-r--r-- | sys/dev/e1000/if_igb.c | 5 | ||||
-rw-r--r-- | sys/dev/e1000/if_lem.c | 5 | ||||
-rw-r--r-- | sys/modules/em/Makefile | 17 | ||||
-rw-r--r-- | sys/modules/igb/Makefile | 17 |
5 files changed, 41 insertions, 8 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 2ca4d3e..140fc77 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -32,10 +32,11 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" #include "opt_inet.h" #include "opt_inet6.h" + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" #endif #include <sys/param.h> diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 3b3c75e..101c73c 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -33,10 +33,11 @@ /*$FreeBSD$*/ -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" #include "opt_inet.h" #include "opt_inet6.h" + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" #include "opt_altq.h" #endif diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index 553aeef..09869eb 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -32,10 +32,11 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" #include "opt_inet.h" #include "opt_inet6.h" + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" #endif #include <sys/param.h> diff --git a/sys/modules/em/Makefile b/sys/modules/em/Makefile index 870d48a..545e37d 100644 --- a/sys/modules/em/Makefile +++ b/sys/modules/em/Makefile @@ -1,7 +1,10 @@ # $FreeBSD$ + +.include <bsd.own.mk> + .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_em -SRCS = device_if.h bus_if.h pci_if.h opt_inet.h +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h SRCS += $(CORE_SRC) $(LEGACY_SRC) SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED) CORE_SRC = if_em.c e1000_osdep.c @@ -18,4 +21,16 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include <bsd.kmod.mk> diff --git a/sys/modules/igb/Makefile b/sys/modules/igb/Makefile index 1906b5a..1ff1274 100644 --- a/sys/modules/igb/Makefile +++ b/sys/modules/igb/Makefile @@ -1,7 +1,10 @@ #$FreeBSD$ + +.include <bsd.own.mk> + .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_igb -SRCS = device_if.h bus_if.h pci_if.h opt_inet.h +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h SRCS += if_igb.c $(SHARED_SRCS) SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c @@ -20,4 +23,16 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 -DSMP # ALTQ. #CFLAGS += -DIGB_LEGACY_TX +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include <bsd.kmod.mk> |