Merge branch 'openssl'
[openwrt.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 PKG_VERSION:=2008-04-07
16 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
18 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
19
20 include $(INCLUDE_DIR)/package.mk
21
22 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
23
24 define KernelPackage/mac80211
25 SUBMENU:=Wireless Drivers
26 TITLE:=Linux 802.11 Wireless Networking Stack
27 DEPENDS:=@LINUX_2_6_23||LINUX_2_6_24 +kmod-crypto-arc4 +kmod-crypto-aes +wireless-tools
28 FILES:= \
29 $(PKG_BUILD_DIR)/net/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
30 $(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
31 AUTOLOAD:=$(call AutoLoad,20,cfg80211 mac80211)
32 endef
33
34 define KernelPackage/mac80211/description
35 Linux 802.11 Wireless Networking Stack
36 endef
37
38 # Ralink rt2x00 drivers
39 RT61FW:=RT61_Firmware_V1.2.zip
40 RT71FW:=RT71W_Firmware_V1.8.zip
41
42 define Download/rt61
43 FILE:=$(RT61FW)
44 URL:=http://www.ralinktech.com.tw/data/
45 MD5SUM:=d4c690c93b470bc9a681297c2adc6281
46 endef
47 $(eval $(call Download,rt61))
48
49 define Download/rt71w
50 FILE:=$(RT71FW)
51 URL:=http://www.ralinktech.com.tw/data/
52 MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
53 endef
54 $(eval $(call Download,rt71w))
55
56 define KernelPackage/rt2x00/Default
57 SUBMENU:=Wireless Drivers
58 TITLE:=Ralink Drivers for RT2x00 cards
59 DEPENDS:=@LINUX_2_6_24 @!TARGET_ar7 @!TARGET_atheros @!TARGET_uml
60 endef
61
62 define KernelPackage/rt2x00-lib
63 $(call KernelPackage/rt2x00/Default)
64 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211
65 TITLE+= (LIB)
66 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.$(LINUX_KMOD_SUFFIX)
67 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
68 endef
69
70 define KernelPackage/rt2x00-pci
71 $(call KernelPackage/rt2x00/Default)
72 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
73 TITLE+= (PCI)
74 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.$(LINUX_KMOD_SUFFIX)
75 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
76 endef
77
78 define KernelPackage/rt2x00-usb
79 $(call KernelPackage/rt2x00/Default)
80 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
81 TITLE+= (USB)
82 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.$(LINUX_KMOD_SUFFIX)
83 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
84 endef
85
86 define KernelPackage/rt2400-pci
87 $(call KernelPackage/rt2x00/Default)
88 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
89 TITLE+= (RT2400 PCI)
90 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.$(LINUX_KMOD_SUFFIX)
91 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
92 endef
93
94 define KernelPackage/rt2500-pci
95 $(call KernelPackage/rt2x00/Default)
96 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
97 TITLE+= (RT2500 PCI)
98 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.$(LINUX_KMOD_SUFFIX)
99 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
100 endef
101
102 define KernelPackage/rt2500-usb
103 $(call KernelPackage/rt2x00/Default)
104 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-crc-itu-t
105 TITLE+= (RT2500 USB)
106 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.$(LINUX_KMOD_SUFFIX)
107 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
108 endef
109
110 define KernelPackage/rt61-pci
111 $(call KernelPackage/rt2x00/Default)
112 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-crc-itu-t
113 TITLE+= (RT2x61 PCI)
114 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.$(LINUX_KMOD_SUFFIX)
115 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
116 endef
117
118 define KernelPackage/rt73-usb
119 $(call KernelPackage/rt2x00/Default)
120 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
121 TITLE+= (RT73 USB)
122 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.$(LINUX_KMOD_SUFFIX)
123 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
124 endef
125
126 RT2X00_CONFOPTS:=CONFIG_RT2X00=y \
127 CONFIG_RT2X00_DEBUG=y \
128 CONFIG_RT2X00_LIB_FIRMWARE=y \
129 CONFIG_RT2X00_LIB_LEDS=y
130
131 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
132 RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_PCI=y
133 endif
134 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
135 RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_USB=y
136 endif
137 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
138 RT2X00_CONFOPTS+= CONFIG_RT2400PCI=y
139 endif
140 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
141 RT2X00_CONFOPTS+= CONFIG_RT2500PCI=y
142 endif
143 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
144 RT2X00_CONFOPTS+= CONFIG_RT2500USB=y
145 endif
146 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
147 RT2X00_CONFOPTS+= CONFIG_RT61PCI=y
148 endif
149 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
150 RT2X00_CONFOPTS+= CONFIG_RT73USB=y
151 endif
152
153
154 CONFOPTS:=MAC80211 CFG80211 NL80211 MAC80211_RC_DEFAULT_PID MAC80211_RC_PID \
155
156 BUILDFLAGS:= \
157 $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
158 $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
159 -D__CONFIG_MAC80211_RC_DEFAULT=pid \
160
161 MAKE_OPTS:= \
162 CROSS_COMPILE="$(TARGET_CROSS)" \
163 ARCH="$(LINUX_KARCH)" \
164 EXTRA_CFLAGS="$(BUILDFLAGS)" \
165 $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
166 CONFIG_NL80211=y \
167 CONFIG_MAC80211_RC_PID=y \
168 CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
169 LINUXINCLUDE="-I$(PKG_BUILD_DIR)/include -I$(LINUX_DIR)/include -include linux/autoconf.h" \
170 KLIB_BUILD="$(LINUX_DIR)" \
171
172 define Build/Prepare
173 rm -rf $(PKG_BUILD_DIR)
174 mkdir -p $(PKG_BUILD_DIR)
175 $(PKG_UNPACK)
176 $(Build/Patch)
177 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
178 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
179 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
180 endef
181
182 ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
183 define Build/Compile/kmod
184 $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
185 endef
186 endif
187
188 define Build/Compile
189 $(call Build/Compile/kmod)
190 endef
191
192 define Build/InstallDev
193 mkdir -p $(1)/usr/include/mac80211
194 $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
195 endef
196
197 define KernelPackage/mac80211/install
198 $(INSTALL_DIR) $(1)/lib/wifi
199 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
200 endef
201
202 define KernelPackage/rt61-pci/install
203 $(INSTALL_DIR) $(1)/lib/firmware
204 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
205 endef
206
207 define KernelPackage/rt73-usb/install
208 $(INSTALL_DIR) $(1)/lib/firmware
209 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
210 endef
211
212
213 $(eval $(call KernelPackage,mac80211))
214 $(eval $(call KernelPackage,rt2x00-lib))
215 $(eval $(call KernelPackage,rt2x00-pci))
216 $(eval $(call KernelPackage,rt2x00-usb))
217 $(eval $(call KernelPackage,rt2400-pci))
218 $(eval $(call KernelPackage,rt2500-pci))
219 $(eval $(call KernelPackage,rt2500-usb))
220 $(eval $(call KernelPackage,rt61-pci))
221 $(eval $(call KernelPackage,rt73-usb))
This page took 0.055193 seconds and 5 git commands to generate.