2 # Copyright (C) 2007-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # $Id: Makefile 7440 2007-06-02 02:22:01Z nbd $
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
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
)
20 include $(INCLUDE_DIR
)/package.mk
22 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
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
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
)
34 define KernelPackage
/mac80211
/description
35 Linux
802.11 Wireless Networking Stack
38 # Ralink rt2x00 drivers
39 RT61FW
:=RT61_Firmware_V1.2.zip
40 RT71FW
:=RT71W_Firmware_V1.8.zip
44 URL
:=http
://www.ralinktech.com.tw
/data
/
45 MD5SUM
:=d4c690c93b470bc9a681297c2adc6281
47 $(eval
$(call Download
,rt61
))
51 URL
:=http
://www.ralinktech.com.tw
/data
/
52 MD5SUM
:=1e7a5dc574e0268574fcda3fd5cf52f7
54 $(eval
$(call Download
,rt71w
))
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
62 define KernelPackage
/rt2x00-lib
63 $(call KernelPackage
/rt2x00
/Default
)
64 DEPENDS
+= @PCI_SUPPORT||USB_SUPPORT
+kmod-mac80211
66 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00lib.
$(LINUX_KMOD_SUFFIX
)
67 AUTOLOAD
:=$(call AutoLoad
,25,blkcipher ecb arc4 rt2x00lib
)
70 define KernelPackage
/rt2x00-pci
71 $(call KernelPackage
/rt2x00
/Default
)
72 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-lib
+kmod-eeprom-93cx6
74 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00pci.
$(LINUX_KMOD_SUFFIX
)
75 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00pci
)
78 define KernelPackage
/rt2x00-usb
79 $(call KernelPackage
/rt2x00
/Default
)
80 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-lib
+kmod-usb-core
82 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2x00usb.
$(LINUX_KMOD_SUFFIX
)
83 AUTOLOAD
:=$(call AutoLoad
,26,rt2x00usb
)
86 define KernelPackage
/rt2400-pci
87 $(call KernelPackage
/rt2x00
/Default
)
88 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
90 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2400pci.
$(LINUX_KMOD_SUFFIX
)
91 AUTOLOAD
:=$(call AutoLoad
,27,rt2400pci
)
94 define KernelPackage
/rt2500-pci
95 $(call KernelPackage
/rt2x00
/Default
)
96 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
98 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2500pci.
$(LINUX_KMOD_SUFFIX
)
99 AUTOLOAD
:=$(call AutoLoad
,27,rt2500pci
)
102 define KernelPackage
/rt2500-usb
103 $(call KernelPackage
/rt2x00
/Default
)
104 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
+kmod-crc-itu-t
106 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt2500usb.
$(LINUX_KMOD_SUFFIX
)
107 AUTOLOAD
:=$(call AutoLoad
,27,rt2500usb
)
110 define KernelPackage
/rt61-pci
111 $(call KernelPackage
/rt2x00
/Default
)
112 DEPENDS
+= @PCI_SUPPORT
+kmod-rt2x00-pci
+kmod-crc-itu-t
114 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt61pci.
$(LINUX_KMOD_SUFFIX
)
115 AUTOLOAD
:=$(call AutoLoad
,27,rt61pci
)
118 define KernelPackage
/rt73-usb
119 $(call KernelPackage
/rt2x00
/Default
)
120 DEPENDS
+= @USB_SUPPORT
+kmod-rt2x00-usb
122 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rt2x00
/rt73usb.
$(LINUX_KMOD_SUFFIX
)
123 AUTOLOAD
:=$(call AutoLoad
,27,rt73usb
)
126 RT2X00_CONFOPTS
:=CONFIG_RT2X00
=y \
127 CONFIG_RT2X00_DEBUG
=y \
128 CONFIG_RT2X00_LIB_FIRMWARE
=y \
129 CONFIG_RT2X00_LIB_LEDS
=y
131 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci
),)
132 RT2X00_CONFOPTS
+= CONFIG_RT2X00_LIB_PCI
=y
134 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb
),)
135 RT2X00_CONFOPTS
+= CONFIG_RT2X00_LIB_USB
=y
137 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci
),)
138 RT2X00_CONFOPTS
+= CONFIG_RT2400PCI
=y
140 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci
),)
141 RT2X00_CONFOPTS
+= CONFIG_RT2500PCI
=y
143 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb
),)
144 RT2X00_CONFOPTS
+= CONFIG_RT2500USB
=y
146 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci
),)
147 RT2X00_CONFOPTS
+= CONFIG_RT61PCI
=y
149 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb
),)
150 RT2X00_CONFOPTS
+= CONFIG_RT73USB
=y
154 CONFOPTS
:=MAC80211 CFG80211 NL80211 MAC80211_RC_DEFAULT_PID MAC80211_RC_PID \
157 $(foreach opt
,$(CONFOPTS
),-DCONFIG_
$(opt
)) \
158 $(if
$(CONFIG_LEDS_TRIGGERS
), -DCONFIG_MAC80211_LEDS
-DCONFIG_LEDS_TRIGGERS
) \
159 -D__CONFIG_MAC80211_RC_DEFAULT
=pid \
162 CROSS_COMPILE
="$(TARGET_CROSS)" \
163 ARCH
="$(LINUX_KARCH)" \
164 EXTRA_CFLAGS
="$(BUILDFLAGS)" \
165 $(foreach opt
,$(CONFOPTS
),CONFIG_
$(opt
)=m
) \
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)" \
173 rm -rf
$(PKG_BUILD_DIR
)
174 mkdir
-p
$(PKG_BUILD_DIR
)
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
)
182 ifneq ($(CONFIG_PACKAGE_kmod-mac80211
),)
183 define Build
/Compile
/kmod
184 $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_OPTS
) all
189 $(call Build
/Compile
/kmod
)
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
/
197 define KernelPackage
/mac80211
/install
198 $(INSTALL_DIR
) $(1)/lib
/wifi
199 $(INSTALL_DATA
) .
/files
/lib
/wifi
/mac80211.sh
$(1)/lib
/wifi
202 define KernelPackage
/rt61-pci
/install
203 $(INSTALL_DIR
) $(1)/lib
/firmware
204 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt2?
61*.bin
$(1)/lib
/firmware
/
207 define KernelPackage
/rt73-usb
/install
208 $(INSTALL_DIR
) $(1)/lib
/firmware
209 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rt73.bin
$(1)/lib
/firmware
/
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
))