source: trunk/package/mac80211/Makefile @ 13206

Last change on this file since 13206 was 13206, checked in by florian, 8 years ago

Build p54 driver from compat-wireless

File size: 13.6 KB
Line 
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
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=mac80211
13PKG_RELEASE:=1
14
15ifneq ($(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
18else
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)
22endif
23
24PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
25PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
26
27include $(INCLUDE_DIR)/package.mk
28STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_kmod-mac80211)
29
30WMENU:=Wireless Drivers
31
32define 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)
41endef
42
43define KernelPackage/mac80211/description
44Linux 802.11 Wireless Networking Stack
45endef
46
47# Prism54 drivers
48P54FW:=2.7.0.0.arm
49
50define Download/p54
51  FILE:=$(P54FW)
52  URL:=http://prism54.org/firmware
53  MD5SUM:=09f9da7ea757173c9de1a0322a1f9782
54endef
55$(eval $(call Download,p54))
56
57define KernelPackage/p54/Default
58  SUBMENU:=$(WMENU)
59  TITLE:=Prism54 Drivers
60endef
61
62define KernelPackage/p54/description
63  Kernel module for Prism54 chipsets (mac80211)
64endef
65
66define 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)
72endef
73
74define 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)
80endef
81
82define 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)
88endef
89
90# Ralink rt2x00 drivers
91RT61FW:=RT61_Firmware_V1.2.zip
92RT71FW:=RT71W_Firmware_V1.8.zip
93RT2860FW:=RT2860_Firmware_V11.zip
94
95define Download/rt61
96  FILE:=$(RT61FW)
97  URL:=http://www.ralinktech.com.tw/data/
98  MD5SUM:=d4c690c93b470bc9a681297c2adc6281
99endef
100$(eval $(call Download,rt61))
101
102define Download/rt71w
103  FILE:=$(RT71FW)
104  URL:=http://www.ralinktech.com.tw/data/
105  MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
106endef
107$(eval $(call Download,rt71w))
108
109define Download/rt2860
110  FILE:=$(RT2860FW)
111  URL:=http://www.ralinktech.com.tw/data/drivers
112  MD5SUM:=440a81756a52c53528f16faa41c40124
113endef
114$(eval $(call Download,rt2860))
115
116define KernelPackage/rt2x00/Default
117  SUBMENU:=$(WMENU)
118  TITLE:=Ralink Drivers for RT2x00 cards
119endef
120
121define 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)
127endef
128
129define 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)
135endef
136
137define 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)
143endef
144
145define 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)
151endef
152
153define 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)
159endef
160
161define 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)
167endef
168
169define 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)
175endef
176
177define 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)
183endef
184
185define 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)
191endef
192
193ZD1211FW_NAME:=zd1211-firmware
194ZD1211FW_VERSION:=1.4
195define Download/zd1211rw
196  FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
197  URL:=@SF/zd1211/
198  MD5SUM:=19f28781d76569af8551c9d11294c870
199endef
200$(eval $(call Download,zd1211rw))
201
202define 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)
208endef
209
210define 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)
217endef
218
219define KernelPackage/ath5k/description
220This module adds support for wireless adapters based on
221Atheros 5xxx chipset.
222endef
223
224define 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)
231endef
232
233define KernelPackage/ath9k-new/description
234This module adds support for wireless adapters based on
235Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
236endef
237
238define 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)
244endef
245
246#Broadcom firmware
247PKG_B43_FWV4_NAME:=broadcom-wl
248PKG_B43_FWV4_VERSION:=4.150.10.5
249PKG_B43_FWV4_OBJECT:=driver/wl_apsta_mimo.o
250PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
251PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
252PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
253
254PKG_B43_FWV3_NAME:=wl_apsta
255PKG_B43_FWV3_VERSION:=3.130.20.0
256PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
257PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
258PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
259
260PKG_B43_FWCUTTER_NAME:=b43-fwcutter
261PKG_B43_FWCUTTER_VERSION:=011
262PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
263PKG_B43_FWCUTTER_SOURCE_URL:=http://bu3sch.de/b43/fwcutter/
264PKG_B43_FWCUTTER_MD5SUM:=3db2f4de85a459451f5b391cf67a8d44
265
266define Download/b43-common
267  FILE:=$(PKG_B43_FWCUTTER_SOURCE)
268  URL:=$(PKG_B43_FWCUTTER_SOURCE_URL)
269  MD5SUM:=$(PKG_B43_FWCUTTER_MD5SUM)
270endef
271$(eval $(call Download,b43-common))
272
273define Download/b43
274  FILE:=$(PKG_B43_FWV4_SOURCE)
275  URL:=$(PKG_B43_FWV4_SOURCE_URL)
276  MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
277endef
278$(eval $(call Download,b43))
279
280define Download/b43legacy
281  FILE:=$(PKG_B43_FWV3_SOURCE)
282  URL:=$(PKG_B43_FWV3_SOURCE_URL)
283  MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
284endef
285$(eval $(call Download,b43legacy))
286
287define 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
292endef
293
294define 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)
299endef
300
301define KernelPackage/b43/description
302Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
303endef
304
305define 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)
310endef
311
312define KernelPackage/b43legacy/description
313Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
314endef
315
316BUILDFLAGS:= \
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
323MAKE_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
336define 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
351endef
352
353ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
354 define Build/Compile/kmod
355        $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
356 endef
357endif
358
359define Build/Compile
360        $(call Build/Compile/kmod)
361endef
362
363define 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/
367endef
368
369define KernelPackage/mac80211/install
370        $(INSTALL_DIR) $(1)/lib/wifi
371        $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
372endef
373
374define KernelPackage/p54-common/install
375        $(INSTALL_DIR) $(1)/lib/firmware
376        $(INSTALL_DATA) $(DL_DIR)/$(P54FW) $(1)/lib/firmware/isl3886
377endef
378
379define KernelPackage/rt61-pci/install
380        $(INSTALL_DIR) $(1)/lib/firmware
381        $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
382endef
383
384define KernelPackage/rt73-usb/install
385        $(INSTALL_DIR) $(1)/lib/firmware
386        $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
387endef
388
389define KernelPackage/rt2800-pci/install
390        $(INSTALL_DIR) $(1)/lib/firmware
391        $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2860.bin $(1)/lib/firmware/
392endef
393
394define KernelPackage/zd1211rw/install
395        $(INSTALL_DIR) $(1)/lib/firmware/zd1211
396        $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
397endef
398
399define 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"
403endef
404
405define 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)
413endef
414
415define 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)
422endef
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))
Note: See TracBrowser for help on using the repository browser.