madwifi: remove the "turbo" iwpriv command, it does not do anything useful, but it...
[openwrt.git] / package / madwifi / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=madwifi
12
13 ifneq ($(CONFIG_MADWIFI_UPSTREAM),)
14 PKG_VERSION:=0.9.4
15 PKG_RELEASE:=2
16
17 PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/
19 PKG_MD5SUM:=399d20de8d855a59f20058857c2178ad
20
21 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/madwifi-$(PKG_VERSION)
22
23 PATCH_DIR=./patches-upstream
24 else
25 # PKG_BRANCH:=madwifi-dfs
26 PKG_REV:=3314
27 PKG_VERSION:=r$(PKG_REV)
28 PKG_RELEASE:=2
29
30 PKG_SOURCE_PROTO:=svn
31 PKG_SOURCE_VERSION:=$(PKG_REV)
32 PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
33 PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
34 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
35
36 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
37
38 PATCH_DIR=./patches
39 endif
40
41 HAL_VERSION:=20090508
42 HAL_FILE:=ath_hal-$(HAL_VERSION).tgz
43 HAL_MD5SUM:=4ab7ae8bdb96c0be388c98bf8f92d5ca
44
45 PKG_BUILD_DEPENDS:=wprobe
46
47 include $(INCLUDE_DIR)/package.mk
48
49 COMPRESSION:=1
50
51 define Download/hal
52 FILE:=$(HAL_FILE)
53 URL:=http://mirror2.openwrt.org/sources
54 MD5SUM:=$(HAL_MD5SUM)
55 endef
56 $(eval $(call Download,hal))
57
58
59 ifneq ($(CONFIG_TARGET_atheros),)
60 BUS:=AHB
61 else
62 ifneq ($(CONFIG_PCI_SUPPORT),)
63 BUS:=PCI
64 endif
65 endif
66
67 ifneq ($(CONFIG_CPU_MIPS32_R2),)
68 ifeq ($(ARCH),mips)
69 HAL_TARGET:=mips32r2-be-elf
70 endif
71 ifeq ($(ARCH),mipsel)
72 HAL_TARGET:=mips32r2-le-elf
73 endif
74 else
75 ifeq ($(ARCH),mips)
76 HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-be-elf,mips32-be-elf)
77 endif
78 ifeq ($(ARCH),mipsel)
79 HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-le-elf,mips32-le-elf)
80 endif
81 endif
82 ifeq ($(ARCH),i386)
83 HAL_TARGET:=i386-elf
84 endif
85 ifeq ($(ARCH),i686)
86 HAL_TARGET:=i386-elf
87 endif
88 ifeq ($(BOARD),ixp4xx)
89 HAL_TARGET:=xscale-be-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
90 endif
91 ifeq ($(BOARD),iop32x)
92 HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
93 endif
94 ifeq ($(BOARD),orion)
95 HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
96 endif
97 ifeq ($(ARCH),powerpc)
98 HAL_TARGET:=powerpc-be-elf
99 endif
100 ifeq ($(BOARD),storm)
101 HAL_TARGET:=armv4-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
102 endif
103 ifneq ($(CONFIG_TARGET_atheros),)
104 HAL_TARGET:=wisoc
105 endif
106
107 ifdef CONFIG_MADWIFI_RCA_MINSTREL
108 RATE_CONTROL:=minstrel
109 endif
110
111 ifdef CONFIG_MADWIFI_RCA_ONOE
112 RATE_CONTROL:=onoe
113 endif
114
115 ifdef CONFIG_MADWIFI_RCA_AMRR
116 RATE_CONTROL:=amrr
117 endif
118
119 ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
120 RATE_CONTROL:=sample
121 endif
122
123 MADWIFI_FILES:= \
124 $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
125 $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
126 $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
127 $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
128 $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
129 $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
130 $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
131 $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
132 $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
133 $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX) \
134
135 MADWIFI_AUTOLOAD:= \
136 wlan \
137 wlan_scan_ap \
138 wlan_scan_sta \
139 ath_hal \
140 ath_rate_$(RATE_CONTROL) \
141 wlan_acl \
142 wlan_ccmp \
143 wlan_tkip \
144 wlan_wep \
145 wlan_xauth \
146
147 ifeq ($(findstring AHB,$(BUS)),AHB)
148 MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
149 MADWIFI_AUTOLOAD+= ath_ahb
150 endif
151 ifeq ($(findstring PCI,$(BUS)),PCI)
152 MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
153 MADWIFI_AUTOLOAD+= ath_pci
154 endif
155
156 MADWIFI_APPLETS:=80211stats athchans athkey athstats wlanconfig ath_info
157 ifdef CONFIG_MADWIFI_DEBUG
158 MADWIFI_APPLETS += athdebug 80211debug
159 endif
160 ifndef CONFIG_MADWIFI_UPSTREAM
161 MADWIFI_APPLETS += madwifi_multi
162 endif
163
164 define KernelPackage/madwifi
165 SUBMENU:=Wireless Drivers
166 TITLE:=Driver for Atheros wireless chipsets
167 URL:=http://madwifi.org/
168 DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_avr32 @!TARGET_etrax @LINUX_2_6
169 FILES:=$(MADWIFI_FILES)
170 AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
171 endef
172
173 define KernelPackage/madwifi/description
174 This package contains a driver for Atheros 802.11a/b/g chipsets.
175 endef
176
177 define KernelPackage/madwifi/config
178 source "$(SOURCE)/Config.in"
179 endef
180
181 MADWIFI_INC = \
182 -I$(PKG_BUILD_DIR) \
183 -I$(PKG_BUILD_DIR)/include \
184 -I$(PKG_BUILD_DIR)/hal \
185 -I$(PKG_BUILD_DIR)/ath \
186 -I$(PKG_BUILD_DIR)/ath_hal \
187 -I$(PKG_BUILD_DIR)/net80211 \
188 -I$(STAGING_DIR)/usr/include/wprobe \
189 -include $(PKG_BUILD_DIR)/include/compat.h
190
191 MAKE_ARGS:= \
192 PATH="$(TARGET_PATH)" \
193 ARCH="$(LINUX_KARCH)" \
194 ARCH-y="$(LINUX_KARCH)" \
195 CROSS_COMPILE="$(TARGET_CROSS)" \
196 TARGET="$(HAL_TARGET)" \
197 TOOLPREFIX="$(KERNEL_CROSS)" \
198 TOOLPATH="$(KERNEL_CROSS)" \
199 KERNELPATH="$(LINUX_DIR)" \
200 LDOPTS="--no-warn-mismatch " \
201 ATH_RATE="ath_rate/$(RATE_CONTROL)" \
202 ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \
203 DO_MULTI=1 \
204 INCS="$(MADWIFI_INC)" \
205 $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
206
207 MAKE_VARS:= \
208 COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \
209
210 ifeq ($(CONFIG_MADWIFI_UPSTREAM),)
211 define Build/Prepare/HAL
212 rm -rf $(PKG_BUILD_DIR)/tmp
213 mkdir -p $(PKG_BUILD_DIR)/tmp
214 tar xvzf $(DL_DIR)/$(HAL_FILE) -C $(PKG_BUILD_DIR)/tmp
215 $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
216 rm -rf $(PKG_BUILD_DIR)/tmp
217 endef
218 endif
219
220 define Build/Prepare
221 $(call Build/Prepare/Default)
222 $(call Build/Prepare/HAL)
223 # patch cflags
224 $(SED) 's, -E[LB],,' \
225 -e 's, -mips2,,' \
226 -e 's, -mapcs-32,,' \
227 $(PKG_BUILD_DIR)/hal/public/*.inc
228 $(SED) 's,march=armv4,march=armv5te,' \
229 $(PKG_BUILD_DIR)/hal/public/xscale*.inc
230 endef
231
232 ifeq ($(findstring AHB,$(BUS)),AHB)
233 define Build/Compile/ahb
234 $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
235 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
236 endef
237 endif
238
239 ifeq ($(findstring PCI,$(BUS)),PCI)
240 define Build/Compile/pci
241 $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
242 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
243 endef
244 endif
245
246 define Build/Configure
247 $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
248 endef
249
250 define Build/Compile
251 $(call Build/Compile/ahb)
252 $(call Build/Compile/pci)
253 endef
254
255 define Build/InstallDev
256 mkdir -p $(1)/usr/include/madwifi
257 $(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/
258 mkdir -p $(1)/usr/include/madwifi/net80211
259 $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/
260 endef
261
262 define KernelPackage/madwifi/install
263 $(INSTALL_DIR) $(1)/usr/sbin
264 $(CP) ./files/* $(1)/
265 $(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
266 endef
267
268 $(eval $(call KernelPackage,madwifi))
This page took 0.054886 seconds and 5 git commands to generate.