OpenWrt v21.02.1: adjust config defaults
[openwrt/openwrt.git] / package / kernel / mac80211 / Makefile
1 #
2 # Copyright (C) 2007-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=mac80211
12
13 PKG_VERSION:=5.10.68-1
14 PKG_RELEASE:=1
15 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.68/
16 PKG_HASH:=bba161b0084590c677a84b80993709e388a3c478f29ed0c475d4fce1b9162968
17
18 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
19 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
23
24 PKG_DRIVERS = \
25 adm8211 \
26 airo \
27 hermes hermes-pci hermes-pcmcia hermes-plx\
28 lib80211 \
29 mac80211-hwsim \
30 mt7601u \
31 p54-common p54-pci p54-usb \
32 rsi91x rsi91x-usb rsi91x-sdio\
33 wlcore wl12xx wl18xx \
34 zd1211rw
35
36 PKG_CONFIG_DEPENDS:= \
37 CONFIG_PACKAGE_kmod-mac80211 \
38 CONFIG_PACKAGE_CFG80211_TESTMODE \
39 CONFIG_PACKAGE_MAC80211_DEBUGFS \
40 CONFIG_PACKAGE_MAC80211_MESH \
41 CONFIG_PACKAGE_MAC80211_TRACING \
42 CONFIG_PACKAGE_IWLWIFI_DEBUG \
43 CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
44 CONFIG_PACKAGE_RTLWIFI_DEBUG \
45
46 include $(INCLUDE_DIR)/package.mk
47
48 WMENU:=Wireless Drivers
49
50 define KernelPackage/mac80211/Default
51 SUBMENU:=$(WMENU)
52 URL:=https://wireless.wiki.kernel.org/
53 MAINTAINER:=Felix Fietkau <nbd@nbd.name>
54 endef
55
56 config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
57
58 config-y:= \
59 WLAN \
60 CFG80211_WEXT \
61 CFG80211_CERTIFICATION_ONUS \
62 MAC80211_RC_MINSTREL \
63 MAC80211_RC_MINSTREL_HT \
64 MAC80211_RC_MINSTREL_VHT \
65 MAC80211_RC_DEFAULT_MINSTREL \
66 WLAN_VENDOR_ADMTEK \
67 WLAN_VENDOR_ATH \
68 WLAN_VENDOR_ATMEL \
69 WLAN_VENDOR_BROADCOM \
70 WLAN_VENDOR_CISCO \
71 WLAN_VENDOR_INTEL \
72 WLAN_VENDOR_INTERSIL \
73 WLAN_VENDOR_MARVELL \
74 WLAN_VENDOR_MEDIATEK \
75 WLAN_VENDOR_RALINK \
76 WLAN_VENDOR_REALTEK \
77 WLAN_VENDOR_RSI \
78 WLAN_VENDOR_ST \
79 WLAN_VENDOR_TI \
80 WLAN_VENDOR_ZYDAS \
81
82 config-$(call config_package,cfg80211) += CFG80211
83 config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE
84
85 config-$(call config_package,mac80211) += MAC80211
86 config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
87
88 include ath.mk
89 include broadcom.mk
90 include intel.mk
91 include marvell.mk
92 include ralink.mk
93 include realtek.mk
94
95 PKG_CONFIG_DEPENDS += \
96 $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS))
97
98 define KernelPackage/cfg80211
99 $(call KernelPackage/mac80211/Default)
100 TITLE:=cfg80211 - wireless configuration API
101 DEPENDS+= +iw +wireless-regdb
102 ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
103 FILES:= \
104 $(PKG_BUILD_DIR)/compat/compat.ko \
105 $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
106 endef
107
108 define KernelPackage/cfg80211/description
109 cfg80211 is the Linux wireless LAN (802.11) configuration API.
110 endef
111
112 define KernelPackage/cfg80211/config
113 if PACKAGE_kmod-cfg80211
114
115 config PACKAGE_CFG80211_TESTMODE
116 bool "Enable testmode command support"
117 default n
118 help
119 This is typically used for tests and calibration during
120 manufacturing, or vendor specific debugging features
121
122 endif
123 endef
124
125
126 define KernelPackage/mac80211
127 $(call KernelPackage/mac80211/Default)
128 TITLE:=Linux 802.11 Wireless Networking Stack
129 # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
130 DEPENDS+= +kmod-cfg80211 +hostapd-common
131 KCONFIG:=\
132 CONFIG_AVERAGE=y
133 FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
134 ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
135 MENU:=1
136 endef
137
138 define KernelPackage/mac80211/config
139 if PACKAGE_kmod-mac80211
140
141 config PACKAGE_MAC80211_DEBUGFS
142 bool "Export mac80211 internals in DebugFS"
143 select KERNEL_DEBUG_FS
144 default y
145 help
146 Select this to see extensive information about
147 the internal state of mac80211 in debugfs.
148
149 config PACKAGE_MAC80211_TRACING
150 bool "Enable tracing (mac80211 and supported drivers)"
151 select KERNEL_FTRACE
152 select KERNEL_ENABLE_DEFAULT_TRACERS
153 default n
154 help
155 Select this to enable tracing of mac80211 and
156 related wifi drivers (using trace-cmd).
157
158 config PACKAGE_MAC80211_MESH
159 bool "Enable 802.11s mesh support"
160 default y
161
162 endif
163 endef
164
165 define KernelPackage/mac80211/description
166 Generic IEEE 802.11 Networking Stack (mac80211)
167 endef
168
169 define KernelPackage/adm8211
170 $(call KernelPackage/mac80211/Default)
171 TITLE:=ADMTek 8211 support
172 DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
173 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/admtek/adm8211.ko
174 AUTOLOAD:=$(call AutoProbe,adm8211)
175 endef
176
177 define KernelPackage/airo
178 $(call KernelPackage/mac80211/Default)
179 TITLE:=Cisco Aironet driver
180 DEPENDS+=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-cfg80211 @TARGET_x86 @BROKEN
181 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/cisco/airo.ko
182 AUTOLOAD:=$(call AutoProbe,airo)
183 endef
184
185 define KernelPackage/airo/description
186 Kernel support for Cisco Aironet cards
187 endef
188
189 define KernelPackage/hermes
190 $(call KernelPackage/mac80211/Default)
191 TITLE:=Hermes 802.11b chipset support
192 DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +kmod-crypto-michael-mic
193 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco.ko
194 AUTOLOAD:=$(call AutoProbe,orinoco)
195 endef
196
197 define KernelPackage/hermes/description
198 Kernel support for Hermes 802.11b chipsets
199 endef
200
201 define KernelPackage/hermes-pci
202 $(call KernelPackage/mac80211/Default)
203 TITLE:=Intersil Prism 2.5 PCI support
204 DEPENDS:=@PCI_SUPPORT +kmod-hermes
205 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_pci.ko
206 AUTOLOAD:=$(call AutoProbe,orinoco_pci)
207 endef
208
209 define KernelPackage/hermes-pci/description
210 Kernel modules for Intersil Prism 2.5 PCI support
211 endef
212
213 define KernelPackage/hermes-plx
214 $(call KernelPackage/mac80211/Default)
215 TITLE:=PLX9052 based PCI adaptor
216 DEPENDS:=@PCI_SUPPORT +kmod-hermes
217 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_plx.ko
218 AUTOLOAD:=$(call AutoProbe,orinoco_plx)
219 endef
220
221 define KernelPackage/hermes-plx/description
222 Kernel modules for Hermes in PLX9052 based PCI adaptors
223 endef
224
225 define KernelPackage/hermes-pcmcia
226 $(call KernelPackage/mac80211/Default)
227 TITLE:=Hermes based PCMCIA adaptors
228 DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes +kmod-pcmcia-core
229 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_cs.ko
230 AUTOLOAD:=$(call AutoProbe,orinoco_cs)
231 endef
232
233 define KernelPackage/hermes-pcmcia/description
234 Kernel modules for Hermes based PCMCIA adaptors
235 endef
236
237
238 define KernelPackage/lib80211
239 $(call KernelPackage/mac80211/Default)
240 TITLE:=802.11 Networking stack
241 DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash +kmod-crypto-ccm
242 FILES:= \
243 $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
244 $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
245 $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
246 $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
247 AUTOLOAD:=$(call AutoProbe, \
248 lib80211 \
249 lib80211_crypt_wep \
250 lib80211_crypt_ccmp \
251 lib80211_crypt_tkip \
252 )
253 endef
254
255 define KernelPackage/lib80211/description
256 Kernel modules for 802.11 Networking stack
257 Includes:
258 - lib80211
259 - lib80211_crypt_wep
260 - lib80211_crypt_tkip
261 - lib80211_crytp_ccmp
262 endef
263
264
265 define KernelPackage/mac80211-hwsim
266 $(call KernelPackage/mac80211/Default)
267 TITLE:=mac80211 HW simulation device
268 DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT
269 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
270 AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
271 endef
272
273
274 define KernelPackage/mt7601u
275 $(call KernelPackage/mac80211/Default)
276 TITLE:=MT7601U-based USB dongles Wireless Driver
277 DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware
278 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
279 AUTOLOAD:=$(call AutoProbe,mt7601u)
280 endef
281
282 define KernelPackage/p54/Default
283 $(call KernelPackage/mac80211/Default)
284 TITLE:=Prism54 Drivers
285 endef
286
287 define KernelPackage/p54/description
288 Kernel module for Prism54 chipsets (mac80211)
289 endef
290
291 define KernelPackage/p54-common
292 $(call KernelPackage/p54/Default)
293 DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt
294 TITLE+= (COMMON)
295 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko
296 endef
297
298 define KernelPackage/p54-pci
299 $(call KernelPackage/p54/Default)
300 TITLE+= (PCI)
301 DEPENDS+= @PCI_SUPPORT +kmod-p54-common +p54-pci-firmware
302 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54pci.ko
303 AUTOLOAD:=$(call AutoProbe,p54pci)
304 endef
305
306 define KernelPackage/p54-usb
307 $(call KernelPackage/p54/Default)
308 TITLE+= (USB)
309 DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common +p54-usb-firmware
310 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54usb.ko
311 AUTOLOAD:=$(call AutoProbe,p54usb)
312 endef
313
314 define KernelPackage/rsi91x
315 $(call KernelPackage/mac80211/Default)
316 TITLE:=Redpine Signals Inc 91x WLAN driver support
317 DEPENDS+= +kmod-mac80211 +rs9113-firmware +@DRIVER_11N_SUPPORT
318 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
319 endef
320
321 define KernelPackage/rsi91x-usb
322 $(call KernelPackage/mac80211/Default)
323 TITLE:=Redpine Signals USB bus support
324 DEPENDS+=@USB_SUPPORT +kmod-usb-core +kmod-mac80211 +kmod-rsi91x +rs9113-firmware
325 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_usb.ko
326 AUTOLOAD:=$(call AutoProbe,rsi_usb)
327 endef
328
329 define KernelPackage/rsi91x-sdio
330 $(call KernelPackage/mac80211/Default)
331 TITLE:=Redpine Signals SDIO bus support
332 DEPENDS+= +kmod-mac80211 +kmod-mmc +kmod-rsi91x +rs9113-firmware
333 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_sdio.ko
334 AUTOLOAD:=$(call AutoProbe,rsi_sdio)
335 endef
336
337
338 define KernelPackage/wlcore
339 $(call KernelPackage/mac80211/Default)
340 TITLE:=TI common driver part
341 DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT
342 FILES:= \
343 $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
344 $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
345 AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
346 endef
347
348 define KernelPackage/wlcore/description
349 This module contains some common parts needed by TI Wireless drivers.
350 endef
351
352 define KernelPackage/wl12xx
353 $(call KernelPackage/mac80211/Default)
354 TITLE:=Driver for TI WL12xx
355 URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
356 DEPENDS+= +kmod-wlcore +wl12xx-firmware
357 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
358 AUTOLOAD:=$(call AutoProbe,wl12xx)
359 endef
360
361 define KernelPackage/wl12xx/description
362 Kernel modules for TI WL12xx
363 endef
364
365 define KernelPackage/wl18xx
366 $(call KernelPackage/mac80211/Default)
367 TITLE:=Driver for TI WL18xx
368 URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl18xx
369 DEPENDS+= +kmod-wlcore +wl18xx-firmware
370 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
371 AUTOLOAD:=$(call AutoProbe,wl18xx)
372 endef
373
374 define KernelPackage/wl18xx/description
375 Kernel modules for TI WL18xx
376 endef
377
378
379 ZD1211FW_NAME:=zd1211-firmware
380 ZD1211FW_VERSION:=1.4
381 define Download/zd1211rw
382 FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
383 URL:=@SF/zd1211/
384 HASH:=866308f6f59f7075f075d4959dff2ede47735c751251fecd1496df1ba4d338e1
385 endef
386 $(eval $(call Download,zd1211rw))
387
388 define KernelPackage/zd1211rw
389 $(call KernelPackage/mac80211/Default)
390 TITLE:=Zydas ZD1211 support
391 DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
392 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko
393 AUTOLOAD:=$(call AutoProbe,zd1211rw)
394 endef
395
396 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
397 config-y += \
398 CFG80211_DEBUGFS \
399 MAC80211_DEBUGFS
400 endif
401
402 ifdef CONFIG_PACKAGE_MAC80211_TRACING
403 config-y += \
404 IWLWIFI_DEVICE_TRACING
405 endif
406
407 config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
408
409 config-$(call config_package,airo) += AIRO
410
411 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
412 config-$(call config_package,mt7601u) += MT7601U
413 config-y += WL_MEDIATEK
414
415 config-$(call config_package,p54-common) += P54_COMMON
416 config-$(call config_package,p54-pci) += P54_PCI
417 config-$(call config_package,p54-usb) += P54_USB
418
419 config-$(call config_package,hermes) += HERMES
420 config-$(call config_package,hermes-pci) += PCI_HERMES
421 config-$(call config_package,hermes-plx) += PLX_HERMES
422 config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
423 config-y += HERMES_PRISM
424
425 config-$(call config_package,adm8211) += ADM8211
426 config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
427 config-$(call config_package,wl12xx) += WL12XX
428 config-$(call config_package,wl18xx) += WL18XX
429 config-y += WL_TI WILINK_PLATFORM_DATA
430 config-$(call config_package,zd1211rw) += ZD1211RW
431 config-$(call config_package,rsi91x) += RSI_91X
432 config-$(call config_package,rsi91x-usb) += RSI_USB
433 config-$(call config_package,rsi91x-sdio) += RSI_SDIO
434
435 config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
436
437 MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
438 $(KERNEL_MAKE_FLAGS) \
439 EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
440 KLIB_BUILD="$(LINUX_DIR)" \
441 MODPROBE=true \
442 KLIB=$(TARGET_MODULES_DIR) \
443 KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
444 KBUILD_LDFLAGS_MODULE_PREREQ=
445
446 define ConfigVars
447 $(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
448 ))
449 endef
450
451 define mac80211_config
452 $(call ConfigVars,m)$(call ConfigVars,y)
453 endef
454 $(eval $(call shexport,mac80211_config))
455
456 define Build/Prepare
457 rm -rf $(PKG_BUILD_DIR)
458 mkdir -p $(PKG_BUILD_DIR)
459 $(PKG_UNPACK)
460 $(Build/Patch)
461 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
462 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
463 $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
464 rm -rf \
465 $(PKG_BUILD_DIR)/include/linux/ssb \
466 $(PKG_BUILD_DIR)/include/linux/bcma \
467 $(PKG_BUILD_DIR)/include/net/bluetooth
468
469 rm -f \
470 $(PKG_BUILD_DIR)/include/linux/cordic.h \
471 $(PKG_BUILD_DIR)/include/linux/crc8.h \
472 $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
473 $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
474 $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
475 $(PKG_BUILD_DIR)/include/net/ieee80211.h \
476 $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h
477
478 echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
479 endef
480
481 ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
482 define Build/Compile/kmod
483 rm -rf $(PKG_BUILD_DIR)/modules
484 +$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
485 endef
486 endif
487
488 #do not Build/Configure for EXTERNAL KERNEL
489 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
490 ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
491 define Build/Configure
492 cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
493 cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
494 cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
495 endef
496 endif
497 endif
498
499 define Build/Patch
500 $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
501 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
502 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
503 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
504 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
505 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
506 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
507 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
508 endef
509
510 define Quilt/Refresh/Package
511 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
512 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
513 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
514 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
515 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
516 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
517 endef
518
519 define Build/Compile
520 $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
521 $(MAKE) $(MAKE_OPTS) allnoconfig
522 $(call Build/Compile/kmod)
523 endef
524
525 define Build/InstallDev
526 mkdir -p \
527 $(1)/usr/include/mac80211 \
528 $(1)/usr/include/mac80211-backport \
529 $(1)/usr/include/mac80211/ath \
530 $(1)/usr/include/net/mac80211
531 $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
532 $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
533 $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
534 $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
535 rm -f $(1)/usr/include/mac80211-backport/linux/module.h
536 endef
537
538
539 define KernelPackage/cfg80211/install
540 $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
541 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
542 $(INSTALL_DATA) ./files/lib/netifd/mac80211.sh $(1)/lib/netifd
543 $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
544 $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
545 $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
546 endef
547
548 define KernelPackage/zd1211rw/install
549 $(INSTALL_DIR) $(1)/lib/firmware/zd1211
550 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
551 endef
552
553 $(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
554 $(eval $(call KernelPackage,cfg80211))
555 $(eval $(call KernelPackage,mac80211))