[packages] mac80211: fix zd1211rw firmware location
[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-10-08
17 PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/10
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:=./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
29 define KernelPackage/mac80211
30 SUBMENU:=Wireless Drivers
31 TITLE:=Linux 802.11 Wireless Networking Stack
32 DEPENDS:=@LINUX_2_6 +kmod-crypto-arc4 +kmod-crypto-aes +wireless-tools @!TARGET_avr32
33 FILES:= \
34 $(PKG_BUILD_DIR)/net/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
35 $(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
36 AUTOLOAD:=$(call AutoLoad,20,cfg80211 mac80211)
37 endef
38
39 define KernelPackage/mac80211/description
40 Linux 802.11 Wireless Networking Stack
41 endef
42
43 # Ralink rt2x00 drivers
44 RT61FW:=RT61_Firmware_V1.2.zip
45 RT71FW:=RT71W_Firmware_V1.8.zip
46
47 define Download/rt61
48 FILE:=$(RT61FW)
49 URL:=http://www.ralinktech.com.tw/data/
50 MD5SUM:=d4c690c93b470bc9a681297c2adc6281
51 endef
52 $(eval $(call Download,rt61))
53
54 define Download/rt71w
55 FILE:=$(RT71FW)
56 URL:=http://www.ralinktech.com.tw/data/
57 MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
58 endef
59 $(eval $(call Download,rt71w))
60
61 define KernelPackage/rt2x00/Default
62 SUBMENU:=Wireless Drivers
63 TITLE:=Ralink Drivers for RT2x00 cards
64 endef
65
66 define KernelPackage/rt2x00-lib
67 $(call KernelPackage/rt2x00/Default)
68 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211 +kmod-crc-itu-t
69 TITLE+= (LIB)
70 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.$(LINUX_KMOD_SUFFIX)
71 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
72 endef
73
74 define KernelPackage/rt2x00-pci
75 $(call KernelPackage/rt2x00/Default)
76 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
77 TITLE+= (PCI)
78 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.$(LINUX_KMOD_SUFFIX)
79 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
80 endef
81
82 define KernelPackage/rt2x00-usb
83 $(call KernelPackage/rt2x00/Default)
84 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
85 TITLE+= (USB)
86 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.$(LINUX_KMOD_SUFFIX)
87 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
88 endef
89
90 define KernelPackage/rt2400-pci
91 $(call KernelPackage/rt2x00/Default)
92 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
93 TITLE+= (RT2400 PCI)
94 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.$(LINUX_KMOD_SUFFIX)
95 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
96 endef
97
98 define KernelPackage/rt2500-pci
99 $(call KernelPackage/rt2x00/Default)
100 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
101 TITLE+= (RT2500 PCI)
102 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.$(LINUX_KMOD_SUFFIX)
103 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
104 endef
105
106 define KernelPackage/rt2500-usb
107 $(call KernelPackage/rt2x00/Default)
108 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
109 TITLE+= (RT2500 USB)
110 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.$(LINUX_KMOD_SUFFIX)
111 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
112 endef
113
114 define KernelPackage/rt61-pci
115 $(call KernelPackage/rt2x00/Default)
116 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
117 TITLE+= (RT2x61 PCI)
118 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.$(LINUX_KMOD_SUFFIX)
119 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
120 endef
121
122 define KernelPackage/rt73-usb
123 $(call KernelPackage/rt2x00/Default)
124 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
125 TITLE+= (RT73 USB)
126 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.$(LINUX_KMOD_SUFFIX)
127 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
128 endef
129
130 ZD1211FW_NAME:=zd1211-firmware
131 ZD1211FW_VERSION:=1.4
132 define Download/zd1211rw
133 FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
134 URL:=@SF/zd1211/
135 MD5SUM:=19f28781d76569af8551c9d11294c870
136 endef
137 $(eval $(call Download,zd1211rw))
138
139 define KernelPackage/zd1211rw
140 SUBMENU:=Wireless Drivers
141 TITLE:=Zydas ZD1211 support
142 DEPENDS:=@LINUX_2_6_24||@LINUX_2_6_25||@LINUX_2_6_26||@LINUX_2_6_27 @USB_SUPPORT +kmod-usb-core +kmod-mac80211
143 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.$(LINUX_KMOD_SUFFIX)
144 AUTOLOAD:=$(call AutoLoad,60,zd1211rw)
145 endef
146
147 define KernelPackage/ath5k
148 SUBMENU:=Wireless Drivers
149 TITLE:=Atheros 5xxx wireless cards support
150 DEPENDS+= @PCI_SUPPORT +kmod-mac80211
151 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath5k/ath5k.$(LINUX_KMOD_SUFFIX)
152 AUTOLOAD:=$(call AutoLoad,27,ath5k)
153 endef
154
155 BUILDFLAGS:= \
156 -I$(PKG_BUILD_DIR)/include \
157 $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
158 $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
159 $(if $(CONFIG_DEBUG_FS), -DCONFIG_MAC80211_DEBUGFS) \
160 -D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
161
162 MAKE_OPTS:= \
163 CROSS_COMPILE="$(TARGET_CROSS)" \
164 ARCH="$(LINUX_KARCH)" \
165 EXTRA_CFLAGS="$(BUILDFLAGS)" \
166 $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
167 CONFIG_NL80211=y \
168 CONFIG_MAC80211_RC_PID=y \
169 CONFIG_MAC80211_RC_MINSTREL=y \
170 CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
171 CONFIG_MAC80211_DEBUGFS=$(CONFIG_DEBUG_FS) \
172 KLIB_BUILD="$(LINUX_DIR)" \
173 MODPROBE=:
174
175 define Build/Prepare
176 rm -rf $(PKG_BUILD_DIR)
177 mkdir -p $(PKG_BUILD_DIR)
178 $(PKG_UNPACK)
179 $(Build/Patch)
180 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
181 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
182 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
183 $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
184 $(if $(CONFIG_TARGET_brcm47xx),rm -rf $(PKG_BUILD_DIR)/include/linux/ssb)
185 endef
186
187 ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
188 define Build/Compile/kmod
189 $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
190 endef
191 endif
192
193 define Build/Compile
194 $(call Build/Compile/kmod)
195 endef
196
197 define Build/InstallDev
198 mkdir -p $(1)/usr/include/mac80211 $(1)/usr/include/net/mac80211
199 $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
200 $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
201 endef
202
203 define KernelPackage/mac80211/install
204 $(INSTALL_DIR) $(1)/lib/wifi
205 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
206 endef
207
208 define KernelPackage/rt61-pci/install
209 $(INSTALL_DIR) $(1)/lib/firmware
210 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
211 endef
212
213 define KernelPackage/rt73-usb/install
214 $(INSTALL_DIR) $(1)/lib/firmware
215 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
216 endef
217
218 define KernelPackage/zd1211rw/install
219 $(INSTALL_DIR) $(1)/lib/firmware/zd1211
220 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
221 endef
222
223 $(eval $(call KernelPackage,ath5k))
224 $(eval $(call KernelPackage,mac80211))
225 $(eval $(call KernelPackage,rt2x00-lib))
226 $(eval $(call KernelPackage,rt2x00-pci))
227 $(eval $(call KernelPackage,rt2x00-usb))
228 $(eval $(call KernelPackage,rt2400-pci))
229 $(eval $(call KernelPackage,rt2500-pci))
230 $(eval $(call KernelPackage,rt2500-usb))
231 $(eval $(call KernelPackage,rt61-pci))
232 $(eval $(call KernelPackage,rt73-usb))
233 $(eval $(call KernelPackage,zd1211rw))