4 ## Make sure to have each variable declaration start
5 ## in the first column, no whitespace allowed.
7 ifeq ($(wildcard $(KLIB_BUILD)/.config),)
8 # These will be ignored by compat autoconf
14 include $(KLIB_BUILD)/.config
17 # We will warn when you don't have MQ support or NET_SCHED enabled.
19 # We could consider just quiting if MQ and NET_SCHED is disabled
20 # as I suspect all users of this package want 802.11e (WME) and
21 # 802.11n (HT) support.
22 ifneq ($(wildcard $(KLIB_BUILD)/Makefile),)
23 COMPAT_LATEST_VERSION = 33
24 KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
25 COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done)
26 $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y))
28 ifdef CONFIG_COMPAT_KERNEL_25
29 $(error "ERROR: compat-wireless by default supports kernels >= 2.6.25, try enabling only one driver though")
32 ifeq ($(CONFIG_CFG80211),y)
33 $(error "ERROR: your kernel has CONFIG_CFG80211=y, you should have it CONFIG_CFG80211=m if you want to use this thing.")
37 # 2.6.27 has FTRACE_DYNAMIC borked, so we will complain if
38 # you have it enabled, otherwise you will very likely run into
40 ifeq ($(KERNEL_SUBLEVEL),27)
41 ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
42 $(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")
46 # This is because with CONFIG_MAC80211 include/linux/skbuff.h will
47 # enable on 2.6.27 a new attribute:
51 # and on 2.6.28 another new attribute:
55 ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 27 && echo yes),yes)
56 ifeq ($(CONFIG_MAC80211),)
57 $(error "ERROR: Your >=2.6.27 kernel has CONFIG_MAC80211 disabled, you should have it CONFIG_MAC80211=m if you want to use this thing.")
61 ifneq ($(KERNELRELEASE),) # This prevents a warning
63 ifeq ($(CONFIG_NET_SCHED),)
64 QOS_REQS_MISSING+=CONFIG_NET_SCHED
67 ifneq ($(QOS_REQS_MISSING),) # Complain about our missing dependencies
68 $(warning "WARNING: You are running a kernel >= 2.6.23, you should enable in it $(QOS_REQS_MISSING) for 802.11[ne] support")
72 endif # kernel Makefile check
74 # These both are needed by compat-wireless || compat-bluetooth so enable them
75 CONFIG_COMPAT_RFKILL=y
77 ifeq ($(CONFIG_MAC80211),y)
78 $(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")
80 CONFIG_COMPAT_WIRELESS=y
81 CONFIG_COMPAT_WIRELESS_MODULES=m
82 CONFIG_COMPAT_VAR_MODULES=m
83 # We could technically separate these but not yet, we only have b44
84 # Note that we don't intend on backporting network drivers that
85 # use Multiqueue as that was a pain to backport to kernels older than
86 # 2.6.27. But -- we could just disable those drivers from kernels
88 CONFIG_COMPAT_NETWORK_MODULES=m
89 CONFIG_COMPAT_NET_USB_MODULES=m
92 # The Bluetooth compatibility only builds on kernels >= 2.6.27 for now
93 ifndef CONFIG_COMPAT_KERNEL_27
95 # we'll ignore compiling bluetooth
97 CONFIG_COMPAT_BLUETOOTH=y
98 CONFIG_COMPAT_BLUETOOTH_MODULES=m
100 endif # Kernel >= 2.6.26
102 ifeq ($(CONFIG_COMPAT_KERNEL_33),y)
103 ifneq ($(CONFIG_FW_LOADER),)
104 CONFIG_COMPAT_FIRMWARE_CLASS=m
109 # Wireless subsystem stuff
112 # CONFIG_MAC80211_DEBUGFS=y
113 # CONFIG_MAC80211_DEBUG_MENU=y
114 # CONFIG_MAC80211_NOINLINE=y
115 # CONFIG_MAC80211_VERBOSE_DEBUG=y
116 # CONFIG_MAC80211_HT_DEBUG=y
117 # CONFIG_MAC80211_TKIP_DEBUG=y
118 # CONFIG_MAC80211_IBSS_DEBUG=y
119 # CONFIG_MAC80211_VERBOSE_PS_DEBUG=y
120 # CONFIG_MAC80211_VERBOSE_MPL_DEBUG=y
121 # CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG=y
122 # CONFIG_MAC80211_DEBUG_COUNTERS=y
123 # CONFIG_MAC80211_DRIVER_API_TRACER=y
125 # choose between pid and minstrel as default rate control algorithm
126 CONFIG_MAC80211_RC_DEFAULT=minstrel
127 CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
128 # CONFIG_MAC80211_RC_DEFAULT_PID=y
129 # This is the one used by our compat-wireless net/mac80211/rate.c
130 # in case you have and old kernel which is overriding this to pid.
131 CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel
132 CONFIG_MAC80211_RC_PID=y
133 CONFIG_MAC80211_RC_MINSTREL=y
134 CONFIG_MAC80211_LEDS=y
136 # enable mesh networking too
137 CONFIG_MAC80211_MESH=y
140 CONFIG_CFG80211_DEFAULT_PS=y
141 # CONFIG_CFG80211_DEBUGFS=y
142 # CONFIG_NL80211_TESTMODE=y
143 # CONFIG_CFG80211_DEVELOPER_WARNINGS=y
144 # CONFIG_CFG80211_REG_DEBUG=y
145 # See below for wext stuff
148 CONFIG_LIB80211_CRYPT_WEP=m
149 CONFIG_LIB80211_CRYPT_CCMP=m
150 CONFIG_LIB80211_CRYPT_TKIP=m
151 # CONFIG_LIB80211_DEBUG=y
153 CONFIG_WIRELESS_OLD_REGULATORY=n
161 # CONFIG_BT_CMTP depends on ISDN_CAPI
162 ifneq ($(CONFIG_BT_CMTP),)
167 ifdef CONFIG_COMPAT_KERNEL_32
168 # Old kernels stil do depend on CONFIG_WIRELESS_EXT
169 # as we add the wireless handler back to the struct
171 ifneq ($(CONFIG_WIRELESS_EXT),)
172 CONFIG_CFG80211_WEXT=y
175 # 2.6.33 and above do not need CONFIG_WIRELESS_EXT, but the
176 # reality is we should select CONFIG_WIRELESS_EXT only if a
177 # driver claims for it (one of the old non-cfg80211 drivers).
178 # Then users could either have this on or off but we leave it
179 # on in case users on >= 2.6.33 still have iwconfig and other
180 # old deprecated userspace applications.
181 CONFIG_CFG80211_WEXT=y
182 endif # CONFIG_COMPAT_KERNEL_32
184 # mac80211 test driver
185 CONFIG_MAC80211_HWSIM=m
188 ifneq ($(CONFIG_PCI),)
191 # CONFIG_ATH5K_DEBUG=y
194 # Note: once ath9k_htc is added we'll have to move
195 # CONFIG_ATH9K_COMMON to an area that doesn't depend on PCI
196 # as you could then have ath9k disabled but ath9k_htc enabled.
197 CONFIG_ATH9K_COMMON=m
198 # CONFIG_ATH9K_DEBUGFS=y
202 # CONFIG_IWLWIFI_DEBUG=y
203 # CONFIG_IWLWIFI_DEBUGFS=y
204 # CONFIG_IWLWIFI_DEVICE_TRACING=y
206 CONFIG_COMPAT_IWL4965=y
213 CONFIG_B43_PCI_AUTOSELECT=y
214 ifneq ($(CONFIG_PCMCIA),)
223 CONFIG_B43LEGACY_HWRNG=y
224 CONFIG_B43LEGACY_PCI_AUTOSELECT=y
225 CONFIG_B43LEGACY_LEDS=y
226 # CONFIG_B43LEGACY_DEBUG=y
227 CONFIG_B43LEGACY_DMA=y
228 CONFIG_B43LEGACY_PIO=y
232 # CONFIG_LIBIPW_DEBUG=y
236 CONFIG_IPW2100_MONITOR=y
237 # CONFIG_IPW2100_DEBUG=y
239 CONFIG_IPW2200_MONITOR=y
240 CONFIG_IPW2200_RADIOTAP=y
241 CONFIG_IPW2200_PROMISCUOUS=y
243 # CONFIG_IPW2200_DEBUG=y
244 # The above enables use a second interface prefixed 'rtap'.
247 # % modprobe ipw2200 rtap_iface=1
248 # % ifconfig rtap0 up
249 # % tethereal -i rtap0
251 # If you do not specify 'rtap_iface=1' as a module parameter then
252 # the rtap interface will not be created and you will need to turn
255 # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
257 ifneq ($(CONFIG_SSB),)
258 # Sonics Silicon Backplane
264 CONFIG_SSB_B43_PCI_BRIDGE=y
265 ifneq ($(CONFIG_PCMCIA),)
266 CONFIG_SSB_PCMCIAHOST=y
269 CONFIG_SSB_DRIVER_PCICORE=y
281 CONFIG_RT2X00_LIB_PCI=m
285 CONFIG_RT2800PCI_PCI=y
288 # Two rt2x00 drivers require firmware: rt61pci and rt73usb. They depend on
289 # CRC to check the firmware. We check here first for the PCI
290 # driver as we're in the PCI section.
291 ifneq ($(CONFIG_CRC_ITU_T),)
293 NEED_RT2X00_FIRMWARE=y
298 # Ethernet drivers go here
307 ifneq ($(CONFIG_PCMCIA),)
309 ifdef CONFIG_COMPAT_KERNEL_27
320 # This is required for some cards
321 CONFIG_EEPROM_93CX6=m
324 ifneq ($(CONFIG_USB),)
326 # CONFIG_ZD1211RW_DEBUG=y
328 # Sorry, rndis_wlan uses cancel_work_sync which is new and can't be done in compat...
330 # Wireless RNDIS USB support (RTL8185 802.11g) A-Link WL54PC
331 # All of these devices are based on Broadcom 4320 chip which
332 # is only wireless RNDIS chip known to date.
333 # Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
334 # it also requires new RNDIS_HOST and CDC_ETHER modules which we add
335 ifdef CONFIG_COMPAT_KERNEL_29
336 CONFIG_USB_COMPAT_USBNET=n
337 CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
338 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
339 CONFIG_USB_NET_COMPAT_CDCETHER=n
341 CONFIG_USB_COMPAT_USBNET=m
342 CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
343 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
344 CONFIG_USB_NET_COMPAT_CDCETHER=m
350 CONFIG_RTL8187_LEDS=y
352 CONFIG_AT76C50X_USB=m
354 ifndef CONFIG_COMPAT_KERNEL_28
359 # RT2500USB does not require firmware
362 CONFIG_RT2X00_LIB_USB=m
364 # RT73USB requires firmware
365 ifneq ($(CONFIG_CRC_ITU_T),)
367 NEED_RT2X00_FIRMWARE=y
370 ifdef CONFIG_COMPAT_KERNEL_27
371 CONFIG_LIBERTAS_THINFIRM_USB=n
372 CONFIG_LIBERTAS_USB=n
375 CONFIG_LIBERTAS_THINFIRM_USB=m
376 CONFIG_LIBERTAS_USB=m
380 endif # end of USB driver list
382 ifneq ($(CONFIG_SPI_MASTER),)
388 ifdef CONFIG_COMPAT_KERNEL_27
389 CONFIG_LIBERTAS_SPI=n
392 CONFIG_LIBERTAS_SPI=m
396 endif # end of SPI driver list
398 ifneq ($(CONFIG_MMC),)
400 CONFIG_SSB_SDIOHOST=y
404 ifdef CONFIG_COMPAT_KERNEL_27
405 CONFIG_LIBERTAS_SDIO=n
408 CONFIG_LIBERTAS_SDIO=m
412 # Activate iwmc3200wifi support only on kernel >= 2.6.29.
413 # iwmc3200wifi uses new netdev_ops api no supported by old kernel.
414 ifndef CONFIG_COMPAT_KERNEL_29
419 endif # end of SDIO driver list
421 # Common rt2x00 requirements
422 ifeq ($(NEED_RT2X00),y)
426 CONFIG_RT2X00_LIB_HT=y
427 CONFIG_RT2X00_LIB_FIRMWARE=y
428 CONFIG_RT2X00_LIB_CRYPTO=y
429 CONFIG_RT2X00_LIB_LEDS=y
430 # CONFIG_RT2X00_DEBUG=y
431 # CONFIG_RT2X00_LIB_DEBUGFS
434 ifeq ($(NEED_RT2X00_FIRMWARE),y)
435 CONFIG_RT2X00_LIB_FIRMWARE=y
450 ifdef CONFIG_COMPAT_KERNEL_27
453 ifeq ($(NEED_LIBERTAS),y)
454 CONFIG_LIBERTAS_THINFIRM=m
456 CONFIG_LIBERTAS_MESH=y
457 # CONFIG_LIBERTAS_DEBUG=y
461 # We need the backported rfkill module on kernel < 2.6.31.
462 # In more recent kernel versions use the in kernel rfkill module.
463 ifdef CONFIG_COMPAT_KERNEL_31
464 CONFIG_RFKILL_BACKPORT=m
465 CONFIG_RFKILL_BACKPORT_LEDS=y
466 CONFIG_RFKILL_BACKPORT_INPUT=y