2e17b3c58a6fda68eb83418b3a84f9266cd83266
[openwrt/svn-archive/archive.git] / package / mac80211 / Makefile
1 #
2 # Copyright (C) 2007-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 7440 2007-06-02 02:22:01Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=mac80211
13 PKG_RELEASE:=1
14
15 ifneq ($(CONFIG_LINUX_2_6_27),)
16 PKG_VERSION:=2008-11-03
17 PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/11
18 else
19 PKG_VERSION:=2008-08-06
20 PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/08
21 PATCH_DIR:=$(if $(CONFIG_TARGET_brcm47xx),./patches-brcm,./patches-old)
22 endif
23
24 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
25 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
26
27 include $(INCLUDE_DIR)/package.mk
28 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_kmod-mac80211)
29
30 WMENU:=Wireless Drivers
31
32 define KernelPackage/mac80211
33 SUBMENU:=$(WMENU)
34 TITLE:=Linux 802.11 Wireless Networking Stack
35 URL:=http://linuxwireless.org/
36 DEPENDS:=@LINUX_2_6 +kmod-crypto-arc4 +kmod-crypto-aes +wireless-tools @!TARGET_avr32
37 FILES:= \
38 $(PKG_BUILD_DIR)/net/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
39 $(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
40 AUTOLOAD:=$(call AutoLoad,20,cfg80211 mac80211)
41 endef
42
43 define KernelPackage/mac80211/description
44 Linux 802.11 Wireless Networking Stack
45 endef
46
47 # Prism54 drivers
48 P54FW:=2.7.0.0.arm
49
50 define Download/p54
51 FILE:=$(P54FW)
52 URL:=http://prism54.org/firmware
53 MD5SUM:=09f9da7ea757173c9de1a0322a1f9782
54 endef
55 $(eval $(call Download,p54))
56
57 define KernelPackage/p54/Default
58 SUBMENU:=$(WMENU)
59 TITLE:=Prism54 Drivers
60 endef
61
62 define KernelPackage/p54/description
63 Kernel module for Prism54 chipsets (mac80211)
64 endef
65
66 define KernelPackage/p54-common
67 $(call KernelPackage/p54/Default)
68 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT
69 TITLE+= (COMMON)
70 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.$(LINUX_KMOD_SUFFIX)
71 AUTOLOAD:=$(call AutoLoad,30,p54common)
72 endef
73
74 define KernelPackage/p54-pci
75 $(call KernelPackage/p54/Default)
76 TITLE+= (PCI)
77 DEPENDS+= @PCI_SUPPORT +kmod-p54-common
78 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.$(LINUX_KMOD_SUFFIX)
79 AUTOLOAD:=$(call AutoLoad,31,p54pci)
80 endef
81
82 define KernelPackage/p54-usb
83 $(call KernelPackage/p54/Default)
84 TITLE+= (USB)
85 DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
86 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.$(LINUX_KMOD_SUFFIX)
87 AUTOLOAD:=$(call AutoLoad,31,p54usb)
88 endef
89
90 # Ralink rt2x00 drivers
91 RT61FW:=RT61_Firmware_V1.2.zip
92 RT71FW:=RT71W_Firmware_V1.8.zip
93 RT2860FW:=RT2860_Firmware_V11.zip
94
95 define Download/rt61
96 FILE:=$(RT61FW)
97 URL:=http://www.ralinktech.com.tw/data/
98 MD5SUM:=d4c690c93b470bc9a681297c2adc6281
99 endef
100 $(eval $(call Download,rt61))
101
102 define Download/rt71w
103 FILE:=$(RT71FW)
104 URL:=http://www.ralinktech.com.tw/data/
105 MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
106 endef
107 $(eval $(call Download,rt71w))
108
109 define Download/rt2860
110 FILE:=$(RT2860FW)
111 URL:=http://www.ralinktech.com.tw/data/drivers
112 MD5SUM:=440a81756a52c53528f16faa41c40124
113 endef
114 $(eval $(call Download,rt2860))
115
116 define KernelPackage/rt2x00/Default
117 SUBMENU:=$(WMENU)
118 TITLE:=Ralink Drivers for RT2x00 cards
119 endef
120
121 define KernelPackage/rt2x00-lib
122 $(call KernelPackage/rt2x00/Default)
123 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211 +kmod-crc-itu-t
124 TITLE+= (LIB)
125 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.$(LINUX_KMOD_SUFFIX)
126 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
127 endef
128
129 define KernelPackage/rt2x00-pci
130 $(call KernelPackage/rt2x00/Default)
131 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
132 TITLE+= (PCI)
133 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.$(LINUX_KMOD_SUFFIX)
134 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
135 endef
136
137 define KernelPackage/rt2x00-usb
138 $(call KernelPackage/rt2x00/Default)
139 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
140 TITLE+= (USB)
141 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.$(LINUX_KMOD_SUFFIX)
142 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
143 endef
144
145 define KernelPackage/rt2400-pci
146 $(call KernelPackage/rt2x00/Default)
147 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
148 TITLE+= (RT2400 PCI)
149 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.$(LINUX_KMOD_SUFFIX)
150 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
151 endef
152
153 define KernelPackage/rt2500-pci
154 $(call KernelPackage/rt2x00/Default)
155 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
156 TITLE+= (RT2500 PCI)
157 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.$(LINUX_KMOD_SUFFIX)
158 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
159 endef
160
161 define KernelPackage/rt2500-usb
162 $(call KernelPackage/rt2x00/Default)
163 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
164 TITLE+= (RT2500 USB)
165 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.$(LINUX_KMOD_SUFFIX)
166 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
167 endef
168
169 define KernelPackage/rt61-pci
170 $(call KernelPackage/rt2x00/Default)
171 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
172 TITLE+= (RT2x61 PCI)
173 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.$(LINUX_KMOD_SUFFIX)
174 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
175 endef
176
177 define KernelPackage/rt73-usb
178 $(call KernelPackage/rt2x00/Default)
179 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
180 TITLE+= (RT73 USB)
181 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.$(LINUX_KMOD_SUFFIX)
182 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
183 endef
184
185 define KernelPackage/rt2800-pci
186 $(call KernelPackage/rt2x00/Default)
187 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci @LINUX_2_6_27||@LINUX_2_6_28
188 TITLE+= (RT2860 PCI)
189 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.$(LINUX_KMOD_SUFFIX)
190 AUTOLOAD:=$(call AutoLoad,27,rt2800pci)
191 endef
192
193 ZD1211FW_NAME:=zd1211-firmware
194 ZD1211FW_VERSION:=1.4
195 define Download/zd1211rw
196 FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
197 URL:=@SF/zd1211/
198 MD5SUM:=19f28781d76569af8551c9d11294c870
199 endef
200 $(eval $(call Download,zd1211rw))
201
202 define KernelPackage/zd1211rw
203 SUBMENU:=$(WMENU)
204 TITLE:=Zydas ZD1211 support
205 DEPENDS:= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
206 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.$(LINUX_KMOD_SUFFIX)
207 AUTOLOAD:=$(call AutoLoad,60,zd1211rw)
208 endef
209
210 define KernelPackage/ath5k
211 SUBMENU:=$(WMENU)
212 TITLE:=Atheros 5xxx wireless cards support
213 URL:=http://linuxwireless.org/en/users/Drivers/ath5k
214 DEPENDS+= @PCI_SUPPORT +kmod-mac80211
215 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath5k/ath5k.$(LINUX_KMOD_SUFFIX)
216 AUTOLOAD:=$(call AutoLoad,27,ath5k)
217 endef
218
219 define KernelPackage/ath5k/description
220 This module adds support for wireless adapters based on
221 Atheros 5xxx chipset.
222 endef
223
224 define KernelPackage/ath9k-new
225 SUBMENU:=$(WMENU)
226 TITLE:=Atheros 802.11n wireless cards support
227 URL:=http://linuxwireless.org/en/users/Drivers/ath9k
228 DEPENDS+= @PCI_SUPPORT +kmod-mac80211 @LINUX_2_6_27||@LINUX_2_6_28 @!kmod-ath9k
229 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath9k/ath9k.$(LINUX_KMOD_SUFFIX)
230 AUTOLOAD:=$(call AutoLoad,27,ath9k)
231 endef
232
233 define KernelPackage/ath9k-new/description
234 This module adds support for wireless adapters based on
235 Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
236 endef
237
238 define KernelPackage/mac80211-hwsim
239 SUBMENU:=$(WMENU)
240 TITLE:=mac80211 HW simulation device
241 DEPENDS+= +kmod-mac80211
242 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.$(LINUX_KMOD_SUFFIX)
243 AUTOLOAD:=$(call AutoLoad,60,mac80211_hwsim)
244 endef
245
246 #Broadcom firmware
247 PKG_B43_FWV4_NAME:=broadcom-wl
248 PKG_B43_FWV4_VERSION:=4.150.10.5
249 PKG_B43_FWV4_OBJECT:=driver/wl_apsta_mimo.o
250 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
251 PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
252 PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
253
254 PKG_B43_FWV3_NAME:=wl_apsta
255 PKG_B43_FWV3_VERSION:=3.130.20.0
256 PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
257 PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
258 PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
259
260 PKG_B43_FWCUTTER_NAME:=b43-fwcutter
261 PKG_B43_FWCUTTER_VERSION:=011
262 PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
263 PKG_B43_FWCUTTER_SOURCE_URL:=http://bu3sch.de/b43/fwcutter/
264 PKG_B43_FWCUTTER_MD5SUM:=3db2f4de85a459451f5b391cf67a8d44
265
266 define Download/b43-common
267 FILE:=$(PKG_B43_FWCUTTER_SOURCE)
268 URL:=$(PKG_B43_FWCUTTER_SOURCE_URL)
269 MD5SUM:=$(PKG_B43_FWCUTTER_MD5SUM)
270 endef
271 $(eval $(call Download,b43-common))
272
273 define Download/b43
274 FILE:=$(PKG_B43_FWV4_SOURCE)
275 URL:=$(PKG_B43_FWV4_SOURCE_URL)
276 MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
277 endef
278 $(eval $(call Download,b43))
279
280 define Download/b43legacy
281 FILE:=$(PKG_B43_FWV3_SOURCE)
282 URL:=$(PKG_B43_FWV3_SOURCE_URL)
283 MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
284 endef
285 $(eval $(call Download,b43legacy))
286
287 define KernelPackage/b43-common
288 SUBMENU:=$(WMENU)
289 TITLE:=Generic stuff for Broadcom wireless devices
290 URL:=http://linuxwireless.org/en/users/Drivers/b43
291 DEPENDS:=@TARGET_brcm47xx +kmod-mac80211
292 endef
293
294 define KernelPackage/b43
295 $(call KernelPackage/b43-common)
296 TITLE:=Broadcom 43xx wireless support
297 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.$(LINUX_KMOD_SUFFIX)
298 AUTOLOAD:=$(call AutoLoad,30,b43)
299 endef
300
301 define KernelPackage/b43/description
302 Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
303 endef
304
305 define KernelPackage/b43legacy
306 $(call KernelPackage/b43-common)
307 TITLE:=Broadcom 43xx-legacy wireless support
308 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.$(LINUX_KMOD_SUFFIX)
309 AUTOLOAD:=$(call AutoLoad,30,b43legacy)
310 endef
311
312 define KernelPackage/b43legacy/description
313 Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
314 endef
315
316 BUILDFLAGS:= \
317 -I$(PKG_BUILD_DIR)/include \
318 $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
319 $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
320 $(if $(CONFIG_DEBUG_FS), -DCONFIG_MAC80211_DEBUGFS) \
321 -D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
322
323 MAKE_OPTS:= \
324 CROSS_COMPILE="$(TARGET_CROSS)" \
325 ARCH="$(LINUX_KARCH)" \
326 EXTRA_CFLAGS="$(BUILDFLAGS)" \
327 $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
328 CONFIG_NL80211=y \
329 CONFIG_MAC80211_RC_PID=y \
330 CONFIG_MAC80211_RC_MINSTREL=y \
331 CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
332 CONFIG_MAC80211_DEBUGFS=$(CONFIG_DEBUG_FS) \
333 KLIB_BUILD="$(LINUX_DIR)" \
334 MODPROBE=:
335
336 define Build/Prepare
337 rm -rf $(PKG_BUILD_DIR)
338 mkdir -p $(PKG_BUILD_DIR)
339 $(PKG_UNPACK)
340 $(Build/Patch)
341 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
342 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
343 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
344 -unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2860FW)
345 $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
346 $(if $(CONFIG_TARGET_brcm47xx),rm -rf $(PKG_BUILD_DIR)/include/linux/ssb)
347 rm $(PKG_BUILD_DIR)/include/net/ieee80211_crypt.h
348 rm $(PKG_BUILD_DIR)/include/net/ieee80211.h
349 rm $(PKG_BUILD_DIR)/include/net/ieee80211_radiotap.h
350 rm $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h
351 endef
352
353 ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
354 define Build/Compile/kmod
355 $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
356 endef
357 endif
358
359 define Build/Compile
360 $(call Build/Compile/kmod)
361 endef
362
363 define Build/InstallDev
364 mkdir -p $(1)/usr/include/mac80211 $(1)/usr/include/net/mac80211
365 $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
366 $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
367 endef
368
369 define KernelPackage/mac80211/install
370 $(INSTALL_DIR) $(1)/lib/wifi
371 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
372 endef
373
374 define KernelPackage/p54-common/install
375 $(INSTALL_DIR) $(1)/lib/firmware
376 $(INSTALL_DATA) $(DL_DIR)/$(P54FW) $(1)/lib/firmware/isl3886
377 endef
378
379 define KernelPackage/rt61-pci/install
380 $(INSTALL_DIR) $(1)/lib/firmware
381 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
382 endef
383
384 define KernelPackage/rt73-usb/install
385 $(INSTALL_DIR) $(1)/lib/firmware
386 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
387 endef
388
389 define KernelPackage/rt2800-pci/install
390 $(INSTALL_DIR) $(1)/lib/firmware
391 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2860.bin $(1)/lib/firmware/
392 endef
393
394 define KernelPackage/zd1211rw/install
395 $(INSTALL_DIR) $(1)/lib/firmware/zd1211
396 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
397 endef
398
399 define Build/b43-common
400 tar xjf "$(DL_DIR)/$(PKG_B43_FWCUTTER_SOURCE)" -C "$(PKG_BUILD_DIR)"
401 $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)" \
402 CFLAGS="-I$(STAGING_DIR_HOST)/include -include endian.h"
403 endef
404
405 define KernelPackage/b43/install
406 $(call Build/b43-common)
407 tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
408 $(INSTALL_DIR) $(1)/lib/firmware/
409
410 $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/b43-fwcutter \
411 -w $(1)/lib/firmware/ \
412 $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/$(PKG_B43_FWV4_OBJECT)
413 endef
414
415 define KernelPackage/b43legacy/install
416 $(call Build/b43-common)
417 $(INSTALL_DIR) $(1)/lib/firmware/
418
419 $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/b43-fwcutter \
420 -w $(1)/lib/firmware/ \
421 $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
422 endef
423
424 $(eval $(call KernelPackage,ath5k))
425 $(eval $(call KernelPackage,mac80211))
426 $(eval $(call KernelPackage,p54-common))
427 $(eval $(call KernelPackage,p54-pci))
428 $(eval $(call KernelPackage,p54-usb))
429 $(eval $(call KernelPackage,rt2x00-lib))
430 $(eval $(call KernelPackage,rt2x00-pci))
431 $(eval $(call KernelPackage,rt2x00-usb))
432 $(eval $(call KernelPackage,rt2400-pci))
433 $(eval $(call KernelPackage,rt2500-pci))
434 $(eval $(call KernelPackage,rt2500-usb))
435 $(eval $(call KernelPackage,rt61-pci))
436 $(eval $(call KernelPackage,rt73-usb))
437 $(eval $(call KernelPackage,rt2800-pci))
438 $(eval $(call KernelPackage,zd1211rw))
439 $(eval $(call KernelPackage,mac80211-hwsim))
440 $(eval $(call KernelPackage,ath9k-new))
441 $(eval $(call KernelPackage,b43))
442 $(eval $(call KernelPackage,b43legacy))