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