source: trunk/package/mac80211/Makefile @ 11462

Last change on this file since 11462 was 11462, checked in by noz, 8 years ago

Remove ssb headers from mac80211 to avoid conflict with in-kernel ones

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-05-26
16PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
17PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/05
18#PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
19PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
20
21include $(INCLUDE_DIR)/package.mk
22
23define KernelPackage/mac80211
24  SUBMENU:=Wireless Drivers
25  TITLE:=Linux 802.11 Wireless Networking Stack
26  DEPENDS:=@LINUX_2_6_23||LINUX_2_6_24||LINUX_2_6_25 +kmod-crypto-arc4 +kmod-crypto-aes +wireless-tools
27  FILES:= \
28        $(PKG_BUILD_DIR)/net/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
29        $(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
30  AUTOLOAD:=$(call AutoLoad,20,cfg80211 mac80211)
31endef
32
33define KernelPackage/mac80211/description
34Linux 802.11 Wireless Networking Stack
35endef
36
37# Ralink rt2x00 drivers
38RT61FW:=RT61_Firmware_V1.2.zip
39RT71FW:=RT71W_Firmware_V1.8.zip
40
41define Download/rt61
42  FILE:=$(RT61FW)
43  URL:=http://www.ralinktech.com.tw/data/
44  MD5SUM:=d4c690c93b470bc9a681297c2adc6281
45endef
46$(eval $(call Download,rt61))
47
48define Download/rt71w
49  FILE:=$(RT71FW)
50  URL:=http://www.ralinktech.com.tw/data/
51  MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
52endef
53$(eval $(call Download,rt71w))
54
55define KernelPackage/rt2x00/Default
56  SUBMENU:=Wireless Drivers
57  TITLE:=Ralink Drivers for RT2x00 cards
58  DEPENDS:=@LINUX_2_6_24||LINUX_2_6_25
59endef
60
61define KernelPackage/rt2x00-lib
62$(call KernelPackage/rt2x00/Default)
63  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211
64  TITLE+= (LIB)
65  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.$(LINUX_KMOD_SUFFIX)
66  AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
67endef
68
69define KernelPackage/rt2x00-pci
70$(call KernelPackage/rt2x00/Default)
71  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
72  TITLE+= (PCI)
73  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.$(LINUX_KMOD_SUFFIX)
74  AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
75endef
76
77define KernelPackage/rt2x00-usb
78$(call KernelPackage/rt2x00/Default)
79  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
80  TITLE+= (USB)
81  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.$(LINUX_KMOD_SUFFIX)
82  AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
83endef
84
85define KernelPackage/rt2400-pci
86$(call KernelPackage/rt2x00/Default)
87  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
88  TITLE+= (RT2400 PCI)
89  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.$(LINUX_KMOD_SUFFIX)
90  AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
91endef
92
93define KernelPackage/rt2500-pci
94$(call KernelPackage/rt2x00/Default)
95  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
96  TITLE+= (RT2500 PCI)
97  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.$(LINUX_KMOD_SUFFIX)
98  AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
99endef
100
101define KernelPackage/rt2500-usb
102$(call KernelPackage/rt2x00/Default)
103  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-crc-itu-t
104  TITLE+= (RT2500 USB)
105  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.$(LINUX_KMOD_SUFFIX)
106  AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
107endef
108
109define KernelPackage/rt61-pci
110$(call KernelPackage/rt2x00/Default)
111  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-crc-itu-t
112  TITLE+= (RT2x61 PCI)
113  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.$(LINUX_KMOD_SUFFIX)
114  AUTOLOAD:=$(call AutoLoad,27,rt61pci)
115endef
116
117define KernelPackage/rt73-usb
118  $(call KernelPackage/rt2x00/Default)
119  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
120  TITLE+= (RT73 USB)
121  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.$(LINUX_KMOD_SUFFIX)
122  AUTOLOAD:=$(call AutoLoad,27,rt73usb)
123endef
124
125RT2X00_CONFOPTS:=CONFIG_RT2X00=y \
126                CONFIG_RT2X00_DEBUG=y \
127                CONFIG_RT2X00_LIB_FIRMWARE=y \
128                CONFIG_RT2X00_LIB_LEDS=y
129
130ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
131  RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_PCI=y
132endif
133ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
134  RT2X00_CONFOPTS+= CONFIG_RT2X00_LIB_USB=y
135endif
136ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
137  RT2X00_CONFOPTS+= CONFIG_RT2400PCI=y
138endif
139ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
140  RT2X00_CONFOPTS+= CONFIG_RT2500PCI=y
141endif
142ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
143  RT2X00_CONFOPTS+= CONFIG_RT2500USB=y
144endif
145ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
146  RT2X00_CONFOPTS+= CONFIG_RT61PCI=y
147endif
148ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
149  RT2X00_CONFOPTS+= CONFIG_RT73USB=y
150endif
151
152
153CONFOPTS:=MAC80211 CFG80211 NL80211 MAC80211_RC_DEFAULT_PID MAC80211_RC_PID \
154
155BUILDFLAGS:= \
156        $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
157        $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
158        -D__CONFIG_MAC80211_RC_DEFAULT=pid \
159
160MAKE_OPTS:= \
161        CROSS_COMPILE="$(TARGET_CROSS)" \
162        ARCH="$(LINUX_KARCH)" \
163        EXTRA_CFLAGS="$(BUILDFLAGS)" \
164        $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
165        CONFIG_NL80211=y \
166        CONFIG_MAC80211_RC_PID=y \
167        CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
168        LINUXINCLUDE="-I$(PKG_BUILD_DIR)/include -I$(LINUX_DIR)/include -include linux/autoconf.h" \
169        KLIB_BUILD="$(LINUX_DIR)" \
170
171define Build/Prepare
172        rm -rf $(PKG_BUILD_DIR)
173        mkdir -p $(PKG_BUILD_DIR)
174        $(PKG_UNPACK)
175        $(Build/Patch)
176        $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
177        unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT61FW)
178        unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
179        rm -rf $(PKG_BUILD_DIR)/include/linux/ssb
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.