source: trunk/package/mac80211/Makefile @ 10951

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

Use the locally mirrored compat-wireless tarblall (#3377)

File size: 6.5 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
15PKG_VERSION:=2008-04-07
16PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
17PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
18PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
19
20include $(INCLUDE_DIR)/package.mk
21
22# XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
23
24define 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)
32endef
33
34define KernelPackage/mac80211/description
35Linux 802.11 Wireless Networking Stack
36endef
37
38# Ralink rt2x00 drivers
39RT61FW:=RT61_Firmware_V1.2.zip
40RT71FW:=RT71W_Firmware_V1.8.zip
41
42define Download/rt61
43  FILE:=$(RT61FW)
44  URL:=http://www.ralinktech.com.tw/data/
45  MD5SUM:=d4c690c93b470bc9a681297c2adc6281
46endef
47$(eval $(call Download,rt61))
48
49define Download/rt71w
50  FILE:=$(RT71FW)
51  URL:=http://www.ralinktech.com.tw/data/
52  MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
53endef
54$(eval $(call Download,rt71w))
55
56define 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
60endef
61
62define 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)
68endef
69
70define 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)
76endef
77
78define 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)
84endef
85
86define 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)
92endef
93
94define 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)
100endef
101
102define 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)
108endef
109
110define 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)
116endef
117
118define 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)
124endef
125
126RT2X00_CONFOPTS:=CONFIG_RT2X00=y \
127                CONFIG_RT2X00_DEBUG=y \
128                CONFIG_RT2X00_LIB_FIRMWARE=y \
129                CONFIG_RT2X00_LIB_LEDS=y
130
131ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
132  RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_PCI=y
133endif
134ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
135  RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_USB=y
136endif
137ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
138  RT2X00_CONFOPTS+= CONFIG_RT2400PCI=y
139endif
140ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
141  RT2X00_CONFOPTS+= CONFIG_RT2500PCI=y
142endif
143ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
144  RT2X00_CONFOPTS+= CONFIG_RT2500USB=y
145endif
146ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
147  RT2X00_CONFOPTS+= CONFIG_RT61PCI=y
148endif
149ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
150  RT2X00_CONFOPTS+= CONFIG_RT73USB=y
151endif
152
153
154CONFOPTS:=MAC80211 CFG80211 NL80211 MAC80211_RC_DEFAULT_PID MAC80211_RC_PID \
155
156BUILDFLAGS:= \
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
161MAKE_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
172define 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)
180endef
181
182ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
183 define Build/Compile/kmod
184        $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
185 endef
186endif
187
188define Build/Compile
189        $(call Build/Compile/kmod)
190endef
191
192define 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/
195endef
196
197define KernelPackage/mac80211/install
198        $(INSTALL_DIR) $(1)/lib/wifi
199        $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
200endef
201
202define KernelPackage/rt61-pci/install
203        $(INSTALL_DIR) $(1)/lib/firmware
204        $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
205endef
206
207define KernelPackage/rt73-usb/install
208        $(INSTALL_DIR) $(1)/lib/firmware
209        $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
210endef
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))
Note: See TracBrowser for help on using the repository browser.