From c000a700bc812419daa0888634548ef0f7880ec2 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Mon, 10 Aug 2009 16:21:46 -0700 Subject: [PATCH] Add CONFIG_COMPAT_WIRELESS_* kconfig like options This lets us selectively compile backward compatibility stuff instead of linking in empty object files in the end. Signed-off-by: Luis R. Rodriguez --- compat/patches/98-add-compat-wireless.patch | 37 ++++++++-------- config.mk | 47 +++++++++++++++++++++ 2 files changed, 66 insertions(+), 18 deletions(-) diff --git a/compat/patches/98-add-compat-wireless.patch b/compat/patches/98-add-compat-wireless.patch index 791bc6b25626..eb83d40a4b20 100644 --- a/compat/patches/98-add-compat-wireless.patch +++ b/compat/patches/98-add-compat-wireless.patch @@ -2,16 +2,17 @@ This patch file includes the changes required to add compat-wireless support. Besides all the patches in this directory we have our own compat-2.6.*.[ch] files which -help backport more. - -We could optimize this to not compile objects for -kernels >= your own kernel but that may mean -some nasty check here, feel free to add it if you -figure out how. +help backport more. These the respective compat-2.6.2x.c +files get compiled and enabled if you are on older kernels +to bring in support for new features when possible. Lastly, the cfg80211.h change is what allows us to get all compat-2.6.*.h files included. Its our only -point of entry through compat code. +point of entry through compat code. It works because +all drivers we are supporting through there one way +or another depend on cfg80211. New wireless drivers +are either mac80211 drivers or cfg80211 drivers, and +all mac80211 drivesr are cfg80211 drivers. If your driver is not a cfg80211 driver you must ensure you include compat.h then. I think we @@ -24,17 +25,17 @@ added compat.h also for ssb, I forget. ccflags-y += -D__CHECK_ENDIAN__ +# Compat-wireless kernel compatibility code -+cfg80211-y += compat-2.6.22.o -+cfg80211-y += compat-2.6.23.o -+cfg80211-y += compat-2.6.24.o -+cfg80211-y += compat-2.6.25.o -+cfg80211-y += compat-2.6.26.o -+cfg80211-y += compat-2.6.27.o -+cfg80211-y += compat-2.6.28.o -+cfg80211-y += compat-2.6.29.o -+cfg80211-y += compat-2.6.30.o -+cfg80211-y += compat-2.6.31.o -+cfg80211-y += compat-2.6.32.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_22) += compat-2.6.22.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_23) += compat-2.6.23.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_24) += compat-2.6.24.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_25) += compat-2.6.25.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_26) += compat-2.6.26.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_27) += compat-2.6.27.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_28) += compat-2.6.28.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_29) += compat-2.6.29.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_30) += compat-2.6.30.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_31) += compat-2.6.31.o ++cfg80211-$(CONFIG_COMPAT_WIRELESS_32) += compat-2.6.32.o + --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h diff --git a/config.mk b/config.mk index 2dab9afbe36a..a3f65ee85ffa 100644 --- a/config.mk +++ b/config.mk @@ -33,6 +33,53 @@ ifeq ($(CONFIG_CFG80211),y) $(error "ERROR: your kernel has CONFIG_CFG80211=y, you should have it CONFIG_CFG80211=m if you want to use this thing.") endif + +# Compat wireless compat-2.6.2x.c files gets selected here + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 21 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_22=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 22 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_23=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 23 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_24=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 24 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_25=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 25 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_26=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_27=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 27 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_28=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 28 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_29=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 29 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_30=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 30 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_31=y +endif + +ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 31 && echo yes),yes) +CONFIG_COMPAT_WIRELESS_32=y +endif + # 2.6.27 has FTRACE_DYNAMIC borked, so we will complain if # you have it enabled, otherwise you will very likely run into # a kernel panic. -- 2.30.2