f649b6bcca6d6756a71fce530c03d59cab9c79d7
[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:=4.19.23-1
14 PKG_RELEASE:=3
15 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.23/
16 PKG_HASH:=703e940b542eb56067fcd847a7c69398dcc9829f34472647eea4211cb2ab3b83
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-spi 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
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 @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||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
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/p54-spi
300 $(call KernelPackage/p54/Default)
301 TITLE+= (SPI)
302 DEPENDS+= @TARGET_omap24xx +kmod-p54-common +p54-spi-firmware
303 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54spi.ko
304 AUTOLOAD:=$(call AutoProbe,p54spi)
305 endef
306
307 define KernelPackage/rsi91x
308 $(call KernelPackage/mac80211/Default)
309 TITLE:=Redpine Signals Inc 91x WLAN driver support
310 DEPENDS+= +kmod-mac80211 +rs9113-firmware
311 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
312 endef
313
314 define KernelPackage/rsi91x-usb
315 $(call KernelPackage/mac80211/Default)
316 TITLE:=Redpine Signals USB bus support
317 DEPENDS+= +kmod-mac80211 +kmod-usb2 +kmod-rsi91x +rs9113-firmware
318 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_usb.ko
319 AUTOLOAD:=$(call AutoProbe,rsi_usb)
320 endef
321
322 define KernelPackage/rsi91x-sdio
323 $(call KernelPackage/mac80211/Default)
324 TITLE:=Redpine Signals SDIO bus support
325 DEPENDS+= +kmod-mac80211 +kmod-mmc +kmod-rsi91x +rs9113-firmware
326 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_sdio.ko
327 AUTOLOAD:=$(call AutoProbe,rsi_sdio)
328 endef
329
330
331 define KernelPackage/wlcore
332 $(call KernelPackage/mac80211/Default)
333 TITLE:=TI common driver part
334 DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT
335 FILES:= \
336 $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
337 $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
338 AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
339 endef
340
341 define KernelPackage/wlcore/description
342 This module contains some common parts needed by TI Wireless drivers.
343 endef
344
345 define KernelPackage/wl12xx
346 $(call KernelPackage/mac80211/Default)
347 TITLE:=Driver for TI WL12xx
348 URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
349 DEPENDS+= +kmod-wlcore +wl12xx-firmware
350 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
351 AUTOLOAD:=$(call AutoProbe,wl12xx)
352 endef
353
354 define KernelPackage/wl12xx/description
355 Kernel modules for TI WL12xx
356 endef
357
358 define KernelPackage/wl18xx
359 $(call KernelPackage/mac80211/Default)
360 TITLE:=Driver for TI WL18xx
361 URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl18xx
362 DEPENDS+= +kmod-wlcore +wl18xx-firmware
363 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
364 AUTOLOAD:=$(call AutoProbe,wl18xx)
365 endef
366
367 define KernelPackage/wl18xx/description
368 Kernel modules for TI WL18xx
369 endef
370
371
372 ZD1211FW_NAME:=zd1211-firmware
373 ZD1211FW_VERSION:=1.4
374 define Download/zd1211rw
375 FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
376 URL:=@SF/zd1211/
377 HASH:=866308f6f59f7075f075d4959dff2ede47735c751251fecd1496df1ba4d338e1
378 endef
379 $(eval $(call Download,zd1211rw))
380
381 define KernelPackage/zd1211rw
382 $(call KernelPackage/mac80211/Default)
383 TITLE:=Zydas ZD1211 support
384 DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
385 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko
386 AUTOLOAD:=$(call AutoProbe,zd1211rw)
387 endef
388
389 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
390 config-y += \
391 CFG80211_DEBUGFS \
392 MAC80211_DEBUGFS
393 endif
394
395 ifdef CONFIG_PACKAGE_MAC80211_TRACING
396 config-y += \
397 IWLWIFI_DEVICE_TRACING
398 endif
399
400 config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
401
402 config-$(call config_package,airo) += AIRO
403
404 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
405 config-$(call config_package,mt7601u) += MT7601U
406 config-y += WL_MEDIATEK
407
408 config-$(call config_package,p54-common) += P54_COMMON
409 config-$(call config_package,p54-pci) += P54_PCI
410 config-$(call config_package,p54-usb) += P54_USB
411 config-$(call config_package,p54-spi) += P54_SPI
412
413 config-$(call config_package,hermes) += HERMES
414 config-$(call config_package,hermes-pci) += PCI_HERMES
415 config-$(call config_package,hermes-plx) += PLX_HERMES
416 config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
417 config-y += HERMES_PRISM
418
419 config-$(call config_package,adm8211) += ADM8211
420 config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
421 config-$(call config_package,wl12xx) += WL12XX
422 config-$(call config_package,wl18xx) += WL18XX
423 config-y += WL_TI WILINK_PLATFORM_DATA
424 config-$(call config_package,zd1211rw) += ZD1211RW
425 config-$(call config_package,rsi91x) += RSI_91X
426 config-$(call config_package,rsi91x-usb) += RSI_USB
427 config-$(call config_package,rsi91x-sdio) += RSI_SDIO
428
429 config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
430
431 MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
432 $(KERNEL_MAKE_FLAGS) \
433 EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
434 KLIB_BUILD="$(LINUX_DIR)" \
435 MODPROBE=true \
436 KLIB=$(TARGET_MODULES_DIR) \
437 KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
438 KBUILD_LDFLAGS_MODULE_PREREQ=
439
440 define ConfigVars
441 $(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
442 ))
443 endef
444
445 define mac80211_config
446 $(call ConfigVars,m)$(call ConfigVars,y)
447 endef
448 $(eval $(call shexport,mac80211_config))
449
450 define Build/Prepare
451 rm -rf $(PKG_BUILD_DIR)
452 mkdir -p $(PKG_BUILD_DIR)
453 $(PKG_UNPACK)
454 $(Build/Patch)
455 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
456 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
457 $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
458 rm -rf \
459 $(PKG_BUILD_DIR)/include/linux/ssb \
460 $(PKG_BUILD_DIR)/include/linux/bcma \
461 $(PKG_BUILD_DIR)/include/net/bluetooth
462
463 rm -f \
464 $(PKG_BUILD_DIR)/include/linux/cordic.h \
465 $(PKG_BUILD_DIR)/include/linux/crc8.h \
466 $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
467 $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
468 $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
469 $(PKG_BUILD_DIR)/include/net/ieee80211.h \
470 $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h
471
472 echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
473 endef
474
475 ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
476 define Build/Compile/kmod
477 rm -rf $(PKG_BUILD_DIR)/modules
478 +$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
479 endef
480 endif
481
482 #do not Build/Configure for EXTERNAL KERNEL
483 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
484 ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
485 define Build/Configure
486 cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
487 cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
488 cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
489 endef
490 endif
491 endif
492
493 define Build/Patch
494 $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
495 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
496 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
497 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
498 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
499 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
500 $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
501 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
502 endef
503
504 define Quilt/Refresh/Package
505 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
506 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
507 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
508 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
509 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
510 $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
511 endef
512
513 define Build/Compile
514 $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
515 $(MAKE) $(MAKE_OPTS) allnoconfig
516 $(call Build/Compile/kmod)
517 endef
518
519 define Build/InstallDev
520 mkdir -p \
521 $(1)/usr/include/mac80211 \
522 $(1)/usr/include/mac80211-backport \
523 $(1)/usr/include/mac80211/ath \
524 $(1)/usr/include/net/mac80211
525 $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
526 $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
527 $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
528 $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
529 rm -f $(1)/usr/include/mac80211-backport/linux/module.h
530 endef
531
532
533 define KernelPackage/b43/install
534 rm -rf $(1)/lib/firmware/
535 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
536 tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
537 else
538 tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
539 endif
540 $(INSTALL_DIR) $(1)/lib/firmware/
541 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
542 $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
543 $(INSTALL_DIR) $(1)/lib/firmware/b43-open/
544 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
545 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
546 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
547 else
548 b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
549 endif
550 ifneq ($(CONFIG_B43_FW_SQUASH),)
551 b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
552 endif
553 endef
554
555 define KernelPackage/cfg80211/install
556 $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
557 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
558 $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
559 $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
560 $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
561 endef
562
563 define KernelPackage/zd1211rw/install
564 $(INSTALL_DIR) $(1)/lib/firmware/zd1211
565 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
566 endef
567
568 $(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
569 $(eval $(call KernelPackage,cfg80211))
570 $(eval $(call KernelPackage,mac80211))