From c68824132a46f94b6de849d6717fd277842b553f Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 18 Apr 2012 22:49:04 +0200 Subject: [PATCH] ef(4): Bring in some small fixes from FreeBSD. Gets rid of a superfluous extra opt_ef.h file in /usr/obj hierarchy. --- sys/net/ef/Makefile | 24 +++++++++++++----------- sys/net/ef/if_ef.c | 9 +++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/net/ef/Makefile b/sys/net/ef/Makefile index 78788e6e6d..361870c4eb 100644 --- a/sys/net/ef/Makefile +++ b/sys/net/ef/Makefile @@ -1,32 +1,34 @@ -# $FreeBSD: src/sys/modules/if_ef/Makefile,v 1.2.2.2 2001/04/25 11:24:03 ru Exp $ +# $FreeBSD: src/sys/modules/if_ef/Makefile,v 1.16 2009/06/08 19:57:35 bz Exp $ -KMOD= if_ef -SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h - -# If you need only limited number of frames comment out unneeded ones -# this will reduce number of visible devices -ETHER_II= -ETHER_8023= -ETHER_8022= -ETHER_SNAP= +KMOD= if_ef +SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h .if defined(EFDEBUG) CFLAGS+= -DEF_DEBUG .endif .if !defined(BUILDING_WITH_KERNEL) +# If you need only a limited number of frames, uncomment the needed ones. +# This will reduce the number of visible devices. Note that the module +# will support all frames by default, i.e., when all are commented here. +#ETHER_II= +#ETHER_8023= +#ETHER_8022= +#ETHER_SNAP= + opt_inet.h: echo "#define INET 1" > ${.TARGET} opt_ipx.h: echo "#define IPX 1" > ${.TARGET} -.endif opt_ef.h: + :> ${.TARGET} .for frame in ETHER_II ETHER_8023 ETHER_8022 ETHER_SNAP .if defined(${frame}) echo "#define ${frame} 1" >> ${.TARGET} .endif .endfor +.endif .include diff --git a/sys/net/ef/if_ef.c b/sys/net/ef/if_ef.c index 8893645d46..5abe9fe931 100644 --- a/sys/net/ef/if_ef.c +++ b/sys/net/ef/if_ef.c @@ -62,6 +62,15 @@ #include #endif +/* If none of the supported layers is enabled explicitly enable them all */ +#if !defined(ETHER_II) && !defined(ETHER_8023) && !defined(ETHER_8022) && \ + !defined(ETHER_SNAP) +#define ETHER_II 1 +#define ETHER_8023 1 +#define ETHER_8022 1 +#define ETHER_SNAP 1 +#endif + /* internal frame types */ #define ETHER_FT_EII 0 /* Ethernet_II - default */ #define ETHER_FT_8023 1 /* 802.3 (Novell) */ -- 2.41.0