3 @@ -17,15 +17,19 @@ ifeq ($(CONFIG_MAC80211),y)
4 $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
8 # We will warn when you don't have MQ support or NET_SCHED enabled.
10 # We could consider just quiting if MQ and NET_SCHED is disabled
11 # as I suspect all users of this package want 802.11e (WME) and
12 # 802.11n (HT) support.
13 -ifeq ($(shell test -e $(KLIB_BUILD)/Makefile && echo yes),yes)
14 -KERNEL_SUBLEVEL = $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
15 +ifneq ($(wildcard $(KLIB_BUILD)/Makefile),)
16 +COMPAT_LATEST_VERSION = 32
17 +KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
18 +COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done)
19 +$(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_WIRELESS_$(ver)=y))
21 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -lt 25 && echo yes),yes)
22 +ifdef CONFIG_COMPAT_WIRELESS_25
23 $(error "ERROR: You should use compat-wireless-2.6-old for older kernels, this one is for kernels >= 2.6.25")
26 @@ -34,56 +38,10 @@ $(error "ERROR: your kernel has CONFIG_C
30 -# Compat wireless compat-2.6.2x.c files gets selected here
32 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 21 && echo yes),yes)
33 -CONFIG_COMPAT_WIRELESS_22=y
36 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 22 && echo yes),yes)
37 -CONFIG_COMPAT_WIRELESS_23=y
40 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 23 && echo yes),yes)
41 -CONFIG_COMPAT_WIRELESS_24=y
44 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 24 && echo yes),yes)
45 -CONFIG_COMPAT_WIRELESS_25=y
48 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 25 && echo yes),yes)
49 -CONFIG_COMPAT_WIRELESS_26=y
52 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
53 -CONFIG_COMPAT_WIRELESS_27=y
56 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 27 && echo yes),yes)
57 -CONFIG_COMPAT_WIRELESS_28=y
60 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 28 && echo yes),yes)
61 -CONFIG_COMPAT_WIRELESS_29=y
64 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 29 && echo yes),yes)
65 -CONFIG_COMPAT_WIRELESS_30=y
68 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 30 && echo yes),yes)
69 -CONFIG_COMPAT_WIRELESS_31=y
72 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 31 && echo yes),yes)
73 -CONFIG_COMPAT_WIRELESS_32=y
76 # 2.6.27 has FTRACE_DYNAMIC borked, so we will complain if
77 # you have it enabled, otherwise you will very likely run into
79 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -eq 27 && echo yes),yes)
80 +ifeq ($(KERNEL_SUBLEVEL),27)
81 ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
82 $(error "ERROR: Your 2.6.27 kernel has CONFIG_DYNAMIC_FTRACE, please upgrade your distribution kernel as newer ones should not have this enabled (and if so report a bug) or remove this warning if you know what you are doing")
84 @@ -291,7 +249,7 @@ endif
86 ifneq ($(CONFIG_PCMCIA),)
88 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
89 +ifdef CONFIG_COMPAT_WIRELESS_27
93 @@ -327,7 +285,7 @@ CONFIG_RTL8187=m
97 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 28 && echo yes),yes)
98 +ifndef CONFIG_COMPAT_WIRELESS_28
102 @@ -343,7 +301,7 @@ CONFIG_RT73USB=m
103 NEED_RT2X00_FIRMWARE=y
106 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
107 +ifdef CONFIG_COMPAT_WIRELESS_27
108 CONFIG_LIBERTAS_THINFIRM_USB=n
109 CONFIG_LIBERTAS_USB=n
111 @@ -360,7 +318,7 @@ ifneq ($(CONFIG_SPI_MASTER),)
115 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
116 +ifdef CONFIG_COMPAT_WIRELESS_27
117 CONFIG_LIBERTAS_SPI=n
120 @@ -372,7 +330,7 @@ endif # end of SPI driver list
122 ifneq ($(CONFIG_MMC),)
124 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
125 +ifdef CONFIG_COMPAT_WIRELESS_27
126 CONFIG_LIBERTAS_SDIO=n
129 @@ -382,7 +340,7 @@ endif
131 # Activate iwmc3200wifi support only on kernel >= 2.6.29.
132 # iwmc3200wifi uses new netdev_ops api no supported by old kernel.
133 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 29 && echo yes),yes)
134 +ifndef CONFIG_COMPAT_WIRELESS_29
138 @@ -425,7 +383,7 @@ CONFIG_SSB=m
142 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 26 && echo yes),yes)
143 +ifdef CONFIG_COMPAT_WIRELESS_27
146 ifeq ($(NEED_LIBERTAS),y)
147 @@ -437,7 +395,7 @@ endif
149 # We need the backported rfkill module on kernel < 2.6.31.
150 # In more recent kernel versions use the in kernel rfkill module.
151 -ifeq ($(shell test $(KERNEL_SUBLEVEL) -le 30 && echo yes),yes)
152 +ifdef CONFIG_COMPAT_WIRELESS_31
153 CONFIG_RFKILL_BACKPORT=m
154 CONFIG_RFKILL_BACKPORT_LEDS=y
155 CONFIG_RFKILL_BACKPORT_INPUT=y