b07ccdeee2bc00c0ebe78cc49edd86c9b5539360
[openwrt-10.03/.git] / package / mac80211 / Makefile
1 #
2 # Copyright (C) 2007-2010 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:=2011-02-07
14 PKG_RELEASE:=1
15 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
16 PKG_MD5SUM:=a194610426c81ed5ad71ee83330c9669
17
18 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
19 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_CONFIG_DEPENDS:= \
23         CONFIG_PACKAGE_kmod-mac80211 \
24         CONFIG_PACKAGE_MAC80211_DEBUGFS \
25         CONFIG_PACKAGE_ATH_DEBUG \
26         CONFIG_ATH_USER_REGD \
27
28 CARL9170_FW_VERSION:=1.9.2
29
30 include $(INCLUDE_DIR)/package.mk
31
32 WMENU:=Wireless Drivers
33
34 define KernelPackage/mac80211/Default
35   SUBMENU:=$(WMENU)
36   URL:=http://linuxwireless.org/
37   MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
38   DEPENDS:=@(!(TARGET_avr32||TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN) @!LINUX_2_4
39 endef
40
41 define KernelPackage/cfg80211
42   $(call KernelPackage/mac80211/Default)
43   TITLE:=cfg80211 - wireless configuration API
44   DEPENDS+= +wireless-tools +iw +crda
45 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.33)),1)
46   FILES:= \
47         $(PKG_BUILD_DIR)/compat/compat.ko \
48         $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
49   AUTOLOAD:=$(call AutoLoad,20,compat cfg80211)
50 else
51   FILES:= \
52         $(PKG_BUILD_DIR)/compat/compat.ko \
53         $(PKG_BUILD_DIR)/compat/compat_firmware_class.ko \
54         $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
55   AUTOLOAD:=$(call AutoLoad,20,compat compat_firmware_class cfg80211)
56 endif
57 endef
58
59 define KernelPackage/cfg80211/description
60 cfg80211 is the Linux wireless LAN (802.11) configuration API.
61 endef
62
63 define KernelPackage/mac80211
64   $(call KernelPackage/mac80211/Default)
65   TITLE:=Linux 802.11 Wireless Networking Stack
66   DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211
67   FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
68   AUTOLOAD:=$(call AutoLoad,21,mac80211)
69   MENU:=1
70 endef
71
72 define KernelPackage/mac80211/config
73         menu "Configuration"
74                 depends on PACKAGE_kmod-mac80211
75
76         config PACKAGE_MAC80211_DEBUGFS
77                 bool "Export mac80211 internals in DebugFS"
78                 default y
79                 help
80                   Select this to see extensive information about
81                   the internal state of mac80211 in debugfs.
82
83                   Say N unless you know you need this.
84
85         endmenu
86 endef
87
88 define KernelPackage/mac80211/description
89 Generic IEEE 802.11 Networking Stack (mac80211)
90 endef
91
92 # Prism54 drivers
93 P54PCIFW:=2.13.12.0.arm
94 P54USBFW:=2.13.24.0.lm87.arm
95 P54SPIFW:=2.13.0.0.a.13.14.arm
96 CARL9170_FW:=carl9170-1.fw
97
98 define Download/p54usb
99   FILE:=$(P54USBFW)
100   URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
101   MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
102 endef
103 $(eval $(call Download,p54usb))
104
105 define Download/p54pci
106   FILE:=$(P54PCIFW)
107   URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
108   MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
109 endef
110 $(eval $(call Download,p54pci))
111
112 define Download/p54spi
113   FILE:=$(P54SPIFW)
114   URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
115   MD5SUM:=42661f8ecbadd88012807493f596081d
116 endef
117 $(eval $(call Download,p54spi))
118
119 define Download/carl9170
120   FILE:=$(CARL9170_FW)-$(CARL9170_FW_VERSION)
121   URL:=http://downloads.openwrt.org/sources/
122   MD5SUM:=9e33ac39dcd610aa1ad80bbf4f1abccf
123 endef
124 $(eval $(call Download,carl9170))
125
126 define KernelPackage/p54/Default
127   $(call KernelPackage/mac80211/Default)
128   TITLE:=Prism54 Drivers
129 endef
130
131 define KernelPackage/p54/description
132   Kernel module for Prism54 chipsets (mac80211)
133 endef
134
135 define KernelPackage/p54-common
136   $(call KernelPackage/p54/Default)
137   DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-crc-ccitt
138   TITLE+= (COMMON)
139   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
140   AUTOLOAD:=$(call AutoLoad,30,p54common)
141 endef
142
143 define KernelPackage/p54-pci
144   $(call KernelPackage/p54/Default)
145   TITLE+= (PCI)
146   DEPENDS+= @PCI_SUPPORT +kmod-p54-common
147   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
148   AUTOLOAD:=$(call AutoLoad,31,p54pci)
149 endef
150
151 define KernelPackage/p54-usb
152   $(call KernelPackage/p54/Default)
153   TITLE+= (USB)
154   DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
155   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
156   AUTOLOAD:=$(call AutoLoad,31,p54usb)
157 endef
158
159 define KernelPackage/p54-spi
160   $(call KernelPackage/p54/Default)
161   TITLE+= (SPI)
162   DEPENDS+= @TARGET_omap24xx +kmod-p54-common
163   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
164   AUTOLOAD:=$(call AutoLoad,31,p54spi)
165 endef
166
167 # Ralink rt2x00 drivers
168 RT61FW:=RT61_Firmware_V1.2.zip
169 RT71FW:=RT71W_Firmware_V1.8.zip
170 RT2860FW:=RT2860_Firmware_V11.zip
171 RT2870FW:=RT2870_Firmware_V8.zip
172
173 define Download/rt61
174   FILE:=$(RT61FW)
175   URL:=http://www.ralinktech.com.tw/data/
176   MD5SUM:=d4c690c93b470bc9a681297c2adc6281
177 endef
178 $(eval $(call Download,rt61))
179
180 define Download/rt71w
181   FILE:=$(RT71FW)
182   URL:=http://www.ralinktech.com.tw/data/
183   MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
184 endef
185 $(eval $(call Download,rt71w))
186
187 define Download/rt2860
188   FILE:=$(RT2860FW)
189   URL:=http://www.ralinktech.com.tw/data/drivers
190   MD5SUM:=440a81756a52c53528f16faa41c40124
191 endef
192 $(eval $(call Download,rt2860))
193
194 define Download/rt2870
195   FILE:=$(RT2870FW)
196   URL:=http://www.ralinktech.com.tw/data/drivers
197   MD5SUM:=a7aae1d8cfd68e4d86a73000df0b6584
198 endef
199 $(eval $(call Download,rt2870))
200
201 AR9170FW:=ar9170.fw
202
203 define Download/ar9170
204   FILE:=$(AR9170FW)
205   URL:=http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170
206   MD5SUM:=34feec4ec0eae3bb92c7c1ea2dfb4530
207 endef
208 $(eval $(call Download,ar9170))
209
210 NEED_RT2X00_LIB_CRYPTO:=y
211 NEED_RT2X00_LIB_FIRMWARE:=y
212 NEED_RT2X00_LIB_HT:=y
213 NEED_RT2X00_LIB_LEDS:=y
214
215 define KernelPackage/rt2x00/Default
216   $(call KernelPackage/mac80211/Default)
217   TITLE:=Ralink Drivers for RT2x00 cards
218 endef
219
220 define KernelPackage/rt2x00-lib
221 $(call KernelPackage/rt2x00/Default)
222   DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-crc-itu-t
223   TITLE+= (LIB)
224   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
225   AUTOLOAD:=$(call AutoLoad,25,rt2x00lib)
226   MENU:=1
227 endef
228
229 define KernelPackage/rt2x00-lib/config
230         menu "Configuration"
231                 depends PACKAGE_kmod-rt2x00-lib
232
233         config PACKAGE_RT2X00_LIB_DEBUGFS
234                 bool "Enable rt2x00 debugfs support"
235                 depends PACKAGE_MAC80211_DEBUGFS
236                 help
237                   Enable creation of debugfs files for the rt2x00 drivers.
238                   These debugfs files support both reading and writing of the
239                   most important register types of the rt2x00 hardware.
240
241         config PACKAGE_RT2X00_DEBUG
242                 bool "Enable rt2x00 debug output"
243                 help
244                   Enable debugging output for all rt2x00 modules
245
246         endmenu
247 endef
248
249 define KernelPackage/rt2x00-pci
250 $(call KernelPackage/rt2x00/Default)
251   DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
252   TITLE+= (PCI)
253   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
254   AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
255 endef
256
257 define KernelPackage/rt2x00-usb
258 $(call KernelPackage/rt2x00/Default)
259   DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
260   TITLE+= (USB)
261   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
262   AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
263 endef
264
265 define KernelPackage/rt2x00-soc
266 $(call KernelPackage/rt2x00/Default)
267   DEPENDS+= @TARGET_ramips +kmod-rt2x00-lib
268   TITLE+= (SoC)
269   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko
270   AUTOLOAD:=$(call AutoLoad,26,rt2x00soc)
271 endef
272
273 define KernelPackage/rt2800-lib
274 $(call KernelPackage/rt2x00/Default)
275   DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +USB_SUPPORT:kmod-rt2x00-usb +TARGET_ramips:kmod-rt2x00-soc
276   TITLE+= (rt2800 LIB)
277   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
278   AUTOLOAD:=$(call AutoLoad,27,rt2800lib)
279 endef
280
281 define KernelPackage/rt2400-pci
282 $(call KernelPackage/rt2x00/Default)
283   DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
284   TITLE+= (RT2400 PCI)
285   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
286   AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
287 endef
288
289 define KernelPackage/rt2500-pci
290 $(call KernelPackage/rt2x00/Default)
291   DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
292   TITLE+= (RT2500 PCI)
293   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
294   AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
295 endef
296
297 define KernelPackage/rt2500-usb
298 $(call KernelPackage/rt2x00/Default)
299   DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
300   TITLE+= (RT2500 USB)
301   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
302   AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
303 endef
304
305 define KernelPackage/rt61-pci
306 $(call KernelPackage/rt2x00/Default)
307   DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
308   TITLE+= (RT2x61 PCI)
309   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
310   AUTOLOAD:=$(call AutoLoad,27,rt61pci)
311 endef
312
313 define KernelPackage/rt73-usb
314   $(call KernelPackage/rt2x00/Default)
315   DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
316   TITLE+= (RT73 USB)
317   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
318   AUTOLOAD:=$(call AutoLoad,27,rt73usb)
319 endef
320
321 define KernelPackage/rt2800-pci
322 $(call KernelPackage/rt2x00/Default)
323   DEPENDS+= +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-crc-ccitt +TARGET_ramips:kmod-rt2x00-soc
324   TITLE+= (RT2860 PCI)
325   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
326   AUTOLOAD:=$(call AutoLoad,28,rt2800pci)
327 endef
328
329 define KernelPackage/rt2800-usb
330 $(call KernelPackage/rt2x00/Default)
331   DEPENDS+= +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-crc-ccitt
332   TITLE+= (RT2870 USB)
333   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
334   AUTOLOAD:=$(call AutoLoad,28,rt2800usb)
335 endef
336
337 define KernelPackage/rtl818x/Default
338   $(call KernelPackage/mac80211/Default)
339   TITLE:=Realtek Drivers for RTL818x devices
340   URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
341   DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
342 endef
343
344 define KernelPackage/rtl8180
345   $(call KernelPackage/rtl818x/Default)
346   DEPENDS+= @PCI_SUPPORT
347   TITLE+= (RTL8180 PCI)
348   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl8180.ko
349   AUTOLOAD:=$(call AutoLoad,27,rtl8180)
350 endef
351
352 define KernelPackage/rtl8187
353 $(call KernelPackage/rtl818x/Default)
354   DEPENDS+= @USB_SUPPORT
355   TITLE+= (RTL8187 USB)
356   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
357   AUTOLOAD:=$(call AutoLoad,27,rtl8187)
358 endef
359
360 ZD1211FW_NAME:=zd1211-firmware
361 ZD1211FW_VERSION:=1.4
362 define Download/zd1211rw
363   FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
364   URL:=@SF/zd1211/
365   MD5SUM:=19f28781d76569af8551c9d11294c870
366 endef
367 $(eval $(call Download,zd1211rw))
368
369 define KernelPackage/zd1211rw
370   $(call KernelPackage/mac80211/Default)
371   TITLE:=Zydas ZD1211 support
372   DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
373   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
374   AUTOLOAD:=$(call AutoLoad,60,zd1211rw)
375 endef
376
377 define KernelPackage/ath/config
378         menu "Configuration"
379                 depends on PACKAGE_kmod-ath
380
381         config ATH_USER_REGD
382                 bool "Force Atheros drivers to respect the user's regdomain settings"
383                 help
384                   Atheros' idea of regulatory handling is that the EEPROM of the card defines
385                   the regulatory limits and the user is only allowed to restrict the settings
386                   even further, even if the country allows frequencies or power levels that
387                   are forbidden by the EEPROM settings.
388
389                   Select this option if you want the driver to respect the user's decision about
390                   regulatory settings.
391
392         config PACKAGE_ATH_DEBUG
393                 bool "Atheros wireless debugging"
394                 help
395                   Say Y, if you want to debug atheros wireless drivers.
396                   Right now only ath9k makes use of this.
397
398         endmenu
399 endef
400
401 define KernelPackage/ath
402   $(call KernelPackage/mac80211/Default)
403   TITLE:=Atheros common driver part
404   DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT +kmod-mac80211
405   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
406   AUTOLOAD:=$(call AutoLoad,26,ath)
407   MENU:=1
408 endef
409
410 define KernelPackage/ath/description
411  This module contains some common parts needed by Atheros Wireless drivers.
412 endef
413
414 define KernelPackage/ath5k
415   $(call KernelPackage/mac80211/Default)
416   TITLE:=Atheros 5xxx wireless cards support
417   URL:=http://linuxwireless.org/en/users/Drivers/ath5k
418   DEPENDS+= @PCI_SUPPORT||@TARGET_atheros +kmod-ath
419   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
420   AUTOLOAD:=$(call AutoLoad,27,ath5k)
421 endef
422
423 define KernelPackage/ath5k/description
424  This module adds support for wireless adapters based on
425  Atheros 5xxx chipset.
426 endef
427
428 define KernelPackage/ath9k
429   $(call KernelPackage/mac80211/Default)
430   TITLE:=Atheros 802.11n wireless cards support
431   URL:=http://linuxwireless.org/en/users/Drivers/ath9k
432   DEPENDS+= @PCI_SUPPORT +kmod-ath
433   FILES:= \
434         $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
435         $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko \
436         $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
437   AUTOLOAD:=$(call AutoLoad,27,ath9k_hw ath9k_common ath9k)
438 endef
439
440 define KernelPackage/ath9k/description
441 This module adds support for wireless adapters based on
442 Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
443 endef
444
445 define KernelPackage/carl9170
446   $(call KernelPackage/mac80211/Default)
447   TITLE:=Driver for Atheros AR9170 USB sticks
448   DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core
449   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
450   AUTOLOAD:=$(call AutoLoad,60,carl9170)
451 endef
452
453 define KernelPackage/carl9170/install
454         $(INSTALL_DIR) $(1)/lib/firmware
455         $(INSTALL_DATA) $(DL_DIR)/$(CARL9170_FW)-$(CARL9170_FW_VERSION) $(1)/lib/firmware/$(CARL9170_FW)
456 endef
457
458
459 USB8388FW_NAME:=usb8388
460 USB8388FW_VERSION:=5.110.22.p23
461
462 define Download/usb8388
463   URL:=http://dev.laptop.org/pub/firmware/libertas/
464   FILE:=$(USB8388FW_NAME)-$(USB8388FW_VERSION).bin
465   MD5SUM=5e38f55719df3d0c58dd3bd02575a09c
466 endef
467 $(eval $(call Download,usb8388))
468
469 SD8686FW_NAME:=sd8686
470 SD8686FW_VERSION:=9.70.7.p0
471
472 define Download/sd8686
473   URL:=http://dev.laptop.org/pub/firmware/libertas/
474   FILE:=$(SD8686FW_NAME)-$(SD8686FW_VERSION).bin
475   MD5SUM=b4f8be61e19780a14836f146c538c5dd
476 endef
477 $(eval $(call Download,sd8686))
478
479 SD8686HELPER_NAME:=sd8686_helper
480
481 define Download/sd8686_helper
482   URL:=http://dev.laptop.org/pub/firmware/libertas/
483   FILE:=$(SD8686HELPER_NAME).bin
484   MD5SUM=2a4d8f4df198ce949c350df5674f4ac6
485 endef
486 $(eval $(call Download,sd8686_helper))
487
488 define KernelPackage/libertas-usb
489   $(call KernelPackage/mac80211/Default)
490   DEPENDS+= @USB_SUPPORT +kmod-mac80211 +kmod-usb-core +kmod-lib80211
491   TITLE:=Marvell 88W8015 Wireless Driver
492   FILES:= \
493         $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
494         $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
495   AUTOLOAD:=$(call AutoLoad,27,libertas usb8xxx)
496 endef
497
498 define KernelPackage/libertas-sd
499   $(call KernelPackage/mac80211/Default)
500   DEPENDS+= +kmod-mac80211 +kmod-lib80211
501   TITLE:=Marvell 88W8686 Wireless Driver
502   FILES:= \
503         $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
504         $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
505   AUTOLOAD:=$(call AutoLoad,27,libertas libertas_sdio)
506 endef
507
508 define KernelPackage/mac80211-hwsim
509   $(call KernelPackage/mac80211/Default)
510   TITLE:=mac80211 HW simulation device
511   DEPENDS+= +kmod-mac80211
512   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
513   AUTOLOAD:=$(call AutoLoad,60,mac80211_hwsim)
514 endef
515
516 define KernelPackage/net-libipw
517   $(call KernelPackage/mac80211/Default)
518   TITLE:=libipw for ipw2100 and ipw2200
519   DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211
520   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/libipw.ko
521   AUTOLOAD:=$(call AutoLoad,49,libipw)
522 endef
523
524 define KernelPackage/net-libipw/description
525  Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200.
526 endef
527
528 IPW2100_NAME:=ipw2100-fw
529 IPW2100_VERSION:=1.3
530
531 define Download/net-ipw2100
532   URL:=http://bughost.org/firmware/
533   FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
534   MD5SUM=46aa75bcda1a00efa841f9707bbbd113
535 endef
536 $(eval $(call Download,net-ipw2100))
537
538 define KernelPackage/net-ipw2100
539   $(call KernelPackage/mac80211/Default)
540   TITLE:=Intel IPW2100 driver
541   DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
542   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko
543   AUTOLOAD:=$(call AutoLoad,50,ipw2100)
544 endef
545
546 define KernelPackage/net-ipw2100/description
547  Kernel support for Intel IPW2100
548  Includes:
549  - ipw2100
550 endef
551
552 IPW2200_NAME:=ipw2200-fw
553 IPW2200_VERSION:=3.1
554
555 define Download/net-ipw2200
556   URL:=http://bughost.org/firmware/
557   FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
558   MD5SUM=eaba788643c7cc7483dd67ace70f6e99
559 endef
560 $(eval $(call Download,net-ipw2200))
561
562 define KernelPackage/net-ipw2200
563   $(call KernelPackage/mac80211/Default)
564   TITLE:=Intel IPW2200 driver
565   DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
566   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko
567   AUTOLOAD:=$(call AutoLoad,50,ipw2200)
568 endef
569
570 define KernelPackage/net-ipw2200/description
571  Kernel support for Intel IPW2200
572  Includes:
573  - ipw2200
574 endef
575
576
577 define KernelPackage/net-hermes
578   $(call KernelPackage/mac80211/Default)
579   TITLE:=Hermes 802.11b chipset support
580   DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211
581   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
582   AUTOLOAD:=$(call AutoLoad,50,orinoco)
583 endef
584
585 define KernelPackage/net-hermes/description
586  Kernel support for Hermes 802.11b chipsets
587 endef
588
589 define KernelPackage/net-hermes-pci
590   $(call KernelPackage/mac80211/Default)
591   TITLE:=Intersil Prism 2.5 PCI support
592   DEPENDS:=@PCI_SUPPORT +kmod-net-hermes +kmod-cfg80211
593   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
594   AUTOLOAD:=$(call AutoLoad,55,orinoco_pci)
595 endef
596
597 define KernelPackage/net-hermes-pci/description
598  Kernel modules for Intersil Prism 2.5 PCI support
599 endef
600
601 define KernelPackage/net-hermes-plx
602   $(call KernelPackage/mac80211/Default)
603   TITLE:=PLX9052 based PCI adaptor
604   DEPENDS:=@PCI_SUPPORT +kmod-net-hermes +kmod-cfg80211
605   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
606   AUTOLOAD:=$(call AutoLoad,55,orinoco_plx)
607 endef
608
609 define KernelPackage/net-hermes-plx/description
610  Kernel modules for Hermes in PLX9052 based PCI adaptors
611 endef
612
613 define KernelPackage/net-hermes-pcmcia
614   $(call KernelPackage/mac80211/Default)
615   TITLE:=Hermes based PCMCIA adaptors
616   DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes +kmod-cfg80211 @BROKEN
617   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
618   AUTOLOAD:=$(call AutoLoad,55,orinoco_cs)
619 endef
620
621 define KernelPackage/net-hermes-pcmcia/description
622  Kernel modules for Hermes based PCMCIA adaptors
623 endef
624
625
626 define KernelPackage/mwl8k
627   $(call KernelPackage/mac80211/Default)
628   TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
629   URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k
630   DEPENDS+= @PCI_SUPPORT +kmod-mac80211
631   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.ko
632   AUTOLOAD:=$(call AutoLoad,27,mwl8k)
633 endef
634
635 define KernelPackage/mwl8k/description
636  Kernel modules for Marvell TOPDOG 802.11 Wireless cards
637 endef
638
639 #Broadcom firmware
640 ifneq ($(CONFIG_B43_EXPERIMENTAL),)
641   PKG_B43_FWV4_NAME:=broadcom-wl
642   PKG_B43_FWV4_VERSION:=4.178.10.4
643   PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
644   PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
645   PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
646   PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
647 else
648   PKG_B43_FWV4_NAME:=broadcom-wl
649   PKG_B43_FWV4_VERSION:=4.150.10.5
650   PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
651   PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
652   PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
653   PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
654 endif
655 ifneq ($(CONFIG_B43_OPENFIRMWARE),)
656   PKG_B43_FWV4_NAME:=broadcom-wl
657   PKG_B43_FWV4_VERSION:=5.2
658   PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
659   PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
660   PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
661   PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
662 endif
663
664
665 PKG_B43_FWV3_NAME:=wl_apsta
666 PKG_B43_FWV3_VERSION:=3.130.20.0
667 PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
668 PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
669 PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
670
671 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
672   PKG_B43_FWCUTTER_NAME:=b43-fwcutter
673   PKG_B43_FWCUTTER_VERSION:=3e69531aa65b8f664a0ab00dfc3e2eefeb0cb417
674   PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
675   PKG_B43_FWCUTTER_PROTO:=git
676   PKG_B43_FWCUTTER_SOURCE_URL:=http://git.bu3sch.de/git/b43-tools.git
677   PKG_B43_FWCUTTER_SUBDIR:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)
678   PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/fwcutter/
679 else
680   PKG_B43_FWCUTTER_NAME:=b43-fwcutter
681   PKG_B43_FWCUTTER_VERSION:=013
682   PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
683   PKG_B43_FWCUTTER_PROTO:=default
684   PKG_B43_FWCUTTER_SOURCE_URL:=http://bu3sch.de/b43/fwcutter/
685   PKG_B43_FWCUTTER_MD5SUM:=3547ec6c474ac1bc2c4a5bb765b791a4
686   PKG_B43_FWCUTTER_SUBDIR:=b43-fwcutter-$(PKG_B43_FWCUTTER_VERSION)
687   PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/
688 endif
689
690 define Download/b43-common
691   FILE:=$(PKG_B43_FWCUTTER_SOURCE)
692   URL:=$(PKG_B43_FWCUTTER_SOURCE_URL)
693   MD5SUM:=$(PKG_B43_FWCUTTER_MD5SUM)
694   PROTO:=$(PKG_B43_FWCUTTER_PROTO)
695   VERSION:=$(PKG_B43_FWCUTTER_VERSION)
696   SUBDIR:=$(PKG_B43_FWCUTTER_SUBDIR)
697 endef
698 $(eval $(call Download,b43-common))
699
700 define Download/b43
701   FILE:=$(PKG_B43_FWV4_SOURCE)
702   URL:=$(PKG_B43_FWV4_SOURCE_URL)
703   MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
704 endef
705 $(eval $(call Download,b43))
706
707 define Download/b43legacy
708   FILE:=$(PKG_B43_FWV3_SOURCE)
709   URL:=$(PKG_B43_FWV3_SOURCE_URL)
710   MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
711 endef
712 $(eval $(call Download,b43legacy))
713
714 define KernelPackage/b43-common
715   $(call KernelPackage/mac80211/Default)
716   TITLE:=Generic stuff for Broadcom wireless devices
717   URL:=http://linuxwireless.org/en/users/Drivers/b43
718   KCONFIG:= \
719         CONFIG_HW_RANDOM=y
720   DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
721 endef
722
723 define KernelPackage/b43
724 $(call KernelPackage/b43-common)
725   TITLE:=Broadcom 43xx wireless support
726   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
727   AUTOLOAD:=$(call AutoLoad,30,b43)
728   MENU:=1
729 endef
730
731 define KernelPackage/b43/config
732         menu "Configuration"
733                 depends on PACKAGE_kmod-b43
734
735         choice
736                 prompt "b43 firmware version"
737                 default B43_STABLE
738                 help
739                   This option allows you to select the version of the b43 firmware.
740
741         config B43_STABLE
742                 bool "4.150.10.5 (stable)"
743                 help
744                   Stable firmware for BCM43xx devices.
745
746                   If unsure, select this.
747
748         config B43_EXPERIMENTAL
749                 bool "4.178.10.4 (experimental)"
750                 help
751                   Experimental firmware for BCM43xx devices.
752
753                   This firmware is not tested as much as the "stable" firmware.
754
755                   If unsure, select the "stable" firmware.
756
757         config B43_OPENFIRMWARE
758                 bool "Open FirmWare for WiFi networks"
759                 help
760                   Opensource firmware for BCM43xx devices.
761
762                   Do _not_ select this, unless you know what you are doing.
763                   The Opensource firmware is not suitable for embedded devices, yet.
764                   It does not support QoS, which is bad for AccessPoints.
765                   It does not support hardware crypto acceleration, which is a showstopper
766                   for embedded devices with low CPU resources.
767
768                   If unsure, select the "stable" firmware.
769
770         endchoice
771
772         config B43_FW_SQUASH
773                 bool "Remove unnecessary firmware files"
774                 depends on !B43_OPENFIRMWARE
775                 default y
776                 help
777                   This options allows you to remove unnecessary b43 firmware files
778                   from the final rootfs image. This can reduce the rootfs size by
779                   up to 200k.
780
781                   If unsure, say Y.
782
783         config B43_FW_SQUASH_COREREVS
784                 string "Core revisions to include"
785                 depends on B43_FW_SQUASH
786                 default "5,6,7,8,9,10,13,14,15"
787                 help
788                   This is a comma seperated list of core revision numbers.
789
790                   Example (keep files for rev5 only):
791                     5
792
793                   Example (keep files for rev5 and rev11):
794                     5,11
795
796         config B43_FW_SQUASH_PHYTYPES
797                 string "PHY types to include"
798                 depends on B43_FW_SQUASH
799                 default "G,LP"
800                 help
801                   This is a comma seperated list of PHY types:
802                     A  => A-PHY
803                     AG => Dual A-PHY G-PHY
804                     G  => G-PHY
805                     LP => LP-PHY
806                     N  => N-PHY
807
808                   Example (keep files for G-PHY only):
809                     G
810
811                   Example (keep files for G-PHY and N-PHY):
812                     G,N
813
814         endmenu
815 endef
816
817 define KernelPackage/b43/description
818 Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
819 endef
820
821 define KernelPackage/b43legacy
822 $(call KernelPackage/b43-common)
823   TITLE:=Broadcom 43xx-legacy wireless support
824   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
825   AUTOLOAD:=$(call AutoLoad,30,b43legacy)
826   MENU:=1
827 endef
828
829 define KernelPackage/b43legacy/config
830         menu "Configuration"
831                 depends on PACKAGE_kmod-b43legacy
832
833         config B43LEGACY_FW_SQUASH
834                 bool "Remove unnecessary firmware files"
835                 default y
836                 help
837                   This options allows you to remove unnecessary b43legacy firmware files
838                   from the final rootfs image. This can reduce the rootfs size by
839                   up to 50k.
840
841                   If unsure, say Y.
842
843         config B43LEGACY_FW_SQUASH_COREREVS
844                 string "Core revisions to include"
845                 depends on B43LEGACY_FW_SQUASH
846                 default "1,2,3,4"
847                 help
848                   This is a comma seperated list of core revision numbers.
849
850                   Example (keep files for rev4 only):
851                     4
852
853                   Example (keep files for rev2 and rev4):
854                     2,4
855
856         endmenu
857 endef
858
859 define KernelPackage/b43legacy/description
860 Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
861 endef
862
863 BUILDFLAGS:= \
864         -I$(PKG_BUILD_DIR)/include \
865         $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
866         $(if $(CONFIG_PCI),-DCONFIG_B43_PCI_AUTOSELECT -DCONFIG_B43_PCICORE_AUTOSELECT) \
867         $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS -DCONFIG_AR9170_LEDS) \
868         -DCONFIG_B43_HWRNG -DCONFIG_B43LEGACY_HWRNG \
869         $(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS -DCONFIG_CARL9170_DEBUGFS) \
870         $(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG -DCONFIG_ATH9K_PKTLOG -DCONFIG_ATH5K_DEBUG) \
871         -D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
872         -DCONFIG_MAC80211_RC_MINSTREL_HT \
873         $(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
874         $(if $(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS),-DCONFIG_RT2X00_LIB_DEBUGFS) \
875         $(if $(CONFIG_PACKAGE_RT2X00_DEBUG),-DCONFIG_RT2X00_DEBUG) \
876         $(if $(NEED_RT2X00_LIB_HT),-DCONFIG_RT2X00_LIB_HT) \
877         $(if $(NEED_RT2X00_LIB_CRYPTO),-DCONFIG_RT2X00_LIB_CRYPTO) \
878         $(if $(NEED_RT2X00_LIB_FIRMWARE),-DCONFIG_RT2X00_LIB_FIRMWARE) \
879         $(if $(NEED_RT2X00_LIB_LEDS),-DCONFIG_RT2X00_LIB_LEDS) \
880         $(if $(CONFIG_PACKAGE_kmod-rt2x00-pci),-DCONFIG_RT2X00_LIB_PCI) \
881         $(if $(CONFIG_PACKAGE_kmod-rt2x00-usb),-DCONFIG_RT2X00_LIB_USB) \
882         $(if $(CONFIG_PACKAGE_kmod-rt2x00-soc),-DCONFIG_RT2X00_LIB_SOC) \
883         $(if $(CONFIG_TARGET_atheros),-DCONFIG_ATH5K_AHB,-DCONFIG_ATH5K_PCI) \
884         -DCONFIG_P54_SPI_DEFAULT_EEPROM
885
886 MAKE_OPTS:= \
887         CROSS_COMPILE="$(KERNEL_CROSS)" \
888         ARCH="$(LINUX_KARCH)" \
889         EXTRA_CFLAGS="$(BUILDFLAGS)" \
890         $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
891         CONFIG_MAC80211=$(if $(CONFIG_PACKAGE_kmod-mac80211),m) \
892         CONFIG_MAC80211_RC_MINSTREL=y \
893         CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
894         CONFIG_MAC80211_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
895         CONFIG_B43_PCMCIA=n CONFIG_B43_PIO=n \
896         CONFIG_B43_PCI_AUTOSELECT=$(if $(CONFIG_PCI),y) \
897         CONFIG_B43_PCICORE_AUTOSELECT=$(if $(CONFIG_PCI),y) \
898         CONFIG_B43LEGACY_LEDS=$(CONFIG_LEDS_TRIGGERS) \
899         CONFIG_B43_LEDS=$(CONFIG_LEDS_TRIGGERS) \
900         CONFIG_B43_HWRNG=$(if $(CONFIG_HW_RANDOM),y) \
901         CONFIG_B43LEGACY_HWRNG=$(if $(CONFIG_HW_RANDOM),y) \
902         CONFIG_B43=$(if $(CONFIG_PACKAGE_kmod-b43),m) \
903         CONFIG_B43LEGACY=$(if $(CONFIG_PACKAGE_kmod-b43legacy),m) \
904         CONFIG_ATH_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath),m) \
905         CONFIG_ATH_DEBUG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
906         CONFIG_ATH5K_DEBUG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
907         CONFIG_ATH9K_PKTLOG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
908         CONFIG_ATH5K=$(if $(CONFIG_PACKAGE_kmod-ath5k),m) \
909         CONFIG_ATH5K_PCI=$(if $(CONFIG_TARGET_atheros),,y) \
910         CONFIG_ATH5K_AHB=$(if $(CONFIG_TARGET_atheros),y) \
911         CONFIG_ATH9K=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
912         CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
913         CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
914         CONFIG_ATH9K_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
915         CONFIG_CARL9170=$(if $(CONFIG_PACKAGE_kmod-carl9170),m) \
916         CONFIG_CARL9170_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
917         CONFIG_ZD1211RW=$(if $(CONFIG_PACKAGE_kmod-zd1211rw),m) \
918         CONFIG_P54_COMMON=$(if $(CONFIG_PACKAGE_kmod-p54-common),m) \
919         CONFIG_P54_PCI=$(if $(CONFIG_PACKAGE_kmod-p54-pci),m) \
920         CONFIG_P54_USB=$(if $(CONFIG_PACKAGE_kmod-p54-usb),m) \
921         CONFIG_P54_SPI=$(if $(CONFIG_PACKAGE_kmod-p54-spi),m) \
922         CONFIG_P54_SPI_DEFAULT_EEPROM=y \
923         CONFIG_RT2X00=$(if $(CONFIG_PACKAGE_kmod-rt2x00-lib),m) \
924         CONFIG_RT2X00_LIB=$(if $(CONFIG_PACKAGE_kmod-rt2x00-lib),m) \
925         CONFIG_RT2X00_LIB_PCI=$(if $(CONFIG_PACKAGE_kmod-rt2x00-pci),m) \
926         CONFIG_RT2X00_LIB_USB=$(if $(CONFIG_PACKAGE_kmod-rt2x00-usb),m) \
927         CONFIG_RT2X00_LIB_SOC=$(if $(CONFIG_PACKAGE_kmod-rt2x00-soc),m) \
928         CONFIG_RT2X00_LIB_DEBUGFS=$(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS) \
929         CONFIG_RT2X00_LIB_CRYPTO=$(NEED_RT2X00_LIB_CRYPTO) \
930         CONFIG_RT2X00_LIB_FIRMWARE=$(NEED_RT2X00_LIB_FIRMWARE) \
931         CONFIG_RT2X00_LIB_HT=$(NEED_RT2X00_LIB_HT) \
932         CONFIG_RT2X00_LIB_LEDS=$(NEED_RT2X00_LIB_LEDS) \
933         CONFIG_RT2400PCI=$(if $(CONFIG_PACKAGE_kmod-rt2400-pci),m) \
934         CONFIG_RT2500PCI=$(if $(CONFIG_PACKAGE_kmod-rt2500-pci),m) \
935         CONFIG_RT2500USB=$(if $(CONFIG_PACKAGE_kmod-rt2500-usb),m) \
936         CONFIG_RT61PCI=$(if $(CONFIG_PACKAGE_kmod-rt61-pci),m) \
937         CONFIG_RT73USB=$(if $(CONFIG_PACKAGE_kmod-rt73-usb),m) \
938         CONFIG_RT2800_LIB=$(if $(CONFIG_PACKAGE_kmod-rt2800-lib),m) \
939         CONFIG_RT2800PCI=$(if $(CONFIG_PACKAGE_kmod-rt2800-pci),m) \
940         CONFIG_RT2800USB=$(if $(CONFIG_PACKAGE_kmod-rt2800-usb),m) \
941         CONFIG_RTL8180=$(if $(CONFIG_PACKAGE_kmod-rtl8180),m) \
942         CONFIG_RTL8187=$(if $(CONFIG_PACKAGE_kmod-rtl8187),m) \
943         CONFIG_RTL8192CE= \
944         CONFIG_MAC80211_HWSIM=$(if $(CONFIG_PACKAGE_kmod-mac80211-hwsim),m) \
945         CONFIG_PCMCIA= \
946         CONFIG_LIBIPW=$(if $(CONFIG_PACKAGE_kmod-net-libipw),m) \
947         CONFIG_LIBERTAS=$(if $(CONFIG_PACKAGE_kmod-libertas-sd)$(CONFIG_PACKAGE_kmod-libertas-usb),m) \
948         CONFIG_LIBERTAS_CS= \
949         CONFIG_LIBERTAS_SPI= \
950         CONFIG_LIBERTAS_SDIO=$(if $(CONFIG_PACKAGE_kmod-libertas-sd),m) \
951         CONFIG_LIBERTAS_THINFIRM= \
952         CONFIG_LIBERTAS_USB=$(if $(CONFIG_PACKAGE_kmod-libertas-usb),m) \
953         CONFIG_IPW2100=$(if $(CONFIG_PACKAGE_kmod-net-ipw2100),m) \
954         CONFIG_IPW2200=$(if $(CONFIG_PACKAGE_kmod-net-ipw2200),m) \
955         CONFIG_NL80211=y \
956         CONFIG_LIB80211= \
957         CONFIG_LIB80211_CRYPT_WEP= \
958         CONFIG_LIB80211_CRYPT_CCMP= \
959         CONFIG_LIB80211_CRYPT_TKIP= \
960         CONFIG_COMPAT_IWLWIFI= \
961         CONFIG_IWLAGN= \
962         CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \
963         CONFIG_ATMEL= \
964         CONFIG_PCMCIA_ATMEL= \
965         CONFIG_ADM8211= \
966         CONFIG_USB_NET_RNDIS_HOST= \
967         CONFIG_USB_NET_RNDIS_WLAN= \
968         CONFIG_USB_NET_CDCETHER= \
969         CONFIG_USB_USBNET= \
970         CONFIG_AT76C50X_USB= \
971         CONFIG_WL12XX= \
972         CONFIG_EEPROM_93CX6= \
973         CONFIG_HERMES=$(if $(CONFIG_PACKAGE_kmod-net-hermes),m) \
974         CONFIG_HERMES_CACHE_FW_ON_INIT= \
975         CONFIG_PCI_HERMES=$(if $(CONFIG_PACKAGE_kmod-net-hermes-pci),m) \
976         CONFIG_PLX_HERMES=$(if $(CONFIG_PACKAGE_kmod-net-hermes-plx),m) \
977         CONFIG_PCMCIA_HERMES=$(if $(CONFIG_PACKAGE_kmod-net-hermes-pcmcia),m) \
978         CONFIG_HERMES_PRISM= \
979         CONFIG_APPLE_AIRPORT= \
980         CONFIG_TMD_HERMES= \
981         CONFIG_NORTEL_HERMES= \
982         CONFIG_PCMCIA_SPECTRUM= \
983         CONFIG_ORINOCO_USB= \
984         CONFIG_AR9170_USB=$(if $(CONFIG_PACKAGE_kmod-ar9170),m) \
985         CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \
986         CONFIG_IWM= \
987         CONFIG_ATH9K_HTC= \
988         CONFIG_MAC80211_RC_MINSTREL_HT=y \
989         MADWIFI= \
990         OLD_IWL= \
991         KLIB_BUILD="$(LINUX_DIR)" \
992         MODPROBE=: \
993         KLIB=$(TARGET_MODULES_DIR) \
994         KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
995         KBUILD_LDFLAGS_MODULE_PREREQ=
996
997 ifeq ($(CONFIG_PACKAGE_kmod-libertas-sd)$(CONFIG_PACKAGE_kmod-libertas-usb)$(CONFIG_PACKAGE_kmod-rt2x00-lib),)
998   MAKE_OPTS += CONFIG_COMPAT_KFIFO=
999 endif
1000
1001 define Build/Prepare
1002         rm -rf $(PKG_BUILD_DIR)
1003         mkdir -p $(PKG_BUILD_DIR)
1004         $(PKG_UNPACK)
1005         $(Build/Patch)
1006         unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
1007         unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
1008         -unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2860FW)
1009         -unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2870FW)
1010         $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
1011         $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
1012         $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
1013         rm -rf $(PKG_BUILD_DIR)/include/linux/ssb
1014         rm -f $(PKG_BUILD_DIR)/include/net/ieee80211.h
1015         rm $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h
1016 endef
1017
1018 ifneq ($(CONFIG_PACKAGE_kmod-cfg80211),)
1019  define Build/Compile/kmod
1020         rm -rf $(PKG_BUILD_DIR)/modules
1021         $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
1022  endef
1023 endif
1024
1025 define Build/Compile
1026         $(call Build/Compile/kmod)
1027 endef
1028
1029 define Build/InstallDev
1030         mkdir -p \
1031                 $(1)/usr/include/mac80211 \
1032                 $(1)/usr/include/mac80211/ath \
1033                 $(1)/usr/include/net/mac80211
1034         $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
1035         $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
1036         $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
1037 endef
1038
1039 define KernelPackage/libertas-usb/install
1040         $(INSTALL_DIR) $(1)/lib/firmware
1041         $(INSTALL_DATA) $(DL_DIR)/$(USB8388FW_NAME)-$(USB8388FW_VERSION).bin $(1)/lib/firmware/$(USB8388FW_NAME).bin
1042 endef
1043
1044 define KernelPackage/libertas-sd/install
1045         echo "Libertas install: $(CONFIG_PACKAGE_kmod-libertas-sd)"
1046         $(INSTALL_DIR) $(1)/lib/firmware
1047         $(INSTALL_DATA) $(DL_DIR)/$(SD8686FW_NAME)-$(SD8686FW_VERSION).bin $(1)/lib/firmware/$(SD8686FW_NAME).bin
1048         $(INSTALL_DATA) $(DL_DIR)/$(SD8686HELPER_NAME).bin $(1)/lib/firmware/$(SD8686HELPER_NAME).bin
1049 endef
1050
1051 define KernelPackage/cfg80211/install
1052         $(INSTALL_DIR) $(1)/lib/wifi
1053         $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
1054 endef
1055
1056 define KernelPackage/p54-pci/install
1057         $(INSTALL_DIR) $(1)/lib/firmware
1058         $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
1059 endef
1060
1061 define KernelPackage/p54-usb/install
1062         $(INSTALL_DIR) $(1)/lib/firmware
1063         $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
1064 endef
1065
1066 define KernelPackage/p54-spi/install
1067         $(INSTALL_DIR) $(1)/lib/firmware
1068         $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
1069 endef
1070
1071 define KernelPackage/rt61-pci/install
1072         $(INSTALL_DIR) $(1)/lib/firmware
1073         $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
1074 endef
1075
1076 define KernelPackage/rt73-usb/install
1077         $(INSTALL_DIR) $(1)/lib/firmware
1078         $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
1079 endef
1080
1081 define KernelPackage/rt2800-pci/install
1082         $(INSTALL_DIR) $(1)/lib/firmware
1083         $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2860.bin $(1)/lib/firmware/
1084 endef
1085
1086 define KernelPackage/rt2800-usb/install
1087         $(INSTALL_DIR) $(1)/lib/firmware
1088         $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2870.bin $(1)/lib/firmware/
1089 endef
1090
1091 define KernelPackage/zd1211rw/install
1092         $(INSTALL_DIR) $(1)/lib/firmware/zd1211
1093         $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
1094 endef
1095
1096 define KernelPackage/ar9170/install
1097         $(INSTALL_DIR) $(1)/lib/firmware
1098         $(INSTALL_DATA) $(DL_DIR)/$(AR9170FW) $(1)/lib/firmware/
1099 endef
1100
1101 define KernelPackage/net-ipw2100/install
1102         $(INSTALL_DIR) $(1)/lib/firmware
1103         $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware
1104 endef
1105
1106 define KernelPackage/net-ipw2200/install
1107         $(INSTALL_DIR) $(1)/lib/firmware
1108         $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
1109 endef
1110
1111 define Build/b43-common
1112         tar xjf "$(DL_DIR)/$(PKG_B43_FWCUTTER_SOURCE)" -C "$(PKG_BUILD_DIR)"
1113         $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)" \
1114                 CFLAGS="-I$(STAGING_DIR_HOST)/include -include endian.h" \
1115                 QUIET_SPARSE=:
1116         $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)/b43-fwcutter $(STAGING_DIR_HOST)/bin/
1117 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
1118         $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
1119         $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/"
1120         $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/b43-asm $(STAGING_DIR_HOST)/bin/
1121         $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/b43-asm.bin $(STAGING_DIR_HOST)/bin/
1122 endif
1123         $(INSTALL_BIN) ./files/host_bin/b43-fwsquash.py $(STAGING_DIR_HOST)/bin/
1124 endef
1125
1126 define KernelPackage/b43/install
1127         rm -rf $(1)/lib/firmware/
1128         $(call Build/b43-common)
1129 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
1130         tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
1131 else
1132         tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
1133 endif
1134         $(INSTALL_DIR) $(1)/lib/firmware/
1135 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
1136         $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
1137         $(INSTALL_DIR) $(1)/lib/firmware/b43-open/
1138         $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
1139         $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
1140         $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
1141 else
1142         b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
1143 endif
1144 ifneq ($(CONFIG_B43_FW_SQUASH),)
1145         b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
1146 endif
1147 endef
1148
1149 define KernelPackage/b43legacy/install
1150         $(call Build/b43-common)
1151         $(INSTALL_DIR) $(1)/lib/firmware/
1152
1153         b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
1154 ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
1155         b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
1156 endif
1157 endef
1158
1159 $(eval $(call KernelPackage,ath5k))
1160 $(eval $(call KernelPackage,libertas-usb))
1161 $(eval $(call KernelPackage,libertas-sd))
1162 $(eval $(call KernelPackage,cfg80211))
1163 $(eval $(call KernelPackage,mac80211))
1164 $(eval $(call KernelPackage,p54-common))
1165 $(eval $(call KernelPackage,p54-pci))
1166 $(eval $(call KernelPackage,p54-usb))
1167 $(eval $(call KernelPackage,p54-spi))
1168 $(eval $(call KernelPackage,rt2x00-lib))
1169 $(eval $(call KernelPackage,rt2x00-pci))
1170 $(eval $(call KernelPackage,rt2x00-usb))
1171 $(eval $(call KernelPackage,rt2x00-soc))
1172 $(eval $(call KernelPackage,rt2800-lib))
1173 $(eval $(call KernelPackage,rt2400-pci))
1174 $(eval $(call KernelPackage,rt2500-pci))
1175 $(eval $(call KernelPackage,rt2500-usb))
1176 $(eval $(call KernelPackage,rt61-pci))
1177 $(eval $(call KernelPackage,rt73-usb))
1178 $(eval $(call KernelPackage,rt2800-pci))
1179 $(eval $(call KernelPackage,rt2800-usb))
1180 $(eval $(call KernelPackage,rtl8180))
1181 $(eval $(call KernelPackage,rtl8187))
1182 $(eval $(call KernelPackage,zd1211rw))
1183 $(eval $(call KernelPackage,mac80211-hwsim))
1184 $(eval $(call KernelPackage,ath9k))
1185 $(eval $(call KernelPackage,ath))
1186 $(eval $(call KernelPackage,carl9170))
1187 $(eval $(call KernelPackage,b43))
1188 $(eval $(call KernelPackage,b43legacy))
1189 $(eval $(call KernelPackage,net-libipw))
1190 $(eval $(call KernelPackage,net-ipw2100))
1191 $(eval $(call KernelPackage,net-ipw2200))
1192 $(eval $(call KernelPackage,mwl8k))
1193 $(eval $(call KernelPackage,net-hermes))
1194 $(eval $(call KernelPackage,net-hermes-pci))
1195 $(eval $(call KernelPackage,net-hermes-plx))
1196 $(eval $(call KernelPackage,net-hermes-pcmcia))